@camstack/types 1.2.575 → 1.2.577

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.
Files changed (47) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/addon.js +1 -1
  3. package/dist/addon.mjs +1 -1
  4. package/dist/automation/action.d.ts +2 -0
  5. package/dist/automation/scheduler.d.ts +2 -0
  6. package/dist/capabilities/action-source.cap.d.ts +1 -0
  7. package/dist/capabilities/actions.cap.d.ts +7 -0
  8. package/dist/capabilities/air-quality-sensor.cap.d.ts +2 -0
  9. package/dist/capabilities/capability-definition.d.ts +22 -0
  10. package/dist/capabilities/climate-control.cap.d.ts +6 -0
  11. package/dist/capabilities/core-blocks.cap.d.ts +20 -0
  12. package/dist/capabilities/device-manager.cap.d.ts +18 -0
  13. package/dist/capabilities/energy-system.cap.d.ts +7 -0
  14. package/dist/capabilities/heat-pump-status.cap.d.ts +4 -0
  15. package/dist/capabilities/humidity-sensor.cap.d.ts +2 -0
  16. package/dist/capabilities/index.d.ts +4 -2
  17. package/dist/capabilities/power-meter.cap.d.ts +2 -0
  18. package/dist/capabilities/schedulers.cap.d.ts +8 -0
  19. package/dist/capabilities/stream-params.cap.d.ts +4 -0
  20. package/dist/capabilities/tags.cap.d.ts +123 -0
  21. package/dist/capabilities/temperature-sensor.cap.d.ts +2 -0
  22. package/dist/capabilities/template.cap.d.ts +8 -0
  23. package/dist/capabilities/water-heater.cap.d.ts +2 -0
  24. package/dist/capabilities/weather-station.cap.d.ts +10 -0
  25. package/dist/client.js +685 -678
  26. package/dist/client.mjs +685 -678
  27. package/dist/device/device-management.d.ts +4 -0
  28. package/dist/device-template-catalogue.d.ts +67 -0
  29. package/dist/device-template-catalogue.js +361 -0
  30. package/dist/device-template-catalogue.mjs +346 -0
  31. package/dist/expression/device-template.d.ts +5 -6
  32. package/dist/generated/addon-api.d.ts +43 -0
  33. package/dist/generated/cap-vocabulary.d.ts +1 -1
  34. package/dist/generated/capability-router-map.d.ts +5 -2
  35. package/dist/generated/device-proxy.d.ts +1 -1
  36. package/dist/generated/history-catalog.d.ts +6 -1
  37. package/dist/generated/method-access-map.d.ts +1 -1
  38. package/dist/generated/method-device-selectors.d.ts +2 -2
  39. package/dist/generated/system-proxy.d.ts +2 -0
  40. package/dist/history/primary-series.d.ts +10 -0
  41. package/dist/index.d.ts +7 -1
  42. package/dist/index.js +4110 -3735
  43. package/dist/index.mjs +4076 -3736
  44. package/dist/{sleep-CsIzA4m_.js → sleep-BURDyp_n.js} +7 -1
  45. package/dist/{sleep-CLDVTB5R.mjs → sleep-C9EWTQr9.mjs} +7 -1
  46. package/dist/tags/tag.d.ts +56 -0
  47. package/package.json +6 -1
@@ -0,0 +1,346 @@
1
+ import { z } from "zod";
2
+ //#region src/device-template-catalogue.ts
3
+ /**
4
+ * The one catalogue of what a device template may name (D1021, D1029).
5
+ *
6
+ * Filters, the `range` global and the reserved names (`now`, `camera`, the
7
+ * caller's recognition values) are listed here. The grammar's allow-list and
8
+ * argument caps are derived from this module; nothing else keeps a second list.
9
+ * The renderer imports this module through the
10
+ * `@camstack/types/device-template-catalogue` subpath, never the types barrel
11
+ * (D453), and sends the derived caps to the worker. The worker does not import it.
12
+ */
13
+ var DEVICE_TEMPLATE_CATALOGUE_KINDS = [
14
+ "filter",
15
+ "global",
16
+ "variable"
17
+ ];
18
+ var DEVICE_TEMPLATE_CATALOGUE_CATEGORIES = [
19
+ "number",
20
+ "unit",
21
+ "text",
22
+ "state",
23
+ "time",
24
+ "fallback",
25
+ "loop",
26
+ "variable"
27
+ ];
28
+ var DEVICE_TEMPLATE_PARAM_TYPES = [
29
+ "string",
30
+ "number",
31
+ "boolean"
32
+ ];
33
+ var deviceTemplateParamSchema = z.object({
34
+ name: z.string().min(1),
35
+ type: z.enum(DEVICE_TEMPLATE_PARAM_TYPES),
36
+ optional: z.boolean(),
37
+ default: z.union([
38
+ z.string(),
39
+ z.number(),
40
+ z.boolean()
41
+ ]).optional()
42
+ });
43
+ var deviceTemplateCatalogueEntrySchema = z.object({
44
+ name: z.string().min(1),
45
+ kind: z.enum(DEVICE_TEMPLATE_CATALOGUE_KINDS),
46
+ category: z.enum(DEVICE_TEMPLATE_CATALOGUE_CATEGORIES),
47
+ params: z.array(deviceTemplateParamSchema),
48
+ descriptionKey: z.string().min(1),
49
+ exampleKey: z.string().min(1)
50
+ });
51
+ function param(name, type, optional, fallback) {
52
+ return fallback === void 0 ? {
53
+ name,
54
+ type,
55
+ optional
56
+ } : {
57
+ name,
58
+ type,
59
+ optional,
60
+ default: fallback
61
+ };
62
+ }
63
+ function entry(name, kind, category, params) {
64
+ return {
65
+ name,
66
+ kind,
67
+ category,
68
+ params: [...params],
69
+ descriptionKey: `uiLibrary.deviceTemplateCatalogue.${name}.description`,
70
+ exampleKey: `uiLibrary.deviceTemplateCatalogue.${name}.example`
71
+ };
72
+ }
73
+ var DIGITS = param("digits", "number", true, 0);
74
+ var FALLBACK_TEXT = param("fallback", "string", false);
75
+ var FALSY = param("falsy", "boolean", true, false);
76
+ /** Every name the engine allows, in the order operators meet them. */
77
+ var DEVICE_TEMPLATE_CATALOGUE = [
78
+ entry("unit", "filter", "unit", [param("symbol", "string", false), param("from", "string", true)]),
79
+ entry("round", "filter", "number", [DIGITS]),
80
+ entry("trunc", "filter", "number", [DIGITS]),
81
+ entry("onoff", "filter", "state", []),
82
+ entry("default", "filter", "fallback", [FALLBACK_TEXT, FALSY]),
83
+ entry("since", "filter", "time", []),
84
+ entry("ago", "filter", "time", []),
85
+ entry("format", "filter", "text", [param("pattern", "string", false)]),
86
+ entry("upper", "filter", "text", []),
87
+ entry("lower", "filter", "text", []),
88
+ entry("title", "filter", "text", []),
89
+ entry("capitalize", "filter", "text", []),
90
+ entry("trim", "filter", "text", []),
91
+ entry("abs", "filter", "number", []),
92
+ entry("int", "filter", "number", [param("fallback", "number", true, 0)]),
93
+ entry("float", "filter", "number", [param("fallback", "number", true, 0)]),
94
+ entry("length", "filter", "text", []),
95
+ entry("d", "filter", "fallback", [FALLBACK_TEXT, FALSY]),
96
+ entry("join", "filter", "text", [param("separator", "string", true, "")]),
97
+ entry("replace", "filter", "text", [
98
+ param("old", "string", false),
99
+ param("new", "string", false),
100
+ param("count", "number", true)
101
+ ]),
102
+ entry("first", "filter", "loop", []),
103
+ entry("last", "filter", "loop", []),
104
+ entry("sort", "filter", "loop", [param("reverse", "boolean", true, false), param("caseSensitive", "boolean", true, false)]),
105
+ entry("reverse", "filter", "loop", []),
106
+ entry("sum", "filter", "number", []),
107
+ entry("string", "filter", "text", []),
108
+ entry("list", "filter", "loop", []),
109
+ entry("truncate", "filter", "text", [
110
+ param("length", "number", false),
111
+ param("killwords", "boolean", true, false),
112
+ param("end", "string", true, "…")
113
+ ]),
114
+ entry("time", "filter", "time", [param("pattern", "string", false)]),
115
+ entry("range", "global", "loop", [
116
+ param("stop", "number", false),
117
+ param("start", "number", true, 0),
118
+ param("step", "number", true, 1)
119
+ ]),
120
+ entry("now", "variable", "time", []),
121
+ entry("camera", "variable", "variable", []),
122
+ entry("loop", "variable", "loop", []),
123
+ entry("lastPerson", "variable", "variable", []),
124
+ entry("lastPlate", "variable", "variable", [])
125
+ ];
126
+ var COPY = {
127
+ unit: {
128
+ description: ["Converts a number from the field’s base unit and prints the symbol.", "Converte un numero dall’unità di base del campo e stampa il simbolo."],
129
+ example: ["{{ garage.temperature | unit('°C') }}", "{{ garage.temperature | unit('°C') }}"]
130
+ },
131
+ round: {
132
+ description: ["Rounds a number to the given decimals.", "Arrotonda un numero ai decimali indicati."],
133
+ example: ["{{ garage.temperature | round(1) }}", "{{ garage.temperature | round(1) }}"]
134
+ },
135
+ trunc: {
136
+ description: ["Cuts decimals toward zero, without rounding.", "Taglia i decimali verso zero, senza arrotondare."],
137
+ example: ["{{ garage.temperature | trunc(1) }}", "{{ garage.temperature | trunc(1) }}"]
138
+ },
139
+ onoff: {
140
+ description: ["Prints a boolean as ON or OFF.", "Stampa un sì/no come ON oppure OFF."],
141
+ example: ["{{ garage.switch | onoff }}", "{{ garage.switch | onoff }}"]
142
+ },
143
+ default: {
144
+ description: ["Replaces a missing value. The second argument also replaces a false or zero.", "Sostituisce un valore assente. Il secondo argomento sostituisce anche falso o zero."],
145
+ example: ["{{ camera.lastPerson | default('') }}", "{{ camera.lastPerson | default('') }}"]
146
+ },
147
+ since: {
148
+ description: ["How long ago a timestamp was, as “5 min”.", "Quanto tempo fa era un istante, come «5 min»."],
149
+ example: ["{{ garage.updated | since }}", "{{ garage.updated | since }}"]
150
+ },
151
+ ago: {
152
+ description: ["The same duration as since, followed by “ago”.", "La stessa durata di since, seguita da «ago»."],
153
+ example: ["{{ garage.updated | ago }}", "{{ garage.updated | ago }}"]
154
+ },
155
+ format: {
156
+ description: ["Prints one value with a single %s, %d or %.Nf placeholder.", "Stampa un valore con un solo segnaposto %s, %d o %.Nf."],
157
+ example: ["{{ garage.temperature | format('%.1f') }}", "{{ garage.temperature | format('%.1f') }}"]
158
+ },
159
+ upper: {
160
+ description: ["Uppercase text.", "Testo in maiuscolo."],
161
+ example: ["{{ camera.lastPerson | upper }}", "{{ camera.lastPerson | upper }}"]
162
+ },
163
+ lower: {
164
+ description: ["Lowercase text.", "Testo in minuscolo."],
165
+ example: ["{{ camera.lastPlate | lower }}", "{{ camera.lastPlate | lower }}"]
166
+ },
167
+ title: {
168
+ description: ["Capitalises each word.", "Mette la maiuscola a ogni parola."],
169
+ example: ["{{ camera.lastPerson | title }}", "{{ camera.lastPerson | title }}"]
170
+ },
171
+ capitalize: {
172
+ description: ["Capitalises the first letter.", "Mette la maiuscola alla prima lettera."],
173
+ example: ["{{ camera.lastPerson | capitalize }}", "{{ camera.lastPerson | capitalize }}"]
174
+ },
175
+ trim: {
176
+ description: ["Removes spaces at both ends.", "Toglie gli spazi alle estremità."],
177
+ example: ["{{ camera.lastPerson | trim }}", "{{ camera.lastPerson | trim }}"]
178
+ },
179
+ abs: {
180
+ description: ["The absolute value of a number.", "Il valore assoluto di un numero."],
181
+ example: ["{{ garage.power | abs }}", "{{ garage.power | abs }}"]
182
+ },
183
+ int: {
184
+ description: ["The whole part of a number.", "La parte intera di un numero."],
185
+ example: ["{{ garage.temperature | int }}", "{{ garage.temperature | int }}"]
186
+ },
187
+ float: {
188
+ description: ["Reads the value as a decimal number.", "Legge il valore come numero decimale."],
189
+ example: ["{{ garage.temperature | float }}", "{{ garage.temperature | float }}"]
190
+ },
191
+ length: {
192
+ description: ["How many characters or items.", "Quanti caratteri o elementi."],
193
+ example: ["{{ camera.lastPerson | length }}", "{{ camera.lastPerson | length }}"]
194
+ },
195
+ d: {
196
+ description: ["The short name of default.", "Il nome breve di default."],
197
+ example: ["{{ camera.lastPerson | d('') }}", "{{ camera.lastPerson | d('') }}"]
198
+ },
199
+ join: {
200
+ description: ["Joins a list with a separator.", "Unisce un elenco con un separatore."],
201
+ example: ["{{ range(3) | join(', ') }}", "{{ range(3) | join(', ') }}"]
202
+ },
203
+ replace: {
204
+ description: ["Replaces text, optionally only the first few times.", "Sostituisce del testo, volendo solo le prime volte."],
205
+ example: ["{{ camera.lastPlate | replace(' ', '') }}", "{{ camera.lastPlate | replace(' ', '') }}"]
206
+ },
207
+ first: {
208
+ description: ["The first item of a list.", "Il primo elemento di un elenco."],
209
+ example: ["{{ range(3) | first }}", "{{ range(3) | first }}"]
210
+ },
211
+ last: {
212
+ description: ["The last item of a list.", "L’ultimo elemento di un elenco."],
213
+ example: ["{{ range(3) | last }}", "{{ range(3) | last }}"]
214
+ },
215
+ sort: {
216
+ description: ["Sorts a list. The arguments reverse it or keep case.", "Ordina un elenco. Gli argomenti lo invertono o rispettano le maiuscole."],
217
+ example: ["{{ range(3) | reverse | sort }}", "{{ range(3) | reverse | sort }}"]
218
+ },
219
+ reverse: {
220
+ description: ["Reverses a list.", "Inverte un elenco."],
221
+ example: ["{{ range(3) | reverse }}", "{{ range(3) | reverse }}"]
222
+ },
223
+ sum: {
224
+ description: ["Adds the numbers in a list.", "Somma i numeri di un elenco."],
225
+ example: ["{{ range(3) | sum }}", "{{ range(3) | sum }}"]
226
+ },
227
+ string: {
228
+ description: ["Prints the value as text.", "Stampa il valore come testo."],
229
+ example: ["{{ garage.temperature | string }}", "{{ garage.temperature | string }}"]
230
+ },
231
+ list: {
232
+ description: ["Wraps the value in a list.", "Mette il valore in un elenco."],
233
+ example: ["{{ garage.temperature | list }}", "{{ garage.temperature | list }}"]
234
+ },
235
+ truncate: {
236
+ description: ["Shortens text to a length, with an ending.", "Accorcia il testo a una lunghezza, con una chiusura."],
237
+ example: ["{{ camera.lastPerson | truncate(12) }}", "{{ camera.lastPerson | truncate(12) }}"]
238
+ },
239
+ time: {
240
+ description: ["Prints a timestamp in the server’s time zone. Tokens: YYYY MM DD HH mm ss.", "Stampa un istante nel fuso del server. Segni: YYYY MM DD HH mm ss."],
241
+ example: ["{{ now | time('HH:mm') }}", "{{ now | time('HH:mm') }}"]
242
+ },
243
+ range: {
244
+ description: ["The integers up to stop, or from start to stop by step. At most 1000 items.", "Gli interi fino a stop, oppure da start a stop con step. Al massimo 1000 elementi."],
245
+ example: ["{% for i in range(3) %}{{ i }}{% endfor %}", "{% for i in range(3) %}{{ i }}{% endfor %}"]
246
+ },
247
+ now: {
248
+ description: ["The hub clock. A bare now prints ISO; time prints a pattern.", "L’orologio dell’hub. now da solo stampa ISO; time stampa un formato."],
249
+ example: ["{{ now | time('HH:mm') }}", "{{ now | time('HH:mm') }}"]
250
+ },
251
+ camera: {
252
+ description: ["The device this text is written for. It stays correct when the text is copied to another camera.", "Il dispositivo per cui è scritto il testo. Resta corretto se il testo viene copiato su un’altra telecamera."],
253
+ example: ["{{ camera.temperature }}", "{{ camera.temperature }}"]
254
+ },
255
+ loop: {
256
+ description: ["The for-loop counter (index, length) inside {% for %}.", "Il contatore del ciclo (index, length) dentro {% for %}."],
257
+ example: ["{% for i in range(3) %}{{ loop.index }}{% endfor %}", "{% for i in range(3) %}{{ loop.index }}{% endfor %}"]
258
+ },
259
+ lastPerson: {
260
+ description: ["The last person recognised on this camera, empty until there is one.", "L’ultima persona riconosciuta su questa telecamera, vuota finché non ce n’è una."],
261
+ example: ["{{ camera.lastPerson }}", "{{ camera.lastPerson }}"]
262
+ },
263
+ lastPlate: {
264
+ description: ["The last plate recognised on this camera, empty until there is one.", "L’ultima targa riconosciuta su questa telecamera, vuota finché non ce n’è una."],
265
+ example: ["{{ camera.lastPlate }}", "{{ camera.lastPlate }}"]
266
+ }
267
+ };
268
+ function buildText() {
269
+ const out = {};
270
+ for (const item of DEVICE_TEMPLATE_CATALOGUE) {
271
+ const row = COPY[item.name];
272
+ if (row === void 0) continue;
273
+ out[item.descriptionKey] = {
274
+ en: row.description[0],
275
+ it: row.description[1]
276
+ };
277
+ out[item.exampleKey] = {
278
+ en: row.example[0],
279
+ it: row.example[1]
280
+ };
281
+ }
282
+ return out;
283
+ }
284
+ /** English and Italian for every description and example key. */
285
+ var DEVICE_TEMPLATE_CATALOGUE_TEXT = buildText();
286
+ /** Names a template may use after `|`. Order matches the catalogue. */
287
+ function deviceTemplateFilterNames() {
288
+ return DEVICE_TEMPLATE_CATALOGUE.filter((item) => item.kind === "filter").map((item) => item.name);
289
+ }
290
+ /**
291
+ * How many arguments a filter may take after its input. Derived from the
292
+ * catalogue's parameter list — the grammar refuses anything past this.
293
+ */
294
+ function deviceTemplateFilterMaxParams() {
295
+ const out = {};
296
+ for (const item of DEVICE_TEMPLATE_CATALOGUE) {
297
+ if (item.kind !== "filter") continue;
298
+ out[item.name] = item.params.length;
299
+ }
300
+ return out;
301
+ }
302
+ /** Globals a template may call, with how many numbers each takes. */
303
+ function deviceTemplateCallableBounds() {
304
+ return DEVICE_TEMPLATE_CATALOGUE.filter((item) => item.kind === "global").map((item) => ({
305
+ name: item.name,
306
+ min: Math.max(1, item.params.filter((p) => !p.optional).length),
307
+ max: item.params.length
308
+ }));
309
+ }
310
+ var ROOT_VARIABLES = new Set([
311
+ "now",
312
+ "camera",
313
+ "loop"
314
+ ]);
315
+ /** Names offered at the start of `{{ }}`: the clock, the for-loop, and `camera` when the field has a device. */
316
+ function deviceTemplateRootVariables() {
317
+ return DEVICE_TEMPLATE_CATALOGUE.filter((item) => item.kind === "variable" && ROOT_VARIABLES.has(item.name));
318
+ }
319
+ /** Values the caller stores on `camera` (`lastPerson`, `lastPlate`), not device fields. */
320
+ function deviceTemplateCameraValues() {
321
+ return DEVICE_TEMPLATE_CATALOGUE.filter((item) => item.kind === "variable" && !ROOT_VARIABLES.has(item.name));
322
+ }
323
+ function deviceTemplateSignature(item) {
324
+ if (item.kind === "variable") return item.name;
325
+ const args = item.params.map((p) => p.optional ? `${p.name}?` : p.name).join(", ");
326
+ return `${item.name}(${args})`;
327
+ }
328
+ /** The operator-facing English (or Italian) sentence for a catalogue key. */
329
+ function deviceTemplateCatalogueSentence(key, language) {
330
+ return DEVICE_TEMPLATE_CATALOGUE_TEXT[key]?.[language];
331
+ }
332
+ /** A markdown table of the catalogue, for the public docs page. */
333
+ function deviceTemplateCatalogueMarkdown() {
334
+ const header = ["| Name | Kind | What it does | Example |", "| --- | --- | --- | --- |"];
335
+ const rows = DEVICE_TEMPLATE_CATALOGUE.map((item) => {
336
+ const description = escapeCell(deviceTemplateCatalogueSentence(item.descriptionKey, "en") ?? "");
337
+ const example = escapeCell(deviceTemplateCatalogueSentence(item.exampleKey, "en") ?? "");
338
+ return `| \`${deviceTemplateSignature(item)}\` | ${item.kind} | ${description} | \`${example}\` |`;
339
+ });
340
+ return [...header, ...rows].join("\n");
341
+ }
342
+ function escapeCell(text) {
343
+ return text.replaceAll("|", "\\|");
344
+ }
345
+ //#endregion
346
+ export { DEVICE_TEMPLATE_CATALOGUE, DEVICE_TEMPLATE_CATALOGUE_CATEGORIES, DEVICE_TEMPLATE_CATALOGUE_KINDS, DEVICE_TEMPLATE_CATALOGUE_TEXT, DEVICE_TEMPLATE_PARAM_TYPES, deviceTemplateCallableBounds, deviceTemplateCameraValues, deviceTemplateCatalogueEntrySchema, deviceTemplateCatalogueMarkdown, deviceTemplateCatalogueSentence, deviceTemplateFilterMaxParams, deviceTemplateFilterNames, deviceTemplateParamSchema, deviceTemplateRootVariables, deviceTemplateSignature };
@@ -48,12 +48,11 @@ export declare const DeviceTemplateThisDeviceSchema: z.ZodObject<{
48
48
  export type DeviceTemplateThisDevice = z.infer<typeof DeviceTemplateThisDeviceSchema>;
49
49
  /** The synthetic slice `thisDevice.values` is exposed under. */
50
50
  export declare const DEVICE_TEMPLATE_VALUES_CAP = "values";
51
- /** The filters a template may use. Anything else is refused at parse time. */
52
- export declare const DEVICE_TEMPLATE_FILTERS: readonly ['unit', 'round', 'trunc',
53
- /** `{{ x | onoff }}`: `true` reads ON, `false` OFF, anything else is left as it is. */
54
- 'onoff', 'default', 'since', 'ago', 'format', 'upper', 'lower', 'title', 'capitalize', 'trim', 'abs', 'int', 'float', 'length', 'd', 'join', 'replace', 'first', 'last', 'sort', 'reverse', 'sum', 'string', 'list', 'truncate',
55
- /** `{{ now | time('HH:mm') }}`: an epoch timestamp as clock text in the server's zone. */
56
- 'time'];
51
+ /**
52
+ * The filters a template may use, derived from the catalogue. Anything else
53
+ * is refused at parse time.
54
+ */
55
+ export declare const DEVICE_TEMPLATE_FILTERS: readonly string[];
57
56
  export type DeviceTemplateFilter = (typeof DEVICE_TEMPLATE_FILTERS)[number];
58
57
  /** A device-state reference found in a template: the alias and the literal path after it. */
59
58
  export interface DeviceTemplateRef {
@@ -150,6 +150,7 @@ import type { streamParamsCapability } from '../capabilities/stream-params.cap.j
150
150
  import type { streamSignalsCapability } from '../capabilities/stream-signals.cap.js';
151
151
  import type { switchCapability } from '../capabilities/switch.cap.js';
152
152
  import type { systemCapability } from '../capabilities/system.cap.js';
153
+ import type { tagsCapability } from '../capabilities/tags.cap.js';
153
154
  import type { templateCapability } from '../capabilities/template.cap.js';
154
155
  import type { terminalSessionCapability } from '../capabilities/terminal-session.cap.js';
155
156
  import type { timedRunCapability } from '../capabilities/timed-run.cap.js';
@@ -2719,6 +2720,13 @@ export type AppRouter = TrpcCoreRouter<{
2719
2720
  output: z.infer<typeof deviceManagerCapability.methods.setLocation.output>;
2720
2721
  meta: object;
2721
2722
  }>;
2723
+ setTags: TRPCMutationProcedure<{
2724
+ input: {
2725
+ [x: string]: unknown;
2726
+ } & z.input<typeof deviceManagerCapability.methods.setTags.input>;
2727
+ output: z.infer<typeof deviceManagerCapability.methods.setTags.output>;
2728
+ meta: object;
2729
+ }>;
2722
2730
  setType: TRPCMutationProcedure<{
2723
2731
  input: {
2724
2732
  [x: string]: unknown;
@@ -10844,6 +10852,41 @@ export type AppRouter = TrpcCoreRouter<{
10844
10852
  meta: object;
10845
10853
  }>;
10846
10854
  }>>;
10855
+ tags: TRPCBuiltRouter<{
10856
+ ctx: TrpcContext;
10857
+ meta: object;
10858
+ errorShape: AugmentedErrorShape;
10859
+ transformer: true;
10860
+ }, TRPCDecorateCreateRouterOptions<{
10861
+ list: TRPCQueryProcedure<{
10862
+ input: {
10863
+ [x: string]: unknown;
10864
+ } & z.input<typeof tagsCapability.methods.list.input>;
10865
+ output: z.infer<typeof tagsCapability.methods.list.output>;
10866
+ meta: object;
10867
+ }>;
10868
+ setStyle: TRPCMutationProcedure<{
10869
+ input: {
10870
+ [x: string]: unknown;
10871
+ } & z.input<typeof tagsCapability.methods.setStyle.input>;
10872
+ output: z.infer<typeof tagsCapability.methods.setStyle.output>;
10873
+ meta: object;
10874
+ }>;
10875
+ rename: TRPCMutationProcedure<{
10876
+ input: {
10877
+ [x: string]: unknown;
10878
+ } & z.input<typeof tagsCapability.methods.rename.input>;
10879
+ output: z.infer<typeof tagsCapability.methods.rename.output>;
10880
+ meta: object;
10881
+ }>;
10882
+ remove: TRPCMutationProcedure<{
10883
+ input: {
10884
+ [x: string]: unknown;
10885
+ } & z.input<typeof tagsCapability.methods.remove.input>;
10886
+ output: z.infer<typeof tagsCapability.methods.remove.output>;
10887
+ meta: object;
10888
+ }>;
10889
+ }>>;
10847
10890
  tamper: TRPCBuiltRouter<{
10848
10891
  ctx: TrpcContext;
10849
10892
  meta: object;
@@ -1,7 +1,7 @@
1
1
  import type { CapVocabularyMap } from '../device/cap-vocabulary/types.js';
2
2
  /**
3
3
  * THE cap vocabulary (D920), projected from the declarations of every
4
- * `*.cap.ts` (D1050): 208 caps (107 device, 101 system).
4
+ * `*.cap.ts` (D1050): 209 caps (107 device, 102 system).
5
5
  * Device caps in their declared picker order, then system caps by name.
6
6
  */
7
7
  export declare const CAP_VOCABULARY: CapVocabularyMap;
@@ -181,6 +181,7 @@ export { streamParamsCapability } from '../capabilities/stream-params.cap.js';
181
181
  export { streamSignalsCapability } from '../capabilities/stream-signals.cap.js';
182
182
  export { switchCapability } from '../capabilities/switch.cap.js';
183
183
  export { systemCapability } from '../capabilities/system.cap.js';
184
+ export { tagsCapability } from '../capabilities/tags.cap.js';
184
185
  export { tamperCapability } from '../capabilities/tamper.cap.js';
185
186
  export { temperatureSensorCapability } from '../capabilities/temperature-sensor.cap.js';
186
187
  export { templateCapability } from '../capabilities/template.cap.js';
@@ -390,6 +391,7 @@ export declare const CAPABILITY_NAMES: {
390
391
  readonly streamSignals: 'stream-signals';
391
392
  readonly switch: 'switch';
392
393
  readonly system: 'system';
394
+ readonly tags: 'tags';
393
395
  readonly tamper: 'tamper';
394
396
  readonly temperatureSensor: 'temperature-sensor';
395
397
  readonly template: 'template';
@@ -612,6 +614,7 @@ export interface CapabilityRouterMap<TRouter = unknown> {
612
614
  readonly streamSignals: TRouter;
613
615
  readonly switch: TRouter;
614
616
  readonly system: TRouter;
617
+ readonly tags: TRouter;
615
618
  readonly tamper: TRouter;
616
619
  readonly temperatureSensor: TRouter;
617
620
  readonly template: TRouter;
@@ -638,8 +641,8 @@ export interface CapabilityRouterMap<TRouter = unknown> {
638
641
  readonly zoneRules: TRouter;
639
642
  readonly zones: TRouter;
640
643
  }
641
- /** Capability names whose mode is `singleton` (168 caps). */
642
- export declare const SINGLETON_CAPABILITY_NAMES: readonly ['accessories', 'actions', 'addon-pages', 'addon-settings', 'addon-widgets', 'addons', 'admin-ui', 'air-quality-sensor', 'alarm-panel', 'alerts', 'ambient-light-sensor', 'audio-analysis', 'audio-analyzer', 'audio-codec', 'audio-metrics', 'automation-control', 'backup', 'battery', 'binary', 'brightness', 'button', 'calendars', 'camera-credentials', 'camera-grid-layout', 'camera-pipeline-config', 'camera-streams', 'carbon-monoxide', 'climate-control', 'cluster-update', 'color', 'composer', 'connectivity', 'consumables', 'contact', 'control', 'core-blocks', 'cover', 'database-snapshot', 'day-night', 'decoder', 'detection-pipeline', 'device-admin-link', 'device-credentials', 'device-history', 'device-manager', 'device-ops', 'device-runs', 'device-state', 'device-status', 'device-transitions', 'dishwasher', 'display-palette', 'do-not-disturb', 'doorbell', 'energy-system', 'enum-sensor', 'error', 'event-emitter', 'face-gallery', 'fan-control', 'fan-presets', 'feature-probe', 'filesystem-browse', 'flood', 'gas', 'group-active', 'group-commands', 'group-status', 'heat-pump-control', 'heat-pump-status', 'heating-valve', 'hero-layout', 'humidifier', 'humidity-sensor', 'image', 'image-settings', 'integrations', 'intercom', 'ir-transmitter', 'keychain', 'keychain-admin', 'lawn-mower-control', 'llm-runtime', 'local-network', 'lock-control', 'media-player', 'meter', 'metrics-provider', 'migrations', 'model-convert', 'model-distributor', 'motion', 'motion-detection', 'motion-trigger', 'motion-zones', 'native-object-detection', 'navigation', 'network-link', 'network-quality', 'node-certificates', 'nodes', 'notification-rules', 'notifier', 'numeric-sensor', 'osd', 'osd-manager', 'pet-feeder', 'pet-fountain', 'pipeline-analytics', 'pipeline-executor', 'pipeline-orchestrator', 'pipeline-runner', 'plate-gallery', 'platform-probe', 'power-meter', 'power-source', 'presence', 'pressure-sensor', 'privacy-mask', 'ptz', 'ptz-autotrack', 'pump-cycle', 'reboot', 'record-entries', 'recording-archive', 'recording-export', 'recording-onboard', 'recording-signal', 'records', 'remote', 'running-state', 'scene-monitor', 'schedulers', 'script-runner', 'server-management', 'settings-store', 'smoke', 'snapshot', 'sso-bridge', 'storage', 'storage-admin', 'storage-migration', 'stream-broker', 'stream-catalog', 'stream-params', 'stream-signals', 'switch', 'system', 'tamper', 'temperature-sensor', 'terminal-session', 'timed-run', 'toast', 'training', 'update', 'user-management', 'vacuum-control', 'valve', 'vector-store', 'vibration', 'viewer-ui', 'water-heater', 'weather', 'weather-station', 'webrtc-session', 'zone-analytics', 'zone-rules', 'zones'];
644
+ /** Capability names whose mode is `singleton` (169 caps). */
645
+ export declare const SINGLETON_CAPABILITY_NAMES: readonly ['accessories', 'actions', 'addon-pages', 'addon-settings', 'addon-widgets', 'addons', 'admin-ui', 'air-quality-sensor', 'alarm-panel', 'alerts', 'ambient-light-sensor', 'audio-analysis', 'audio-analyzer', 'audio-codec', 'audio-metrics', 'automation-control', 'backup', 'battery', 'binary', 'brightness', 'button', 'calendars', 'camera-credentials', 'camera-grid-layout', 'camera-pipeline-config', 'camera-streams', 'carbon-monoxide', 'climate-control', 'cluster-update', 'color', 'composer', 'connectivity', 'consumables', 'contact', 'control', 'core-blocks', 'cover', 'database-snapshot', 'day-night', 'decoder', 'detection-pipeline', 'device-admin-link', 'device-credentials', 'device-history', 'device-manager', 'device-ops', 'device-runs', 'device-state', 'device-status', 'device-transitions', 'dishwasher', 'display-palette', 'do-not-disturb', 'doorbell', 'energy-system', 'enum-sensor', 'error', 'event-emitter', 'face-gallery', 'fan-control', 'fan-presets', 'feature-probe', 'filesystem-browse', 'flood', 'gas', 'group-active', 'group-commands', 'group-status', 'heat-pump-control', 'heat-pump-status', 'heating-valve', 'hero-layout', 'humidifier', 'humidity-sensor', 'image', 'image-settings', 'integrations', 'intercom', 'ir-transmitter', 'keychain', 'keychain-admin', 'lawn-mower-control', 'llm-runtime', 'local-network', 'lock-control', 'media-player', 'meter', 'metrics-provider', 'migrations', 'model-convert', 'model-distributor', 'motion', 'motion-detection', 'motion-trigger', 'motion-zones', 'native-object-detection', 'navigation', 'network-link', 'network-quality', 'node-certificates', 'nodes', 'notification-rules', 'notifier', 'numeric-sensor', 'osd', 'osd-manager', 'pet-feeder', 'pet-fountain', 'pipeline-analytics', 'pipeline-executor', 'pipeline-orchestrator', 'pipeline-runner', 'plate-gallery', 'platform-probe', 'power-meter', 'power-source', 'presence', 'pressure-sensor', 'privacy-mask', 'ptz', 'ptz-autotrack', 'pump-cycle', 'reboot', 'record-entries', 'recording-archive', 'recording-export', 'recording-onboard', 'recording-signal', 'records', 'remote', 'running-state', 'scene-monitor', 'schedulers', 'script-runner', 'server-management', 'settings-store', 'smoke', 'snapshot', 'sso-bridge', 'storage', 'storage-admin', 'storage-migration', 'stream-broker', 'stream-catalog', 'stream-params', 'stream-signals', 'switch', 'system', 'tags', 'tamper', 'temperature-sensor', 'terminal-session', 'timed-run', 'toast', 'training', 'update', 'user-management', 'vacuum-control', 'valve', 'vector-store', 'vibration', 'viewer-ui', 'water-heater', 'weather', 'weather-station', 'webrtc-session', 'zone-analytics', 'zone-rules', 'zones'];
643
646
  /** Union of singleton capability names (literal string union). */
644
647
  export type SingletonCapabilityName = typeof SINGLETON_CAPABILITY_NAMES[number];
645
648
  /** Capability names whose mode is `collection` (40 caps). */
@@ -353,7 +353,7 @@ export interface DeviceProxy {
353
353
  readonly deviceAdoption: Pick<InferDeviceProxyCap<typeof deviceAdoptionCapability>, 'getStatus'>;
354
354
  readonly deviceExport: Pick<InferDeviceProxyCap<typeof deviceExportCapability>, 'getDeviceSettingsContribution' | 'getDeviceLiveContribution' | 'applyDeviceSettingsPatch'>;
355
355
  readonly deviceHistory: Pick<InferDeviceProxyCap<typeof deviceHistoryCapability>, 'listSeries' | 'query' | 'getDeviceEnabled' | 'setDeviceEnabled'>;
356
- readonly deviceManager: Pick<InferDeviceProxyCap<typeof deviceManagerCapability>, 'loadConfig' | 'loadRuntimeState' | 'loadMeta' | 'setName' | 'setAlias' | 'setLocation' | 'setType' | 'setIntegrationId' | 'setLinkDeviceId' | 'setPrimaryChildEntityId' | 'setChildLayout' | 'setPrimaryChildPreference' | 'setDisplay' | 'getWireableFields' | 'setRole' | 'applyInitialMeta' | 'setMetadata' | 'setDisabled' | 'getDevice' | 'getLinkedDevices' | 'getStreamSources' | 'getConfigSchema' | 'getSettingsSchema' | 'updateConfig' | 'enable' | 'disable' | 'remove' | 'getStreamProfileMap' | 'setStreamProfileMap' | 'probeStreams' | 'getBindings' | 'setWrapperActive' | 'getWrapperActivation' | 'getDeviceSettingsAggregate' | 'getDeviceLiveInfoAggregate' | 'getDeviceAggregate' | 'runDeviceAction' | 'updateDeviceField' | 'updateDeviceFieldsBatch' | 'testField' | 'getDeviceStatusAggregate'>;
356
+ readonly deviceManager: Pick<InferDeviceProxyCap<typeof deviceManagerCapability>, 'loadConfig' | 'loadRuntimeState' | 'loadMeta' | 'setName' | 'setAlias' | 'setLocation' | 'setTags' | 'setType' | 'setIntegrationId' | 'setLinkDeviceId' | 'setPrimaryChildEntityId' | 'setChildLayout' | 'setPrimaryChildPreference' | 'setDisplay' | 'getWireableFields' | 'setRole' | 'applyInitialMeta' | 'setMetadata' | 'setDisabled' | 'getDevice' | 'getLinkedDevices' | 'getStreamSources' | 'getConfigSchema' | 'getSettingsSchema' | 'updateConfig' | 'enable' | 'disable' | 'remove' | 'getStreamProfileMap' | 'setStreamProfileMap' | 'probeStreams' | 'getBindings' | 'setWrapperActive' | 'getWrapperActivation' | 'getDeviceSettingsAggregate' | 'getDeviceLiveInfoAggregate' | 'getDeviceAggregate' | 'runDeviceAction' | 'updateDeviceField' | 'updateDeviceFieldsBatch' | 'testField' | 'getDeviceStatusAggregate'>;
357
357
  readonly deviceState: Pick<InferDeviceProxyCap<typeof deviceStateCapability>, 'getSnapshot' | 'getCapSlice' | 'setCapSlice' | 'claimFields' | 'patchOwnedFields' | 'releaseClaim' | 'getNativeCapSlice'>;
358
358
  readonly faceGallery: Pick<InferDeviceProxyCap<typeof faceGalleryCapability>, 'listRecentFaces' | 'getFaceByTrack'>;
359
359
  readonly networkQuality: Pick<InferDeviceProxyCap<typeof networkQualityCapability>, 'getDeviceStats' | 'reportClientStats'>;
@@ -1,4 +1,4 @@
1
- import type { CapabilityHistoryField, CapabilityHistoryItems } from '../capabilities/capability-definition.js';
1
+ import type { CapabilityHistoryField, CapabilityHistoryItems, CapabilityHistoryPrimary } from '../capabilities/capability-definition.js';
2
2
  /**
3
3
  * Cap history catalog, projected from every `*.cap.ts` `history` block.
4
4
  * 46 caps with series (124 series), 38 caps answered `'none'`.
@@ -11,6 +11,11 @@ export declare const HISTORY_CATALOG: Readonly<Record<string, Readonly<Record<st
11
11
  * the series key is `cap:<capName>.<path>[].<field>`.
12
12
  */
13
13
  export declare const HISTORY_ITEM_CATALOG: Readonly<Record<string, CapabilityHistoryItems>>;
14
+ /**
15
+ * The series a device card trends, per cap (`history.primary` + `history.priority`):
16
+ * 6 caps. The card shows the primary of the enabled cap with the highest priority.
17
+ */
18
+ export declare const HISTORY_PRIMARY: Readonly<Record<string, CapabilityHistoryPrimary>>;
14
19
  /** Caps that declared `history: 'none'`, sorted. */
15
20
  export declare const HISTORY_NONE_CAPS: readonly string[];
16
21
  /** The series specs of `capName`; empty for a `'none'` cap or an unknown one. */
@@ -6,7 +6,7 @@
6
6
  * scope+access check inside `protectedProcedure` (see
7
7
  * `server/backend/src/api/trpc/trpc.middleware.ts`).
8
8
  *
9
- * Coverage: 1496 method paths across 208 capabilities.
9
+ * Coverage: 1501 method paths across 209 capabilities.
10
10
  */
11
11
  import type { MethodRole } from '../auth/viewer-access.js';
12
12
  import type { CapabilityMethodAccess } from '../capabilities/capability-definition.js';
@@ -6,8 +6,8 @@
6
6
  * system-scope cap that takes a deviceId was previously never device-filtered
7
7
  * — see the generator header).
8
8
  *
9
- * Coverage: 623 methods carry a device reference, of which
10
- * 196 are on SYSTEM-scope caps.
9
+ * Coverage: 624 methods carry a device reference, of which
10
+ * 197 are on SYSTEM-scope caps.
11
11
  *
12
12
  * Top-level fields, number arrays, and one-level arrays of objects carrying
13
13
  * a numeric device field (targets[].deviceId) are all mapped; the matcher
@@ -58,6 +58,7 @@ import type { storageCapability } from '../capabilities/storage.cap.js';
58
58
  import type { storageMigrationCapability } from '../capabilities/storage-migration.cap.js';
59
59
  import type { streamBrokerCapability } from '../capabilities/stream-broker.cap.js';
60
60
  import type { systemCapability } from '../capabilities/system.cap.js';
61
+ import type { tagsCapability } from '../capabilities/tags.cap.js';
61
62
  import type { templateCapability } from '../capabilities/template.cap.js';
62
63
  import type { terminalSessionCapability } from '../capabilities/terminal-session.cap.js';
63
64
  import type { toastCapability } from '../capabilities/toast.cap.js';
@@ -131,6 +132,7 @@ export interface SystemProxy {
131
132
  readonly storageMigration: Pick<InferProvider<typeof storageMigrationCapability>, 'plan' | 'start' | 'status' | 'cancel' | 'movers' | 'moverClearance' | 'residue' | 'drain' | 'cleanupStart' | 'cleanupStatus' | 'cleanupCancel' | 'history'>;
132
133
  readonly streamBroker: Pick<InferProvider<typeof streamBrokerCapability>, 'fetchEventMedia' | 'listAllCameraStreams' | 'listAllProfileSlots' | 'getBrokerStats' | 'probeStream' | 'listClients' | 'getLiveViewerCounts' | 'killClient' | 'getStreamUrl' | 'getStreamWithCodec' | 'releaseStreamWithCodec' | 'acquireEgressTranscode' | 'releaseEgressTranscode' | 'subscribeAudioChunks' | 'pullAudioChunks' | 'unsubscribeAudioChunks' | 'setPreBufferDuration' | 'getPreBufferInfo' | 'getRtspPort' | 'getAllRtspEntries' | 'getRtspEntry' | 'regenerateRtspToken' | 'setRtspEnabled' | 'isRtspEnabled'>;
133
134
  readonly system: Pick<InferProvider<typeof systemCapability>, 'info' | 'health' | 'featureFlags' | 'networkAddresses' | 'getRetentionConfig' | 'setRetentionConfig' | 'forceRetentionCleanup' | 'getSiteLocation' | 'setSiteLocation' | 'detectSiteLocation' | 'getRequestCensus' | 'getLoadContributions' | 'getFailureContributions' | 'getLoggingSettings' | 'setLoggingSettings' | 'debugWatch'>;
135
+ readonly tags: Pick<InferProvider<typeof tagsCapability>, 'list' | 'setStyle' | 'rename' | 'remove'>;
134
136
  readonly template: Pick<InferProvider<typeof templateCapability>, 'list' | 'get' | 'create' | 'update' | 'delete'>;
135
137
  readonly terminalSession: Pick<InferProvider<typeof terminalSessionCapability>, 'listProfiles' | 'listLegacyCameras' | 'adoptLegacyMonitor' | 'listSessions' | 'serverShellStatus' | 'openSession' | 'resize' | 'pullOutput' | 'writeInput' | 'close'>;
136
138
  readonly toast: Pick<InferProvider<typeof toastCapability>, 'onToast'>;
@@ -0,0 +1,10 @@
1
+ /** The history series key of a cap's declared primary field; `null` when it declares none. */
2
+ export declare function primarySeriesKey(cap: string): string | null;
3
+ export interface PickPrimarySeriesInput {
4
+ /** The caps enabled on the device (its hero layout's bindings). A disabled cap is absent. */
5
+ readonly enabledCaps: readonly string[];
6
+ /** Whether the device has points for a series key. */
7
+ readonly hasData: (key: string) => boolean;
8
+ }
9
+ /** The card series of a device: the data-bearing primary of the highest-priority enabled cap. */
10
+ export declare function pickPrimarySeriesKey(input: PickPrimarySeriesInput): string | null;
package/dist/index.d.ts CHANGED
@@ -163,6 +163,8 @@ export type { AgentPipelineSettings, CameraPipelineSettings, DeviceStepConfig, }
163
163
  export { cameraScopedStepSettings, isModelScopedStepSettingKey, modelScopedStepSettingKeys, } from './types/agent-pipeline-settings.js';
164
164
  export { NODE_COLOR_IDS, NodeColorIdSchema, assignNodeColorId, } from './node-color.js';
165
165
  export type { NodeColorId } from './node-color.js';
166
+ export { DEFAULT_TAG_ICON, TAG_COLOR_IDS, TAG_NAME_MAX_LENGTH, TAGS_PER_RECORD_MAX, TagColorIdSchema, TagNameSchema, TagStyleSchema, TagsFieldSchema, defaultTagColorId, normalizeTags, removeFromTags, renameInTags, sameTag, tagKey, } from './tags/tag.js';
167
+ export type { TagColorId, TagName, TagStyle } from './tags/tag.js';
166
168
  export * from './types/analytics.js';
167
169
  export * from './types/appearance.js';
168
170
  export type { CameraPipelineConfig } from './types/camera-pipeline.js';
@@ -313,6 +315,8 @@ export { EventCategory, isOwnerOnlyEventCategory, OWNER_ONLY_EVENT_CATEGORIES, p
313
315
  export * from './enums/index.js';
314
316
  export type { CompileResult, EvaluateExpressionSourceResult, ExpressionBinaryOperator, ExpressionBindingSource, ExpressionBuiltin, ExpressionEvalHooks, ExpressionEvalOptions, ExpressionFieldBinding, ExpressionGlobalBinding, ExpressionLiteralBinding, ExpressionLogicalOperator, ExpressionNode, ExpressionNodePath, ExpressionSource, ExpressionSourceInput, ExpressionUnaryOperator, ExpressionValue, CountCallState, RoseCallState, StatefulCallState, StatefulCallInvocation, StatefulExpressionEnvironment, StatefulExpressionMemory, StatefulExpressionBuiltin, Keyword, ParsedExpression, Punctuator, Token, } from './expression/index.js';
315
317
  export { DEVICE_TEMPLATE_BUDGET_MS, DEVICE_TEMPLATE_FILTERS, DEVICE_TEMPLATE_MAX_LENGTH, DEVICE_TEMPLATE_MAX_OUTPUT, DEVICE_TEMPLATE_NOW_ALIAS, DEVICE_TEMPLATE_THIS_ALIAS, DEVICE_TEMPLATE_VALUES_CAP, DEVICE_TEMPLATE_UNAVAILABLE, DEVICE_TEMPLATE_REFUSAL_REASONS, DEVICE_TEMPLATE_TRACE_REASONS, DeviceTemplateRefusalSchema, DeviceTemplateRenderSchema, DeviceTemplateSchema, DeviceTemplateThisDeviceSchema, DeviceTemplateTraceEntrySchema, DeviceTemplateValueSchema, resolveTemplateRef, templateCapKey, } from './expression/device-template.js';
318
+ export { DEVICE_TEMPLATE_CATALOGUE, DEVICE_TEMPLATE_CATALOGUE_CATEGORIES, DEVICE_TEMPLATE_CATALOGUE_KINDS, DEVICE_TEMPLATE_CATALOGUE_TEXT, DEVICE_TEMPLATE_PARAM_TYPES, deviceTemplateCallableBounds, deviceTemplateCameraValues, deviceTemplateCatalogueEntrySchema, deviceTemplateCatalogueMarkdown, deviceTemplateCatalogueSentence, deviceTemplateFilterMaxParams, deviceTemplateFilterNames, deviceTemplateParamSchema, deviceTemplateRootVariables, deviceTemplateSignature, } from './device-template-catalogue.js';
319
+ export type { DeviceTemplateCallableBounds, DeviceTemplateCatalogueCategory, DeviceTemplateCatalogueEntry, DeviceTemplateCatalogueKind, DeviceTemplateCatalogueText, DeviceTemplateParam, DeviceTemplateParamType, } from './device-template-catalogue.js';
316
320
  export type { DeviceTemplateFilter, DeviceTemplateRef, DeviceTemplateRefusal, DeviceTemplateRefusalReason, DeviceTemplateRender, DeviceTemplateThisDevice, DeviceTemplateTraceEntry, DeviceTemplateTraceReason, DeviceTemplateView, ResolvedTemplateRef, } from './expression/device-template.js';
317
321
  export { compileExpression, compileExpressionSafe, cloneStatefulExpressionMemory, createExpressionScope, createStatefulExpressionMemory, EXPRESSION_BUILTIN_NAMES, EXPRESSION_BUILTINS, EXPRESSION_COMPILE_CACHE_CAPACITY, EXPRESSION_IDENTIFIER_RE, EXPRESSION_INJECTED_NOW, ExpressionBindingSourceSchema, ExpressionEvalError, ExpressionFieldBindingSchema, ExpressionGlobalBindingSchema, ExpressionLiteralBindingSchema, ExpressionParseError, ExpressionSourceSchema, evaluateAst, evaluateCount, disarmRoseMemory, evaluateExpressionSource, evaluateRose, evaluateStatefulExpressionCall, isStatefulBuiltin, MAX_EXPRESSION_AST_NODES, MAX_EXPRESSION_BINDINGS, MAX_EXPRESSION_CALL_ARGS, MAX_EXPRESSION_EVAL_STEPS, MAX_EXPRESSION_SOURCE_LENGTH, parseExpression, RESERVED_BINDING_NAMES, toExpressionValue, tokenize, validateExpressionSource, } from './expression/index.js';
318
322
  export type { AddonApi, AppRouter } from './generated/addon-api.js';
@@ -331,7 +335,9 @@ export { CAP_PROVIDER_KIND_MAP, getCapsByProviderKind, PROVIDER_KIND_CAP_NAMES,
331
335
  export type { RuntimeStatePolicy } from './generated/runtime-state-durability.js';
332
336
  export { isRestoredCap, RESTORED_CAP_NAMES, RUNTIME_STATE_POLICY, runtimeStatePolicyFor, } from './generated/runtime-state-durability.js';
333
337
  export { BucketAccumulator, bucketStartOf, type ClosedHistoryBucket, HISTORY_BUCKET_MS, MAX_REQUEUED_BUCKETS_PER_SERIES, } from './history/bucket-accumulator.js';
334
- export { HISTORY_CATALOG, HISTORY_ITEM_CATALOG, HISTORY_NONE_CAPS, historyFieldsFor, } from './generated/history-catalog.js';
338
+ export { pickPrimarySeriesKey, primarySeriesKey } from './history/primary-series.js';
339
+ export type { PickPrimarySeriesInput } from './history/primary-series.js';
340
+ export { HISTORY_CATALOG, HISTORY_ITEM_CATALOG, HISTORY_PRIMARY, HISTORY_NONE_CAPS, historyFieldsFor, } from './generated/history-catalog.js';
335
341
  export { CAP_CUSTOMIZE_CATALOG } from './generated/customize-catalog.js';
336
342
  export type { CustomizeCatalog, CustomizeCatalogField, CustomizeCatalogSource, CustomizeCatalogTarget, CustomizeCatalogTransform, } from './capabilities/customize-catalog.js';
337
343
  export { CAP_RUNTIME_FIELD_UNITS } from './generated/customize-catalog.js';