@ulm0/gonogo 0.0.0-stage → 0.1.2
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/LICENSE +21 -0
- package/README.md +24 -2
- package/bin/gonogo.js +18 -0
- package/dist/client/THIRD-PARTY-NOTICES.md +409 -0
- package/dist/client/apple-touch-icon.png +0 -0
- package/dist/client/assets/doto-latin-900-normal-D1bF_x6I.woff +0 -0
- package/dist/client/assets/geist-latin-400-normal-B40WzpMT.woff2 +0 -0
- package/dist/client/assets/geist-latin-400-normal-akEymXtG.woff +0 -0
- package/dist/client/assets/geist-latin-500-normal-BDXIbFrL.woff +0 -0
- package/dist/client/assets/geist-latin-500-normal-CTWBw9NS.woff2 +0 -0
- package/dist/client/assets/geist-latin-600-normal-CSETrqM2.woff2 +0 -0
- package/dist/client/assets/geist-latin-600-normal-DsPlZH-9.woff +0 -0
- package/dist/client/assets/geist-mono-latin-400-normal-B2yvC1Cq.woff +0 -0
- package/dist/client/assets/geist-mono-latin-400-normal-DTRLJnHl.woff2 +0 -0
- package/dist/client/assets/geist-mono-latin-500-normal-D-GG86Jb.woff +0 -0
- package/dist/client/assets/geist-mono-latin-500-normal-YINYabwD.woff2 +0 -0
- package/dist/client/assets/geist-mono-latin-600-normal-V-KvD_pi.woff2 +0 -0
- package/dist/client/assets/geist-mono-latin-600-normal-bZn07FKM.woff +0 -0
- package/dist/client/assets/index-BqCn1SM7.js +50 -0
- package/dist/client/assets/index-KZtFVMJG.css +1 -0
- package/dist/client/favicon.ico +0 -0
- package/dist/client/favicon.svg +1 -0
- package/dist/client/index.html +19 -0
- package/dist/server/audited.js +133 -0
- package/dist/server/blackbox.js +261 -0
- package/dist/server/board.js +123 -0
- package/dist/server/cleanroom.js +214 -0
- package/dist/server/clearance.js +158 -0
- package/dist/server/cli.js +763 -0
- package/dist/server/command.js +44 -0
- package/dist/server/constants.js +465 -0
- package/dist/server/docking.js +541 -0
- package/dist/server/downlink.js +191 -0
- package/dist/server/hangar.js +311 -0
- package/dist/server/home.js +520 -0
- package/dist/server/hooks.js +166 -0
- package/dist/server/hub.js +2642 -0
- package/dist/server/launcher.js +547 -0
- package/dist/server/livery.js +210 -0
- package/dist/server/logchart.js +58 -0
- package/dist/server/logsearch.js +112 -0
- package/dist/server/massbudget.js +169 -0
- package/dist/server/mcp.js +228 -0
- package/dist/server/migrate.js +122 -0
- package/dist/server/missionlog.js +211 -0
- package/dist/server/payload.js +168 -0
- package/dist/server/propellant.js +314 -0
- package/dist/server/providers.js +199 -0
- package/dist/server/recorder.js +176 -0
- package/dist/server/relay.js +300 -0
- package/dist/server/relaykinds.js +182 -0
- package/dist/server/relief.js +226 -0
- package/dist/server/rollout.js +172 -0
- package/dist/server/schedules.js +277 -0
- package/dist/server/tasks.js +272 -0
- package/dist/server/telemetry.js +110 -0
- package/dist/server/terminal.js +635 -0
- package/dist/server/uplinks.js +356 -0
- package/dist/server/web.js +1607 -0
- package/dist/shared/cron.js +149 -0
- package/dist/shared/fuel.js +18 -0
- package/dist/shared/livery.js +348 -0
- package/dist/shared/positions.js +132 -0
- package/dist/shared/protocol.js +245 -0
- package/package.json +84 -3
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Launch Window's rules: five fields (minute hour day-of-month month day-of-week) in the local time zone of the machine
|
|
3
|
+
* that runs this code. The server runs them in its own zone (TZ); a browser previews them in its own. No imports, so the
|
|
4
|
+
* client and the server compile the same file and agree on every rule.
|
|
5
|
+
*
|
|
6
|
+
* Each field is a list of `*`, a number, a range `a-b` or `*` or a range with a step (`*` `/n`, `a-b/n`). Months
|
|
7
|
+
* take jan to dec and days of week sun to sat (any case); day of week 7 is Sunday. When both day fields are limited
|
|
8
|
+
* (neither starts with `*`) a day matches when either does, as in Vixie cron.
|
|
9
|
+
*
|
|
10
|
+
* shortcut: a time that does not exist (the hour a clock skips in spring) does not fire that day, and one that happens
|
|
11
|
+
* twice (the hour a clock repeats in autumn) fires once; Vixie cron runs the first late. Add that if it ever matters.
|
|
12
|
+
*/
|
|
13
|
+
const MONTH_NAMES = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
|
|
14
|
+
const DAY_NAMES = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
|
|
15
|
+
const FIELDS = [
|
|
16
|
+
{ name: 'minute', min: 0, max: 59 },
|
|
17
|
+
{ name: 'hour', min: 0, max: 23 },
|
|
18
|
+
{ name: 'day of month', min: 1, max: 31 },
|
|
19
|
+
{ name: 'month', min: 1, max: 12, names: MONTH_NAMES },
|
|
20
|
+
{ name: 'day of week', min: 0, max: 7, names: DAY_NAMES },
|
|
21
|
+
];
|
|
22
|
+
/** Days in each month, February with its leap day: a rule that needs more never fires. */
|
|
23
|
+
const MONTH_DAYS = [0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
24
|
+
/** The most a rule can look ahead: a 29 February needs up to eight years. */
|
|
25
|
+
const HORIZON_MS = 9 * 366 * 86_400_000;
|
|
26
|
+
const MAX_STEPS = 200_000;
|
|
27
|
+
function value(text, spec) {
|
|
28
|
+
let n = NaN;
|
|
29
|
+
if (/^\d{1,3}$/.test(text))
|
|
30
|
+
n = Number(text);
|
|
31
|
+
else if (spec.names) {
|
|
32
|
+
const at = spec.names.indexOf(text.toLowerCase());
|
|
33
|
+
if (at >= 0)
|
|
34
|
+
n = at + (spec.name === 'month' ? 1 : 0);
|
|
35
|
+
}
|
|
36
|
+
if (Number.isNaN(n))
|
|
37
|
+
return `${spec.name}: "${text}" is not a number${spec.names ? ' or a name' : ''}`;
|
|
38
|
+
if (n < spec.min || n > spec.max)
|
|
39
|
+
return `${spec.name}: ${n} is not from ${spec.min} to ${spec.max}`;
|
|
40
|
+
return n;
|
|
41
|
+
}
|
|
42
|
+
function field(text, spec) {
|
|
43
|
+
const out = new Set();
|
|
44
|
+
for (const part of text.split(',')) {
|
|
45
|
+
const [range = '', step, extra] = part.split('/');
|
|
46
|
+
if (part === '' || extra !== undefined)
|
|
47
|
+
return `${spec.name}: "${part}" is not a value, a range or a step`;
|
|
48
|
+
let from;
|
|
49
|
+
let to;
|
|
50
|
+
if (range === '*') {
|
|
51
|
+
from = spec.min;
|
|
52
|
+
to = spec.name === 'day of week' ? 6 : spec.max;
|
|
53
|
+
}
|
|
54
|
+
else if (range.includes('-')) {
|
|
55
|
+
const [a = '', b = '', more] = range.split('-');
|
|
56
|
+
if (more !== undefined)
|
|
57
|
+
return `${spec.name}: "${range}" is not a range`;
|
|
58
|
+
from = value(a, spec);
|
|
59
|
+
to = value(b, spec);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
from = value(range, spec);
|
|
63
|
+
to = from;
|
|
64
|
+
if (step !== undefined)
|
|
65
|
+
return `${spec.name}: a step needs * or a range, as in */5 or 1-30/5`;
|
|
66
|
+
}
|
|
67
|
+
if (typeof from === 'string')
|
|
68
|
+
return from;
|
|
69
|
+
if (typeof to === 'string')
|
|
70
|
+
return to;
|
|
71
|
+
if (from > to)
|
|
72
|
+
return `${spec.name}: the range ${range} ends before it starts`;
|
|
73
|
+
let by = 1;
|
|
74
|
+
if (step !== undefined) {
|
|
75
|
+
if (!/^\d{1,3}$/.test(step) || Number(step) < 1)
|
|
76
|
+
return `${spec.name}: the step "${step}" is not a positive number`;
|
|
77
|
+
by = Number(step);
|
|
78
|
+
}
|
|
79
|
+
for (let v = from; v <= to; v += by)
|
|
80
|
+
out.add(spec.name === 'day of week' && v === 7 ? 0 : v);
|
|
81
|
+
}
|
|
82
|
+
return out;
|
|
83
|
+
}
|
|
84
|
+
/** A rule from its text, or the reason it is not one (one line, for the person who typed it). */
|
|
85
|
+
export function parseCron(text) {
|
|
86
|
+
const parts = text.trim().split(/\s+/);
|
|
87
|
+
if (parts.length !== 5)
|
|
88
|
+
return 'a rule has 5 fields: minute hour day-of-month month day-of-week';
|
|
89
|
+
const sets = [];
|
|
90
|
+
for (const [i, spec] of FIELDS.entries()) {
|
|
91
|
+
const set = field(parts[i] ?? '', spec);
|
|
92
|
+
if (typeof set === 'string')
|
|
93
|
+
return set;
|
|
94
|
+
sets.push(set);
|
|
95
|
+
}
|
|
96
|
+
const [minutes, hours, days, months, weekdays] = sets;
|
|
97
|
+
const rule = { minutes, hours, days, months, weekdays, daysStar: parts[2]?.startsWith('*') === true, weekdaysStar: parts[4]?.startsWith('*') === true };
|
|
98
|
+
// With the day of week free, only the days of the month count: 31 February is a rule that never fires.
|
|
99
|
+
if (!rule.daysStar && rule.weekdaysStar && ![...months].some((m) => [...days].some((d) => d <= (MONTH_DAYS[m] ?? 0)))) {
|
|
100
|
+
return 'day of month: that day never comes in the months given';
|
|
101
|
+
}
|
|
102
|
+
return rule;
|
|
103
|
+
}
|
|
104
|
+
function dayMatches(rule, d) {
|
|
105
|
+
const day = rule.days.has(d.getDate());
|
|
106
|
+
const weekday = rule.weekdays.has(d.getDay());
|
|
107
|
+
return rule.daysStar || rule.weekdaysStar ? day && weekday : day || weekday;
|
|
108
|
+
}
|
|
109
|
+
/** The first minute after `after` (ms epoch) the rule fires, in local time, or null when none comes within nine years. */
|
|
110
|
+
export function nextFire(rule, after) {
|
|
111
|
+
const d = new Date(after);
|
|
112
|
+
d.setSeconds(0, 0);
|
|
113
|
+
d.setMinutes(d.getMinutes() + 1);
|
|
114
|
+
const limit = after + HORIZON_MS;
|
|
115
|
+
// Each step moves to the start of the next month, day, hour or minute, so a rule is found in a few hundred steps.
|
|
116
|
+
for (let steps = 0; steps < MAX_STEPS && d.getTime() <= limit; steps += 1) {
|
|
117
|
+
if (!rule.months.has(d.getMonth() + 1)) {
|
|
118
|
+
d.setMonth(d.getMonth() + 1, 1);
|
|
119
|
+
d.setHours(0, 0, 0, 0);
|
|
120
|
+
}
|
|
121
|
+
else if (!dayMatches(rule, d)) {
|
|
122
|
+
d.setDate(d.getDate() + 1);
|
|
123
|
+
d.setHours(0, 0, 0, 0);
|
|
124
|
+
}
|
|
125
|
+
else if (!rule.hours.has(d.getHours())) {
|
|
126
|
+
d.setHours(d.getHours() + 1, 0, 0, 0);
|
|
127
|
+
}
|
|
128
|
+
else if (!rule.minutes.has(d.getMinutes())) {
|
|
129
|
+
d.setMinutes(d.getMinutes() + 1, 0, 0);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
return d.getTime();
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
/** The next `count` fire times after `after`. */
|
|
138
|
+
export function nextFires(rule, after, count) {
|
|
139
|
+
const out = [];
|
|
140
|
+
let at = after;
|
|
141
|
+
while (out.length < count) {
|
|
142
|
+
const next = nextFire(rule, at);
|
|
143
|
+
if (next === null)
|
|
144
|
+
break;
|
|
145
|
+
out.push(next);
|
|
146
|
+
at = next;
|
|
147
|
+
}
|
|
148
|
+
return out;
|
|
149
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Token amounts as people read and type them: 950, 12.5k, 1.2M. Shared by the server's trip reasons and the client. */
|
|
2
|
+
/** Whole tokens as 950, 12.5k or 1.2M. */
|
|
3
|
+
export function tokenText(n) {
|
|
4
|
+
if (n < 1000)
|
|
5
|
+
return String(Math.round(n));
|
|
6
|
+
if (n < 1_000_000)
|
|
7
|
+
return `${+(n / 1000).toFixed(1)}k`;
|
|
8
|
+
return `${+(n / 1_000_000).toFixed(1)}M`;
|
|
9
|
+
}
|
|
10
|
+
/** "2000000", "500k", "1.5M" (any case, spaces and commas ignored) to whole tokens; null when it is not a positive amount. */
|
|
11
|
+
export function parseTokens(text) {
|
|
12
|
+
const m = /^(\d+(?:\.\d+)?)([kKmM]?)$/.exec(text.replace(/[\s,_]/g, ''));
|
|
13
|
+
if (!m)
|
|
14
|
+
return null;
|
|
15
|
+
const unit = m[2]?.toLowerCase();
|
|
16
|
+
const n = Math.round(Number(m[1]) * (unit === 'k' ? 1e3 : unit === 'm' ? 1e6 : 1));
|
|
17
|
+
return Number.isSafeInteger(n) && n >= 1 ? n : null;
|
|
18
|
+
}
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
/** The tokens a livery sets, with what each one is for. The role is what an agent that designs a livery reads. */
|
|
2
|
+
export const LIVERY_TOKENS = [
|
|
3
|
+
{ name: '--body', role: 'the page and the body of the device' },
|
|
4
|
+
{ name: '--panel', role: 'a module, one step lighter or darker than the body' },
|
|
5
|
+
{ name: '--key', role: 'a key, a console, an input: the most raised surface' },
|
|
6
|
+
{ name: '--well', role: 'a sunk surface: a stopped console, a read-only field' },
|
|
7
|
+
{ name: '--edge', role: 'the thin line around a module or a key' },
|
|
8
|
+
{ name: '--edge-2', role: 'a dashed line: an open seat' },
|
|
9
|
+
{ name: '--text', role: 'the main text, and the fill of the primary key' },
|
|
10
|
+
{ name: '--text-2', role: 'second text, on a surface and on a tint' },
|
|
11
|
+
{ name: '--muted', role: 'small quiet text, on the body, a module or a key' },
|
|
12
|
+
{ name: '--lcd', role: 'the dark screen of the terminal, the clock and the numbers' },
|
|
13
|
+
{ name: '--lcd-text', role: 'text on the screen' },
|
|
14
|
+
{ name: '--lcd-dim', role: 'quiet text on the screen' },
|
|
15
|
+
{ name: '--lcd-warm', role: 'text on the screen of a console that needs the Director' },
|
|
16
|
+
{ name: '--work', role: 'the working signal: a light and a chip outline' },
|
|
17
|
+
{ name: '--you', role: 'the signal that needs the Director' },
|
|
18
|
+
{ name: '--you-tint', role: 'the fill of what needs the Director' },
|
|
19
|
+
{ name: '--you-edge', role: 'the line around that fill' },
|
|
20
|
+
{ name: '--you-ink', role: 'text on that fill' },
|
|
21
|
+
{ name: '--you-key', role: 'the line of a key that sits on that fill' },
|
|
22
|
+
{ name: '--go', role: 'the go signal' },
|
|
23
|
+
{ name: '--go-tint', role: 'the fill of a go' },
|
|
24
|
+
{ name: '--go-ink', role: 'text on that fill' },
|
|
25
|
+
{ name: '--go-lit', role: 'the go light on a dark key' },
|
|
26
|
+
{ name: '--nogo', role: 'the no-go signal and the line of a danger' },
|
|
27
|
+
{ name: '--nogo-text', role: 'danger text, on the page and on its tint' },
|
|
28
|
+
{ name: '--nogo-tint', role: 'the fill of a no-go or an error' },
|
|
29
|
+
{ name: '--track', role: 'an empty ring, a vote that has not come' },
|
|
30
|
+
{ name: '--seq-base', role: 'the empty line of a sequence track' },
|
|
31
|
+
];
|
|
32
|
+
export const LIVERY_NAMES = LIVERY_TOKENS.map((t) => t.name);
|
|
33
|
+
export const LIVERY_NAME_MAX_CHARS = 40;
|
|
34
|
+
export const LIVERY_DESCRIPTION_MAX_CHARS = 200;
|
|
35
|
+
export const LIVERY_BRIEF_MAX_CHARS = 500;
|
|
36
|
+
/** How many custom liveries the folder holds. */
|
|
37
|
+
export const LIVERIES_MAX = 12;
|
|
38
|
+
export const LIVERY_SLUG_PATTERN = '^[a-z0-9][a-z0-9-]{0,39}$';
|
|
39
|
+
export const DEFAULT_LIVERY = 'instrument';
|
|
40
|
+
export const MIN_CONTRAST = 4.5;
|
|
41
|
+
/** The screen of the terminal stays dark: the terminal draws its own colours (the ANSI palette) for a dark screen. */
|
|
42
|
+
export const LCD_MAX_LUMINANCE = 0.2;
|
|
43
|
+
/** [text, the surfaces it sits on]. Every pair must reach MIN_CONTRAST; this is the one list, used by the check, the brief and the tests. */
|
|
44
|
+
export const CONTRAST_PAIRS = [
|
|
45
|
+
['--text', ['--body', '--panel', '--key', '--well', '--you-tint', '--go-tint', '--nogo-tint']],
|
|
46
|
+
['--text-2', ['--body', '--panel', '--key', '--well', '--you-tint', '--go-tint', '--nogo-tint']],
|
|
47
|
+
['--muted', ['--body', '--panel', '--key', '--well']],
|
|
48
|
+
['--work', ['--panel', '--key']],
|
|
49
|
+
['--nogo-text', ['--body', '--panel', '--key', '--nogo-tint']],
|
|
50
|
+
['--you-ink', ['--you-tint']],
|
|
51
|
+
['--go-ink', ['--go-tint']],
|
|
52
|
+
['--panel', ['--text']],
|
|
53
|
+
['--lcd-text', ['--lcd']],
|
|
54
|
+
['--lcd-dim', ['--lcd']],
|
|
55
|
+
['--lcd-warm', ['--lcd']],
|
|
56
|
+
];
|
|
57
|
+
/** The slug of a name: lowercase words joined by dashes, at most 40 characters; '' when no letter or digit is left. */
|
|
58
|
+
export const slugOf = (name) => name
|
|
59
|
+
.toLowerCase()
|
|
60
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
61
|
+
.replace(/^-+|-+$/g, '')
|
|
62
|
+
.slice(0, 40)
|
|
63
|
+
.replace(/-+$/, '');
|
|
64
|
+
const NUMBER = '[+-]?(?:\\d+\\.?\\d*|\\.\\d+)';
|
|
65
|
+
const NUMBER_RE = new RegExp(`^${NUMBER}$`);
|
|
66
|
+
const PERCENT_RE = new RegExp(`^${NUMBER}%$`);
|
|
67
|
+
const ANGLE_RE = new RegExp(`^${NUMBER}(?:deg)?$`);
|
|
68
|
+
const HEX_RE = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
69
|
+
const FUNCTION_RE = /^(rgb|hsl|oklch)\(\s*([^()]*?)\s*\)$/i;
|
|
70
|
+
const clamp = (n, low = 0, high = 1) => Math.min(high, Math.max(low, n));
|
|
71
|
+
const decode = (c) => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4);
|
|
72
|
+
const encode = (c) => (c <= 0.0031308 ? c * 12.92 : 1.055 * c ** (1 / 2.4) - 0.055);
|
|
73
|
+
/** The three parts of a function body: all separated by commas or all by spaces; null otherwise. */
|
|
74
|
+
function parts(body) {
|
|
75
|
+
const list = body.includes(',') ? body.split(/\s*,\s*/) : body.split(/\s+/);
|
|
76
|
+
return list.length === 3 && list.every((p) => p !== '') ? list : null;
|
|
77
|
+
}
|
|
78
|
+
function hslToRgb(h, s, l) {
|
|
79
|
+
const a = s * Math.min(l, 1 - l);
|
|
80
|
+
const f = (n) => {
|
|
81
|
+
const k = (n + h / 30) % 12;
|
|
82
|
+
return l - a * Math.max(-1, Math.min(k - 3, 9 - k, 1));
|
|
83
|
+
};
|
|
84
|
+
return [f(0), f(8), f(4)];
|
|
85
|
+
}
|
|
86
|
+
/** Linear-light sRGB of an OKLCH colour, each channel clipped to 0..1. */
|
|
87
|
+
function oklchToLinear(l, c, h) {
|
|
88
|
+
const a = c * Math.cos((h * Math.PI) / 180);
|
|
89
|
+
const b = c * Math.sin((h * Math.PI) / 180);
|
|
90
|
+
const l_ = (l + 0.3963377774 * a + 0.2158037573 * b) ** 3;
|
|
91
|
+
const m_ = (l - 0.1055613458 * a - 0.0638541728 * b) ** 3;
|
|
92
|
+
const s_ = (l - 0.0894841775 * a - 1.291485548 * b) ** 3;
|
|
93
|
+
return [
|
|
94
|
+
clamp(4.0767416621 * l_ - 3.3077115913 * m_ + 0.2309699292 * s_),
|
|
95
|
+
clamp(-1.2684380046 * l_ + 2.6097574011 * m_ - 0.3413193965 * s_),
|
|
96
|
+
clamp(-0.0041960863 * l_ - 0.7034186147 * m_ + 1.707614701 * s_),
|
|
97
|
+
];
|
|
98
|
+
}
|
|
99
|
+
/** Linear-light sRGB (0..1 per channel) of a colour value, or null when the text is not a colour of the allowed kinds. */
|
|
100
|
+
export function toLinear(value) {
|
|
101
|
+
const text = value.trim();
|
|
102
|
+
if (HEX_RE.test(text)) {
|
|
103
|
+
const hex = text.length === 4 ? [...text.slice(1)].map((d) => d + d).join('') : text.slice(1);
|
|
104
|
+
return [0, 2, 4].map((i) => decode(parseInt(hex.slice(i, i + 2), 16) / 255));
|
|
105
|
+
}
|
|
106
|
+
const found = FUNCTION_RE.exec(text);
|
|
107
|
+
const p = found ? parts(found[2] ?? '') : null;
|
|
108
|
+
if (!found || !p)
|
|
109
|
+
return null;
|
|
110
|
+
const [x = '', y = '', z = ''] = p;
|
|
111
|
+
switch ((found[1] ?? '').toLowerCase()) {
|
|
112
|
+
case 'rgb': {
|
|
113
|
+
// three numbers 0..255, or three percentages
|
|
114
|
+
const percent = PERCENT_RE.test(x);
|
|
115
|
+
if (!p.every((q) => (percent ? PERCENT_RE.test(q) : NUMBER_RE.test(q))))
|
|
116
|
+
return null;
|
|
117
|
+
const channels = p.map((q) => parseFloat(q) / (percent ? 100 : 255));
|
|
118
|
+
return channels.every((n) => n >= 0 && n <= 1) ? channels.map(decode) : null;
|
|
119
|
+
}
|
|
120
|
+
case 'hsl': {
|
|
121
|
+
if (!ANGLE_RE.test(x) || !PERCENT_RE.test(y) || !PERCENT_RE.test(z))
|
|
122
|
+
return null;
|
|
123
|
+
const s = parseFloat(y) / 100;
|
|
124
|
+
const l = parseFloat(z) / 100;
|
|
125
|
+
if (s < 0 || s > 1 || l < 0 || l > 1)
|
|
126
|
+
return null;
|
|
127
|
+
return hslToRgb((((parseFloat(x) % 360) + 360) % 360), s, l).map(decode);
|
|
128
|
+
}
|
|
129
|
+
default: {
|
|
130
|
+
// oklch(L C H): L a number 0..1 or a percentage, C a number of 0 or more, H degrees
|
|
131
|
+
const l = PERCENT_RE.test(x) ? parseFloat(x) / 100 : NUMBER_RE.test(x) ? parseFloat(x) : Number.NaN;
|
|
132
|
+
if (!(l >= 0 && l <= 1) || !NUMBER_RE.test(y) || parseFloat(y) < 0 || !ANGLE_RE.test(z))
|
|
133
|
+
return null;
|
|
134
|
+
return oklchToLinear(l, parseFloat(y), parseFloat(z));
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
export const isColour = (value) => typeof value === 'string' && value.length <= 64 && toLinear(value) !== null;
|
|
139
|
+
/** `#rrggbb` of a colour value (for xterm, which wants plain colours); null when it is not one. */
|
|
140
|
+
export function toHex(value) {
|
|
141
|
+
const linear = toLinear(value);
|
|
142
|
+
return linear === null ? null : `#${linear.map((c) => Math.round(clamp(encode(c)) * 255).toString(16).padStart(2, '0')).join('')}`;
|
|
143
|
+
}
|
|
144
|
+
/** WCAG 2 relative luminance, 0 (black) to 1 (white). */
|
|
145
|
+
export function luminance(value) {
|
|
146
|
+
const linear = toLinear(value);
|
|
147
|
+
return linear === null ? null : 0.2126 * linear[0] + 0.7152 * linear[1] + 0.0722 * linear[2];
|
|
148
|
+
}
|
|
149
|
+
/** WCAG 2 contrast ratio, 1 to 21; null when either is not a colour. */
|
|
150
|
+
export function contrast(a, b) {
|
|
151
|
+
const x = luminance(a);
|
|
152
|
+
const y = luminance(b);
|
|
153
|
+
return x === null || y === null ? null : (Math.max(x, y) + 0.05) / (Math.min(x, y) + 0.05);
|
|
154
|
+
}
|
|
155
|
+
/** The colour scheme of a livery, from its body: the browser draws scrollbars and native controls for it. */
|
|
156
|
+
export const schemeOf = (tokens) => ((luminance(tokens['--body'] ?? '') ?? 1) < 0.18 ? 'dark' : 'light');
|
|
157
|
+
/** One line per fault; an empty list means the livery is whole, made of colours, and readable. Unknown names are faults too. */
|
|
158
|
+
export function checkLivery(tokens) {
|
|
159
|
+
if (typeof tokens !== 'object' || tokens === null || Array.isArray(tokens))
|
|
160
|
+
return ['tokens must be an object of token names and colours'];
|
|
161
|
+
const record = tokens;
|
|
162
|
+
const problems = [];
|
|
163
|
+
for (const key of Object.keys(record))
|
|
164
|
+
if (!LIVERY_NAMES.includes(key))
|
|
165
|
+
problems.push(`${key} is not a token of a livery`);
|
|
166
|
+
const missing = LIVERY_NAMES.filter((name) => !Object.hasOwn(record, name));
|
|
167
|
+
if (missing.length > 0)
|
|
168
|
+
problems.push(`missing: ${missing.join(', ')}`);
|
|
169
|
+
for (const name of LIVERY_NAMES) {
|
|
170
|
+
if (Object.hasOwn(record, name) && !isColour(record[name]))
|
|
171
|
+
problems.push(`${name} must be a colour written as #rgb, #rrggbb, rgb(), hsl() or oklch() with no alpha`);
|
|
172
|
+
}
|
|
173
|
+
if (problems.length > 0)
|
|
174
|
+
return problems;
|
|
175
|
+
const value = record;
|
|
176
|
+
for (const [text, surfaces] of CONTRAST_PAIRS) {
|
|
177
|
+
for (const surface of surfaces) {
|
|
178
|
+
const ratio = contrast(value[text] ?? '', value[surface] ?? '') ?? 0;
|
|
179
|
+
if (ratio < MIN_CONTRAST)
|
|
180
|
+
problems.push(`${text} on ${surface} is ${ratio.toFixed(2)}:1, it needs ${MIN_CONTRAST}:1`);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if ((luminance(value['--lcd'] ?? '') ?? 1) >= LCD_MAX_LUMINANCE)
|
|
184
|
+
problems.push(`--lcd must be a dark screen (relative luminance under ${LCD_MAX_LUMINANCE})`);
|
|
185
|
+
return problems;
|
|
186
|
+
}
|
|
187
|
+
/** The contrast rule in words, one line per text token, from CONTRAST_PAIRS. */
|
|
188
|
+
export const contrastRules = () => [
|
|
189
|
+
...CONTRAST_PAIRS.map(([text, surfaces]) => `${text} on ${surfaces.join(', ')}: at least ${MIN_CONTRAST}:1`),
|
|
190
|
+
`--lcd: dark, relative luminance under ${LCD_MAX_LUMINANCE}`,
|
|
191
|
+
];
|
|
192
|
+
/**
|
|
193
|
+
* What a livery sets on :root, as [property, value]: only whitelisted names with colour values, then the colour scheme. A token that
|
|
194
|
+
* fails is left out. The page sets them through the CSSOM (`style.setProperty`), which a Content-Security-Policy of a reverse proxy
|
|
195
|
+
* does not block the way it blocks a style element.
|
|
196
|
+
*/
|
|
197
|
+
export function liveryProperties(tokens) {
|
|
198
|
+
return [...LIVERY_NAMES.flatMap((name) => (isColour(tokens[name]) ? [[name, tokens[name].trim()]] : [])), ['color-scheme', schemeOf(tokens)]];
|
|
199
|
+
}
|
|
200
|
+
export const BUILTIN_LIVERIES = [
|
|
201
|
+
{
|
|
202
|
+
slug: 'instrument',
|
|
203
|
+
name: 'Instrument',
|
|
204
|
+
description: 'The default: a warm grey device with a small green screen.',
|
|
205
|
+
// the values of tokens.css (a test keeps every livery that ships equal to its block there)
|
|
206
|
+
tokens: {
|
|
207
|
+
'--body': '#e4e2dc',
|
|
208
|
+
'--panel': '#f1f0ec',
|
|
209
|
+
'--key': '#faf9f6',
|
|
210
|
+
'--well': '#e9e7e1',
|
|
211
|
+
'--edge': '#c9c6be',
|
|
212
|
+
'--edge-2': '#b1aea6',
|
|
213
|
+
'--text': '#26272b',
|
|
214
|
+
'--text-2': '#44463f',
|
|
215
|
+
'--muted': '#61605b',
|
|
216
|
+
'--lcd': '#2b2f2a',
|
|
217
|
+
'--lcd-text': '#cfe6c9',
|
|
218
|
+
'--lcd-dim': '#9fb79b',
|
|
219
|
+
'--lcd-warm': '#f1d79a',
|
|
220
|
+
'--work': '#4a5bd4',
|
|
221
|
+
'--you': '#e0a93a',
|
|
222
|
+
'--you-tint': '#f4e3b7',
|
|
223
|
+
'--you-edge': '#d9b45a',
|
|
224
|
+
'--you-ink': '#5c4a1c',
|
|
225
|
+
'--you-key': '#b8933f',
|
|
226
|
+
'--go': '#5e9e73',
|
|
227
|
+
'--go-tint': '#d7e8da',
|
|
228
|
+
'--go-ink': '#2c5a3a',
|
|
229
|
+
'--go-lit': '#7cc493',
|
|
230
|
+
'--nogo': '#c2414b',
|
|
231
|
+
'--nogo-text': '#a8323c',
|
|
232
|
+
'--nogo-tint': '#f5d9da',
|
|
233
|
+
'--track': '#d6d3cb',
|
|
234
|
+
'--seq-base': '#e2dfd7',
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
slug: 'night-shift',
|
|
239
|
+
name: 'Night Shift',
|
|
240
|
+
description: 'A dark graphite device with a mint screen, for working at night.',
|
|
241
|
+
tokens: {
|
|
242
|
+
'--body': '#16181d',
|
|
243
|
+
'--panel': '#1e2127',
|
|
244
|
+
'--key': '#272b33',
|
|
245
|
+
'--well': '#121418',
|
|
246
|
+
'--edge': '#353a44',
|
|
247
|
+
'--edge-2': '#4a5160',
|
|
248
|
+
'--text': '#e8e9ec',
|
|
249
|
+
'--text-2': '#c5c8cf',
|
|
250
|
+
'--muted': '#9ba1ac',
|
|
251
|
+
'--lcd': '#0b0e0d',
|
|
252
|
+
'--lcd-text': '#a9ecd4',
|
|
253
|
+
'--lcd-dim': '#6fb8a0',
|
|
254
|
+
'--lcd-warm': '#f4cf80',
|
|
255
|
+
'--work': '#93a0ff',
|
|
256
|
+
'--you': '#e5b04c',
|
|
257
|
+
'--you-tint': '#3a2f15',
|
|
258
|
+
'--you-edge': '#8d6f27',
|
|
259
|
+
'--you-ink': '#f6d890',
|
|
260
|
+
'--you-key': '#b8933f',
|
|
261
|
+
'--go': '#5cbf86',
|
|
262
|
+
'--go-tint': '#17352a',
|
|
263
|
+
'--go-ink': '#a3e6bf',
|
|
264
|
+
'--go-lit': '#7bd9a0',
|
|
265
|
+
'--nogo': '#e5606b',
|
|
266
|
+
'--nogo-text': '#ff9ea6',
|
|
267
|
+
'--nogo-tint': '#43191f',
|
|
268
|
+
'--track': '#353a44',
|
|
269
|
+
'--seq-base': '#2a2e36',
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
slug: 'low-ink',
|
|
274
|
+
name: 'Low Ink',
|
|
275
|
+
description: 'Near-white paper with thin grey lines and pale tints: little toner when printed.',
|
|
276
|
+
tokens: {
|
|
277
|
+
'--body': '#f7f6f2',
|
|
278
|
+
'--panel': '#fbfaf7',
|
|
279
|
+
'--key': '#ffffff',
|
|
280
|
+
'--well': '#efede7',
|
|
281
|
+
'--edge': '#bdb9af',
|
|
282
|
+
'--edge-2': '#8c887d',
|
|
283
|
+
'--text': '#141414',
|
|
284
|
+
'--text-2': '#333330',
|
|
285
|
+
'--muted': '#55524b',
|
|
286
|
+
'--lcd': '#2a2a2a',
|
|
287
|
+
'--lcd-text': '#f0f0ea',
|
|
288
|
+
'--lcd-dim': '#b8b8b0',
|
|
289
|
+
'--lcd-warm': '#f2d98e',
|
|
290
|
+
'--work': '#2f3fa8',
|
|
291
|
+
'--you': '#b77a05',
|
|
292
|
+
'--you-tint': '#fcf4dc',
|
|
293
|
+
'--you-edge': '#d2b25a',
|
|
294
|
+
'--you-ink': '#4f3b08',
|
|
295
|
+
'--you-key': '#a07a1a',
|
|
296
|
+
'--go': '#2f7d52',
|
|
297
|
+
'--go-tint': '#e8f3ec',
|
|
298
|
+
'--go-ink': '#1f4d33',
|
|
299
|
+
'--go-lit': '#7cc493',
|
|
300
|
+
'--nogo': '#b3261e',
|
|
301
|
+
'--nogo-text': '#96211a',
|
|
302
|
+
'--nogo-tint': '#fbe9e7',
|
|
303
|
+
'--track': '#cfcbc1',
|
|
304
|
+
'--seq-base': '#e6e3db',
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
slug: 'high-contrast',
|
|
309
|
+
name: 'High Contrast',
|
|
310
|
+
description: 'Black on white with black lines and strong signals: every text is 7:1 or better.',
|
|
311
|
+
tokens: {
|
|
312
|
+
'--body': '#ffffff',
|
|
313
|
+
'--panel': '#ffffff',
|
|
314
|
+
'--key': '#ffffff',
|
|
315
|
+
'--well': '#ebebeb',
|
|
316
|
+
'--edge': '#1a1a1a',
|
|
317
|
+
'--edge-2': '#555555',
|
|
318
|
+
'--text': '#000000',
|
|
319
|
+
'--text-2': '#111111',
|
|
320
|
+
'--muted': '#2e2e2e',
|
|
321
|
+
'--lcd': '#000000',
|
|
322
|
+
'--lcd-text': '#ffffff',
|
|
323
|
+
'--lcd-dim': '#cfcfcf',
|
|
324
|
+
'--lcd-warm': '#ffe27a',
|
|
325
|
+
'--work': '#0b1bb3',
|
|
326
|
+
'--you': '#8a5a00',
|
|
327
|
+
'--you-tint': '#ffeeb0',
|
|
328
|
+
'--you-edge': '#5c3d00',
|
|
329
|
+
'--you-ink': '#2e1d00',
|
|
330
|
+
'--you-key': '#5c3d00',
|
|
331
|
+
'--go': '#00692f',
|
|
332
|
+
'--go-tint': '#cdf2da',
|
|
333
|
+
'--go-ink': '#00290f',
|
|
334
|
+
'--go-lit': '#5be08c',
|
|
335
|
+
'--nogo': '#b00020',
|
|
336
|
+
'--nogo-text': '#7d0017',
|
|
337
|
+
'--nogo-tint': '#ffd6dc',
|
|
338
|
+
'--track': '#6b6b6b',
|
|
339
|
+
'--seq-base': '#c4c4c4',
|
|
340
|
+
},
|
|
341
|
+
},
|
|
342
|
+
];
|
|
343
|
+
/** The default livery as the table of tokens, for a fallback. */
|
|
344
|
+
export const INSTRUMENT = BUILTIN_LIVERIES[0];
|
|
345
|
+
/** The four that ship as entries of a view; a copy each call, so that no caller can change what ships. */
|
|
346
|
+
export const builtinEntries = () => BUILTIN_LIVERIES.map((b) => ({ ...b, tokens: { ...b.tokens }, builtin: true, author: null }));
|
|
347
|
+
/** What a page shows before the server has said: the default livery chosen, the four that ship. */
|
|
348
|
+
export const defaultView = () => ({ current: DEFAULT_LIVERY, liveries: builtinEntries() });
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
export const POSITIONS = [
|
|
2
|
+
{
|
|
3
|
+
id: 'flight',
|
|
4
|
+
callSign: 'FLIGHT',
|
|
5
|
+
title: 'Flight director',
|
|
6
|
+
summary: 'The boss: takes the brief, hands out work',
|
|
7
|
+
color: '#f5c451',
|
|
8
|
+
role: [
|
|
9
|
+
'You are FLIGHT, the flight director of this team. The Director (the human, the recipient "user") briefs you with goals.',
|
|
10
|
+
'Split each goal into tasks, find the right position with list_roster, and send each task with send_message: a clear subject and a self-contained body (paths, what done looks like).',
|
|
11
|
+
'Before a large or risky step, ask the Director for a go or no-go. When a position reports back, check the result and tell the Director the outcome in a few lines.',
|
|
12
|
+
'If no position fits, ask the Director for one with hire_agent (a name, a position or a role, a folder, a mode up to acceptEdits): it only makes a request, he sees every field and decides, and you get his answer as a message. You cannot hire or remove agents yourself.',
|
|
13
|
+
'Send anything risky (spending money, deleting data, changing scope) to "user" and wait for the answer.',
|
|
14
|
+
].join(' '),
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: 'fao',
|
|
18
|
+
callSign: 'FAO',
|
|
19
|
+
title: 'Flight activities officer',
|
|
20
|
+
summary: 'Planner: breaks the brief into tasks',
|
|
21
|
+
color: '#5fd4e6',
|
|
22
|
+
role: 'You are FAO, the flight activities officer. You keep the plan. When FLIGHT or the Director gives you a goal, break it into small tasks with a clear order, an owner position for each and what done looks like, and keep the list current as work finishes. Do not write the code yourself: hand tasks out through send_message and report the plan to FLIGHT.',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: 'fido',
|
|
26
|
+
callSign: 'FIDO',
|
|
27
|
+
title: 'Flight dynamics officer',
|
|
28
|
+
summary: 'Architect: picks the approach and the interfaces',
|
|
29
|
+
color: '#7ea6ff',
|
|
30
|
+
role: 'You are FIDO, the flight dynamics officer. You choose the approach. For each task decide the design: modules, interfaces, data flow and the order of changes. When the choice matters, weigh two options and say why you pick one. Write the decision in a few lines for the position that will build it. Prefer the smallest design that works.',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: 'guido',
|
|
34
|
+
callSign: 'GUIDO',
|
|
35
|
+
title: 'Guidance officer',
|
|
36
|
+
summary: 'Backend and core logic',
|
|
37
|
+
color: '#4fd1b8',
|
|
38
|
+
role: 'You are GUIDO, the guidance officer. You own the core logic and the backend: server code, algorithms and the data flow behind them. Make small, correct changes, keep the tests green and run the checks before you report. Report what changed and anything you could not verify.',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: 'control',
|
|
42
|
+
callSign: 'CONTROL',
|
|
43
|
+
title: 'Lunar module controller',
|
|
44
|
+
summary: 'Frontend: the controls people touch',
|
|
45
|
+
color: '#b69cff',
|
|
46
|
+
role: 'You are CONTROL, who owns the controls people touch. You build the user interface: components, layout, interaction, accessibility and the look. Check your work in a running browser when you can, and report what you saw, not what you expect.',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: 'dps',
|
|
50
|
+
callSign: 'DPS',
|
|
51
|
+
title: 'Data processing systems',
|
|
52
|
+
summary: 'Data: schemas, queries, migrations',
|
|
53
|
+
color: '#62b8ff',
|
|
54
|
+
role: 'You are DPS, who owns the data systems: schemas, queries, migrations and data integrity. Never run a destructive statement without a backup and a go from the Director. Report the exact statements you ran and what they changed.',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: 'inco',
|
|
58
|
+
callSign: 'INCO',
|
|
59
|
+
title: 'Instrumentation and communications',
|
|
60
|
+
summary: 'Integrations, APIs, logging',
|
|
61
|
+
color: '#ff9bd2',
|
|
62
|
+
role: 'You are INCO, the integration and communications officer. You own APIs, integrations with outside services, logging and the glue between systems. Check what a remote service really returns before you rely on it, and never put credentials in code, logs or messages.',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: 'eecom',
|
|
66
|
+
callSign: 'EECOM',
|
|
67
|
+
title: 'Electrical, environmental and consumables',
|
|
68
|
+
summary: 'Infrastructure: CI, environments, dependencies, budget',
|
|
69
|
+
color: '#c3d86b',
|
|
70
|
+
role: 'You are EECOM, who keeps the systems alive. You own infrastructure: environments, CI, dependencies, containers, and the token and time budget of this team. Keep changes reversible, prefer pinned versions, and report what a change costs.',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 'booster',
|
|
74
|
+
callSign: 'BOOSTER',
|
|
75
|
+
title: 'Booster systems',
|
|
76
|
+
summary: 'Build and release',
|
|
77
|
+
color: '#ff8f6b',
|
|
78
|
+
role: 'You are BOOSTER, who owns build and release. You make the build reproducible, run the full build and test pipeline, package the result and prepare the release notes. Never publish or push anything without a go from the Director.',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: 'surgeon',
|
|
82
|
+
callSign: 'SURGEON',
|
|
83
|
+
title: 'Flight surgeon',
|
|
84
|
+
summary: 'Tests and debugging',
|
|
85
|
+
color: '#7de0c0',
|
|
86
|
+
role: 'You are SURGEON, who owns the health of the code. You write and run tests, reproduce bugs, find the root cause and make the smallest fix. Show a failing test before the fix and a passing one after it.',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: 'simsup',
|
|
90
|
+
callSign: 'SIMSUP',
|
|
91
|
+
title: 'Simulation supervisor',
|
|
92
|
+
summary: 'Adversarial tester: breaks things on purpose',
|
|
93
|
+
color: '#d48cff',
|
|
94
|
+
role: 'You are SIMSUP, the simulation supervisor. You try to break what the others built: hostile input, empty and huge values, bad timing, a crash halfway through. Report each failure with the exact steps to reproduce it. Do not fix other positions\' code.',
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: 'retro',
|
|
98
|
+
callSign: 'RETRO',
|
|
99
|
+
title: 'Retrofire officer',
|
|
100
|
+
summary: 'Code reviewer, plans the rollback',
|
|
101
|
+
color: '#9fb0c8',
|
|
102
|
+
role: 'You are RETRO, who plans the way back. You review changes before they ship: correctness, risk and what can go wrong, and you write the rollback for each risky change. Report findings as a short ranked list with file and line.',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: 'rso',
|
|
106
|
+
callSign: 'RSO',
|
|
107
|
+
title: 'Range safety officer',
|
|
108
|
+
summary: 'Security reviewer, can call an abort',
|
|
109
|
+
color: '#ff7a90',
|
|
110
|
+
role: 'You are RSO, the range safety officer. You review for security and safety: injection, secrets, permissions, dangerous commands and data loss. You may call an abort: when something must not ship, tell FLIGHT and the Director at once, with the evidence.',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
id: 'pao',
|
|
114
|
+
callSign: 'PAO',
|
|
115
|
+
title: 'Public affairs officer',
|
|
116
|
+
summary: 'Docs, README, changelog',
|
|
117
|
+
color: '#ffd9a0',
|
|
118
|
+
role: 'You are PAO, who owns public affairs: the README, usage notes, the changelog and comments that explain why. Keep it short and accurate, check it against the code, and run the commands you document.',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
id: 'capcom',
|
|
122
|
+
callSign: 'CAPCOM',
|
|
123
|
+
title: 'Capsule communicator',
|
|
124
|
+
summary: 'Reporter: one clear update for the Director',
|
|
125
|
+
color: '#8ce0ff',
|
|
126
|
+
role: 'You are CAPCOM, the one voice to the Director. You collect status from the other positions with list_roster and read_messages, and send the Director a single clear update: what is done, what is blocked, what you need from them. Keep updates short and do not repeat yourself.',
|
|
127
|
+
},
|
|
128
|
+
];
|
|
129
|
+
export const POSITION_IDS = POSITIONS.map((p) => p.id);
|
|
130
|
+
export function positionById(id) {
|
|
131
|
+
return POSITIONS.find((p) => p.id === id) ?? null;
|
|
132
|
+
}
|