@camstack/types 1.2.415 → 1.2.417

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 (56) hide show
  1. package/dist/addon.js +1 -1
  2. package/dist/addon.mjs +1 -1
  3. package/dist/capabilities/air-quality-sensor.cap.d.ts +2 -8
  4. package/dist/capabilities/ambient-light-sensor.cap.d.ts +3 -14
  5. package/dist/capabilities/battery.cap.d.ts +9 -2
  6. package/dist/capabilities/binary.cap.d.ts +0 -5
  7. package/dist/capabilities/capability-definition.d.ts +6 -6
  8. package/dist/capabilities/consumables.cap.d.ts +30 -41
  9. package/dist/capabilities/control.cap.d.ts +3 -25
  10. package/dist/capabilities/core-blocks.cap.d.ts +1 -0
  11. package/dist/capabilities/customize-catalog.d.ts +26 -8
  12. package/dist/capabilities/customize-spec.d.ts +8 -4
  13. package/dist/capabilities/device-manager.cap.d.ts +79 -0
  14. package/dist/capabilities/device-provider.cap.d.ts +36 -0
  15. package/dist/capabilities/doorbell.cap.d.ts +1 -0
  16. package/dist/capabilities/enum-sensor.cap.d.ts +5 -17
  17. package/dist/capabilities/humidity-sensor.cap.d.ts +3 -14
  18. package/dist/capabilities/index.d.ts +1 -1
  19. package/dist/capabilities/motion.cap.d.ts +1 -1
  20. package/dist/capabilities/numeric-sensor.cap.d.ts +8 -16
  21. package/dist/capabilities/pet-feeder.cap.d.ts +1 -1
  22. package/dist/capabilities/power-meter.cap.d.ts +0 -11
  23. package/dist/capabilities/pressure-sensor.cap.d.ts +3 -9
  24. package/dist/capabilities/running-state.cap.d.ts +2 -2
  25. package/dist/capabilities/runtime-field-unit.d.ts +1 -0
  26. package/dist/capabilities/runtime-field-units.d.ts +8 -0
  27. package/dist/capabilities/switch.cap.d.ts +0 -5
  28. package/dist/capabilities/temperature-sensor.cap.d.ts +5 -20
  29. package/dist/capabilities/weather.cap.d.ts +4 -13
  30. package/dist/client.d.ts +2 -1
  31. package/dist/client.js +54 -5
  32. package/dist/client.mjs +52 -6
  33. package/dist/composition/composition-report.d.ts +8 -3
  34. package/dist/composition/customize/override-draft.d.ts +10 -0
  35. package/dist/composition/state-fields.d.ts +1 -1
  36. package/dist/composition/validate-composition.d.ts +3 -2
  37. package/dist/device/cap-vocabulary/types.d.ts +2 -2
  38. package/dist/device/schema-fields.d.ts +3 -0
  39. package/dist/device/source-info.d.ts +12 -6
  40. package/dist/generated/addon-cap-facts.d.ts +1 -1
  41. package/dist/generated/customize-catalog.d.ts +59 -87
  42. package/dist/generated/history-catalog.d.ts +1 -1
  43. package/dist/index.d.ts +4 -2
  44. package/dist/index.js +842 -507
  45. package/dist/index.mjs +825 -507
  46. package/dist/{sleep-BErAxhul.mjs → sleep-CARd6wZF.mjs} +161 -128
  47. package/dist/{sleep-BPQ2ZyaI.js → sleep-gtskVoMw.js} +214 -127
  48. package/dist/units/convert.d.ts +5 -0
  49. package/dist/units/format-reading.d.ts +15 -0
  50. package/dist/units/index.d.ts +8 -1
  51. package/dist/units/ingest-reading.d.ts +21 -0
  52. package/dist/units/quantity.d.ts +47 -0
  53. package/dist/units/threshold.d.ts +6 -0
  54. package/dist/units/unit-table.d.ts +2 -228
  55. package/package.json +7 -2
  56. package/dist/capabilities/advanced-parameters.d.ts +0 -17
@@ -1,32 +1,31 @@
1
1
  import { DeviceType } from '../device/device-type.js';
2
2
  /**
3
3
  * Customize catalog, projected from every `*.cap.ts` `customize` block.
4
- * 11 caps. Field keys are `runtimeState` paths. No Zod.
4
+ * 5 caps. Field keys are `runtimeState` paths. No Zod.
5
5
  */
6
6
  export declare const CAP_CUSTOMIZE_CATALOG: {
7
- readonly 'ambient-light-sensor': {
8
- readonly version: 1;
9
- readonly targets: readonly [];
10
- readonly advancedParameters: readonly [{
11
- readonly path: 'lux';
12
- readonly kind: 'number';
13
- readonly label: 'Illuminance';
14
- readonly unit: 'lx';
15
- }];
16
- };
17
7
  readonly battery: {
18
8
  readonly version: 1;
19
9
  readonly targets: readonly [{
20
10
  readonly id: 'percentage';
21
11
  readonly cardinality: 'scalar';
22
12
  readonly deviceTypes: readonly [DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat];
23
- readonly apply: 'add-or-replace';
13
+ readonly apply: 'add';
24
14
  readonly vocabularyCap: 'battery';
25
15
  readonly vocabularyStateField: 'percentage';
26
16
  readonly sources: readonly [{
27
17
  readonly kind: 'field';
28
18
  readonly valueKinds: readonly ["number", "string"];
29
19
  readonly transformKinds: readonly ["identity", "linear"];
20
+ readonly transforms: readonly [{
21
+ readonly kind: 'identity';
22
+ }, {
23
+ readonly kind: 'linear';
24
+ readonly defaultScale: 1;
25
+ readonly defaultOffset: 0;
26
+ readonly clampMin: 0;
27
+ readonly clampMax: 100;
28
+ }];
30
29
  }];
31
30
  readonly sourceReport: {
32
31
  readonly status: 'assignment-status';
@@ -51,29 +50,6 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
51
50
  readonly when: 'add';
52
51
  }];
53
52
  }];
54
- readonly advancedParameters: readonly [{
55
- readonly path: 'binary';
56
- readonly kind: 'boolean';
57
- readonly label: 'Binary indicator';
58
- }, {
59
- readonly path: 'charging';
60
- readonly kind: 'enum';
61
- readonly label: 'Charging source';
62
- readonly enumValues: readonly ["dc", "solar", "none", "unknown"];
63
- }, {
64
- readonly path: 'sleeping';
65
- readonly kind: 'boolean';
66
- readonly label: 'Sleeping';
67
- }];
68
- };
69
- readonly binary: {
70
- readonly version: 1;
71
- readonly targets: readonly [];
72
- readonly advancedParameters: readonly [{
73
- readonly path: 'on';
74
- readonly kind: 'boolean';
75
- readonly label: 'On';
76
- }];
77
53
  };
78
54
  readonly consumables: {
79
55
  readonly version: 1;
@@ -99,6 +75,15 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
99
75
  readonly sources: readonly [{
100
76
  readonly kind: 'numeric';
101
77
  readonly transformKinds: readonly ["identity", "linear"];
78
+ readonly transforms: readonly [{
79
+ readonly kind: 'identity';
80
+ }, {
81
+ readonly kind: 'linear';
82
+ readonly defaultScale: 1;
83
+ readonly defaultOffset: 0;
84
+ readonly clampMin: 0;
85
+ readonly clampMax: 100;
86
+ }];
102
87
  }];
103
88
  }, {
104
89
  readonly path: 'remaining.value';
@@ -107,10 +92,13 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
107
92
  readonly sources: readonly [{
108
93
  readonly kind: 'numeric';
109
94
  readonly transformKinds: readonly ["identity"];
95
+ readonly transforms: readonly [{
96
+ readonly kind: 'identity';
97
+ }];
110
98
  }];
111
99
  readonly literals: readonly [{
112
- readonly path: 'remaining.unit';
113
- readonly values: readonly ["days", "hours", "cycles"];
100
+ readonly path: 'remaining.kind';
101
+ readonly values: readonly ["duration", "count"];
114
102
  }];
115
103
  }, {
116
104
  readonly path: 'status';
@@ -120,6 +108,11 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
120
108
  readonly sources: readonly [{
121
109
  readonly kind: 'enum';
122
110
  readonly transformKinds: readonly ["enum-map"];
111
+ readonly transforms: readonly [{
112
+ readonly kind: 'enum-map';
113
+ readonly outputValues: readonly ["ok", "low", "empty", "full", "replace"];
114
+ readonly unmapped: null;
115
+ }];
123
116
  }];
124
117
  }];
125
118
  readonly traits: readonly [{
@@ -141,7 +134,6 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
141
134
  readonly when: 'add';
142
135
  }];
143
136
  }];
144
- readonly advancedParameters: readonly [];
145
137
  };
146
138
  readonly doorbell: {
147
139
  readonly version: 1;
@@ -155,9 +147,11 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
155
147
  readonly sources: readonly [{
156
148
  readonly kind: 'binary';
157
149
  readonly transformKinds: readonly [];
150
+ readonly transforms: readonly [];
158
151
  }, {
159
152
  readonly kind: 'switch';
160
153
  readonly transformKinds: readonly [];
154
+ readonly transforms: readonly [];
161
155
  }];
162
156
  readonly sourceReport: {
163
157
  readonly status: 'assignment-status';
@@ -170,22 +164,12 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
170
164
  readonly eventName: 'onPressed';
171
165
  readonly combine: 'any';
172
166
  readonly edges: readonly ["rising"];
167
+ readonly defaultEdge: 'rising';
173
168
  readonly timestampPath: 'lastPressedAt';
174
169
  readonly counterPath: 'pressCountSinceStart';
175
170
  readonly highWater: 'composer-advance';
176
171
  readonly debounceMs: 2000;
177
172
  }];
178
- readonly advancedParameters: readonly [];
179
- };
180
- readonly 'humidity-sensor': {
181
- readonly version: 1;
182
- readonly targets: readonly [];
183
- readonly advancedParameters: readonly [{
184
- readonly path: 'percent';
185
- readonly kind: 'number';
186
- readonly label: 'Humidity';
187
- readonly unit: '%';
188
- }];
189
173
  };
190
174
  readonly motion: {
191
175
  readonly version: 1;
@@ -193,15 +177,17 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
193
177
  readonly id: 'detected';
194
178
  readonly cardinality: 'event';
195
179
  readonly deviceTypes: readonly [DeviceType.Camera];
196
- readonly apply: 'replace';
180
+ readonly apply: 'add';
197
181
  readonly vocabularyCap: 'motion';
198
182
  readonly vocabularyEvent: 'onMotionChanged';
199
183
  readonly sources: readonly [{
200
184
  readonly kind: 'binary';
201
185
  readonly transformKinds: readonly [];
186
+ readonly transforms: readonly [];
202
187
  }, {
203
188
  readonly kind: 'switch';
204
189
  readonly transformKinds: readonly [];
190
+ readonly transforms: readonly [];
205
191
  }];
206
192
  readonly sourceReport: {
207
193
  readonly status: 'assignment-status';
@@ -219,22 +205,6 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
219
205
  readonly timeoutMs: 30000;
220
206
  readonly sourceModes: readonly ["in-addition", "confirm", "replace"];
221
207
  }];
222
- readonly advancedParameters: readonly [];
223
- };
224
- readonly 'power-meter': {
225
- readonly version: 1;
226
- readonly targets: readonly [];
227
- readonly advancedParameters: readonly [{
228
- readonly path: 'kwhTotal';
229
- readonly kind: 'number';
230
- readonly label: 'Energy';
231
- readonly unit: 'kWh';
232
- }, {
233
- readonly path: 'watts';
234
- readonly kind: 'number';
235
- readonly label: 'Power';
236
- readonly unit: 'W';
237
- }];
238
208
  };
239
209
  readonly 'running-state': {
240
210
  readonly version: 1;
@@ -242,19 +212,36 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
242
212
  readonly id: 'running';
243
213
  readonly cardinality: 'scalar';
244
214
  readonly deviceTypes: readonly [DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder];
245
- readonly apply: 'add-or-replace';
215
+ readonly apply: 'add';
246
216
  readonly vocabularyCap: 'running-state';
247
217
  readonly vocabularyStateField: 'running';
248
218
  readonly sources: readonly [{
249
219
  readonly kind: 'switch';
250
220
  readonly transformKinds: readonly ["identity"];
221
+ readonly transforms: readonly [{
222
+ readonly kind: 'identity';
223
+ }];
251
224
  }, {
252
225
  readonly kind: 'binary';
253
226
  readonly transformKinds: readonly ["identity", "invert"];
227
+ readonly transforms: readonly [{
228
+ readonly kind: 'identity';
229
+ }, {
230
+ readonly kind: 'invert';
231
+ }];
254
232
  }, {
255
233
  readonly kind: 'numeric';
256
234
  readonly requiredUnit: 'W';
257
235
  readonly transformKinds: readonly ["threshold"];
236
+ readonly transforms: readonly [{
237
+ readonly kind: 'threshold';
238
+ readonly comparisons: readonly ["gte", "lte"];
239
+ readonly comparison: 'gte';
240
+ readonly defaultThreshold: 5;
241
+ readonly defaultStartDwellMs: 30000;
242
+ readonly defaultStopDwellMs: 180000;
243
+ readonly thresholdUnit: 'W';
244
+ }];
258
245
  }];
259
246
  readonly sourceReport: {
260
247
  readonly status: 'assignment-status';
@@ -286,25 +273,10 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
286
273
  readonly sourceChangedAt: 'prefer';
287
274
  }];
288
275
  }];
289
- readonly advancedParameters: readonly [];
290
- };
291
- readonly switch: {
292
- readonly version: 1;
293
- readonly targets: readonly [];
294
- readonly advancedParameters: readonly [{
295
- readonly path: 'on';
296
- readonly kind: 'boolean';
297
- readonly label: 'On';
298
- }];
299
- };
300
- readonly 'temperature-sensor': {
301
- readonly version: 1;
302
- readonly targets: readonly [];
303
- readonly advancedParameters: readonly [{
304
- readonly path: 'celsius';
305
- readonly kind: 'number';
306
- readonly label: 'Temperature';
307
- readonly unit: '°C';
308
- }];
309
276
  };
310
277
  };
278
+ /**
279
+ * Unit meta on runtime-state fields. The composed-device row reads this;
280
+ * it is not an override list (D944).
281
+ */
282
+ export declare const CAP_RUNTIME_FIELD_UNITS: Readonly<Record<string, Readonly<Record<string, string>>>>;
@@ -1,7 +1,7 @@
1
1
  import type { CapabilityHistoryField, CapabilityHistoryItems } from '../capabilities/capability-definition.js';
2
2
  /**
3
3
  * Cap history catalog, projected from every `*.cap.ts` `history` block.
4
- * 41 caps with series (74 series), 30 caps answered `'none'`.
4
+ * 41 caps with series (75 series), 30 caps answered `'none'`.
5
5
  * Field keys are `runtimeState` paths (`a.b` into fixed objects only).
6
6
  */
7
7
  export declare const HISTORY_CATALOG: Readonly<Record<string, Readonly<Record<string, CapabilityHistoryField>>>>;
package/dist/index.d.ts CHANGED
@@ -258,10 +258,12 @@ export { isRestoredCap, RESTORED_CAP_NAMES, RUNTIME_STATE_POLICY, runtimeStatePo
258
258
  export { BucketAccumulator, bucketStartOf, type ClosedHistoryBucket, HISTORY_BUCKET_MS, MAX_REQUEUED_BUCKETS_PER_SERIES, } from './history/bucket-accumulator.js';
259
259
  export { HISTORY_CATALOG, HISTORY_ITEM_CATALOG, HISTORY_NONE_CAPS, historyFieldsFor, } from './generated/history-catalog.js';
260
260
  export { CAP_CUSTOMIZE_CATALOG } from './generated/customize-catalog.js';
261
- export type { CustomizeCatalog, CustomizeCatalogAdvancedParameter, CustomizeCatalogField, CustomizeCatalogSource, CustomizeCatalogTarget, } from './capabilities/customize-catalog.js';
261
+ export type { CustomizeCatalog, CustomizeCatalogField, CustomizeCatalogSource, CustomizeCatalogTarget, CustomizeCatalogTransform, } from './capabilities/customize-catalog.js';
262
+ export { CAP_RUNTIME_FIELD_UNITS } from './generated/customize-catalog.js';
263
+ export { runtimeFieldUnit } from './capabilities/runtime-field-unit.js';
262
264
  export { compositionFillStatus, decodeCompositionToCards, formulaProblem, primaryCapForRole, problemsBlockSave, } from './composition/cards/index.js';
263
265
  export type { CompositionFillStatus } from './composition/cards/index.js';
264
- export type { CapabilityCustomizeSpec, CapabilityCustomizeTarget, CustomizeCardinality, EventCustomizeTarget, PulseEventCustomizeTarget, SpanEventCustomizeTarget, } from './capabilities/customize-spec.js';
266
+ export type { CapabilityCustomizeSpec, CapabilityCustomizeTarget, CustomizeCardinality, CustomizeEventEdge, EventCustomizeTarget, PulseEventCustomizeTarget, SpanEventCustomizeTarget, } from './capabilities/customize-spec.js';
265
267
  export { CustomizeAssignmentStatusSchema, OverrideDraftSchema, type CustomizeAssignmentStatus, type OverrideDraft, } from './composition/customize/override-draft.js';
266
268
  export { compileScalarOverride, type ScalarCompileInput, type ScalarValueKind, } from './composition/customize/scalar-compile.js';
267
269
  export { decodeScalarOverride, type ScalarDecoded, type ScalarDecodeInput, } from './composition/customize/scalar-decode.js';