@ramme-io/kernel 8.1.5 → 8.1.7
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/dist/{AiGateway-DV1RjnCa.js → AiGateway-DN3LvD0r.js} +1 -1
- package/dist/{bodewellAdapter-CGBgINab.js → bodewellAdapter-BKQlwGRw.js} +1 -1
- package/dist/{deviceReadings-DUA6cQh5.js → deviceReadings-D8PeyG1y.js} +230 -208
- package/dist/index.es.js +1199 -1199
- package/dist/kernel/src/stores/useSettingsStore.d.ts.map +1 -1
- package/dist/server.es.js +4 -4
- package/dist/signals.es.js +2 -2
- package/package.json +3 -3
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { z as e } from "zod";
|
|
2
|
-
var
|
|
3
|
-
for (var
|
|
4
|
-
|
|
5
|
-
},
|
|
2
|
+
var ne = Object.defineProperty, oe = (a, i) => {
|
|
3
|
+
for (var x in i)
|
|
4
|
+
ne(a, x, { get: i[x], enumerable: !0 });
|
|
5
|
+
}, ie = e.object({
|
|
6
6
|
key: e.string(),
|
|
7
7
|
label: e.string(),
|
|
8
8
|
type: e.enum(["text", "number", "currency", "percent", "delta", "date", "boolean", "status", "email", "image", "textarea"]),
|
|
9
9
|
required: e.boolean().optional(),
|
|
10
10
|
description: e.string().optional(),
|
|
11
11
|
defaultValue: e.any().optional()
|
|
12
|
-
}),
|
|
12
|
+
}), re = e.object({
|
|
13
13
|
id: e.string(),
|
|
14
14
|
name: e.string(),
|
|
15
|
-
fields: e.array(
|
|
15
|
+
fields: e.array(ie),
|
|
16
16
|
defaultView: e.enum(["table", "grid", "list"]).optional(),
|
|
17
17
|
features: e.object({
|
|
18
18
|
searchable: e.boolean().optional(),
|
|
@@ -21,7 +21,7 @@ var te = Object.defineProperty, ae = (a, i) => {
|
|
|
21
21
|
deletable: e.boolean().optional(),
|
|
22
22
|
exportable: e.boolean().optional()
|
|
23
23
|
}).optional()
|
|
24
|
-
}),
|
|
24
|
+
}), se = e.object({
|
|
25
25
|
id: e.string().min(1, "Signal ID is required"),
|
|
26
26
|
label: e.string(),
|
|
27
27
|
description: e.string().optional(),
|
|
@@ -37,7 +37,7 @@ var te = Object.defineProperty, ae = (a, i) => {
|
|
|
37
37
|
unit: e.string().optional(),
|
|
38
38
|
min: e.number().optional(),
|
|
39
39
|
max: e.number().optional()
|
|
40
|
-
}),
|
|
40
|
+
}), le = e.object({
|
|
41
41
|
id: e.string(),
|
|
42
42
|
name: e.string(),
|
|
43
43
|
description: e.string().optional(),
|
|
@@ -49,11 +49,11 @@ var te = Object.defineProperty, ae = (a, i) => {
|
|
|
49
49
|
color: e.string().optional(),
|
|
50
50
|
dashboardComponent: e.string().optional()
|
|
51
51
|
}).optional()
|
|
52
|
-
}),
|
|
52
|
+
}), ue = e.object({
|
|
53
53
|
id: e.string(),
|
|
54
54
|
type: e.enum(["signal_change", "manual_action", "schedule", "webhook"]),
|
|
55
55
|
config: e.record(e.string(), e.any())
|
|
56
|
-
}),
|
|
56
|
+
}), me = e.object({
|
|
57
57
|
id: e.string(),
|
|
58
58
|
type: e.enum([
|
|
59
59
|
"update_resource",
|
|
@@ -64,13 +64,13 @@ var te = Object.defineProperty, ae = (a, i) => {
|
|
|
64
64
|
"agent_task"
|
|
65
65
|
]),
|
|
66
66
|
config: e.record(e.string(), e.any())
|
|
67
|
-
}),
|
|
67
|
+
}), ce = e.object({
|
|
68
68
|
id: e.string(),
|
|
69
69
|
name: e.string(),
|
|
70
70
|
active: e.boolean().default(!0),
|
|
71
|
-
trigger:
|
|
72
|
-
actions: e.array(
|
|
73
|
-
}),
|
|
71
|
+
trigger: ue,
|
|
72
|
+
actions: e.array(me)
|
|
73
|
+
}), de = e.object({
|
|
74
74
|
id: e.string(),
|
|
75
75
|
type: e.string(),
|
|
76
76
|
props: e.record(e.string(), e.any()),
|
|
@@ -78,7 +78,7 @@ var te = Object.defineProperty, ae = (a, i) => {
|
|
|
78
78
|
colSpan: e.number().optional(),
|
|
79
79
|
rowSpan: e.number().optional()
|
|
80
80
|
}).optional()
|
|
81
|
-
}),
|
|
81
|
+
}), pe = e.object({
|
|
82
82
|
id: e.string(),
|
|
83
83
|
title: e.string().optional(),
|
|
84
84
|
description: e.string().optional(),
|
|
@@ -86,18 +86,18 @@ var te = Object.defineProperty, ae = (a, i) => {
|
|
|
86
86
|
columns: e.number().optional(),
|
|
87
87
|
variant: e.enum(["grid", "stack", "split"]).optional()
|
|
88
88
|
}).optional(),
|
|
89
|
-
blocks: e.array(
|
|
90
|
-
}),
|
|
89
|
+
blocks: e.array(de)
|
|
90
|
+
}), he = e.object({
|
|
91
91
|
id: e.string(),
|
|
92
92
|
slug: e.string(),
|
|
93
93
|
title: e.string(),
|
|
94
94
|
description: e.string().optional(),
|
|
95
95
|
icon: e.string().optional(),
|
|
96
|
-
sections: e.array(
|
|
97
|
-
}),
|
|
98
|
-
strategy:
|
|
96
|
+
sections: e.array(pe)
|
|
97
|
+
}), xe = e.enum(["ENVIRONMENT", "SESSION_BYOK", "VAULT"]), ge = e.object({
|
|
98
|
+
strategy: xe,
|
|
99
99
|
status: e.enum(["VALID", "KEY_EXPIRED", "BYOK_REQUIRED", "DEGRADED", "UNKNOWN"]).default("UNKNOWN")
|
|
100
|
-
}),
|
|
100
|
+
}), kt = e.object({
|
|
101
101
|
meta: e.object({
|
|
102
102
|
name: e.string(),
|
|
103
103
|
version: e.string(),
|
|
@@ -110,22 +110,22 @@ var te = Object.defineProperty, ae = (a, i) => {
|
|
|
110
110
|
layout: e.enum(["dashboard", "explorer", "studio", "focus"]).default("dashboard"),
|
|
111
111
|
mockMode: e.boolean().default(!0),
|
|
112
112
|
brokerUrl: e.string().optional(),
|
|
113
|
-
aiKeyManifest:
|
|
113
|
+
aiKeyManifest: ge.optional()
|
|
114
114
|
}),
|
|
115
115
|
modules: e.array(e.string()).optional(),
|
|
116
|
-
resources: e.array(
|
|
116
|
+
resources: e.array(re).optional(),
|
|
117
117
|
domain: e.object({
|
|
118
|
-
signals: e.array(
|
|
119
|
-
entities: e.array(
|
|
120
|
-
workflows: e.array(
|
|
118
|
+
signals: e.array(se),
|
|
119
|
+
entities: e.array(le),
|
|
120
|
+
workflows: e.array(ce).optional()
|
|
121
121
|
}),
|
|
122
|
-
pages: e.array(
|
|
123
|
-
}),
|
|
122
|
+
pages: e.array(he).optional()
|
|
123
|
+
}), jt = e.object({
|
|
124
124
|
timestamp: e.number(),
|
|
125
125
|
soilMoisture: e.number().min(0).max(100),
|
|
126
126
|
ambientLight: e.number().min(0).max(1e5),
|
|
127
127
|
temperature: e.number().min(-40).max(125)
|
|
128
|
-
}),
|
|
128
|
+
}), be = e.object({
|
|
129
129
|
id: e.string(),
|
|
130
130
|
source: e.enum(["mqtt", "http", "ws", "mock"]),
|
|
131
131
|
domain: e.string(),
|
|
@@ -135,13 +135,13 @@ var te = Object.defineProperty, ae = (a, i) => {
|
|
|
135
135
|
timestamp: e.number(),
|
|
136
136
|
meta: e.record(e.unknown()).optional()
|
|
137
137
|
});
|
|
138
|
-
e.array(
|
|
139
|
-
var
|
|
138
|
+
e.array(be);
|
|
139
|
+
var fe = {
|
|
140
140
|
AGRICULTURE: "agriculture",
|
|
141
141
|
// Derived — Methodology Engine outputs
|
|
142
142
|
ENVIRONMENT: "environment"
|
|
143
143
|
// A device's surroundings — temperature, humidity, light
|
|
144
|
-
},
|
|
144
|
+
}, ve = e.enum(["telemetry", "market", "system", "logic"]), ye = e.enum(["mqtt", "http", "ws", "mock"]);
|
|
145
145
|
e.object({
|
|
146
146
|
/**
|
|
147
147
|
* Globally unique signal identifier.
|
|
@@ -153,7 +153,7 @@ e.object({
|
|
|
153
153
|
* The semantic category of this signal.
|
|
154
154
|
* Determines which Methodology Engine processes it.
|
|
155
155
|
*/
|
|
156
|
-
kind:
|
|
156
|
+
kind: ve,
|
|
157
157
|
/**
|
|
158
158
|
* The specific measurement or metric key within its kind.
|
|
159
159
|
* RULE: Keys MUST be abstract and domain-agnostic where possible.
|
|
@@ -181,7 +181,7 @@ e.object({
|
|
|
181
181
|
/**
|
|
182
182
|
* The transport source that produced this signal.
|
|
183
183
|
*/
|
|
184
|
-
source:
|
|
184
|
+
source: ye.optional(),
|
|
185
185
|
/**
|
|
186
186
|
* Optional domain namespace for grouping related signals.
|
|
187
187
|
* Examples: 'bodewell', 'finance', 'infrastructure', 'user_behavior'
|
|
@@ -195,11 +195,11 @@ e.object({
|
|
|
195
195
|
*/
|
|
196
196
|
meta: e.record(e.unknown()).optional()
|
|
197
197
|
});
|
|
198
|
-
var
|
|
199
|
-
|
|
200
|
-
BodewellCommandSchema: () =>
|
|
198
|
+
var we = {};
|
|
199
|
+
oe(we, {
|
|
200
|
+
BodewellCommandSchema: () => Ee,
|
|
201
201
|
BodewellDeviceID: () => T,
|
|
202
|
-
BodewellTelemetrySchema: () =>
|
|
202
|
+
BodewellTelemetrySchema: () => Ae
|
|
203
203
|
});
|
|
204
204
|
var T = e.enum([
|
|
205
205
|
"STK-V1-001",
|
|
@@ -207,7 +207,7 @@ var T = e.enum([
|
|
|
207
207
|
"STK-V1-003",
|
|
208
208
|
"STK-PRO-001",
|
|
209
209
|
"STK-VIS-001"
|
|
210
|
-
]),
|
|
210
|
+
]), Ae = e.object({
|
|
211
211
|
device_id: T,
|
|
212
212
|
stick_id: e.string().optional().describe("Firmware alias for device_id"),
|
|
213
213
|
timestamp: e.number().optional().describe("Epoch timestamp from NTP"),
|
|
@@ -222,12 +222,12 @@ var T = e.enum([
|
|
|
222
222
|
soil_moisture: e.number().optional().describe("Firmware alias for raw capacitance"),
|
|
223
223
|
soil_moisture_raw: e.number().optional().describe("Unscaled capacitance (300-1100)"),
|
|
224
224
|
fw_version: e.string().max(40).optional().describe("Firmware build the board is running; absent on v4 sketches, which cannot be updated over the air")
|
|
225
|
-
}).passthrough(),
|
|
225
|
+
}).passthrough(), Ee = e.object({
|
|
226
226
|
stick_id: T,
|
|
227
227
|
// Note: Your API uses stick_id here, not device_id
|
|
228
228
|
type: e.enum(["dry", "wet"]),
|
|
229
229
|
value: e.number()
|
|
230
|
-
}),
|
|
230
|
+
}), Se = e.enum([
|
|
231
231
|
"esp32-touch-28",
|
|
232
232
|
// 2.8" 240x320 resistive touch, the workshop board
|
|
233
233
|
"esp32-headless",
|
|
@@ -240,7 +240,7 @@ var T = e.enum([
|
|
|
240
240
|
"aircraft",
|
|
241
241
|
"sensor",
|
|
242
242
|
"blank"
|
|
243
|
-
]),
|
|
243
|
+
]), Ce = e.object({
|
|
244
244
|
/** Postal code is what a person knows; the portal resolves it to coordinates. */
|
|
245
245
|
postalCode: e.string().min(3).max(12),
|
|
246
246
|
latitude: e.number().min(-90).max(90).optional(),
|
|
@@ -248,29 +248,29 @@ var T = e.enum([
|
|
|
248
248
|
units: e.enum(["imperial", "metric"]).default("imperial"),
|
|
249
249
|
showForecast: e.boolean().default(!0),
|
|
250
250
|
refreshSeconds: e.number().int().min(300).max(86400).default(900)
|
|
251
|
-
}),
|
|
251
|
+
}), _e = e.object({
|
|
252
252
|
/** IANA zone, e.g. "America/New_York". */
|
|
253
253
|
timezone: e.string().default("America/New_York"),
|
|
254
254
|
twentyFourHour: e.boolean().default(!1),
|
|
255
255
|
showSeconds: e.boolean().default(!1),
|
|
256
256
|
showDate: e.boolean().default(!0)
|
|
257
|
-
}),
|
|
257
|
+
}), Be = e.object({
|
|
258
258
|
latitude: e.number().min(-90).max(90),
|
|
259
259
|
longitude: e.number().min(-180).max(180),
|
|
260
260
|
radiusKm: e.number().min(5).max(400).default(80),
|
|
261
261
|
/** Rows the list view can show before the screen runs out. */
|
|
262
262
|
maxRows: e.number().int().min(1).max(12).default(8),
|
|
263
263
|
refreshSeconds: e.number().int().min(10).max(600).default(30)
|
|
264
|
-
}),
|
|
264
|
+
}), Fe = e.object({
|
|
265
265
|
/** Signal keys to display, in order. Abstract keys per the Signal contract. */
|
|
266
266
|
keys: e.array(e.string()).min(1).max(6),
|
|
267
267
|
refreshSeconds: e.number().int().min(1).max(3600).default(10)
|
|
268
|
-
}),
|
|
269
|
-
weather:
|
|
270
|
-
clock:
|
|
271
|
-
aircraft:
|
|
272
|
-
sensor:
|
|
273
|
-
}),
|
|
268
|
+
}), ke = e.object({
|
|
269
|
+
weather: Ce.optional(),
|
|
270
|
+
clock: _e.optional(),
|
|
271
|
+
aircraft: Be.optional(),
|
|
272
|
+
sensor: Fe.optional()
|
|
273
|
+
}), je = e.object({
|
|
274
274
|
brightness: e.number().int().min(5).max(100).default(80),
|
|
275
275
|
/** Degrees clockwise. The board can sit either way up in a case. */
|
|
276
276
|
rotation: e.union([e.literal(0), e.literal(90), e.literal(180), e.literal(270)]).default(0),
|
|
@@ -283,7 +283,7 @@ var T = e.enum([
|
|
|
283
283
|
}), E = e.string().regex(
|
|
284
284
|
/^\d{1,3} \d{1,3} \d{1,3}$/,
|
|
285
285
|
'Expected space-separated RGB integers, e.g. "13 110 253"'
|
|
286
|
-
),
|
|
286
|
+
), Ie = e.object({
|
|
287
287
|
preset: e.enum(["light", "dark", "corporate", "midnight", "blueprint", "custom"]).default("dark"),
|
|
288
288
|
background: E.optional(),
|
|
289
289
|
foreground: E.optional(),
|
|
@@ -299,11 +299,11 @@ e.object({
|
|
|
299
299
|
revision: e.number().int().nonnegative(),
|
|
300
300
|
updatedAt: e.string().datetime().optional(),
|
|
301
301
|
activeApp: U,
|
|
302
|
-
apps:
|
|
303
|
-
display:
|
|
304
|
-
theme:
|
|
302
|
+
apps: ke,
|
|
303
|
+
display: je,
|
|
304
|
+
theme: Ie
|
|
305
305
|
});
|
|
306
|
-
var
|
|
306
|
+
var De = e.enum([
|
|
307
307
|
"unprovisioned",
|
|
308
308
|
"connecting",
|
|
309
309
|
"online",
|
|
@@ -312,11 +312,11 @@ var je = e.enum([
|
|
|
312
312
|
]);
|
|
313
313
|
e.object({
|
|
314
314
|
deviceId: e.string().min(1),
|
|
315
|
-
kind:
|
|
315
|
+
kind: Se,
|
|
316
316
|
firmwareVersion: e.string(),
|
|
317
317
|
/** Shown on the device's own screen at boot — how the user finds it. */
|
|
318
318
|
ipAddress: e.string().optional(),
|
|
319
|
-
provisioning:
|
|
319
|
+
provisioning: De,
|
|
320
320
|
/** Revision the device is actually running, not the one it was sent. */
|
|
321
321
|
configRevision: e.number().int().nonnegative(),
|
|
322
322
|
activeApp: U,
|
|
@@ -324,7 +324,7 @@ e.object({
|
|
|
324
324
|
uptimeSeconds: e.number().int().nonnegative().optional(),
|
|
325
325
|
freeHeapBytes: e.number().int().nonnegative().optional()
|
|
326
326
|
});
|
|
327
|
-
var
|
|
327
|
+
var Te = e.enum([
|
|
328
328
|
"background",
|
|
329
329
|
"foreground",
|
|
330
330
|
"muted",
|
|
@@ -332,7 +332,7 @@ var Ie = e.enum([
|
|
|
332
332
|
"success",
|
|
333
333
|
"warning",
|
|
334
334
|
"danger"
|
|
335
|
-
]),
|
|
335
|
+
]), Re = e.string().regex(/^\d{1,3} \d{1,3} \d{1,3}$/, 'RGB must be three space-separated integers, e.g. "13 110 253"'), S = e.union([Te, Re]), K = e.enum(["xs", "sm", "base", "lg", "xl", "display"]), C = e.enum(["start", "center", "end"]), Me = e.discriminatedUnion("kind", [
|
|
336
336
|
e.object({
|
|
337
337
|
kind: e.literal("weather"),
|
|
338
338
|
latitude: e.number().min(-90).max(90),
|
|
@@ -398,7 +398,7 @@ var Ie = e.enum([
|
|
|
398
398
|
]), I = e.union([
|
|
399
399
|
e.object({ literal: e.number() }),
|
|
400
400
|
e.object({ source: e.string().min(1), field: e.string().min(1) })
|
|
401
|
-
]),
|
|
401
|
+
]), Oe = e.object({
|
|
402
402
|
compute: e.enum(["add", "subtract", "multiply", "divide"]),
|
|
403
403
|
of: e.tuple([I, I]),
|
|
404
404
|
round: e.boolean().default(!0)
|
|
@@ -410,7 +410,7 @@ var Ie = e.enum([
|
|
|
410
410
|
/** Field on that source, e.g. "temperature", "high", "condition". */
|
|
411
411
|
field: e.string().min(1)
|
|
412
412
|
}),
|
|
413
|
-
|
|
413
|
+
Oe
|
|
414
414
|
]), _ = e.object({
|
|
415
415
|
value: I,
|
|
416
416
|
op: e.enum(["<", "<=", ">", ">=", "==", "!="]),
|
|
@@ -425,7 +425,7 @@ var Ie = e.enum([
|
|
|
425
425
|
hideWhen: _.optional(),
|
|
426
426
|
/** Conditional style. First match wins. */
|
|
427
427
|
rules: e.array(W).max(4).optional()
|
|
428
|
-
},
|
|
428
|
+
}, Ne = e.object({
|
|
429
429
|
type: e.literal("text"),
|
|
430
430
|
value: w,
|
|
431
431
|
size: K.default("base"),
|
|
@@ -435,30 +435,30 @@ var Ie = e.enum([
|
|
|
435
435
|
prefix: e.string().max(8).optional(),
|
|
436
436
|
suffix: e.string().max(8).optional(),
|
|
437
437
|
...B
|
|
438
|
-
}),
|
|
438
|
+
}), Pe = e.object({
|
|
439
439
|
type: e.literal("dial"),
|
|
440
440
|
value: w,
|
|
441
441
|
min: e.number(),
|
|
442
442
|
max: e.number(),
|
|
443
443
|
label: e.string().max(24).optional(),
|
|
444
444
|
...B
|
|
445
|
-
}),
|
|
445
|
+
}), $e = e.object({
|
|
446
446
|
type: e.literal("sparkline"),
|
|
447
447
|
/** A source field holding a series rather than a scalar. */
|
|
448
448
|
series: w,
|
|
449
449
|
...B
|
|
450
|
-
}),
|
|
450
|
+
}), ze = e.object({
|
|
451
451
|
type: e.literal("bar"),
|
|
452
452
|
value: w,
|
|
453
453
|
min: e.number(),
|
|
454
454
|
max: e.number(),
|
|
455
455
|
...B
|
|
456
|
-
}),
|
|
456
|
+
}), Le = e.object({
|
|
457
457
|
type: e.literal("status"),
|
|
458
458
|
state: w,
|
|
459
459
|
label: e.string().max(24).optional(),
|
|
460
460
|
...B
|
|
461
|
-
}), F = 64,
|
|
461
|
+
}), F = 64, Ve = F / 2, He = Math.ceil(Ve * F / 3) * 4, Ue = e.object({
|
|
462
462
|
type: e.literal("sprite"),
|
|
463
463
|
width: e.number().int().min(1).max(F),
|
|
464
464
|
height: e.number().int().min(1).max(F),
|
|
@@ -473,11 +473,11 @@ var Ie = e.enum([
|
|
|
473
473
|
*/
|
|
474
474
|
palette: e.array(S).min(1).max(16),
|
|
475
475
|
/** base64 of the packed nibbles. */
|
|
476
|
-
pixels: e.string().min(4).max(
|
|
476
|
+
pixels: e.string().min(4).max(He),
|
|
477
477
|
align: C.default("start"),
|
|
478
478
|
/** Drawn only when this is false, or absent. */
|
|
479
479
|
hideWhen: _.optional()
|
|
480
|
-
}), D = e.string().regex(/^[0-9a-f]{64}$/, "a lowercase hex SHA-256"), f = { width: 304, height: 224 },
|
|
480
|
+
}), D = e.string().regex(/^[0-9a-f]{64}$/, "a lowercase hex SHA-256"), f = { width: 304, height: 224 }, Ke = 8, z = {
|
|
481
481
|
/** "RSPR". */
|
|
482
482
|
magic: [82, 83, 80, 82],
|
|
483
483
|
version: 1,
|
|
@@ -486,13 +486,13 @@ var Ie = e.enum([
|
|
|
486
486
|
/** Only 4 today: two pixels per byte, high nibble first, rows padded to a byte. */
|
|
487
487
|
bitsPerPixel: 4,
|
|
488
488
|
maxColors: 16
|
|
489
|
-
},
|
|
489
|
+
}, It = z.headerBytes + z.maxColors * 2 + Math.ceil(f.width / 2) * f.height, We = e.object({
|
|
490
490
|
type: e.literal("image"),
|
|
491
491
|
asset: D,
|
|
492
492
|
/** The file's own pixels, not the drawn size. */
|
|
493
493
|
width: e.number().int().min(1).max(f.width),
|
|
494
494
|
height: e.number().int().min(1).max(f.height),
|
|
495
|
-
scale: e.number().int().min(1).max(
|
|
495
|
+
scale: e.number().int().min(1).max(Ke).default(1),
|
|
496
496
|
/**
|
|
497
497
|
* What kind of file `asset` names: `spr`, the palette file the retro look
|
|
498
498
|
* uses, or `jpeg`, the full-colour rendition (drawn at scale 1). Absent means
|
|
@@ -502,7 +502,7 @@ var Ie = e.enum([
|
|
|
502
502
|
align: C.default("start"),
|
|
503
503
|
/** Drawn only when this is false, or absent. */
|
|
504
504
|
hideWhen: _.optional()
|
|
505
|
-
}),
|
|
505
|
+
}), Dt = { sm: 24, md: 48, lg: 72, xl: 96 }, Ge = e.object({
|
|
506
506
|
type: e.literal("icon"),
|
|
507
507
|
value: w,
|
|
508
508
|
size: e.enum(["sm", "md", "lg", "xl"]).default("md"),
|
|
@@ -512,15 +512,15 @@ var Ie = e.enum([
|
|
|
512
512
|
/** Drawn only when this is false, or absent. */
|
|
513
513
|
hideWhen: _.optional()
|
|
514
514
|
}), G = e.discriminatedUnion("type", [
|
|
515
|
-
Oe,
|
|
516
|
-
Me,
|
|
517
515
|
Ne,
|
|
518
516
|
Pe,
|
|
519
517
|
$e,
|
|
520
|
-
|
|
518
|
+
ze,
|
|
519
|
+
Le,
|
|
521
520
|
Ue,
|
|
522
|
-
|
|
523
|
-
|
|
521
|
+
We,
|
|
522
|
+
Ge
|
|
523
|
+
]), Ze = e.object({
|
|
524
524
|
type: e.literal("group"),
|
|
525
525
|
direction: e.enum(["row", "stack"]),
|
|
526
526
|
gap: e.number().int().min(0).max(64).default(4),
|
|
@@ -537,12 +537,12 @@ var Ie = e.enum([
|
|
|
537
537
|
*/
|
|
538
538
|
pack: e.boolean().optional(),
|
|
539
539
|
children: e.array(G).min(1).max(8)
|
|
540
|
-
}),
|
|
540
|
+
}), qe = e.union([G, Ze]);
|
|
541
541
|
e.enum(["landscape", "portrait"]);
|
|
542
|
-
var
|
|
542
|
+
var Tt = {
|
|
543
543
|
landscape: { width: 320, height: 240 },
|
|
544
544
|
portrait: { width: 240, height: 320 }
|
|
545
|
-
},
|
|
545
|
+
}, Ye = e.preprocess(
|
|
546
546
|
(a) => a === "240x320" ? "320x240" : a,
|
|
547
547
|
e.enum(["320x240"])
|
|
548
548
|
), R = e.object({
|
|
@@ -552,7 +552,7 @@ var Ft = {
|
|
|
552
552
|
name: e.string().min(1).max(48),
|
|
553
553
|
/** Free text. Never an email or anything else identifying — see the plan. */
|
|
554
554
|
author: e.string().max(32).optional(),
|
|
555
|
-
screen:
|
|
555
|
+
screen: Ye.default("320x240"),
|
|
556
556
|
background: S.default("background"),
|
|
557
557
|
/**
|
|
558
558
|
* Where the blocks sit on the screen as a whole: from the top, or in the
|
|
@@ -583,13 +583,13 @@ var Ft = {
|
|
|
583
583
|
*/
|
|
584
584
|
font: e.enum(["inter", "pixel", "tay"]).optional(),
|
|
585
585
|
/** Named so bindings can refer to them. */
|
|
586
|
-
sources: e.record(
|
|
587
|
-
blocks: e.array(
|
|
586
|
+
sources: e.record(Me).default({}),
|
|
587
|
+
blocks: e.array(qe).min(1).max(12)
|
|
588
588
|
}).superRefine((a, i) => {
|
|
589
|
-
const
|
|
589
|
+
const x = (d) => Math.ceil(d / 2), m = (d, n) => {
|
|
590
590
|
const t = d;
|
|
591
591
|
if ((t == null ? void 0 : t.type) !== "sprite" || !t.width || !t.height || typeof t.pixels != "string") return;
|
|
592
|
-
const s =
|
|
592
|
+
const s = x(t.width) * t.height, l = Math.floor(t.pixels.replace(/=+$/, "").length * 3 / 4);
|
|
593
593
|
l !== s && i.addIssue({
|
|
594
594
|
code: e.ZodIssueCode.custom,
|
|
595
595
|
path: [...n, "pixels"],
|
|
@@ -651,7 +651,7 @@ e.object({
|
|
|
651
651
|
crop: Z.optional()
|
|
652
652
|
});
|
|
653
653
|
e.enum(["register", "poll", "send"]);
|
|
654
|
-
var
|
|
654
|
+
var Xe = e.enum(["working", "missing", "unsupported", "fault"]), q = e.string().regex(/^[a-z][a-z0-9-]{0,23}$/), Y = e.record(q, Xe).refine((a) => Object.keys(a).length <= 16, { message: "at most 16 features" });
|
|
655
655
|
e.object({
|
|
656
656
|
/** When the board last said any of this, by the server's clock. */
|
|
657
657
|
reportedAt: e.number().int().nonnegative().optional(),
|
|
@@ -717,19 +717,19 @@ e.object({
|
|
|
717
717
|
*/
|
|
718
718
|
rotation: e.number().int().min(0).max(3).optional()
|
|
719
719
|
});
|
|
720
|
-
var
|
|
720
|
+
var Je = e.object({
|
|
721
721
|
key: q,
|
|
722
722
|
value: e.union([e.number().finite(), e.string().max(64), e.boolean()]),
|
|
723
723
|
unit: e.string().max(16).optional(),
|
|
724
724
|
at: e.number().int().nonnegative().optional()
|
|
725
725
|
});
|
|
726
726
|
e.object({
|
|
727
|
-
readings: e.array(
|
|
727
|
+
readings: e.array(Je).min(1).max(16)
|
|
728
728
|
});
|
|
729
|
-
var
|
|
729
|
+
var p = e.string().regex(/^[0-9A-HJKMNP-TV-Z]{8}$/, "eight characters, no I L O or U"), M = e.string().regex(/^\d{4}$/);
|
|
730
730
|
e.object({
|
|
731
|
-
deviceId:
|
|
732
|
-
code:
|
|
731
|
+
deviceId: p,
|
|
732
|
+
code: M,
|
|
733
733
|
/** Firmware build, so a support question has an answer. */
|
|
734
734
|
version: e.string().max(40).optional(),
|
|
735
735
|
/** Which board this is, from Boards.h — the two variants need different firmware. */
|
|
@@ -758,31 +758,31 @@ e.object({
|
|
|
758
758
|
features: Y.optional()
|
|
759
759
|
});
|
|
760
760
|
e.object({
|
|
761
|
-
deviceId:
|
|
762
|
-
code:
|
|
761
|
+
deviceId: p,
|
|
762
|
+
code: M
|
|
763
763
|
});
|
|
764
764
|
e.object({
|
|
765
|
-
deviceId:
|
|
765
|
+
deviceId: p
|
|
766
766
|
});
|
|
767
767
|
e.object({
|
|
768
768
|
revision: e.number().int().nonnegative(),
|
|
769
769
|
sentAt: e.number().int().nonnegative()
|
|
770
770
|
});
|
|
771
771
|
e.object({
|
|
772
|
-
deviceId:
|
|
773
|
-
code:
|
|
772
|
+
deviceId: p,
|
|
773
|
+
code: M,
|
|
774
774
|
ownerId: e.string().nullable().default(null),
|
|
775
775
|
version: e.string().max(40).optional(),
|
|
776
776
|
createdAt: e.number().int().nonnegative(),
|
|
777
777
|
lastSeenAt: e.number().int().nonnegative()
|
|
778
778
|
});
|
|
779
|
-
var
|
|
779
|
+
var Qe = e.object({
|
|
780
780
|
version: e.string().min(1).max(40),
|
|
781
781
|
url: e.string().url().max(200),
|
|
782
782
|
sha256: e.string().regex(/^[0-9a-f]{64}$/),
|
|
783
783
|
bytes: e.number().int().positive(),
|
|
784
784
|
requestedAt: e.number().int().nonnegative()
|
|
785
|
-
}),
|
|
785
|
+
}), Rt = "?", Mt = {
|
|
786
786
|
// Accented Latin, CP437 0x80-0xA5 and 0xE1
|
|
787
787
|
Ç: { byte: 128, shows: "Ç" },
|
|
788
788
|
ü: { byte: 129, shows: "ü" },
|
|
@@ -854,7 +854,7 @@ var Xe = e.object({
|
|
|
854
854
|
"—": { byte: 45, shows: "-" },
|
|
855
855
|
"−": { byte: 45, shows: "-" },
|
|
856
856
|
" ": { byte: 32, shows: " " }
|
|
857
|
-
},
|
|
857
|
+
}, Ot = 28, Nt = {
|
|
858
858
|
background: "17 17 17",
|
|
859
859
|
foreground: "238 238 238",
|
|
860
860
|
muted: "153 153 153",
|
|
@@ -862,7 +862,7 @@ var Xe = e.object({
|
|
|
862
862
|
success: "34 197 94",
|
|
863
863
|
warning: "245 158 11",
|
|
864
864
|
danger: "220 53 69"
|
|
865
|
-
},
|
|
865
|
+
}, Pt = 48, $t = 3, zt = {
|
|
866
866
|
sun: [
|
|
867
867
|
[32, 24, 32, 26, 30, 29, 29, 30, 26, 32, 22, 32, 19, 30, 18, 29, 16, 26, 16, 22, 18, 19, 19, 18, 22, 16, 26, 16, 29, 18, 30, 19, 32, 22, 32, 24],
|
|
868
868
|
[37, 24, 43, 24],
|
|
@@ -910,7 +910,7 @@ var Xe = e.object({
|
|
|
910
910
|
[41, 25, 37, 29, 35, 30, 13, 30, 10, 29, 9, 27, 9, 22, 10, 20, 14, 18, 15, 15, 15, 13, 19, 9, 21, 8, 26, 8, 29, 9, 31, 11, 33, 15, 36, 16, 38, 17, 40, 19, 41, 22, 41, 24],
|
|
911
911
|
[26, 33, 20, 41, 27, 41, 22, 47]
|
|
912
912
|
]
|
|
913
|
-
}, k = 8,
|
|
913
|
+
}, k = 8, et = e.object({
|
|
914
914
|
apps: e.array(R).min(1).max(k),
|
|
915
915
|
/** Which app to show — an index into `apps`. */
|
|
916
916
|
show: e.number().int().min(0).max(k - 1),
|
|
@@ -922,17 +922,29 @@ var Xe = e.object({
|
|
|
922
922
|
* sent longest ago, so sending always works. Missing reads as oldest.
|
|
923
923
|
*/
|
|
924
924
|
added: e.array(e.number().int().nonnegative()).max(k).optional()
|
|
925
|
-
})
|
|
925
|
+
}), X = e.union([e.literal(10), e.literal(30), e.literal(60), e.literal(0)]), tt = [
|
|
926
|
+
"podcasts",
|
|
927
|
+
"radio",
|
|
928
|
+
"music",
|
|
929
|
+
"snake",
|
|
930
|
+
"menu",
|
|
931
|
+
"settings",
|
|
932
|
+
"home",
|
|
933
|
+
"next",
|
|
934
|
+
"quieter",
|
|
935
|
+
"louder",
|
|
936
|
+
"sleep"
|
|
937
|
+
], J = e.enum(tt), at = 8, nt = e.object({ n: e.number().int().positive(), do: J });
|
|
926
938
|
e.discriminatedUnion("op", [
|
|
927
|
-
e.object({ op: e.literal("show"), deviceId:
|
|
928
|
-
e.object({ op: e.literal("remove"), deviceId:
|
|
939
|
+
e.object({ op: e.literal("show"), deviceId: p, index: e.number().int().min(0) }),
|
|
940
|
+
e.object({ op: e.literal("remove"), deviceId: p, index: e.number().int().min(0) }),
|
|
929
941
|
e.object({
|
|
930
942
|
op: e.literal("move"),
|
|
931
|
-
deviceId:
|
|
943
|
+
deviceId: p,
|
|
932
944
|
from: e.number().int().min(0),
|
|
933
945
|
to: e.number().int().min(0)
|
|
934
946
|
}),
|
|
935
|
-
e.object({ op: e.literal("rotate"), deviceId:
|
|
947
|
+
e.object({ op: e.literal("rotate"), deviceId: p, minutes: e.number().int().min(0).max(1440) }),
|
|
936
948
|
/**
|
|
937
949
|
* Swap the panel's light and dark. Not about apps, but it rides the same
|
|
938
950
|
* route and the same poll: some units of the same board carry a panel wired
|
|
@@ -940,13 +952,21 @@ e.discriminatedUnion("op", [
|
|
|
940
952
|
* from identical firmware. It is a fact about one board's glass, so it is a
|
|
941
953
|
* per-board setting rather than a build.
|
|
942
954
|
*/
|
|
943
|
-
e.object({ op: e.literal("screen"), deviceId:
|
|
955
|
+
e.object({ op: e.literal("screen"), deviceId: p, invert: e.boolean() }),
|
|
956
|
+
/**
|
|
957
|
+
* How long the board may be left alone on its battery before it sleeps,
|
|
958
|
+
* 0 for never. Beside the panel setting, and for the same reason: it is
|
|
959
|
+
* about one board, not the apps on it.
|
|
960
|
+
*/
|
|
961
|
+
e.object({ op: e.literal("sleep"), deviceId: p, minutes: X }),
|
|
962
|
+
/** A press from the page's Remote; see BOARD_REMOTE_COMMANDS. */
|
|
963
|
+
e.object({ op: e.literal("remote"), deviceId: p, do: J }),
|
|
944
964
|
/**
|
|
945
965
|
* Remove one entry from the list of apps sent to this board, by the revision
|
|
946
966
|
* it was sent as. The record only: what the board holds is the shelf's
|
|
947
967
|
* business, and `remove` above is how an app comes off it.
|
|
948
968
|
*/
|
|
949
|
-
e.object({ op: e.literal("forget"), deviceId:
|
|
969
|
+
e.object({ op: e.literal("forget"), deviceId: p, revision: e.number().int().min(1) })
|
|
950
970
|
]);
|
|
951
971
|
e.object({
|
|
952
972
|
document: R,
|
|
@@ -964,7 +984,7 @@ var v = e.string().regex(/^\d{1,3} \d{1,3} \d{1,3}$/, 'Must be "R G B", e.g. "13
|
|
|
964
984
|
success: v,
|
|
965
985
|
warning: v,
|
|
966
986
|
danger: v
|
|
967
|
-
}),
|
|
987
|
+
}), Q = e.enum(["inter", "tay", "pixel"]), ot = ["0rem", "0.25rem", "0.5rem", "0.75rem", "1rem"], V = e.string().trim().min(1).max(60).regex(/^[A-Za-z0-9 ]+$/), it = e.object({
|
|
968
988
|
heading: V.optional(),
|
|
969
989
|
body: V.optional()
|
|
970
990
|
});
|
|
@@ -974,25 +994,27 @@ e.object({
|
|
|
974
994
|
base: e.string().max(40).optional(),
|
|
975
995
|
light: L,
|
|
976
996
|
dark: L,
|
|
977
|
-
lettering:
|
|
978
|
-
radius: e.enum(
|
|
979
|
-
fonts:
|
|
997
|
+
lettering: Q,
|
|
998
|
+
radius: e.enum(ot),
|
|
999
|
+
fonts: it.optional()
|
|
980
1000
|
});
|
|
981
1001
|
e.object({
|
|
982
1002
|
text: e.string().max(2e3)
|
|
983
1003
|
});
|
|
984
|
-
var
|
|
1004
|
+
var rt = e.string().regex(/^[0-9a-f]{42}$/), st = e.union([e.literal("auto"), Q]);
|
|
985
1005
|
e.object({
|
|
986
1006
|
revision: e.number().int().nonnegative(),
|
|
987
1007
|
sentAt: e.number().int().nonnegative().optional(),
|
|
988
1008
|
document: R.optional(),
|
|
989
|
-
shelf:
|
|
990
|
-
update:
|
|
991
|
-
screen: e.object({ invert: e.boolean() }).optional(),
|
|
992
|
-
palette:
|
|
993
|
-
font:
|
|
1009
|
+
shelf: et.optional(),
|
|
1010
|
+
update: Qe.optional(),
|
|
1011
|
+
screen: e.object({ invert: e.boolean(), sleepMinutes: X.optional() }).optional(),
|
|
1012
|
+
palette: rt.optional(),
|
|
1013
|
+
font: st.optional(),
|
|
1014
|
+
hiddenApps: e.string().regex(/^([a-z]+(,[a-z]+)*)?$/).optional(),
|
|
1015
|
+
remote: e.array(nt).max(at).optional()
|
|
994
1016
|
});
|
|
995
|
-
var
|
|
1017
|
+
var Lt = { inter: { family: "Inter", weight: 500, caps: !1 }, tay: { family: "TAY Dreamboat", weight: 400, caps: !0 } }, Vt = { inter: { 10: { 0: 6, 1: 4, 2: 6, 3: 6, 4: 7, 5: 6, 6: 6, 7: 6, 8: 6, 9: 6, " ": 3, "!": 3, '"': 5, "#": 6, $: 6, "%": 10, "&": 7, "'": 3, "(": 4, ")": 4, "*": 5, "+": 7, ",": 3, "-": 5, ".": 3, "/": 4, ":": 3, ";": 3, "<": 7, "=": 7, ">": 7, "?": 5, "@": 10, A: 7, B: 7, C: 7, D: 7, E: 6, F: 6, G: 7, H: 7, I: 3, J: 6, K: 7, L: 6, M: 9, N: 8, O: 8, P: 6, Q: 8, R: 6, S: 6, T: 7, U: 7, V: 7, W: 10, X: 7, Y: 7, Z: 6, "[": 4, "\\": 4, "]": 4, "^": 5, _: 5, "`": 3, a: 6, b: 6, c: 6, d: 6, e: 6, f: 4, g: 6, h: 6, i: 3, j: 3, k: 6, l: 3, m: 9, n: 6, o: 6, p: 6, q: 6, r: 4, s: 5, t: 3, u: 6, v: 6, w: 8, x: 6, y: 6, z: 6, "{": 4, "|": 3, "}": 4, "~": 7, " ": 3, "¡": 3, "¢": 6, "£": 6, "¥": 6, ª: 5, "«": 6, "¬": 7, "°": 5, "±": 7, "²": 4, µ: 6, "·": 3, º: 5, "»": 6, "¼": 8, "½": 9, "¿": 5, Ä: 7, Å: 7, Æ: 10, Ç: 7, É: 6, Ñ: 8, Ö: 8, Ü: 7, ß: 6, à: 6, á: 6, â: 6, ä: 6, å: 6, æ: 9, ç: 6, è: 6, é: 6, ê: 6, ë: 6, ì: 3, í: 3, î: 3, ï: 3, ñ: 6, ò: 6, ó: 6, ô: 6, ö: 6, "÷": 7, ù: 6, ú: 6, û: 6, ü: 6, ÿ: 6, ƒ: 5, Ω: 8, π: 5, "–": 5, "—": 10, "‘": 3, "’": 3, "“": 5, "”": 5, "−": 7, "√": 5, "∞": 7, "≈": 5, "≤": 5, "≥": 5 }, 12: { 0: 8, 1: 5, 2: 7, 3: 8, 4: 8, 5: 7, 6: 8, 7: 7, 8: 8, 9: 8, " ": 3, "!": 4, '"': 6, "#": 8, $: 8, "%": 12, "&": 8, "'": 4, "(": 4, ")": 4, "*": 6, "+": 8, ",": 4, "-": 6, ".": 4, "/": 4, ":": 4, ";": 4, "<": 8, "=": 8, ">": 8, "?": 6, "@": 12, A: 9, B: 8, C: 9, D: 9, E: 7, F: 7, G: 9, H: 9, I: 3, J: 7, K: 8, L: 7, M: 11, N: 9, O: 9, P: 8, Q: 9, R: 8, S: 8, T: 8, U: 9, V: 9, W: 12, X: 8, Y: 8, Z: 8, "[": 4, "\\": 4, "]": 4, "^": 6, _: 6, "`": 4, a: 7, b: 7, c: 7, d: 7, e: 7, f: 5, g: 7, h: 7, i: 3, j: 3, k: 7, l: 3, m: 11, n: 7, o: 7, p: 7, q: 7, r: 5, s: 6, t: 4, u: 7, v: 7, w: 10, x: 7, y: 7, z: 7, "{": 5, "|": 4, "}": 5, "~": 8, " ": 3, "¡": 4, "¢": 7, "£": 7, "¥": 7, ª: 5, "«": 7, "¬": 8, "°": 5, "±": 8, "²": 5, µ: 7, "·": 4, º: 6, "»": 7, "¼": 10, "½": 10, "¿": 6, Ä: 9, Å: 9, Æ: 12, Ç: 9, É: 7, Ñ: 9, Ö: 9, Ü: 9, ß: 8, à: 7, á: 7, â: 7, ä: 7, å: 7, æ: 11, ç: 7, è: 7, é: 7, ê: 7, ë: 7, ì: 3, í: 3, î: 3, ï: 3, ñ: 7, ò: 7, ó: 7, ô: 7, ö: 7, "÷": 8, ù: 7, ú: 7, û: 7, ü: 7, ÿ: 7, ƒ: 6, Ω: 9, π: 7, "–": 6, "—": 12, "‘": 3, "’": 3, "“": 6, "”": 6, "−": 8, "√": 7, "∞": 9, "≈": 7, "≤": 7, "≥": 7 }, 16: { 0: 10, 1: 7, 2: 10, 3: 10, 4: 11, 5: 10, 6: 10, 7: 9, 8: 10, 9: 10, " ": 4, "!": 5, '"': 8, "#": 10, $: 10, "%": 16, "&": 10, "'": 5, "(": 6, ")": 6, "*": 8, "+": 11, ",": 5, "-": 7, ".": 5, "/": 6, ":": 5, ";": 5, "<": 11, "=": 11, ">": 11, "?": 8, "@": 16, A: 11, B: 11, C: 12, D: 12, E: 10, F: 9, G: 12, H: 12, I: 4, J: 9, K: 11, L: 9, M: 15, N: 12, O: 12, P: 10, Q: 12, R: 10, S: 10, T: 10, U: 12, V: 11, W: 16, X: 11, Y: 11, Z: 10, "[": 6, "\\": 6, "]": 6, "^": 8, _: 7, "`": 5, a: 9, b: 10, c: 9, d: 10, e: 9, f: 6, g: 10, h: 10, i: 4, j: 4, k: 9, l: 4, m: 14, n: 10, o: 10, p: 10, q: 10, r: 6, s: 9, t: 5, u: 10, v: 9, w: 13, x: 9, y: 9, z: 9, "{": 7, "|": 6, "}": 7, "~": 11, " ": 4, "¡": 5, "¢": 9, "£": 10, "¥": 9, ª: 7, "«": 10, "¬": 11, "°": 7, "±": 11, "²": 7, µ: 10, "·": 5, º: 8, "»": 10, "¼": 13, "½": 14, "¿": 8, Ä: 11, Å: 11, Æ: 16, Ç: 12, É: 10, Ñ: 12, Ö: 12, Ü: 12, ß: 10, à: 9, á: 9, â: 9, ä: 9, å: 9, æ: 15, ç: 9, è: 9, é: 9, ê: 9, ë: 9, ì: 4, í: 4, î: 4, ï: 4, ñ: 10, ò: 10, ó: 10, ô: 10, ö: 10, "÷": 11, ù: 10, ú: 10, û: 10, ü: 10, ÿ: 9, ƒ: 8, Ω: 12, π: 9, "–": 8, "—": 16, "‘": 4, "’": 4, "“": 8, "”": 8, "−": 11, "√": 9, "∞": 11, "≈": 9, "≤": 9, "≥": 9 }, 20: { 0: 13, 1: 8, 2: 12, 3: 13, 4: 13, 5: 12, 6: 13, 7: 11, 8: 13, 9: 13, " ": 5, "!": 6, '"': 10, "#": 13, $: 13, "%": 20, "&": 13, "'": 6, "(": 7, ")": 7, "*": 10, "+": 13, ",": 6, "-": 9, ".": 6, "/": 7, ":": 6, ";": 6, "<": 13, "=": 13, ">": 13, "?": 11, "@": 20, A: 14, B: 13, C: 15, D: 14, E: 12, F: 12, G: 15, H: 15, I: 5, J: 12, K: 14, L: 11, M: 18, N: 15, O: 15, P: 13, Q: 15, R: 13, S: 13, T: 13, U: 15, V: 14, W: 20, X: 14, Y: 14, Z: 13, "[": 7, "\\": 7, "]": 7, "^": 10, _: 9, "`": 7, a: 11, b: 12, c: 12, d: 12, e: 12, f: 8, g: 12, h: 12, i: 5, j: 5, k: 11, l: 5, m: 18, n: 12, o: 12, p: 12, q: 12, r: 8, s: 11, t: 7, u: 12, v: 11, w: 17, x: 11, y: 12, z: 11, "{": 9, "|": 7, "}": 9, "~": 13, " ": 5, "¡": 6, "¢": 12, "£": 12, "¥": 11, ª: 9, "«": 12, "¬": 13, "°": 9, "±": 13, "²": 9, µ: 12, "·": 6, º: 10, "»": 12, "¼": 16, "½": 17, "¿": 11, Ä: 14, Å: 14, Æ: 20, Ç: 15, É: 12, Ñ: 15, Ö: 15, Ü: 15, ß: 13, à: 11, á: 11, â: 11, ä: 11, å: 11, æ: 18, ç: 12, è: 12, é: 12, ê: 12, ë: 12, ì: 5, í: 5, î: 5, ï: 5, ñ: 12, ò: 12, ó: 12, ô: 12, ö: 12, "÷": 13, ù: 12, ú: 12, û: 12, ü: 12, ÿ: 12, ƒ: 10, Ω: 15, π: 11, "–": 10, "—": 20, "‘": 6, "’": 6, "“": 9, "”": 9, "−": 13, "√": 11, "∞": 14, "≈": 11, "≤": 11, "≥": 11 }, 28: { 0: 18, 1: 12, 2: 17, 3: 18, 4: 18, 5: 17, 6: 18, 7: 16, 8: 18, 9: 18, " ": 7, "!": 9, '"': 14, "#": 18, $: 18, "%": 28, "&": 18, "'": 9, "(": 10, ")": 10, "*": 15, "+": 19, ",": 8, "-": 13, ".": 8, "/": 10, ":": 8, ";": 9, "<": 19, "=": 19, ">": 19, "?": 15, "@": 28, A: 20, B: 18, C: 21, D: 20, E: 17, F: 17, G: 21, H: 21, I: 8, J: 16, K: 19, L: 16, M: 26, N: 21, O: 21, P: 18, Q: 22, R: 18, S: 18, T: 18, U: 21, V: 20, W: 28, X: 20, Y: 19, Z: 18, "[": 10, "\\": 10, "]": 10, "^": 13, _: 13, "`": 9, a: 16, b: 17, c: 16, d: 17, e: 16, f: 11, g: 17, h: 17, i: 7, j: 7, k: 16, l: 7, m: 25, n: 17, o: 17, p: 17, q: 17, r: 11, s: 15, t: 10, u: 17, v: 16, w: 23, x: 16, y: 16, z: 16, "{": 12, "|": 10, "}": 12, "~": 19, " ": 7, "¡": 9, "¢": 16, "£": 17, "¥": 16, ª: 13, "«": 17, "¬": 19, "°": 13, "±": 19, "²": 13, µ: 17, "·": 8, º: 14, "»": 17, "¼": 23, "½": 24, "¿": 15, Ä: 20, Å: 20, Æ: 28, Ç: 21, É: 17, Ñ: 21, Ö: 21, Ü: 21, ß: 18, à: 16, á: 16, â: 16, ä: 16, å: 16, æ: 26, ç: 16, è: 16, é: 16, ê: 16, ë: 16, ì: 7, í: 7, î: 7, ï: 7, ñ: 17, ò: 17, ó: 17, ô: 17, ö: 17, "÷": 19, ù: 17, ú: 17, û: 17, ü: 17, ÿ: 16, ƒ: 14, Ω: 22, π: 15, "–": 14, "—": 28, "‘": 8, "’": 8, "“": 13, "”": 13, "−": 19, "√": 15, "∞": 20, "≈": 15, "≤": 15, "≥": 15 }, 56: { 0: 36, 1: 23, 2: 35, 3: 35, 4: 37, 5: 34, 6: 35, 7: 32, 8: 35, 9: 35, " ": 15, "!": 17, '"': 28, "#": 36, $: 36, "%": 56, "&": 37, "'": 18, "(": 21, ")": 21, "*": 29, "+": 37, ",": 17, "-": 26, ".": 17, "/": 21, ":": 17, ";": 18, "<": 37, "=": 37, ">": 37, "?": 30, "@": 55, A: 40, B: 37, C: 41, D: 40, E: 34, F: 33, G: 42, H: 42, I: 15, J: 32, K: 39, L: 32, M: 51, N: 42, O: 43, P: 36, Q: 43, R: 36, S: 36, T: 37, U: 41, V: 40, W: 56, X: 39, Y: 39, Z: 36, "[": 21, "\\": 21, "]": 21, "^": 27, _: 26, "`": 19, a: 32, b: 35, c: 32, d: 35, e: 33, f: 21, g: 35, h: 34, i: 14, j: 14, k: 31, l: 14, m: 50, n: 34, o: 34, p: 35, q: 35, r: 22, s: 30, t: 19, u: 34, v: 32, w: 46, x: 31, y: 32, z: 31, "{": 25, "|": 19, "}": 25, "~": 37, "°": 26 } }, tay: { 28: { 0: 29, 1: 16, 2: 28, 3: 28, 4: 30, 5: 27, 6: 28, 7: 26, 8: 29, 9: 29, " ": 12, "!": 16, '"': 12, "#": 27, $: 27, "%": 29, "&": 33, "'": 9, "(": 20, ")": 20, "*": 14, "+": 21, ",": 10, "-": 16, ".": 10, "/": 19, ":": 13, ";": 12, "<": 18, "=": 22, ">": 18, "?": 27, "@": 31, A: 28, B: 32, C: 28, D: 30, E: 30, F: 29, G: 29, H: 32, I: 16, J: 27, K: 29, L: 27, M: 36, N: 32, O: 29, P: 30, Q: 30, R: 30, S: 29, T: 31, U: 29, V: 28, W: 40, X: 29, Y: 29, Z: 30, "[": 17, "\\": 19, "]": 17, "^": 13, _: 19, "`": 9, "{": 13, "|": 6, "}": 13, "~": 15, " ": 8, "¡": 15, "¢": 14, "£": 26, "¥": 31, ª: 8, "«": 14, "¬": 16, "°": 14, "±": 15, "²": 8, "·": 7, º: 9, "»": 14, "¼": 21, "½": 21, "¿": 26, Ä: 28, Å: 28, Æ: 25, Ç: 28, É: 30, Ñ: 32, Ö: 29, Ü: 29, "÷": 15, Ω: 22, "–": 14, "—": 28, "‘": 9, "’": 9, "“": 12, "”": 12, "−": 16, "√": 15, "∞": 20, "≈": 15, "≤": 15, "≥": 15 }, 56: { 0: 58, 1: 33, 2: 56, 3: 57, 4: 60, 5: 55, 6: 57, 7: 51, 8: 58, 9: 59, " ": 24, "!": 32, '"': 23, "#": 55, $: 55, "%": 59, "&": 66, "'": 18, "(": 39, ")": 39, "*": 28, "+": 43, ",": 20, "-": 31, ".": 20, "/": 38, ":": 26, ";": 23, "<": 37, "=": 44, ">": 37, "?": 54, "@": 61, A: 56, B: 63, C: 56, D: 60, E: 60, F: 58, G: 58, H: 63, I: 33, J: 55, K: 58, L: 53, M: 72, N: 65, O: 59, P: 60, Q: 59, R: 61, S: 58, T: 62, U: 58, V: 56, W: 79, X: 58, Y: 58, Z: 59, "[": 34, "\\": 38, "]": 34, "^": 26, _: 39, "`": 19, "{": 27, "|": 11, "}": 27, "~": 30, "°": 27 } } };
|
|
996
1018
|
e.object({
|
|
997
1019
|
deviceId: e.string().min(1, "Device ID is required"),
|
|
998
1020
|
timeRange: e.enum(["1h", "24h", "7d"], {
|
|
@@ -1002,17 +1024,17 @@ e.object({
|
|
|
1002
1024
|
e.enum(["temperature", "humidity", "vwc", "ec", "ph", "pressure", "co2"])
|
|
1003
1025
|
).min(1, "At least one metric is required").max(4, "Maximum 4 metrics per graph")
|
|
1004
1026
|
});
|
|
1005
|
-
var j = "gemini-2.5-flash",
|
|
1027
|
+
var j = "gemini-2.5-flash", lt = "gemini-2.5-flash", ut = "gemini-2.5-pro", Ht = {
|
|
1006
1028
|
"google-gemini": "gemini-2.5-flash",
|
|
1007
1029
|
openai: "gpt-4o-mini",
|
|
1008
1030
|
anthropic: "claude-haiku-4-5-20251001",
|
|
1009
1031
|
grok: "grok-2-1212",
|
|
1010
1032
|
deepseek: "deepseek-chat",
|
|
1011
1033
|
ollama: "llama3.3"
|
|
1012
|
-
},
|
|
1034
|
+
}, Ut = {
|
|
1013
1035
|
/** The Strategist: high creativity, exploratory conversation */
|
|
1014
1036
|
STRATEGIST: {
|
|
1015
|
-
model:
|
|
1037
|
+
model: lt,
|
|
1016
1038
|
provider: "google-gemini",
|
|
1017
1039
|
temperature: 0.7
|
|
1018
1040
|
},
|
|
@@ -1032,7 +1054,7 @@ var j = "gemini-2.5-flash", nt = "gemini-2.5-flash", ot = "gemini-2.5-pro", Pt =
|
|
|
1032
1054
|
* Uses the Pro tier for superior reasoning on complex structured tasks.
|
|
1033
1055
|
*/
|
|
1034
1056
|
REVIEWER: {
|
|
1035
|
-
model:
|
|
1057
|
+
model: ut,
|
|
1036
1058
|
provider: "google-gemini",
|
|
1037
1059
|
temperature: 0.2
|
|
1038
1060
|
},
|
|
@@ -1042,7 +1064,7 @@ var j = "gemini-2.5-flash", nt = "gemini-2.5-flash", ot = "gemini-2.5-pro", Pt =
|
|
|
1042
1064
|
provider: "google-gemini",
|
|
1043
1065
|
temperature: 0.2
|
|
1044
1066
|
}
|
|
1045
|
-
},
|
|
1067
|
+
}, Kt = `
|
|
1046
1068
|
You write tiny apps for a small desk device whose screen is 320 pixels wide and
|
|
1047
1069
|
240 pixels high — landscape.
|
|
1048
1070
|
|
|
@@ -1205,10 +1227,10 @@ RULES
|
|
|
1205
1227
|
closest thing it can and do not invent a component.
|
|
1206
1228
|
6. Prefer a rule over a fixed colour whenever the request ties appearance to a
|
|
1207
1229
|
value. "Red when cold" is a rule; "red" is not.
|
|
1208
|
-
`.trim(),
|
|
1230
|
+
`.trim(), Wt = "Here is the current app. Change only what is asked:", o = e.string().regex(
|
|
1209
1231
|
/^\d{1,3}\s+\d{1,3}\s+\d{1,3}$/,
|
|
1210
1232
|
'Must be space-separated RGB integers (e.g. "13 110 253")'
|
|
1211
|
-
),
|
|
1233
|
+
), mt = e.object({
|
|
1212
1234
|
// ── Core Brand ───────────────────────────────────────────────────────────
|
|
1213
1235
|
"--app-primary-color": o.optional(),
|
|
1214
1236
|
"--app-primary-foreground-color": o.optional(),
|
|
@@ -1239,7 +1261,7 @@ RULES
|
|
|
1239
1261
|
"--app-chart-3": o.optional(),
|
|
1240
1262
|
"--app-chart-4": o.optional(),
|
|
1241
1263
|
"--app-chart-5": o.optional()
|
|
1242
|
-
}).strict(),
|
|
1264
|
+
}).strict(), ct = e.object({
|
|
1243
1265
|
/** Google Font name for headings (h1–h4, .font-serif). Example: "Playfair Display" */
|
|
1244
1266
|
heading: e.string(),
|
|
1245
1267
|
/** Google Font name for body text. Example: "Inter" */
|
|
@@ -1253,13 +1275,13 @@ e.object({
|
|
|
1253
1275
|
/** One-sentence vibe description. Example: "Dark indigo with golden accents." */
|
|
1254
1276
|
description: e.string(),
|
|
1255
1277
|
/** Google Font pairing for heading and body text. */
|
|
1256
|
-
fonts:
|
|
1278
|
+
fonts: ct.optional(),
|
|
1257
1279
|
/**
|
|
1258
1280
|
* CSS variable overrides.
|
|
1259
1281
|
* Every key must match an --app-* variable name.
|
|
1260
1282
|
* All color values must be space-separated RGB integers.
|
|
1261
1283
|
*/
|
|
1262
|
-
cssVars:
|
|
1284
|
+
cssVars: mt
|
|
1263
1285
|
});
|
|
1264
1286
|
e.object({
|
|
1265
1287
|
primary: o,
|
|
@@ -1269,14 +1291,14 @@ e.object({
|
|
|
1269
1291
|
destructive: o,
|
|
1270
1292
|
radius: e.enum(["none", "sm", "md", "lg", "full"])
|
|
1271
1293
|
});
|
|
1272
|
-
var
|
|
1294
|
+
var Gt = {
|
|
1273
1295
|
primary: "13 110 253",
|
|
1274
1296
|
neutral: "24 24 27",
|
|
1275
1297
|
success: "34 197 94",
|
|
1276
1298
|
warning: "234 179 8",
|
|
1277
1299
|
destructive: "239 68 68",
|
|
1278
1300
|
radius: "md"
|
|
1279
|
-
},
|
|
1301
|
+
}, h = e.number().finite(), r = h.positive(), g = h.nonnegative(), dt = e.object({
|
|
1280
1302
|
name: e.string().min(1).default("Bambu Lab X1 Carbon"),
|
|
1281
1303
|
/** Walls are whole multiples of this. */
|
|
1282
1304
|
nozzle: r.default(0.4),
|
|
@@ -1284,19 +1306,19 @@ var Vt = {
|
|
|
1284
1306
|
clearance_slip: g.default(0.2),
|
|
1285
1307
|
/** Gap for a friction fit. */
|
|
1286
1308
|
clearance_press: g.default(0.1)
|
|
1287
|
-
}),
|
|
1309
|
+
}), pt = e.enum(["east", "west", "north", "south", "top", "bottom"]), ht = e.object({
|
|
1288
1310
|
/** The tongue's length, from its free end to where it joins the floor. */
|
|
1289
1311
|
length: r.default(12),
|
|
1290
1312
|
/** Its width. */
|
|
1291
1313
|
width: r.default(5),
|
|
1292
1314
|
/** The way from the switch to where the tongue joins the floor. */
|
|
1293
1315
|
hinge: e.enum(["east", "west", "north", "south"])
|
|
1294
|
-
}),
|
|
1316
|
+
}), xt = e.object({
|
|
1295
1317
|
/** usb_c, screen, reset_button, status_led, sd_card… */
|
|
1296
1318
|
name: e.string().min(1),
|
|
1297
|
-
edge:
|
|
1319
|
+
edge: pt,
|
|
1298
1320
|
/** From the centre of that face — see COORDINATES above. */
|
|
1299
|
-
offset_from_center: e.tuple([
|
|
1321
|
+
offset_from_center: e.tuple([h, h]).default([0, 0]),
|
|
1300
1322
|
/**
|
|
1301
1323
|
* A grille is a field of small round holes filling an ellipse of
|
|
1302
1324
|
* `cutout_size` — a speaker's — on a top or bottom face only.
|
|
@@ -1309,7 +1331,7 @@ var Vt = {
|
|
|
1309
1331
|
/** A wider recess on the outside face, [width, height, depth], for a thick cable boot. */
|
|
1310
1332
|
outer_recess: e.tuple([r, r, r]).optional(),
|
|
1311
1333
|
/** Press it through the floor instead of opening a hole — see FlexButtonSchema. */
|
|
1312
|
-
flex_button:
|
|
1334
|
+
flex_button: ht.optional(),
|
|
1313
1335
|
/**
|
|
1314
1336
|
* A 45° ramp this deep round the opening at the outside face, widening it
|
|
1315
1337
|
* by this much a side there. For a screen set back behind a bezel: the
|
|
@@ -1317,25 +1339,25 @@ var Vt = {
|
|
|
1317
1339
|
* openings only.
|
|
1318
1340
|
*/
|
|
1319
1341
|
chamfer: g.optional()
|
|
1320
|
-
}),
|
|
1342
|
+
}), gt = e.object({
|
|
1321
1343
|
/** Four holes, this far in from each corner: [east-west, north-south]. */
|
|
1322
1344
|
inset_from_corners: e.tuple([r, r]).optional(),
|
|
1323
1345
|
/** Or exactly where they are: [east, north] from the footprint centre. */
|
|
1324
|
-
positions: e.array(e.tuple([
|
|
1346
|
+
positions: e.array(e.tuple([h, h])).min(1).optional(),
|
|
1325
1347
|
thread: e.enum(["M2", "M2.5", "M3"]),
|
|
1326
1348
|
/** Heat-set insert outer diameter and depth. split_shell_lip only: tray_bezel's screws cut their own thread. */
|
|
1327
1349
|
insert_od: r.optional(),
|
|
1328
1350
|
insert_depth: r.optional()
|
|
1329
1351
|
}).refine((a) => (a.inset_from_corners ? 1 : 0) + (a.positions ? 1 : 0) == 1, {
|
|
1330
1352
|
message: "give either inset_from_corners or positions, not both or neither"
|
|
1331
|
-
}),
|
|
1353
|
+
}), bt = e.object({
|
|
1332
1354
|
relative_to: e.string().min(1),
|
|
1333
1355
|
where: e.enum(["below", "above", "east", "west", "north", "south"]),
|
|
1334
1356
|
/** Space between the two keep-outs. */
|
|
1335
1357
|
gap: g.default(1),
|
|
1336
1358
|
/** Moved this far [east, north] from centred on the other, once placed. */
|
|
1337
|
-
offset: e.tuple([
|
|
1338
|
-
}),
|
|
1359
|
+
offset: e.tuple([h, h]).default([0, 0])
|
|
1360
|
+
}), ee = e.object({
|
|
1339
1361
|
id: e.string().regex(/^[a-z][a-z0-9_]*$/, "lowercase letters, digits and underscores"),
|
|
1340
1362
|
type: e.enum(["pcb", "display", "battery", "speaker", "module"]),
|
|
1341
1363
|
/** [east, north, up] — see COORDINATES. */
|
|
@@ -1353,12 +1375,12 @@ var Vt = {
|
|
|
1353
1375
|
clearance_z_bottom: g.default(0),
|
|
1354
1376
|
/** Quarter turns about Z, applied before placement. */
|
|
1355
1377
|
rotation: e.union([e.literal(0), e.literal(90), e.literal(180), e.literal(270)]).default(0),
|
|
1356
|
-
placement:
|
|
1357
|
-
mount_holes:
|
|
1358
|
-
interfaces: e.array(
|
|
1378
|
+
placement: bt.optional(),
|
|
1379
|
+
mount_holes: gt.optional(),
|
|
1380
|
+
interfaces: e.array(xt).default([]),
|
|
1359
1381
|
/** How it is held if it has no screw holes. */
|
|
1360
1382
|
retention: e.enum(["none", "cradle_ribs"]).default("none")
|
|
1361
|
-
}),
|
|
1383
|
+
}), ft = e.object({
|
|
1362
1384
|
/** The SVG file, relative to the manifest. Filled paths only; strokes are ignored. */
|
|
1363
1385
|
svg: e.string().min(1),
|
|
1364
1386
|
face: e.enum(["top", "bottom"]).default("bottom"),
|
|
@@ -1367,7 +1389,7 @@ var Vt = {
|
|
|
1367
1389
|
/** How deep it is pressed in. */
|
|
1368
1390
|
depth: r.default(0.6),
|
|
1369
1391
|
/** From the centre of the case's footprint, [east, north]. */
|
|
1370
|
-
offset: e.tuple([
|
|
1392
|
+
offset: e.tuple([h, h]).default([0, 0]),
|
|
1371
1393
|
/**
|
|
1372
1394
|
* Cut it right through the face instead, as a stencil — a speaker's grille
|
|
1373
1395
|
* in the shape of the mark. Whatever its lines enclose would fall out, so
|
|
@@ -1378,7 +1400,7 @@ var Vt = {
|
|
|
1378
1400
|
* check, by where it is.
|
|
1379
1401
|
*/
|
|
1380
1402
|
stencil: e.object({
|
|
1381
|
-
bridges: e.array(e.object({ at: e.tuple([
|
|
1403
|
+
bridges: e.array(e.object({ at: e.tuple([h, h]), angle: e.number().default(0), length: r.default(3) })).default([])
|
|
1382
1404
|
}).optional()
|
|
1383
1405
|
});
|
|
1384
1406
|
e.object({
|
|
@@ -1407,15 +1429,15 @@ e.object({
|
|
|
1407
1429
|
size: r,
|
|
1408
1430
|
soften: g.default(0)
|
|
1409
1431
|
}).optional(),
|
|
1410
|
-
printer:
|
|
1411
|
-
components: e.array(
|
|
1412
|
-
emblem:
|
|
1432
|
+
printer: dt.default({}),
|
|
1433
|
+
components: e.array(ee).min(1),
|
|
1434
|
+
emblem: ft.optional()
|
|
1413
1435
|
}).superRefine((a, i) => {
|
|
1414
|
-
const
|
|
1415
|
-
Math.abs(
|
|
1436
|
+
const x = a.wall_thickness / a.printer.nozzle;
|
|
1437
|
+
Math.abs(x - Math.round(x)) > 1e-6 && i.addIssue({
|
|
1416
1438
|
code: e.ZodIssueCode.custom,
|
|
1417
1439
|
path: ["wall_thickness"],
|
|
1418
|
-
message: `${a.wall_thickness}mm is not a whole number of ${a.printer.nozzle}mm lines — try ${(Math.round(
|
|
1440
|
+
message: `${a.wall_thickness}mm is not a whole number of ${a.printer.nozzle}mm lines — try ${(Math.round(x) * a.printer.nozzle).toFixed(2)}`
|
|
1419
1441
|
});
|
|
1420
1442
|
for (const [n, t] of Object.entries(a.walls)) {
|
|
1421
1443
|
if (t === void 0) continue;
|
|
@@ -1469,12 +1491,12 @@ e.object({
|
|
|
1469
1491
|
u && (u[0] * 2 >= s || u[1] * 2 >= l) && i.addIssue({ code: e.ZodIssueCode.custom, path: ["components", t, "mount_holes", "inset_from_corners"], message: `insets [${u}] meet in the middle of a ${s}×${l} footprint` });
|
|
1470
1492
|
});
|
|
1471
1493
|
});
|
|
1472
|
-
var
|
|
1494
|
+
var vt = e.object({
|
|
1473
1495
|
label: e.string().min(1),
|
|
1474
1496
|
/** One sentence: what it is for. */
|
|
1475
1497
|
description: e.string().optional(),
|
|
1476
1498
|
/** Components added to the base manifest's. */
|
|
1477
|
-
components: e.array(
|
|
1499
|
+
components: e.array(ee).default([]),
|
|
1478
1500
|
/** Top-level manifest fields this choice sets: wall_thickness, emblem… */
|
|
1479
1501
|
set: e.record(e.unknown()).default({}),
|
|
1480
1502
|
/**
|
|
@@ -1484,16 +1506,16 @@ var ht = e.object({
|
|
|
1484
1506
|
* clearance and widens its screen opening to the glass.
|
|
1485
1507
|
*/
|
|
1486
1508
|
patch: e.record(e.record(e.unknown())).default({})
|
|
1487
|
-
}),
|
|
1509
|
+
}), yt = e.object({
|
|
1488
1510
|
label: e.string().min(1),
|
|
1489
1511
|
/** In order; the first is the default. Ids are lowercase words and dashes. */
|
|
1490
|
-
choices: e.array(
|
|
1512
|
+
choices: e.array(vt.extend({ id: e.string().regex(/^[a-z0-9][a-z0-9-]*$/) })).min(1)
|
|
1491
1513
|
});
|
|
1492
1514
|
e.object({
|
|
1493
1515
|
/** The base manifest, relative to this file. */
|
|
1494
1516
|
manifest: e.string().min(1),
|
|
1495
1517
|
/** Option groups, in the order they are offered: base, top… */
|
|
1496
|
-
options: e.record(e.string().regex(/^[a-z][a-z0-9-]*$/),
|
|
1518
|
+
options: e.record(e.string().regex(/^[a-z][a-z0-9-]*$/), yt)
|
|
1497
1519
|
});
|
|
1498
1520
|
e.object({
|
|
1499
1521
|
id: e.string().default(""),
|
|
@@ -1506,7 +1528,7 @@ e.object({
|
|
|
1506
1528
|
lastActive: e.string().optional(),
|
|
1507
1529
|
avatarUrl: e.string().optional()
|
|
1508
1530
|
});
|
|
1509
|
-
var y = e.string().regex(/^acct_[0-9a-f]{12}$/, "acct_ and 12 hex digits"),
|
|
1531
|
+
var y = e.string().regex(/^acct_[0-9a-f]{12}$/, "acct_ and 12 hex digits"), O = e.enum(["member", "admin"]), te = e.enum(["active", "suspended"]), wt = e.object({
|
|
1510
1532
|
algo: e.literal("scrypt"),
|
|
1511
1533
|
n: e.number().int().positive(),
|
|
1512
1534
|
r: e.number().int().positive(),
|
|
@@ -1520,9 +1542,9 @@ e.object({
|
|
|
1520
1542
|
/** Lowercased on write, because a login must not depend on how it was typed. */
|
|
1521
1543
|
email: e.string().email().max(254),
|
|
1522
1544
|
name: e.string().min(1).max(64),
|
|
1523
|
-
role:
|
|
1524
|
-
status:
|
|
1525
|
-
password:
|
|
1545
|
+
role: O,
|
|
1546
|
+
status: te,
|
|
1547
|
+
password: wt,
|
|
1526
1548
|
createdAt: e.number().int().nonnegative(),
|
|
1527
1549
|
lastLoginAt: e.number().int().nonnegative().nullable().default(null),
|
|
1528
1550
|
/** Which admin approved this, or null for the bootstrap account. */
|
|
@@ -1536,8 +1558,8 @@ e.object({
|
|
|
1536
1558
|
accountId: y,
|
|
1537
1559
|
email: e.string().email(),
|
|
1538
1560
|
name: e.string(),
|
|
1539
|
-
role:
|
|
1540
|
-
status:
|
|
1561
|
+
role: O,
|
|
1562
|
+
status: te
|
|
1541
1563
|
});
|
|
1542
1564
|
e.object({
|
|
1543
1565
|
accountId: y,
|
|
@@ -1547,7 +1569,7 @@ e.object({
|
|
|
1547
1569
|
});
|
|
1548
1570
|
e.object({
|
|
1549
1571
|
email: e.string().email().max(254),
|
|
1550
|
-
role:
|
|
1572
|
+
role: O,
|
|
1551
1573
|
createdAt: e.number().int().nonnegative(),
|
|
1552
1574
|
expiresAt: e.number().int().nonnegative(),
|
|
1553
1575
|
invitedBy: y
|
|
@@ -1558,41 +1580,41 @@ e.object({
|
|
|
1558
1580
|
/** Optional, and never shown publicly. Long enough to be useful, short enough not to be an essay. */
|
|
1559
1581
|
reason: e.string().max(500).optional()
|
|
1560
1582
|
});
|
|
1561
|
-
var
|
|
1583
|
+
var At = e.enum(["pending", "approved", "denied"]);
|
|
1562
1584
|
e.object({
|
|
1563
1585
|
requestId: e.string().regex(/^req_[0-9a-f]{12}$/, "req_ and 12 hex digits"),
|
|
1564
1586
|
email: e.string().email().max(254),
|
|
1565
1587
|
name: e.string().min(1).max(64),
|
|
1566
1588
|
reason: e.string().max(500).optional(),
|
|
1567
|
-
status:
|
|
1589
|
+
status: At,
|
|
1568
1590
|
createdAt: e.number().int().nonnegative(),
|
|
1569
1591
|
decidedAt: e.number().int().nonnegative().nullable().default(null),
|
|
1570
1592
|
decidedBy: y.nullable().default(null)
|
|
1571
1593
|
});
|
|
1572
|
-
var
|
|
1594
|
+
var Et = ["boards:read", "boards:send", "boards:configure", "apps:read", "apps:write"], ae = e.enum(Et), St = [7, 30, 90, 365], Ct = e.object({
|
|
1573
1595
|
/** The first 12 hex digits of the hash: what the owner sees and revokes by. */
|
|
1574
1596
|
tokenId: e.string().regex(/^[0-9a-f]{12}$/),
|
|
1575
1597
|
accountId: y,
|
|
1576
1598
|
/** What the owner called it: "laptop", "Claude Code". */
|
|
1577
1599
|
name: e.string().trim().min(1).max(60),
|
|
1578
|
-
scopes: e.array(
|
|
1600
|
+
scopes: e.array(ae).min(1),
|
|
1579
1601
|
createdAt: e.number().int().nonnegative(),
|
|
1580
1602
|
expiresAt: e.number().int().nonnegative(),
|
|
1581
1603
|
/** Moved forward at most once a day, so using a token is not a write per request. */
|
|
1582
1604
|
lastUsedAt: e.number().int().nonnegative().nullable().default(null)
|
|
1583
1605
|
});
|
|
1584
|
-
|
|
1606
|
+
Ct.omit({ accountId: !0 });
|
|
1585
1607
|
e.object({
|
|
1586
1608
|
name: e.string().trim().min(1, "Give it a name.").max(60),
|
|
1587
|
-
scopes: e.array(
|
|
1588
|
-
days: e.union(
|
|
1609
|
+
scopes: e.array(ae).min(1, "Choose at least one thing it can do."),
|
|
1610
|
+
days: e.union(St.map((a) => e.literal(a)))
|
|
1589
1611
|
});
|
|
1590
|
-
const
|
|
1591
|
-
const b = m.at !== void 0 && m.at >=
|
|
1612
|
+
const _t = Date.UTC(2024, 0, 1), Bt = 24 * 60 * 60 * 1e3, Zt = (a, i, x) => i.map((m) => {
|
|
1613
|
+
const b = m.at !== void 0 && m.at >= _t && m.at <= x + Bt ? m.at : x;
|
|
1592
1614
|
return {
|
|
1593
1615
|
id: `${a}:${m.key}`,
|
|
1594
1616
|
source: "http",
|
|
1595
|
-
domain:
|
|
1617
|
+
domain: fe.ENVIRONMENT,
|
|
1596
1618
|
key: m.key,
|
|
1597
1619
|
value: m.value,
|
|
1598
1620
|
...m.unit ? { unit: m.unit } : {},
|
|
@@ -1600,40 +1622,40 @@ const wt = Date.UTC(2024, 0, 1), At = 24 * 60 * 60 * 1e3, Ht = (a, i, h) => i.ma
|
|
|
1600
1622
|
};
|
|
1601
1623
|
});
|
|
1602
1624
|
export {
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1625
|
+
Ut as A,
|
|
1626
|
+
de as B,
|
|
1627
|
+
lt as D,
|
|
1628
|
+
le as E,
|
|
1629
|
+
ie as F,
|
|
1630
|
+
Dt as I,
|
|
1631
|
+
pe as P,
|
|
1632
|
+
re as R,
|
|
1633
|
+
be as S,
|
|
1634
|
+
ue as T,
|
|
1635
|
+
ce as W,
|
|
1614
1636
|
j as a,
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1637
|
+
Kt as b,
|
|
1638
|
+
Wt as c,
|
|
1639
|
+
Zt as d,
|
|
1618
1640
|
R as e,
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1641
|
+
me as f,
|
|
1642
|
+
he as g,
|
|
1643
|
+
kt as h,
|
|
1644
|
+
fe as i,
|
|
1645
|
+
Ht as j,
|
|
1624
1646
|
z as k,
|
|
1625
|
-
|
|
1647
|
+
It as l,
|
|
1626
1648
|
F as m,
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1649
|
+
Gt as n,
|
|
1650
|
+
Nt as o,
|
|
1651
|
+
Mt as p,
|
|
1652
|
+
Rt as q,
|
|
1653
|
+
Ot as r,
|
|
1654
|
+
Lt as s,
|
|
1655
|
+
Tt as t,
|
|
1656
|
+
zt as u,
|
|
1657
|
+
Pt as v,
|
|
1658
|
+
$t as w,
|
|
1659
|
+
Vt as x,
|
|
1660
|
+
jt as y
|
|
1639
1661
|
};
|