@ramme-io/kernel 7.3.1 → 8.0.0
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-Bdcl3v8h.js → AiGateway-U28yN4Mf.js} +409 -358
- package/dist/{bodewellAdapter-BzbeTSIP.js → bodewellAdapter-Cw9brU9k.js} +1 -1
- package/dist/deviceReadings-3Z4nql34.js +16 -0
- package/dist/index-BrFe7_2L.js +1614 -0
- package/dist/index.es.js +4340 -4610
- package/dist/kernel/src/agents/roster.d.ts +11 -3
- package/dist/kernel/src/agents/roster.d.ts.map +1 -1
- package/dist/kernel/src/agents/scope.d.ts +21 -0
- package/dist/kernel/src/agents/scope.d.ts.map +1 -0
- package/dist/kernel/src/agents/scope.test.d.ts +2 -0
- package/dist/kernel/src/agents/scope.test.d.ts.map +1 -0
- package/dist/kernel/src/components/AIChatPanel.d.ts +12 -0
- package/dist/kernel/src/components/AIChatPanel.d.ts.map +1 -1
- package/dist/kernel/src/engine/runtime/data-seeder.d.ts +2 -0
- package/dist/kernel/src/engine/runtime/data-seeder.d.ts.map +1 -1
- package/dist/kernel/src/engine/runtime/useSignal.d.ts +15 -0
- package/dist/kernel/src/engine/runtime/useSignal.d.ts.map +1 -1
- package/dist/kernel/src/engine/runtime/useSignal.test.d.ts +2 -0
- package/dist/kernel/src/engine/runtime/useSignal.test.d.ts.map +1 -0
- package/dist/kernel/src/index.d.ts +1 -4
- package/dist/kernel/src/index.d.ts.map +1 -1
- package/dist/kernel/src/renderers/AppDocumentRenderer.d.ts +57 -5
- package/dist/kernel/src/renderers/AppDocumentRenderer.d.ts.map +1 -1
- package/dist/kernel/src/renderers/AppOrientation.test.d.ts +2 -0
- package/dist/kernel/src/renderers/AppOrientation.test.d.ts.map +1 -0
- package/dist/kernel/src/server.d.ts +3 -0
- package/dist/kernel/src/server.d.ts.map +1 -1
- package/dist/kernel/src/services/ai/AiGatewayService.d.ts.map +1 -1
- package/dist/kernel/src/services/ai/providers/GeminiAdapter.d.ts.map +1 -1
- package/dist/kernel/src/services/ai/providers/OllamaAdapter.d.ts +1 -0
- package/dist/kernel/src/services/ai/providers/OllamaAdapter.d.ts.map +1 -1
- package/dist/kernel/src/services/ai/toolPromptGenerator.d.ts +0 -1
- package/dist/kernel/src/services/ai/toolPromptGenerator.d.ts.map +1 -1
- package/dist/kernel/src/signals/deviceReadings.d.ts +9 -0
- package/dist/kernel/src/signals/deviceReadings.d.ts.map +1 -0
- package/dist/kernel/src/signals/deviceReadings.test.d.ts +2 -0
- package/dist/kernel/src/signals/deviceReadings.test.d.ts.map +1 -0
- package/dist/kernel/src/signals/index.d.ts +1 -0
- package/dist/kernel/src/signals/index.d.ts.map +1 -1
- package/dist/server.es.js +47 -44
- package/dist/signals.es.js +12 -10
- package/package.json +4 -4
- package/dist/index-kBkq1FSR.js +0 -1236
- package/dist/kernel/src/events/mockEventSource.d.ts +0 -28
- package/dist/kernel/src/events/mockEventSource.d.ts.map +0 -1
- package/dist/kernel/src/services/MarketDataService.d.ts +0 -29
- package/dist/kernel/src/services/MarketDataService.d.ts.map +0 -1
- package/dist/kernel/src/services/marketSession.d.ts +0 -33
- package/dist/kernel/src/services/marketSession.d.ts.map +0 -1
- package/dist/kernel/src/services/marketSession.test.d.ts +0 -14
- package/dist/kernel/src/services/marketSession.test.d.ts.map +0 -1
- package/dist/kernel/src/stores/useMarketDataStore.d.ts +0 -50
- package/dist/kernel/src/stores/useMarketDataStore.d.ts.map +0 -1
package/dist/index-kBkq1FSR.js
DELETED
|
@@ -1,1236 +0,0 @@
|
|
|
1
|
-
import { z as e } from "zod";
|
|
2
|
-
var M = Object.defineProperty, U = (l, m) => {
|
|
3
|
-
for (var h in m)
|
|
4
|
-
M(l, h, { get: m[h], enumerable: !0 });
|
|
5
|
-
}, V = e.object({
|
|
6
|
-
key: e.string(),
|
|
7
|
-
label: e.string(),
|
|
8
|
-
type: e.enum(["text", "number", "currency", "percent", "delta", "date", "boolean", "status", "email", "image", "textarea"]),
|
|
9
|
-
required: e.boolean().optional(),
|
|
10
|
-
description: e.string().optional(),
|
|
11
|
-
defaultValue: e.any().optional()
|
|
12
|
-
}), L = e.object({
|
|
13
|
-
id: e.string(),
|
|
14
|
-
name: e.string(),
|
|
15
|
-
fields: e.array(V),
|
|
16
|
-
defaultView: e.enum(["table", "grid", "list"]).optional(),
|
|
17
|
-
features: e.object({
|
|
18
|
-
searchable: e.boolean().optional(),
|
|
19
|
-
creatable: e.boolean().optional(),
|
|
20
|
-
editable: e.boolean().optional(),
|
|
21
|
-
deletable: e.boolean().optional(),
|
|
22
|
-
exportable: e.boolean().optional()
|
|
23
|
-
}).optional()
|
|
24
|
-
}), H = e.object({
|
|
25
|
-
id: e.string().min(1, "Signal ID is required"),
|
|
26
|
-
label: e.string(),
|
|
27
|
-
description: e.string().optional(),
|
|
28
|
-
kind: e.enum(["sensor", "actuator", "setpoint", "metric", "status", "kpi"]),
|
|
29
|
-
source: e.enum(["mock", "mqtt", "http", "derived", "local"]),
|
|
30
|
-
// Connectivity
|
|
31
|
-
topic: e.string().optional(),
|
|
32
|
-
endpoint: e.string().optional(),
|
|
33
|
-
jsonPath: e.string().optional(),
|
|
34
|
-
refreshRate: e.number().optional().default(1e3),
|
|
35
|
-
// Values
|
|
36
|
-
defaultValue: e.any().optional(),
|
|
37
|
-
unit: e.string().optional(),
|
|
38
|
-
min: e.number().optional(),
|
|
39
|
-
max: e.number().optional()
|
|
40
|
-
}), $ = e.object({
|
|
41
|
-
id: e.string(),
|
|
42
|
-
name: e.string(),
|
|
43
|
-
description: e.string().optional(),
|
|
44
|
-
type: e.string(),
|
|
45
|
-
category: e.string().default("logical"),
|
|
46
|
-
signals: e.array(e.string()),
|
|
47
|
-
ui: e.object({
|
|
48
|
-
icon: e.string().optional(),
|
|
49
|
-
color: e.string().optional(),
|
|
50
|
-
dashboardComponent: e.string().optional()
|
|
51
|
-
}).optional()
|
|
52
|
-
}), W = e.object({
|
|
53
|
-
id: e.string(),
|
|
54
|
-
type: e.enum(["signal_change", "manual_action", "schedule", "webhook"]),
|
|
55
|
-
config: e.record(e.string(), e.any())
|
|
56
|
-
}), K = e.object({
|
|
57
|
-
id: e.string(),
|
|
58
|
-
type: e.enum([
|
|
59
|
-
"update_resource",
|
|
60
|
-
"send_notification",
|
|
61
|
-
"mqtt_publish",
|
|
62
|
-
"api_call",
|
|
63
|
-
"navigate",
|
|
64
|
-
"agent_task"
|
|
65
|
-
]),
|
|
66
|
-
config: e.record(e.string(), e.any())
|
|
67
|
-
}), q = e.object({
|
|
68
|
-
id: e.string(),
|
|
69
|
-
name: e.string(),
|
|
70
|
-
active: e.boolean().default(!0),
|
|
71
|
-
trigger: W,
|
|
72
|
-
actions: e.array(K)
|
|
73
|
-
}), G = e.object({
|
|
74
|
-
id: e.string(),
|
|
75
|
-
type: e.string(),
|
|
76
|
-
props: e.record(e.string(), e.any()),
|
|
77
|
-
layout: e.object({
|
|
78
|
-
colSpan: e.number().optional(),
|
|
79
|
-
rowSpan: e.number().optional()
|
|
80
|
-
}).optional()
|
|
81
|
-
}), z = e.object({
|
|
82
|
-
id: e.string(),
|
|
83
|
-
title: e.string().optional(),
|
|
84
|
-
description: e.string().optional(),
|
|
85
|
-
layout: e.object({
|
|
86
|
-
columns: e.number().optional(),
|
|
87
|
-
variant: e.enum(["grid", "stack", "split"]).optional()
|
|
88
|
-
}).optional(),
|
|
89
|
-
blocks: e.array(G)
|
|
90
|
-
}), Y = e.object({
|
|
91
|
-
id: e.string(),
|
|
92
|
-
slug: e.string(),
|
|
93
|
-
title: e.string(),
|
|
94
|
-
description: e.string().optional(),
|
|
95
|
-
icon: e.string().optional(),
|
|
96
|
-
sections: e.array(z)
|
|
97
|
-
}), X = e.enum(["ENVIRONMENT", "SESSION_BYOK", "VAULT"]), Z = e.object({
|
|
98
|
-
strategy: X,
|
|
99
|
-
status: e.enum(["VALID", "KEY_EXPIRED", "BYOK_REQUIRED", "DEGRADED", "UNKNOWN"]).default("UNKNOWN")
|
|
100
|
-
}), ze = e.object({
|
|
101
|
-
meta: e.object({
|
|
102
|
-
name: e.string(),
|
|
103
|
-
version: e.string(),
|
|
104
|
-
description: e.string().optional(),
|
|
105
|
-
author: e.string().optional(),
|
|
106
|
-
createdAt: e.string().optional()
|
|
107
|
-
}),
|
|
108
|
-
config: e.object({
|
|
109
|
-
theme: e.enum(["light", "dark", "system", "corporate", "midnight", "blueprint"]).default("system"),
|
|
110
|
-
layout: e.enum(["dashboard", "explorer", "studio", "focus"]).default("dashboard"),
|
|
111
|
-
mockMode: e.boolean().default(!0),
|
|
112
|
-
brokerUrl: e.string().optional(),
|
|
113
|
-
aiKeyManifest: Z.optional()
|
|
114
|
-
}),
|
|
115
|
-
modules: e.array(e.string()).optional(),
|
|
116
|
-
resources: e.array(L).optional(),
|
|
117
|
-
domain: e.object({
|
|
118
|
-
signals: e.array(H),
|
|
119
|
-
entities: e.array($),
|
|
120
|
-
workflows: e.array(q).optional()
|
|
121
|
-
}),
|
|
122
|
-
pages: e.array(Y).optional()
|
|
123
|
-
}), Ye = e.object({
|
|
124
|
-
timestamp: e.number(),
|
|
125
|
-
soilMoisture: e.number().min(0).max(100),
|
|
126
|
-
ambientLight: e.number().min(0).max(1e5),
|
|
127
|
-
temperature: e.number().min(-40).max(125)
|
|
128
|
-
}), J = e.object({
|
|
129
|
-
id: e.string(),
|
|
130
|
-
source: e.enum(["mqtt", "http", "ws", "mock"]),
|
|
131
|
-
domain: e.string(),
|
|
132
|
-
key: e.string(),
|
|
133
|
-
value: e.union([e.number(), e.string(), e.boolean()]),
|
|
134
|
-
unit: e.string().optional(),
|
|
135
|
-
timestamp: e.number(),
|
|
136
|
-
meta: e.record(e.unknown()).optional()
|
|
137
|
-
});
|
|
138
|
-
e.array(J);
|
|
139
|
-
var Xe = {
|
|
140
|
-
AGRICULTURE: "agriculture"
|
|
141
|
-
}, Q = e.enum(["telemetry", "market", "system", "logic"]), ee = e.enum(["mqtt", "http", "ws", "mock"]);
|
|
142
|
-
e.object({
|
|
143
|
-
/**
|
|
144
|
-
* Globally unique signal identifier.
|
|
145
|
-
* Convention: '<device-or-entity-id>:<key>'
|
|
146
|
-
* Examples: 'sensor-01:soil_vwc', 'AAPL:price', 'server-01:cpu_pct'
|
|
147
|
-
*/
|
|
148
|
-
id: e.string(),
|
|
149
|
-
/**
|
|
150
|
-
* The semantic category of this signal.
|
|
151
|
-
* Determines which Methodology Engine processes it.
|
|
152
|
-
*/
|
|
153
|
-
kind: Q,
|
|
154
|
-
/**
|
|
155
|
-
* The specific measurement or metric key within its kind.
|
|
156
|
-
* RULE: Keys MUST be abstract and domain-agnostic where possible.
|
|
157
|
-
* Use 'price' not 'stock_price'. Use 'moisture' not 'soil_vwc'.
|
|
158
|
-
* Hardware-specific keys (soil_vwc) MUST be mapped to abstract keys
|
|
159
|
-
* at the adapter layer BEFORE the SignalPacket is created.
|
|
160
|
-
*/
|
|
161
|
-
key: e.string(),
|
|
162
|
-
/**
|
|
163
|
-
* The scalar value. Accepts number, string, or boolean.
|
|
164
|
-
* Structured data MUST be flattened into multiple SignalPackets,
|
|
165
|
-
* one per measurable dimension.
|
|
166
|
-
*/
|
|
167
|
-
value: e.union([e.number(), e.string(), e.boolean()]),
|
|
168
|
-
/**
|
|
169
|
-
* Optional unit of measurement.
|
|
170
|
-
* Examples: 'VWC%', 'USD', 'bpm', 'ms', '°C', 'pct'
|
|
171
|
-
*/
|
|
172
|
-
unit: e.string().optional(),
|
|
173
|
-
/**
|
|
174
|
-
* Unix timestamp in milliseconds (Date.now() format).
|
|
175
|
-
* MUST represent when the measurement was taken, not when it was received.
|
|
176
|
-
*/
|
|
177
|
-
ts: e.number(),
|
|
178
|
-
/**
|
|
179
|
-
* The transport source that produced this signal.
|
|
180
|
-
*/
|
|
181
|
-
source: ee.optional(),
|
|
182
|
-
/**
|
|
183
|
-
* Optional domain namespace for grouping related signals.
|
|
184
|
-
* Examples: 'bodewell', 'finance', 'infrastructure', 'user_behavior'
|
|
185
|
-
*/
|
|
186
|
-
domain: e.string().optional(),
|
|
187
|
-
/**
|
|
188
|
-
* Optional pass-through for source-specific metadata that does NOT
|
|
189
|
-
* belong in the core contract (e.g. device firmware version, exchange name).
|
|
190
|
-
* RULE: If you find yourself reading from meta in UI components, that
|
|
191
|
-
* field should be promoted to the core schema or handled in the adapter.
|
|
192
|
-
*/
|
|
193
|
-
meta: e.record(e.unknown()).optional()
|
|
194
|
-
});
|
|
195
|
-
var te = {};
|
|
196
|
-
U(te, {
|
|
197
|
-
BodewellCommandSchema: () => ne,
|
|
198
|
-
BodewellDeviceID: () => k,
|
|
199
|
-
BodewellTelemetrySchema: () => ae
|
|
200
|
-
});
|
|
201
|
-
var k = e.enum([
|
|
202
|
-
"STK-V1-001",
|
|
203
|
-
"STK-V1-002",
|
|
204
|
-
"STK-V1-003",
|
|
205
|
-
"STK-PRO-001",
|
|
206
|
-
"STK-VIS-001"
|
|
207
|
-
]), ae = e.object({
|
|
208
|
-
device_id: k,
|
|
209
|
-
stick_id: e.string().optional().describe("Firmware alias for device_id"),
|
|
210
|
-
timestamp: e.number().optional().describe("Epoch timestamp from NTP"),
|
|
211
|
-
air_temp: e.number().optional().describe("Celsius"),
|
|
212
|
-
air_humid: e.number().optional().describe("Relative Humidity %"),
|
|
213
|
-
humidity: e.number().optional().describe("Firmware alias for air_humid"),
|
|
214
|
-
air_pressure: e.number().optional().describe("hPa"),
|
|
215
|
-
pressure: e.number().optional().describe("Firmware alias for air_pressure"),
|
|
216
|
-
light_lux: e.number().optional().describe("Lux level"),
|
|
217
|
-
soil_temp_stemma: e.number().optional().describe("Celsius"),
|
|
218
|
-
soil_vwc: e.number().describe("Volumetric Water Content / Raw Capacitance"),
|
|
219
|
-
soil_moisture: e.number().optional().describe("Firmware alias for raw capacitance"),
|
|
220
|
-
soil_moisture_raw: e.number().optional().describe("Unscaled capacitance (300-1100)"),
|
|
221
|
-
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")
|
|
222
|
-
}).passthrough(), ne = e.object({
|
|
223
|
-
stick_id: k,
|
|
224
|
-
// Note: Your API uses stick_id here, not device_id
|
|
225
|
-
type: e.enum(["dry", "wet"]),
|
|
226
|
-
value: e.number()
|
|
227
|
-
}), ie = e.enum([
|
|
228
|
-
"esp32-touch-28",
|
|
229
|
-
// 2.8" 240x320 resistive touch, the workshop board
|
|
230
|
-
"esp32-headless",
|
|
231
|
-
// no display; sensor node
|
|
232
|
-
"simulator"
|
|
233
|
-
// browser-side stand-in, for building without hardware
|
|
234
|
-
]), R = e.enum([
|
|
235
|
-
"weather",
|
|
236
|
-
"clock",
|
|
237
|
-
"aircraft",
|
|
238
|
-
"sensor",
|
|
239
|
-
"blank"
|
|
240
|
-
]), re = e.object({
|
|
241
|
-
/** Postal code is what a person knows; the portal resolves it to coordinates. */
|
|
242
|
-
postalCode: e.string().min(3).max(12),
|
|
243
|
-
latitude: e.number().min(-90).max(90).optional(),
|
|
244
|
-
longitude: e.number().min(-180).max(180).optional(),
|
|
245
|
-
units: e.enum(["imperial", "metric"]).default("imperial"),
|
|
246
|
-
showForecast: e.boolean().default(!0),
|
|
247
|
-
refreshSeconds: e.number().int().min(300).max(86400).default(900)
|
|
248
|
-
}), oe = e.object({
|
|
249
|
-
/** IANA zone, e.g. "America/New_York". */
|
|
250
|
-
timezone: e.string().default("America/New_York"),
|
|
251
|
-
twentyFourHour: e.boolean().default(!1),
|
|
252
|
-
showSeconds: e.boolean().default(!1),
|
|
253
|
-
showDate: e.boolean().default(!0)
|
|
254
|
-
}), se = e.object({
|
|
255
|
-
latitude: e.number().min(-90).max(90),
|
|
256
|
-
longitude: e.number().min(-180).max(180),
|
|
257
|
-
radiusKm: e.number().min(5).max(400).default(80),
|
|
258
|
-
/** Rows the list view can show before the screen runs out. */
|
|
259
|
-
maxRows: e.number().int().min(1).max(12).default(8),
|
|
260
|
-
refreshSeconds: e.number().int().min(10).max(600).default(30)
|
|
261
|
-
}), le = e.object({
|
|
262
|
-
/** Signal keys to display, in order. Abstract keys per the Signal contract. */
|
|
263
|
-
keys: e.array(e.string()).min(1).max(6),
|
|
264
|
-
refreshSeconds: e.number().int().min(1).max(3600).default(10)
|
|
265
|
-
}), ce = e.object({
|
|
266
|
-
weather: re.optional(),
|
|
267
|
-
clock: oe.optional(),
|
|
268
|
-
aircraft: se.optional(),
|
|
269
|
-
sensor: le.optional()
|
|
270
|
-
}), me = e.object({
|
|
271
|
-
brightness: e.number().int().min(5).max(100).default(80),
|
|
272
|
-
/** Degrees clockwise. The board can sit either way up in a case. */
|
|
273
|
-
rotation: e.union([e.literal(0), e.literal(90), e.literal(180), e.literal(270)]).default(0),
|
|
274
|
-
/** Dim rather than sleep — a desk display that blanks looks broken. */
|
|
275
|
-
dimAfterSeconds: e.number().int().min(0).max(86400).default(0),
|
|
276
|
-
dimBrightness: e.number().int().min(0).max(100).default(15),
|
|
277
|
-
/** Local 24h times, e.g. "22:30". Empty disables night dimming. */
|
|
278
|
-
nightStart: e.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/).optional(),
|
|
279
|
-
nightEnd: e.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/).optional()
|
|
280
|
-
}), u = e.string().regex(
|
|
281
|
-
/^\d{1,3} \d{1,3} \d{1,3}$/,
|
|
282
|
-
'Expected space-separated RGB integers, e.g. "13 110 253"'
|
|
283
|
-
), ue = e.object({
|
|
284
|
-
preset: e.enum(["light", "dark", "corporate", "midnight", "blueprint", "custom"]).default("dark"),
|
|
285
|
-
background: u.optional(),
|
|
286
|
-
foreground: u.optional(),
|
|
287
|
-
accent: u.optional(),
|
|
288
|
-
muted: u.optional(),
|
|
289
|
-
warning: u.optional()
|
|
290
|
-
});
|
|
291
|
-
e.object({
|
|
292
|
-
/** Bumped only on breaking shape changes, so old firmware can refuse safely. */
|
|
293
|
-
schemaVersion: e.literal(1),
|
|
294
|
-
deviceId: e.string().min(1),
|
|
295
|
-
/** Monotonic. Portal increments on write; device echoes what it is running. */
|
|
296
|
-
revision: e.number().int().nonnegative(),
|
|
297
|
-
updatedAt: e.string().datetime().optional(),
|
|
298
|
-
activeApp: R,
|
|
299
|
-
apps: ce,
|
|
300
|
-
display: me,
|
|
301
|
-
theme: ue
|
|
302
|
-
});
|
|
303
|
-
var de = e.enum([
|
|
304
|
-
"unprovisioned",
|
|
305
|
-
"connecting",
|
|
306
|
-
"online",
|
|
307
|
-
"offline",
|
|
308
|
-
"failed"
|
|
309
|
-
]);
|
|
310
|
-
e.object({
|
|
311
|
-
deviceId: e.string().min(1),
|
|
312
|
-
kind: ie,
|
|
313
|
-
firmwareVersion: e.string(),
|
|
314
|
-
/** Shown on the device's own screen at boot — how the user finds it. */
|
|
315
|
-
ipAddress: e.string().optional(),
|
|
316
|
-
provisioning: de,
|
|
317
|
-
/** Revision the device is actually running, not the one it was sent. */
|
|
318
|
-
configRevision: e.number().int().nonnegative(),
|
|
319
|
-
activeApp: R,
|
|
320
|
-
rssi: e.number().int().optional().describe("dBm"),
|
|
321
|
-
uptimeSeconds: e.number().int().nonnegative().optional(),
|
|
322
|
-
freeHeapBytes: e.number().int().nonnegative().optional()
|
|
323
|
-
});
|
|
324
|
-
var pe = e.enum([
|
|
325
|
-
"background",
|
|
326
|
-
"foreground",
|
|
327
|
-
"muted",
|
|
328
|
-
"accent",
|
|
329
|
-
"success",
|
|
330
|
-
"warning",
|
|
331
|
-
"danger"
|
|
332
|
-
]), be = e.string().regex(/^\d{1,3} \d{1,3} \d{1,3}$/, 'RGB must be three space-separated integers, e.g. "13 110 253"'), y = e.union([pe, be]), B = e.enum(["xs", "sm", "base", "lg", "xl", "display"]), x = e.enum(["start", "center", "end"]), he = e.discriminatedUnion("kind", [
|
|
333
|
-
e.object({
|
|
334
|
-
kind: e.literal("weather"),
|
|
335
|
-
latitude: e.number().min(-90).max(90),
|
|
336
|
-
longitude: e.number().min(-180).max(180),
|
|
337
|
-
units: e.enum(["imperial", "metric"]).default("imperial"),
|
|
338
|
-
refreshSeconds: e.number().int().min(300).max(86400).default(600)
|
|
339
|
-
}),
|
|
340
|
-
e.object({
|
|
341
|
-
kind: e.literal("clock"),
|
|
342
|
-
/** IANA zone, e.g. "America/New_York". */
|
|
343
|
-
timezone: e.string().default("America/New_York"),
|
|
344
|
-
twentyFourHour: e.boolean().default(!1)
|
|
345
|
-
}),
|
|
346
|
-
e.object({
|
|
347
|
-
kind: e.literal("countdown"),
|
|
348
|
-
/** ISO date or datetime, e.g. "2026-12-25" or "2026-12-25T18:00:00Z". */
|
|
349
|
-
target: e.string().min(4),
|
|
350
|
-
label: e.string().max(24).optional()
|
|
351
|
-
}),
|
|
352
|
-
e.object({
|
|
353
|
-
kind: e.literal("static"),
|
|
354
|
-
values: e.record(e.union([e.string(), e.number(), e.boolean()]))
|
|
355
|
-
}),
|
|
356
|
-
/**
|
|
357
|
-
* Taking turns: a number that counts 0, 1, 2 … up to `count - 1` and starts
|
|
358
|
-
* again, moving on every `minutes`. Its one field is `index`.
|
|
359
|
-
*
|
|
360
|
-
* It exists for the photo frame — each photo hides unless the index is its
|
|
361
|
-
* own — and works for anything that should alternate, like two lines of a
|
|
362
|
-
* sign. Counted from UTC minutes since 1970, so the browser and every board
|
|
363
|
-
* agree on which turn it is without talking to each other, and minutes
|
|
364
|
-
* because a board redraws once a minute and no faster (see loop() in
|
|
365
|
-
* hardware/weather-display/weather-display.ino).
|
|
366
|
-
*/
|
|
367
|
-
e.object({
|
|
368
|
-
kind: e.literal("cycle"),
|
|
369
|
-
count: e.number().int().min(2).max(12),
|
|
370
|
-
minutes: e.number().int().min(1).max(1440).default(5)
|
|
371
|
-
})
|
|
372
|
-
]), A = e.union([
|
|
373
|
-
e.object({ literal: e.number() }),
|
|
374
|
-
e.object({ source: e.string().min(1), field: e.string().min(1) })
|
|
375
|
-
]), ge = e.object({
|
|
376
|
-
compute: e.enum(["add", "subtract", "multiply", "divide"]),
|
|
377
|
-
of: e.tuple([A, A]),
|
|
378
|
-
round: e.boolean().default(!0)
|
|
379
|
-
}), d = e.union([
|
|
380
|
-
e.object({ literal: e.union([e.string(), e.number(), e.boolean()]) }),
|
|
381
|
-
e.object({
|
|
382
|
-
/** Key into the document's `sources` map. */
|
|
383
|
-
source: e.string().min(1),
|
|
384
|
-
/** Field on that source, e.g. "temperature", "high", "condition". */
|
|
385
|
-
field: e.string().min(1)
|
|
386
|
-
}),
|
|
387
|
-
ge
|
|
388
|
-
]), v = e.object({
|
|
389
|
-
value: A,
|
|
390
|
-
op: e.enum(["<", "<=", ">", ">=", "==", "!="]),
|
|
391
|
-
than: e.union([e.number(), e.string(), e.boolean()])
|
|
392
|
-
}), ye = e.object({
|
|
393
|
-
when: v,
|
|
394
|
-
color: y.optional(),
|
|
395
|
-
size: B.optional()
|
|
396
|
-
}), p = {
|
|
397
|
-
color: y.optional(),
|
|
398
|
-
/** Drawn only when this is false, or absent. */
|
|
399
|
-
hideWhen: v.optional(),
|
|
400
|
-
/** Conditional style. First match wins. */
|
|
401
|
-
rules: e.array(ye).max(4).optional()
|
|
402
|
-
}, xe = e.object({
|
|
403
|
-
type: e.literal("text"),
|
|
404
|
-
value: d,
|
|
405
|
-
size: B.default("base"),
|
|
406
|
-
align: x.default("start"),
|
|
407
|
-
/** Printed after the value, e.g. a degree symbol. Never itself bound. */
|
|
408
|
-
suffix: e.string().max(8).optional(),
|
|
409
|
-
...p
|
|
410
|
-
}), ve = e.object({
|
|
411
|
-
type: e.literal("dial"),
|
|
412
|
-
value: d,
|
|
413
|
-
min: e.number(),
|
|
414
|
-
max: e.number(),
|
|
415
|
-
label: e.string().max(24).optional(),
|
|
416
|
-
...p
|
|
417
|
-
}), we = e.object({
|
|
418
|
-
type: e.literal("sparkline"),
|
|
419
|
-
/** A source field holding a series rather than a scalar. */
|
|
420
|
-
series: d,
|
|
421
|
-
...p
|
|
422
|
-
}), fe = e.object({
|
|
423
|
-
type: e.literal("bar"),
|
|
424
|
-
value: d,
|
|
425
|
-
min: e.number(),
|
|
426
|
-
max: e.number(),
|
|
427
|
-
...p
|
|
428
|
-
}), Se = e.object({
|
|
429
|
-
type: e.literal("status"),
|
|
430
|
-
state: d,
|
|
431
|
-
label: e.string().max(24).optional(),
|
|
432
|
-
...p
|
|
433
|
-
}), g = 64, Ae = g / 2, ke = Math.ceil(Ae * g / 3) * 4, Ee = e.object({
|
|
434
|
-
type: e.literal("sprite"),
|
|
435
|
-
width: e.number().int().min(1).max(g),
|
|
436
|
-
height: e.number().int().min(1).max(g),
|
|
437
|
-
/**
|
|
438
|
-
* Up to sixteen colours, in the same form every other colour in a document
|
|
439
|
-
* takes: a semantic token, or literal RGB.
|
|
440
|
-
*
|
|
441
|
-
* Both are allowed on purpose. A token re-colours with the theme, which is
|
|
442
|
-
* what an icon wants; literal RGB does not, which is what a drawing wants.
|
|
443
|
-
* A picture of a dog is content, not chrome, and should not turn teal
|
|
444
|
-
* because somebody switched to the corporate theme.
|
|
445
|
-
*/
|
|
446
|
-
palette: e.array(y).min(1).max(16),
|
|
447
|
-
/** base64 of the packed nibbles. */
|
|
448
|
-
pixels: e.string().min(4).max(ke),
|
|
449
|
-
align: x.default("start"),
|
|
450
|
-
/** Drawn only when this is false, or absent. */
|
|
451
|
-
hideWhen: v.optional()
|
|
452
|
-
}), F = e.string().regex(/^[0-9a-f]{64}$/, "a lowercase hex SHA-256"), s = { width: 304, height: 224 }, je = 8, D = {
|
|
453
|
-
/** "RSPR". */
|
|
454
|
-
magic: [82, 83, 80, 82],
|
|
455
|
-
version: 1,
|
|
456
|
-
/** magic 4, version 1, width u16, height u16, bits per pixel 1, palette count 1. */
|
|
457
|
-
headerBytes: 11,
|
|
458
|
-
/** Only 4 today: two pixels per byte, high nibble first, rows padded to a byte. */
|
|
459
|
-
bitsPerPixel: 4,
|
|
460
|
-
maxColors: 16
|
|
461
|
-
}, Ze = D.headerBytes + D.maxColors * 2 + Math.ceil(s.width / 2) * s.height, _e = e.object({
|
|
462
|
-
type: e.literal("image"),
|
|
463
|
-
asset: F,
|
|
464
|
-
/** The file's own pixels, not the drawn size. */
|
|
465
|
-
width: e.number().int().min(1).max(s.width),
|
|
466
|
-
height: e.number().int().min(1).max(s.height),
|
|
467
|
-
scale: e.number().int().min(1).max(je).default(1),
|
|
468
|
-
align: x.default("start"),
|
|
469
|
-
/** Drawn only when this is false, or absent. */
|
|
470
|
-
hideWhen: v.optional()
|
|
471
|
-
}), P = e.discriminatedUnion("type", [
|
|
472
|
-
xe,
|
|
473
|
-
ve,
|
|
474
|
-
we,
|
|
475
|
-
fe,
|
|
476
|
-
Se,
|
|
477
|
-
Ee,
|
|
478
|
-
_e
|
|
479
|
-
]), Te = e.object({
|
|
480
|
-
type: e.literal("group"),
|
|
481
|
-
direction: e.enum(["row", "stack"]),
|
|
482
|
-
gap: e.number().int().min(0).max(64).default(4),
|
|
483
|
-
align: x.default("start"),
|
|
484
|
-
children: e.array(P).min(1).max(8)
|
|
485
|
-
}), Ce = e.union([P, Te]), Ie = e.preprocess(
|
|
486
|
-
(l) => l === "240x320" ? "320x240" : l,
|
|
487
|
-
e.enum(["320x240"])
|
|
488
|
-
), Je = e.object({
|
|
489
|
-
/** Bumped only for a breaking change; the device checks it before parsing. */
|
|
490
|
-
schemaVersion: e.literal(1),
|
|
491
|
-
id: e.string().regex(/^[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$/, "lowercase slug"),
|
|
492
|
-
name: e.string().min(1).max(48),
|
|
493
|
-
/** Free text. Never an email or anything else identifying — see the plan. */
|
|
494
|
-
author: e.string().max(32).optional(),
|
|
495
|
-
screen: Ie.default("320x240"),
|
|
496
|
-
background: y.default("background"),
|
|
497
|
-
/** Named so bindings can refer to them. */
|
|
498
|
-
sources: e.record(he).default({}),
|
|
499
|
-
blocks: e.array(Ce).min(1).max(12)
|
|
500
|
-
}).superRefine((l, m) => {
|
|
501
|
-
const h = (n) => Math.ceil(n / 2), T = (n, r) => {
|
|
502
|
-
const a = n;
|
|
503
|
-
if ((a == null ? void 0 : a.type) !== "sprite" || !a.width || !a.height || typeof a.pixels != "string") return;
|
|
504
|
-
const i = h(a.width) * a.height, o = Math.floor(a.pixels.replace(/=+$/, "").length * 3 / 4);
|
|
505
|
-
o !== i && m.addIssue({
|
|
506
|
-
code: e.ZodIssueCode.custom,
|
|
507
|
-
path: [...r, "pixels"],
|
|
508
|
-
message: `${a.width}x${a.height} needs ${i} bytes of pixel data, and this decodes to ${o}. Rows are padded to whole bytes, so the length is ceil(width / 2) * height.`
|
|
509
|
-
});
|
|
510
|
-
}, C = (n, r) => {
|
|
511
|
-
const a = n;
|
|
512
|
-
if ((a == null ? void 0 : a.type) !== "image" || !a.width || !a.height) return;
|
|
513
|
-
const i = a.scale ?? 1, o = a.width * i, I = a.height * i;
|
|
514
|
-
o <= s.width && I <= s.height || m.addIssue({
|
|
515
|
-
code: e.ZodIssueCode.custom,
|
|
516
|
-
path: [...r, "scale"],
|
|
517
|
-
message: `${a.width}x${a.height} at scale ${i} draws ${o}x${I}, and a board draws at most ${s.width}x${s.height} inside its margin.`
|
|
518
|
-
});
|
|
519
|
-
};
|
|
520
|
-
l.blocks.forEach((n, r) => {
|
|
521
|
-
T(n, ["blocks", r]), C(n, ["blocks", r]);
|
|
522
|
-
const a = n.children;
|
|
523
|
-
Array.isArray(a) && a.forEach((i, o) => {
|
|
524
|
-
T(i, ["blocks", r, "children", o]), C(i, ["blocks", r, "children", o]);
|
|
525
|
-
});
|
|
526
|
-
});
|
|
527
|
-
});
|
|
528
|
-
e.object({
|
|
529
|
-
rendition: e.string().min(4),
|
|
530
|
-
original: e.string().min(4)
|
|
531
|
-
});
|
|
532
|
-
e.object({
|
|
533
|
-
hash: F,
|
|
534
|
-
/** The rendition's own pixels. */
|
|
535
|
-
width: e.number().int().positive(),
|
|
536
|
-
height: e.number().int().positive(),
|
|
537
|
-
renditionBytes: e.number().int().positive(),
|
|
538
|
-
originalWidth: e.number().int().positive(),
|
|
539
|
-
originalHeight: e.number().int().positive(),
|
|
540
|
-
originalBytes: e.number().int().positive(),
|
|
541
|
-
uploadedAt: e.number().int()
|
|
542
|
-
});
|
|
543
|
-
var w = e.string().regex(/^[0-9A-HJKMNP-TV-Z]{8}$/, "eight characters, no I L O or U"), E = e.string().regex(/^\d{4}$/);
|
|
544
|
-
e.object({
|
|
545
|
-
deviceId: w,
|
|
546
|
-
code: E,
|
|
547
|
-
/** Firmware build, so a support question has an answer. */
|
|
548
|
-
version: e.string().max(40).optional(),
|
|
549
|
-
/** Which board this is, from Boards.h — the two variants need different firmware. */
|
|
550
|
-
board: e.string().max(40).optional(),
|
|
551
|
-
/** dBm, always negative. -50 is across the room; -85 is a complaint. */
|
|
552
|
-
rssi: e.number().int().min(-127).max(0).optional(),
|
|
553
|
-
/** On the owner's own network. Long enough for IPv6, which this does not send yet. */
|
|
554
|
-
ip: e.string().max(45).optional(),
|
|
555
|
-
/** Seconds since boot. Not growing between check-ins means it is restarting. */
|
|
556
|
-
uptime: e.number().int().nonnegative().optional(),
|
|
557
|
-
/** Free heap in bytes. */
|
|
558
|
-
heap: e.number().int().nonnegative().optional(),
|
|
559
|
-
/** The app revision the board has actually drawn. */
|
|
560
|
-
drew: e.number().int().nonnegative().optional(),
|
|
561
|
-
/** Why it last restarted, already mapped to a word by the firmware. */
|
|
562
|
-
reset: e.string().max(40).optional()
|
|
563
|
-
});
|
|
564
|
-
e.object({
|
|
565
|
-
deviceId: w,
|
|
566
|
-
code: E
|
|
567
|
-
});
|
|
568
|
-
e.object({
|
|
569
|
-
deviceId: w
|
|
570
|
-
});
|
|
571
|
-
e.object({
|
|
572
|
-
revision: e.number().int().nonnegative(),
|
|
573
|
-
sentAt: e.number().int().nonnegative()
|
|
574
|
-
});
|
|
575
|
-
e.object({
|
|
576
|
-
deviceId: w,
|
|
577
|
-
code: E,
|
|
578
|
-
ownerId: e.string().nullable().default(null),
|
|
579
|
-
version: e.string().max(40).optional(),
|
|
580
|
-
createdAt: e.number().int().nonnegative(),
|
|
581
|
-
lastSeenAt: e.number().int().nonnegative()
|
|
582
|
-
});
|
|
583
|
-
e.enum(["register", "poll", "send"]);
|
|
584
|
-
e.object({
|
|
585
|
-
/** When the board last said any of this, by the server's clock. */
|
|
586
|
-
reportedAt: e.number().int().nonnegative().optional(),
|
|
587
|
-
/**
|
|
588
|
-
* The firmware build. Today every board sends the literal "doc-1", which is a
|
|
589
|
-
* protocol marker rather than a build id — so this is shown as reported and
|
|
590
|
-
* labelled as not yet a version. The real value lives in the published
|
|
591
|
-
* manifest until firmware carries it.
|
|
592
|
-
*/
|
|
593
|
-
firmwareVersion: e.string().max(40).optional(),
|
|
594
|
-
/** Which board this is. Nothing distinguishes a CYD from a Freenove S3 yet. */
|
|
595
|
-
board: e.string().max(40).optional(),
|
|
596
|
-
/** dBm, negative. -50 is across the room, -85 is a complaint. */
|
|
597
|
-
rssi: e.number().int().min(-127).max(0).optional(),
|
|
598
|
-
/** The board's address on its own network, as the board sees it. */
|
|
599
|
-
ip: e.string().max(45).optional(),
|
|
600
|
-
uptimeSeconds: e.number().int().nonnegative().optional(),
|
|
601
|
-
freeHeapBytes: e.number().int().nonnegative().optional(),
|
|
602
|
-
/**
|
|
603
|
-
* The revision the board is actually showing.
|
|
604
|
-
*
|
|
605
|
-
* Distinct from the revision that was sent, and the difference is the whole
|
|
606
|
-
* value: a send that was never drawn looks identical to a successful one until
|
|
607
|
-
* these two numbers disagree.
|
|
608
|
-
*/
|
|
609
|
-
drewRevision: e.number().int().nonnegative().optional(),
|
|
610
|
-
/** Why it last restarted, if it says. A board power-cycling in a loop is a fault. */
|
|
611
|
-
resetReason: e.string().max(40).optional(),
|
|
612
|
-
/** When it last polled — finer-grained than a registration, for liveness only. */
|
|
613
|
-
lastPollAt: e.number().int().nonnegative().optional()
|
|
614
|
-
});
|
|
615
|
-
e.object({
|
|
616
|
-
/** When the board last asked for its app. The freshest signal this system has. */
|
|
617
|
-
lastPollAt: e.number().int().nonnegative(),
|
|
618
|
-
/** The revision it reported drawing at that moment. */
|
|
619
|
-
drewRevision: e.number().int().nonnegative().optional()
|
|
620
|
-
});
|
|
621
|
-
var Qe = "?", et = {
|
|
622
|
-
// Accented Latin, CP437 0x80-0xA5 and 0xE1
|
|
623
|
-
Ç: { byte: 128, shows: "Ç" },
|
|
624
|
-
ü: { byte: 129, shows: "ü" },
|
|
625
|
-
é: { byte: 130, shows: "é" },
|
|
626
|
-
â: { byte: 131, shows: "â" },
|
|
627
|
-
ä: { byte: 132, shows: "ä" },
|
|
628
|
-
à: { byte: 133, shows: "à" },
|
|
629
|
-
å: { byte: 134, shows: "å" },
|
|
630
|
-
ç: { byte: 135, shows: "ç" },
|
|
631
|
-
ê: { byte: 136, shows: "ê" },
|
|
632
|
-
ë: { byte: 137, shows: "ë" },
|
|
633
|
-
è: { byte: 138, shows: "è" },
|
|
634
|
-
ï: { byte: 139, shows: "ï" },
|
|
635
|
-
î: { byte: 140, shows: "î" },
|
|
636
|
-
ì: { byte: 141, shows: "ì" },
|
|
637
|
-
Ä: { byte: 142, shows: "Ä" },
|
|
638
|
-
Å: { byte: 143, shows: "Å" },
|
|
639
|
-
É: { byte: 144, shows: "É" },
|
|
640
|
-
æ: { byte: 145, shows: "æ" },
|
|
641
|
-
Æ: { byte: 146, shows: "Æ" },
|
|
642
|
-
ô: { byte: 147, shows: "ô" },
|
|
643
|
-
ö: { byte: 148, shows: "ö" },
|
|
644
|
-
ò: { byte: 149, shows: "ò" },
|
|
645
|
-
û: { byte: 150, shows: "û" },
|
|
646
|
-
ù: { byte: 151, shows: "ù" },
|
|
647
|
-
ÿ: { byte: 152, shows: "ÿ" },
|
|
648
|
-
Ö: { byte: 153, shows: "Ö" },
|
|
649
|
-
Ü: { byte: 154, shows: "Ü" },
|
|
650
|
-
á: { byte: 160, shows: "á" },
|
|
651
|
-
í: { byte: 161, shows: "í" },
|
|
652
|
-
ó: { byte: 162, shows: "ó" },
|
|
653
|
-
ú: { byte: 163, shows: "ú" },
|
|
654
|
-
ñ: { byte: 164, shows: "ñ" },
|
|
655
|
-
Ñ: { byte: 165, shows: "Ñ" },
|
|
656
|
-
ß: { byte: 225, shows: "ß" },
|
|
657
|
-
// Symbols a readout uses
|
|
658
|
-
"¢": { byte: 155, shows: "¢" },
|
|
659
|
-
"£": { byte: 156, shows: "£" },
|
|
660
|
-
"¥": { byte: 157, shows: "¥" },
|
|
661
|
-
ƒ: { byte: 159, shows: "ƒ" },
|
|
662
|
-
ª: { byte: 166, shows: "ª" },
|
|
663
|
-
º: { byte: 167, shows: "º" },
|
|
664
|
-
"¿": { byte: 168, shows: "¿" },
|
|
665
|
-
"¬": { byte: 170, shows: "¬" },
|
|
666
|
-
"½": { byte: 171, shows: "½" },
|
|
667
|
-
"¼": { byte: 172, shows: "¼" },
|
|
668
|
-
"¡": { byte: 173, shows: "¡" },
|
|
669
|
-
"«": { byte: 174, shows: "«" },
|
|
670
|
-
"»": { byte: 175, shows: "»" },
|
|
671
|
-
π: { byte: 227, shows: "π" },
|
|
672
|
-
µ: { byte: 230, shows: "µ" },
|
|
673
|
-
Ω: { byte: 234, shows: "Ω" },
|
|
674
|
-
"∞": { byte: 236, shows: "∞" },
|
|
675
|
-
"±": { byte: 241, shows: "±" },
|
|
676
|
-
"≥": { byte: 242, shows: "≥" },
|
|
677
|
-
"≤": { byte: 243, shows: "≤" },
|
|
678
|
-
"÷": { byte: 246, shows: "÷" },
|
|
679
|
-
"≈": { byte: 247, shows: "≈" },
|
|
680
|
-
"°": { byte: 248, shows: "°" },
|
|
681
|
-
"·": { byte: 250, shows: "·" },
|
|
682
|
-
"√": { byte: 251, shows: "√" },
|
|
683
|
-
"²": { byte: 253, shows: "²" },
|
|
684
|
-
// Punctuation an AI writes without being asked, folded to ASCII
|
|
685
|
-
"‘": { byte: 39, shows: "'" },
|
|
686
|
-
"’": { byte: 39, shows: "'" },
|
|
687
|
-
"“": { byte: 34, shows: '"' },
|
|
688
|
-
"”": { byte: 34, shows: '"' },
|
|
689
|
-
"–": { byte: 45, shows: "-" },
|
|
690
|
-
"—": { byte: 45, shows: "-" },
|
|
691
|
-
"−": { byte: 45, shows: "-" },
|
|
692
|
-
" ": { byte: 32, shows: " " }
|
|
693
|
-
}, tt = {
|
|
694
|
-
background: "17 17 17",
|
|
695
|
-
foreground: "238 238 238",
|
|
696
|
-
muted: "153 153 153",
|
|
697
|
-
accent: "23 162 184",
|
|
698
|
-
success: "34 197 94",
|
|
699
|
-
warning: "245 158 11",
|
|
700
|
-
danger: "220 53 69"
|
|
701
|
-
};
|
|
702
|
-
e.object({
|
|
703
|
-
deviceId: e.string().min(1, "Device ID is required"),
|
|
704
|
-
timeRange: e.enum(["1h", "24h", "7d"], {
|
|
705
|
-
errorMap: () => ({ message: "Time range must be 1h, 24h, or 7d" })
|
|
706
|
-
}),
|
|
707
|
-
metrics: e.array(
|
|
708
|
-
e.enum(["temperature", "humidity", "vwc", "ec", "ph", "pressure", "co2"])
|
|
709
|
-
).min(1, "At least one metric is required").max(4, "Maximum 4 metrics per graph")
|
|
710
|
-
});
|
|
711
|
-
e.object({
|
|
712
|
-
ticker: e.string().min(1).describe("The stock ticker symbol explicitly requested by the user. YOU MUST EXTRACT AND PROVIDE THIS (e.g., 'AAPL', 'MSFT')."),
|
|
713
|
-
timeRange: e.enum(["1D", "1W", "1M", "1Y"], {
|
|
714
|
-
errorMap: () => ({ message: "Time range must be 1D, 1W, 1M, or 1Y" })
|
|
715
|
-
}).describe("The time range for the chart. Choose based on user request or default to '1M'."),
|
|
716
|
-
metrics: e.array(e.enum(["price", "volume", "moving_average"])).min(1, "At least one metric is required").describe("Array of metrics to display. Always include 'price' and 'volume' unless user specifies otherwise.")
|
|
717
|
-
});
|
|
718
|
-
var b = e.string().min(1).describe("The stock ticker symbol (e.g., 'AAPL', 'TSLA', 'MSFT').");
|
|
719
|
-
e.object({ ticker: b });
|
|
720
|
-
e.object({ ticker: b });
|
|
721
|
-
e.object({ ticker: b });
|
|
722
|
-
e.object({
|
|
723
|
-
ticker: b,
|
|
724
|
-
hops: e.number().int().min(1).max(2).optional().describe("How many relationship hops to traverse (1 = direct counterparties only, 2 = counterparties-of-counterparties too). Defaults to 1 if omitted.")
|
|
725
|
-
});
|
|
726
|
-
e.object({ ticker: b });
|
|
727
|
-
e.object({});
|
|
728
|
-
var S = "gemini-2.5-flash", De = "gemini-2.5-flash", Re = "gemini-2.5-pro", at = {
|
|
729
|
-
"google-gemini": "gemini-2.5-flash",
|
|
730
|
-
openai: "gpt-4o-mini",
|
|
731
|
-
anthropic: "claude-haiku-4-5-20251001",
|
|
732
|
-
grok: "grok-2-1212",
|
|
733
|
-
deepseek: "deepseek-chat",
|
|
734
|
-
ollama: "llama3.3"
|
|
735
|
-
}, nt = {
|
|
736
|
-
/** The Strategist: high creativity, exploratory conversation */
|
|
737
|
-
STRATEGIST: {
|
|
738
|
-
model: De,
|
|
739
|
-
provider: "google-gemini",
|
|
740
|
-
temperature: 0.7
|
|
741
|
-
},
|
|
742
|
-
/** The Architect: data schema and resource modeling — precision required */
|
|
743
|
-
ARCHITECT: {
|
|
744
|
-
model: S,
|
|
745
|
-
provider: "google-gemini",
|
|
746
|
-
temperature: 0.3
|
|
747
|
-
},
|
|
748
|
-
/** The Designer: UI layout generation — moderate creativity */
|
|
749
|
-
DESIGNER: {
|
|
750
|
-
model: S,
|
|
751
|
-
provider: "google-gemini",
|
|
752
|
-
temperature: 0.5
|
|
753
|
-
},
|
|
754
|
-
/** The Reviewer/Product Owner: structured plan output — strict adherence.
|
|
755
|
-
* Uses the Pro tier for superior reasoning on complex structured tasks.
|
|
756
|
-
*/
|
|
757
|
-
REVIEWER: {
|
|
758
|
-
model: Re,
|
|
759
|
-
provider: "google-gemini",
|
|
760
|
-
temperature: 0.2
|
|
761
|
-
},
|
|
762
|
-
/** The Genesis Engine: one-shot app generation — must be schema-strict */
|
|
763
|
-
GENESIS: {
|
|
764
|
-
model: S,
|
|
765
|
-
provider: "google-gemini",
|
|
766
|
-
temperature: 0.2
|
|
767
|
-
}
|
|
768
|
-
}, it = `
|
|
769
|
-
You write tiny apps for a small desk device whose screen is 320 pixels wide and
|
|
770
|
-
240 pixels high — landscape.
|
|
771
|
-
|
|
772
|
-
Reply with ONE JSON object and nothing else. No markdown fences, no explanation.
|
|
773
|
-
|
|
774
|
-
THE SHAPE
|
|
775
|
-
|
|
776
|
-
{
|
|
777
|
-
"schemaVersion": 1,
|
|
778
|
-
"id": "lowercase-slug",
|
|
779
|
-
"name": "Short Name",
|
|
780
|
-
"screen": "320x240",
|
|
781
|
-
"background": "background",
|
|
782
|
-
"sources": { },
|
|
783
|
-
"blocks": [ ]
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
BLOCKS — up to 12, drawn top to bottom. Each is one of:
|
|
787
|
-
|
|
788
|
-
{ "type": "text", "value": V, "size": S, "align": A, "color": C, "suffix": "°" }
|
|
789
|
-
{ "type": "dial", "value": V, "min": 0, "max": 100, "label": "CPU", "color": C }
|
|
790
|
-
{ "type": "bar", "value": V, "min": 0, "max": 100, "color": C }
|
|
791
|
-
{ "type": "sparkline", "series": V, "color": C }
|
|
792
|
-
{ "type": "status", "state": V, "label": "Door", "color": C }
|
|
793
|
-
{ "type": "sprite", "palette": [C, ...], "grid": "0011
|
|
794
|
-
0110
|
|
795
|
-
1100
|
|
796
|
-
0011", "align": A }
|
|
797
|
-
{ "type": "group", "direction": "row"|"stack", "gap": 8, "align": A, "children": [ ...leaves... ] }
|
|
798
|
-
|
|
799
|
-
DRAWING A SPRITE — you may, and here is the only form that works.
|
|
800
|
-
|
|
801
|
-
Write a "grid": one line per row, one hex character per pixel, each character
|
|
802
|
-
indexing "palette" (so "0" is the first colour, "1" the second, up to "f").
|
|
803
|
-
Every row must be exactly the same length. Up to 64x64, but 16x16 and 32x32
|
|
804
|
-
look far better — small palettes and bold shapes read on a 320x240 panel, fine
|
|
805
|
-
detail does not.
|
|
806
|
-
|
|
807
|
-
{ "type": "sprite",
|
|
808
|
-
"palette": ["background", "255 214 10", "17 17 17"],
|
|
809
|
-
"grid": "0011110
|
|
810
|
-
0122210
|
|
811
|
-
1222221
|
|
812
|
-
1211121
|
|
813
|
-
1222221
|
|
814
|
-
0122210
|
|
815
|
-
0011110" }
|
|
816
|
-
|
|
817
|
-
Put the background colour FIRST so "0" means empty, and use "." as a synonym
|
|
818
|
-
for "0" if it makes the shape easier to see while you write it.
|
|
819
|
-
|
|
820
|
-
Palette entries are the same colours as everywhere else: a semantic token
|
|
821
|
-
re-colours with the theme, which is what an icon wants, and literal "R G B"
|
|
822
|
-
does not, which is what a picture wants.
|
|
823
|
-
|
|
824
|
-
NEVER write a "pixels" field yourself. That is base64 of packed nibbles, one
|
|
825
|
-
wrong character shifts every pixel after it, and you cannot check it. Write the
|
|
826
|
-
grid; it is converted for you. If a document you are editing already has
|
|
827
|
-
"pixels" and no "grid", leave it exactly as it is.
|
|
828
|
-
|
|
829
|
-
PHOTOS — a document you are editing may hold { "type": "image", "asset": "<64 hex
|
|
830
|
-
characters>", ... }. That is a picture someone uploaded, named by the hash of
|
|
831
|
-
its file. Keep every image block exactly as it is unless asked to remove it, and
|
|
832
|
-
never write one yourself: you cannot make the file it names, so any hash you
|
|
833
|
-
invent draws nothing.
|
|
834
|
-
|
|
835
|
-
Count your rows before you answer. A grid whose rows are different lengths is
|
|
836
|
-
the one mistake that will come back to you.
|
|
837
|
-
|
|
838
|
-
A group holds leaves only. Groups do NOT nest inside groups — the device has no
|
|
839
|
-
layout engine, only computed offsets.
|
|
840
|
-
|
|
841
|
-
CONDITIONS — any block may also carry these:
|
|
842
|
-
|
|
843
|
-
"hideWhen": { "value": O, "op": "<", "than": 32 }
|
|
844
|
-
leave it off the screen entirely while that is true
|
|
845
|
-
|
|
846
|
-
"rules": [ { "when": { "value": O, "op": "<", "than": 32 }, "color": "accent" },
|
|
847
|
-
{ "when": { "value": O, "op": ">", "than": 85 }, "color": "danger" } ]
|
|
848
|
-
style that applies only when something is true. First match wins, so write
|
|
849
|
-
the narrowest band first. At most four. Each may set "color", "size" or both.
|
|
850
|
-
|
|
851
|
-
op is one of "<" "<=" ">" ">=" "==" "!="
|
|
852
|
-
Only == and != work on words; the rest are for numbers.
|
|
853
|
-
|
|
854
|
-
O is an operand: { "literal": 32 } or { "source": "forecast", "field": "temperature" }
|
|
855
|
-
|
|
856
|
-
This is how "make it red when it is freezing" is expressed. Use it whenever a
|
|
857
|
-
request contains "when", "if", "unless", "only", or a colour tied to a value.
|
|
858
|
-
|
|
859
|
-
S (size) "xs" | "sm" | "base" | "lg" | "xl" | "display"
|
|
860
|
-
A (align) "start" | "center" | "end"
|
|
861
|
-
C (color) "background" | "foreground" | "muted" | "accent" | "success" | "warning" | "danger"
|
|
862
|
-
or three space-separated RGB numbers, e.g. "220 53 69"
|
|
863
|
-
|
|
864
|
-
VALUES — every V is one of:
|
|
865
|
-
|
|
866
|
-
{ "literal": "Hello" } text you wrote
|
|
867
|
-
{ "source": "forecast", "field": "temperature" } read from a source
|
|
868
|
-
{ "compute": "subtract", "of": [O, O], "round": true } arithmetic
|
|
869
|
-
|
|
870
|
-
compute is "add" | "subtract" | "multiply" | "divide", exactly two operands,
|
|
871
|
-
and it does NOT nest — an operand is a literal or a source field, never
|
|
872
|
-
another compute. "The difference between the high and the low" is the shape
|
|
873
|
-
this is for.
|
|
874
|
-
|
|
875
|
-
SOURCES — declare what the app reads, then bind to it by name:
|
|
876
|
-
|
|
877
|
-
"forecast": { "kind": "weather", "latitude": 39.95, "longitude": -75.17,
|
|
878
|
-
"units": "imperial", "refreshSeconds": 600 }
|
|
879
|
-
fields: temperature, condition, high, low
|
|
880
|
-
"now": { "kind": "clock", "timezone": "America/New_York", "twentyFourHour": false }
|
|
881
|
-
fields: time, date, weekday, hour (hour is 0-23, for rules about time of day)
|
|
882
|
-
"until": { "kind": "countdown", "target": "2026-12-25", "label": "Christmas" }
|
|
883
|
-
fields: days, hours, minutes, seconds, label
|
|
884
|
-
"fixed": { "kind": "static", "values": { "anything": 1 } }
|
|
885
|
-
fields: whatever you put in values
|
|
886
|
-
"turn": { "kind": "cycle", "count": 2, "minutes": 5 }
|
|
887
|
-
fields: index (0, 1, … count-1, moving on every "minutes", then round again)
|
|
888
|
-
For things that take turns: give each block "hideWhen": { "value":
|
|
889
|
-
{ "source": "turn", "field": "index" }, "op": "!=", "than": N } so only
|
|
890
|
-
block N shows on turn N. The board changes at most once a minute.
|
|
891
|
-
|
|
892
|
-
RULES
|
|
893
|
-
|
|
894
|
-
1. 320x240 is small, and it is wider than it is tall. A "display" size text is
|
|
895
|
-
about 56 pixels tall — one of those and two or three smaller lines fill the
|
|
896
|
-
height. Use the width: a "row" group puts two or three things side by side.
|
|
897
|
-
Prefer fewer, bigger things over a dense dashboard.
|
|
898
|
-
2. Use semantic colours unless asked for a specific one. They follow the theme.
|
|
899
|
-
3. There is no scrolling and no text wrapping. Long strings are cut off.
|
|
900
|
-
4. No tables, no forms, no images, no buttons. The screen shows; it does not
|
|
901
|
-
take input.
|
|
902
|
-
5. If the request needs something the vocabulary cannot express, build the
|
|
903
|
-
closest thing it can and do not invent a component.
|
|
904
|
-
6. Prefer a rule over a fixed colour whenever the request ties appearance to a
|
|
905
|
-
value. "Red when cold" is a rule; "red" is not.
|
|
906
|
-
`.trim(), rt = "Here is the current app. Change only what is asked:", t = e.string().regex(
|
|
907
|
-
/^\d{1,3}\s+\d{1,3}\s+\d{1,3}$/,
|
|
908
|
-
'Must be space-separated RGB integers (e.g. "13 110 253")'
|
|
909
|
-
), Be = e.object({
|
|
910
|
-
// ── Core Brand ───────────────────────────────────────────────────────────
|
|
911
|
-
"--app-primary-color": t.optional(),
|
|
912
|
-
"--app-primary-foreground-color": t.optional(),
|
|
913
|
-
"--app-secondary-color": t.optional(),
|
|
914
|
-
"--app-secondary-foreground-color": t.optional(),
|
|
915
|
-
"--app-accent-color": t.optional(),
|
|
916
|
-
"--app-accent-foreground-color": t.optional(),
|
|
917
|
-
// ── Base Surface ─────────────────────────────────────────────────────────
|
|
918
|
-
"--app-bg-color": t.optional(),
|
|
919
|
-
"--app-card-bg-color": t.optional(),
|
|
920
|
-
"--app-text-color": t.optional(),
|
|
921
|
-
"--app-border-color": t.optional(),
|
|
922
|
-
"--app-muted-bg": t.optional(),
|
|
923
|
-
"--app-muted-text": t.optional(),
|
|
924
|
-
// ── Shape ────────────────────────────────────────────────────────────────
|
|
925
|
-
"--app-border-radius-sm": e.string().optional(),
|
|
926
|
-
"--app-border-radius-md": e.string().optional(),
|
|
927
|
-
"--app-border-radius-lg": e.string().optional(),
|
|
928
|
-
// ── Form Controls ────────────────────────────────────────────────────────
|
|
929
|
-
"--app-input-bg-color": t.optional(),
|
|
930
|
-
"--app-input-text-color": t.optional(),
|
|
931
|
-
"--app-input-border-color": t.optional(),
|
|
932
|
-
"--app-input-focus-ring-color": t.optional(),
|
|
933
|
-
"--app-input-placeholder-color": t.optional(),
|
|
934
|
-
// ── Chart Palette ────────────────────────────────────────────────────────
|
|
935
|
-
"--app-chart-1": t.optional(),
|
|
936
|
-
"--app-chart-2": t.optional(),
|
|
937
|
-
"--app-chart-3": t.optional(),
|
|
938
|
-
"--app-chart-4": t.optional(),
|
|
939
|
-
"--app-chart-5": t.optional()
|
|
940
|
-
}).strict(), Fe = e.object({
|
|
941
|
-
/** Google Font name for headings (h1–h4, .font-serif). Example: "Playfair Display" */
|
|
942
|
-
heading: e.string(),
|
|
943
|
-
/** Google Font name for body text. Example: "Inter" */
|
|
944
|
-
body: e.string(),
|
|
945
|
-
/** Optional monospace font. Example: "Roboto Mono" */
|
|
946
|
-
mono: e.string().optional()
|
|
947
|
-
});
|
|
948
|
-
e.object({
|
|
949
|
-
/** Short descriptive theme name. Example: "Midnight Garden" */
|
|
950
|
-
name: e.string(),
|
|
951
|
-
/** One-sentence vibe description. Example: "Dark indigo with golden accents." */
|
|
952
|
-
description: e.string(),
|
|
953
|
-
/** Google Font pairing for heading and body text. */
|
|
954
|
-
fonts: Fe.optional(),
|
|
955
|
-
/**
|
|
956
|
-
* CSS variable overrides.
|
|
957
|
-
* Every key must match an --app-* variable name.
|
|
958
|
-
* All color values must be space-separated RGB integers.
|
|
959
|
-
*/
|
|
960
|
-
cssVars: Be
|
|
961
|
-
});
|
|
962
|
-
e.object({
|
|
963
|
-
primary: t,
|
|
964
|
-
neutral: t,
|
|
965
|
-
success: t,
|
|
966
|
-
warning: t,
|
|
967
|
-
destructive: t,
|
|
968
|
-
radius: e.enum(["none", "sm", "md", "lg", "full"])
|
|
969
|
-
});
|
|
970
|
-
var ot = {
|
|
971
|
-
primary: "13 110 253",
|
|
972
|
-
neutral: "24 24 27",
|
|
973
|
-
success: "34 197 94",
|
|
974
|
-
warning: "234 179 8",
|
|
975
|
-
destructive: "239 68 68",
|
|
976
|
-
radius: "md"
|
|
977
|
-
};
|
|
978
|
-
e.object({
|
|
979
|
-
id: e.string().default(""),
|
|
980
|
-
name: e.string(),
|
|
981
|
-
email: e.string().email(),
|
|
982
|
-
password: e.string().optional(),
|
|
983
|
-
role: e.string(),
|
|
984
|
-
status: e.string().optional(),
|
|
985
|
-
joinedAt: e.string().optional(),
|
|
986
|
-
lastActive: e.string().optional(),
|
|
987
|
-
avatarUrl: e.string().optional()
|
|
988
|
-
});
|
|
989
|
-
var c = e.string().regex(/^acct_[0-9a-f]{12}$/, "acct_ and 12 hex digits"), j = e.enum(["member", "admin"]), N = e.enum(["active", "suspended"]), Pe = e.object({
|
|
990
|
-
algo: e.literal("scrypt"),
|
|
991
|
-
n: e.number().int().positive(),
|
|
992
|
-
r: e.number().int().positive(),
|
|
993
|
-
p: e.number().int().positive(),
|
|
994
|
-
keylen: e.number().int().positive(),
|
|
995
|
-
salt: e.string().min(16),
|
|
996
|
-
hash: e.string().min(16)
|
|
997
|
-
});
|
|
998
|
-
e.object({
|
|
999
|
-
accountId: c,
|
|
1000
|
-
/** Lowercased on write, because a login must not depend on how it was typed. */
|
|
1001
|
-
email: e.string().email().max(254),
|
|
1002
|
-
name: e.string().min(1).max(64),
|
|
1003
|
-
role: j,
|
|
1004
|
-
status: N,
|
|
1005
|
-
password: Pe,
|
|
1006
|
-
createdAt: e.number().int().nonnegative(),
|
|
1007
|
-
lastLoginAt: e.number().int().nonnegative().nullable().default(null),
|
|
1008
|
-
/** Which admin approved this, or null for the bootstrap account. */
|
|
1009
|
-
invitedBy: c.nullable().default(null)
|
|
1010
|
-
});
|
|
1011
|
-
e.object({
|
|
1012
|
-
accountId: c,
|
|
1013
|
-
email: e.string().email(),
|
|
1014
|
-
name: e.string(),
|
|
1015
|
-
role: j,
|
|
1016
|
-
status: N
|
|
1017
|
-
});
|
|
1018
|
-
e.object({
|
|
1019
|
-
accountId: c,
|
|
1020
|
-
createdAt: e.number().int().nonnegative(),
|
|
1021
|
-
expiresAt: e.number().int().nonnegative(),
|
|
1022
|
-
lastSeenAt: e.number().int().nonnegative()
|
|
1023
|
-
});
|
|
1024
|
-
e.object({
|
|
1025
|
-
email: e.string().email().max(254),
|
|
1026
|
-
role: j,
|
|
1027
|
-
createdAt: e.number().int().nonnegative(),
|
|
1028
|
-
expiresAt: e.number().int().nonnegative(),
|
|
1029
|
-
invitedBy: c
|
|
1030
|
-
});
|
|
1031
|
-
e.object({
|
|
1032
|
-
email: e.string().email().max(254),
|
|
1033
|
-
name: e.string().min(1).max(64),
|
|
1034
|
-
/** Optional, and never shown publicly. Long enough to be useful, short enough not to be an essay. */
|
|
1035
|
-
reason: e.string().max(500).optional()
|
|
1036
|
-
});
|
|
1037
|
-
var Ne = e.enum(["pending", "approved", "denied"]);
|
|
1038
|
-
e.object({
|
|
1039
|
-
requestId: e.string().regex(/^req_[0-9a-f]{12}$/, "req_ and 12 hex digits"),
|
|
1040
|
-
email: e.string().email().max(254),
|
|
1041
|
-
name: e.string().min(1).max(64),
|
|
1042
|
-
reason: e.string().max(500).optional(),
|
|
1043
|
-
status: Ne,
|
|
1044
|
-
createdAt: e.number().int().nonnegative(),
|
|
1045
|
-
decidedAt: e.number().int().nonnegative().nullable().default(null),
|
|
1046
|
-
decidedBy: c.nullable().default(null)
|
|
1047
|
-
});
|
|
1048
|
-
var Oe = e.enum([
|
|
1049
|
-
"supplier",
|
|
1050
|
-
"customer",
|
|
1051
|
-
"partner",
|
|
1052
|
-
"competitor",
|
|
1053
|
-
"regulator",
|
|
1054
|
-
"unknown"
|
|
1055
|
-
]), Me = e.enum([
|
|
1056
|
-
"public",
|
|
1057
|
-
"public_uncovered",
|
|
1058
|
-
"private",
|
|
1059
|
-
"unresolved"
|
|
1060
|
-
]);
|
|
1061
|
-
e.object({
|
|
1062
|
-
id: e.string(),
|
|
1063
|
-
ticker: e.string().nullable(),
|
|
1064
|
-
/** Name as it appeared in the source signal — e.g. "Nike". Not the registered name. */
|
|
1065
|
-
name: e.string(),
|
|
1066
|
-
/** Registered legal name from `profiles` — e.g. "NIKE, Inc.". Null unless `public`. */
|
|
1067
|
-
publicName: e.string().nullable(),
|
|
1068
|
-
lei: e.string().nullable(),
|
|
1069
|
-
resolution: Me,
|
|
1070
|
-
type: Oe,
|
|
1071
|
-
confidence: e.number().min(0).max(1),
|
|
1072
|
-
sourceSignalIds: e.array(e.number()),
|
|
1073
|
-
firstSeenAt: e.string().datetime(),
|
|
1074
|
-
lastSeenAt: e.string().datetime()
|
|
1075
|
-
});
|
|
1076
|
-
var Ue = e.enum([
|
|
1077
|
-
"supplies_to",
|
|
1078
|
-
"purchases_from",
|
|
1079
|
-
"partners_with",
|
|
1080
|
-
"competes_with",
|
|
1081
|
-
"regulated_by",
|
|
1082
|
-
"invests_in",
|
|
1083
|
-
"acquires",
|
|
1084
|
-
/**
|
|
1085
|
-
* Identity equivalence, not a business relationship: source and target are
|
|
1086
|
-
* the same real-world entity under two different node ids (typically a
|
|
1087
|
-
* slug-keyed node that predates LEI resolution, pointing at the canonical
|
|
1088
|
-
* LEI-keyed node once resolution succeeds). Never delete/merge either
|
|
1089
|
-
* node — this edge exists so a consumer wanting a deduped view can follow
|
|
1090
|
-
* it to the canonical id, reversibly.
|
|
1091
|
-
*/
|
|
1092
|
-
"same_as"
|
|
1093
|
-
]);
|
|
1094
|
-
e.object({
|
|
1095
|
-
id: e.string(),
|
|
1096
|
-
sourceId: e.string(),
|
|
1097
|
-
targetId: e.string(),
|
|
1098
|
-
edgeType: Ue,
|
|
1099
|
-
weight: e.number().min(0).max(1),
|
|
1100
|
-
evidenceSignalIds: e.array(e.number()),
|
|
1101
|
-
updatedAt: e.string().datetime(),
|
|
1102
|
-
validFrom: e.string().datetime(),
|
|
1103
|
-
/** null = currently valid. Set when a differently-typed edge supersedes this one. */
|
|
1104
|
-
validTo: e.string().datetime().nullable()
|
|
1105
|
-
});
|
|
1106
|
-
var Ve = e.object({
|
|
1107
|
-
signalId: e.number(),
|
|
1108
|
-
weight: e.number().min(0).max(1),
|
|
1109
|
-
reason: e.string().max(280)
|
|
1110
|
-
});
|
|
1111
|
-
e.object({
|
|
1112
|
-
ticker: e.string(),
|
|
1113
|
-
// 'operations'/'customer' are current; 'operational'/'ux' are pre-rename
|
|
1114
|
-
// values that still exist on rows written before the backend's rename —
|
|
1115
|
-
// kept here so reading old rows doesn't fail validation.
|
|
1116
|
-
metric: e.enum(["operations", "customer", "operational", "ux"]),
|
|
1117
|
-
score: e.number(),
|
|
1118
|
-
baseline: e.number(),
|
|
1119
|
-
observed: e.number(),
|
|
1120
|
-
computedAt: e.string().datetime(),
|
|
1121
|
-
contributingSignals: e.array(Ve)
|
|
1122
|
-
});
|
|
1123
|
-
e.object({
|
|
1124
|
-
lei: e.string().nullable(),
|
|
1125
|
-
entityName: e.string(),
|
|
1126
|
-
jurisdiction: e.string().nullable(),
|
|
1127
|
-
registrationStatus: e.string(),
|
|
1128
|
-
parentEntityLei: e.string().nullable(),
|
|
1129
|
-
materialMetadata: e.record(e.unknown()),
|
|
1130
|
-
discoveredAt: e.string().datetime()
|
|
1131
|
-
});
|
|
1132
|
-
var f = e.enum(["db", "mock"]), _ = e.enum(["news", "filing", "report"]), O = e.enum(["graded", "binary", "default", "none"]), Le = e.enum(["second", "day"]), He = e.object({
|
|
1133
|
-
/** Namespaced so ids never collide across sources: `news:1234`, `filing:AAPL:2026-07-31`. */
|
|
1134
|
-
id: e.string(),
|
|
1135
|
-
kind: _,
|
|
1136
|
-
/**
|
|
1137
|
-
* The producer's own type string, unmodified — `NEWS_YAHOO FINANCE_YAHOO RSS`,
|
|
1138
|
-
* `ANNUAL`, `SNAPSHOT`. There are 31 distinct NEWS variants in the live table,
|
|
1139
|
-
* so this is for filtering and debugging: never render it raw to a user.
|
|
1140
|
-
*/
|
|
1141
|
-
subtype: e.string().nullable(),
|
|
1142
|
-
ticker: e.string(),
|
|
1143
|
-
/** Always `YYYY-MM-DDTHH:MM:SSZ`. Fixed-width, so lexical order == chronological order. */
|
|
1144
|
-
occurredAt: e.string(),
|
|
1145
|
-
precision: Le,
|
|
1146
|
-
title: e.string(),
|
|
1147
|
-
summary: e.string().nullable(),
|
|
1148
|
-
url: e.string().nullable(),
|
|
1149
|
-
impact: e.number().nullable(),
|
|
1150
|
-
impactScale: O,
|
|
1151
|
-
/** 0 bearish … 50 neutral … 100 bullish. */
|
|
1152
|
-
sentiment: e.number().nullable(),
|
|
1153
|
-
/** False for filings, and for any event sitting at exactly neutral. */
|
|
1154
|
-
sentimentIsMeaningful: e.boolean(),
|
|
1155
|
-
source: f,
|
|
1156
|
-
meta: e.record(e.unknown()).nullable()
|
|
1157
|
-
});
|
|
1158
|
-
e.object({
|
|
1159
|
-
total: e.number(),
|
|
1160
|
-
page: e.number(),
|
|
1161
|
-
page_size: e.number(),
|
|
1162
|
-
data: e.array(He)
|
|
1163
|
-
});
|
|
1164
|
-
var $e = e.enum(["day", "week", "month"]), We = e.object({
|
|
1165
|
-
bucketStart: e.string(),
|
|
1166
|
-
kind: _,
|
|
1167
|
-
count: e.number(),
|
|
1168
|
-
/** Null when no event in the bucket had meaningful sentiment. */
|
|
1169
|
-
avgSentiment: e.number().nullable(),
|
|
1170
|
-
maxImpact: e.number().nullable()
|
|
1171
|
-
});
|
|
1172
|
-
e.object({
|
|
1173
|
-
ticker: e.string(),
|
|
1174
|
-
bucket: $e,
|
|
1175
|
-
buckets: e.array(We),
|
|
1176
|
-
/** So the client can set its time domain without a second request. */
|
|
1177
|
-
range: e.object({ min: e.string(), max: e.string() }),
|
|
1178
|
-
source: f
|
|
1179
|
-
});
|
|
1180
|
-
var Ke = e.object({
|
|
1181
|
-
kind: _,
|
|
1182
|
-
count: e.number(),
|
|
1183
|
-
earliest: e.string().nullable(),
|
|
1184
|
-
latest: e.string().nullable(),
|
|
1185
|
-
impactScale: O,
|
|
1186
|
-
sentimentUsable: e.boolean()
|
|
1187
|
-
});
|
|
1188
|
-
e.object({
|
|
1189
|
-
ticker: e.string(),
|
|
1190
|
-
facets: e.array(Ke),
|
|
1191
|
-
source: f
|
|
1192
|
-
});
|
|
1193
|
-
var qe = e.object({
|
|
1194
|
-
date: e.string(),
|
|
1195
|
-
open: e.number().nullable(),
|
|
1196
|
-
high: e.number().nullable(),
|
|
1197
|
-
low: e.number().nullable(),
|
|
1198
|
-
close: e.number(),
|
|
1199
|
-
volume: e.number().nullable()
|
|
1200
|
-
});
|
|
1201
|
-
e.object({
|
|
1202
|
-
ticker: e.string(),
|
|
1203
|
-
series: e.array(qe),
|
|
1204
|
-
source: f
|
|
1205
|
-
});
|
|
1206
|
-
var st = 50;
|
|
1207
|
-
export {
|
|
1208
|
-
nt as A,
|
|
1209
|
-
G as B,
|
|
1210
|
-
De as D,
|
|
1211
|
-
$ as E,
|
|
1212
|
-
V as F,
|
|
1213
|
-
z as P,
|
|
1214
|
-
L as R,
|
|
1215
|
-
J as S,
|
|
1216
|
-
W as T,
|
|
1217
|
-
q as W,
|
|
1218
|
-
S as a,
|
|
1219
|
-
it as b,
|
|
1220
|
-
rt as c,
|
|
1221
|
-
Je as d,
|
|
1222
|
-
K as e,
|
|
1223
|
-
Y as f,
|
|
1224
|
-
ze as g,
|
|
1225
|
-
Xe as h,
|
|
1226
|
-
at as i,
|
|
1227
|
-
D as j,
|
|
1228
|
-
Ze as k,
|
|
1229
|
-
g as l,
|
|
1230
|
-
ot as m,
|
|
1231
|
-
tt as n,
|
|
1232
|
-
et as o,
|
|
1233
|
-
Qe as p,
|
|
1234
|
-
Ye as q,
|
|
1235
|
-
st as r
|
|
1236
|
-
};
|