@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
package/dist/addon.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-BPQ2ZyaI.js");
2
+ const require_sleep = require("./sleep-gtskVoMw.js");
3
3
  const require_event_category = require("./event-category-DXZ3f9Q5.js");
4
4
  const require_err_msg = require("./err-msg-BhVbr0NX.js");
5
5
  //#region src/generated/cap-input-defaults.ts
package/dist/addon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as expandCapMethods, $n as PEER_BYTES_CHUNK_BYTES, $t as REMOVE_LEAF, A as HF_REPO, An as RECORD_BATCH_MAX_BYTES, Ar as emitReadiness, B as withoutCallerStamp, Bn as RECORD_SECRET_COLLECTION_PREFIX, Br as SECRET_CLEAR, Bt as entryBody, C as addonSliceHandleApi, Cn as RevConflictError, Cr as globalSecretScope, Dn as asRecordsError, En as UnknownRecordKindError, Er as parseSecretRef, Fn as RECORD_ID_MAX_LENGTH, G as adminUiCapability, Gn as createSecretsAccess, Gr as isSecretMarkerLike, Gt as RecordIndexSchema, Hn as RECORD_SWEEP_INTERVAL_MS, Hr as isSecretClear, Ht as assertTransactScope, I as deviceOpsCapability, In as RECORD_MAX_DATA_BYTES, Jn as forgetKnownSecret, Jt as RecordRetentionSchema, Kn as MIN_SCRUBBED_LENGTH, Kr as makeSecretMarker, Kt as RecordKindDeclarationSchema, L as viewerUiCapability, Ln as RECORD_MAX_INDEXES, M as CAP_ADVANCE_FIELDS, Mn as RECORD_DATABASES, Nn as RECORD_DEFAULT_MAX_DATA_BYTES, On as recordsErrorFromMessage, P as CAP_STATE_LEAVES, Pn as RECORD_DELETE_BATCH, Qn as shortSecretRefHash, Qt as defineRecordKinds, R as DEVICE_CHILDREN_BATCH_MAX, Rn as RECORD_MAX_INDEX_FIELDS, Rt as makeInMemoryRecords, Sn as RecordsError, Sr as formatSecretScope, Tn as UnindexedFilterError, Tr as normalizeSecretOwner, U as describeCustomActions, Un as resolveSecretViewsIn, Ur as isSecretFieldView, Ut as EntryDescriptorSchema, Vn as RECORD_SETTINGS_MAX_ROWS, Vr as classifySecretWrite, Vt as createRecordsAccess, Wn as REVALIDATE_AFTER_MS, Wr as isSecretMarker, Wt as RecordFieldPathSchema, Xn as registerKnownSecret, Xt as assertValidDeclaration, Yn as knownSecretCount, Yt as StoredRecordKindDeclarationSchema, Zn as scrubKnownSecrets, Zt as declarationsOf, _ as readErrorI18n, _n as RECORDS_ERROR_CODES, an as recordSecretRef, b as isDeviceScopedCap, bn as RecordTooLargeError, br as arrayItemFieldPath, c as asString, cn as collectZodSecretPaths, ct as readNodePin, d as parseJsonUnknown, dn as DeclarationRefusedError, dt as ReadinessRegistry, en as collectSecretLeaves, er as PEER_BYTES_MAX_OUTSTANDING, f as hfModelUrl, fn as FilterRequiredError, ft as ReadinessTimeoutError, g as ErrorI18nPayloadSchema, gn as PlaintextSecretError, hn as NoCallerError, ht as scopeKey, in as recordSecretCollection, ir as DATAPLANE_SECRET_HEADER, jn as RECORD_CLASSES, kn as RECORD_BATCH_MAX, kr as createEvent, ln as isZodSecret, lr as normalizeAddonInitResult, mn as InvalidRecordError, nn as parseSecretPath, nr as PEER_BYTES_TICKET_TTL_MS, o as asJsonObject, on as secretArrayPrefixes, or as DisposerChain, p as BOOT_RECOVERY_BACKOFF_MS, pn as ForeignSecretMarkerError, qn as clearKnownSecrets, qr as toSecretFieldView, qt as RecordKindNameSchema, r as maskUrlCredentials, rn as recordArrayItemPath, sr as BaseAddon, st as nodePin, t as sleep, tn as mapSecretLeaves, tr as PEER_BYTES_STALL_MS, un as BatchTooLargeError, ut as MODEL_FORMATS, vn as RecordNotFoundError, w as createEventBusSliceSource, wn as TransactRefusedError, wr as isSecretRef, x as createDeviceProxy, xn as RecordUniqueViolationError, xr as buildSecretRef, y as DEVICE_SCOPED_CAPS, yn as RecordSecretUnavailableError, yr as SECRET_REF_SCHEME, z as CALLER_STAMPED_CAPABILITIES, zn as RECORD_QUERY_MAX, zt as defineEntryKind } from "./sleep-BErAxhul.mjs";
1
+ import { $ as expandCapMethods, $n as REVALIDATE_AFTER_MS, $r as isSecretMarker, $t as RecordFieldPathSchema, A as HF_REPO, An as RecordUniqueViolationError, Ar as buildSecretRef, B as withoutCallerStamp, Bn as RECORD_CLASSES, C as addonSliceHandleApi, Cn as InvalidRecordError, Dn as RecordNotFoundError, En as RECORDS_ERROR_CODES, Fn as UnknownRecordKindError, Fr as parseSecretRef, G as adminUiCapability, Gn as RECORD_MAX_DATA_BYTES, Hn as RECORD_DEFAULT_MAX_DATA_BYTES, I as deviceOpsCapability, In as asRecordsError, Jn as RECORD_QUERY_MAX, Jt as defineEntryKind, Kn as RECORD_MAX_INDEXES, L as viewerUiCapability, Ln as recordsErrorFromMessage, M as CAP_ADVANCE_FIELDS, Mn as RevConflictError, Mr as globalSecretScope, Nn as TransactRefusedError, Nr as isSecretRef, On as RecordSecretUnavailableError, Or as SECRET_REF_SCHEME, P as CAP_STATE_LEAVES, Pn as UnindexedFilterError, Pr as normalizeSecretOwner, Qn as resolveSecretViewsIn, Qr as isSecretFieldView, Qt as EntryDescriptorSchema, R as DEVICE_CHILDREN_BATCH_MAX, Rn as RECORD_BATCH_MAX, Rr as createEvent, Sn as ForeignSecretMarkerError, Tn as PlaintextSecretError, U as describeCustomActions, Un as RECORD_DELETE_BATCH, Vn as RECORD_DATABASES, Wn as RECORD_ID_MAX_LENGTH, Xn as RECORD_SETTINGS_MAX_ROWS, Xr as classifySecretWrite, Xt as createRecordsAccess, Yn as RECORD_SECRET_COLLECTION_PREFIX, Yr as SECRET_CLEAR, Yt as entryBody, Zn as RECORD_SWEEP_INTERVAL_MS, Zr as isSecretClear, Zt as assertTransactScope, _ as readErrorI18n, _n as collectZodSecretPaths, an as assertValidDeclaration, ar as registerKnownSecret, b as isDeviceScopedCap, bn as DeclarationRefusedError, c as asString, cn as REMOVE_LEAF, cr as PEER_BYTES_CHUNK_BYTES, ct as readNodePin, d as parseJsonUnknown, dn as parseSecretPath, dr as PEER_BYTES_TICKET_TTL_MS, dt as ReadinessRegistry, ei as isSecretMarkerLike, en as RecordIndexSchema, er as createSecretsAccess, f as hfModelUrl, fn as recordArrayItemPath, ft as ReadinessTimeoutError, g as ErrorI18nPayloadSchema, gr as BaseAddon, hn as secretArrayPrefixes, hr as DisposerChain, ht as scopeKey, in as StoredRecordKindDeclarationSchema, ir as knownSecretCount, jn as RecordsError, jr as formatSecretScope, kn as RecordTooLargeError, kr as arrayItemFieldPath, ln as collectSecretLeaves, lr as PEER_BYTES_MAX_OUTSTANDING, mn as recordSecretRef, ni as toSecretFieldView, nn as RecordKindNameSchema, nr as clearKnownSecrets, o as asJsonObject, on as declarationsOf, or as scrubKnownSecrets, p as BOOT_RECOVERY_BACKOFF_MS, pn as recordSecretCollection, pr as DATAPLANE_SECRET_HEADER, qn as RECORD_MAX_INDEX_FIELDS, qt as makeInMemoryRecords, r as maskUrlCredentials, rn as RecordRetentionSchema, rr as forgetKnownSecret, sn as defineRecordKinds, sr as shortSecretRefHash, st as nodePin, t as sleep, ti as makeSecretMarker, tn as RecordKindDeclarationSchema, tr as MIN_SCRUBBED_LENGTH, un as mapSecretLeaves, ur as PEER_BYTES_STALL_MS, ut as MODEL_FORMATS, vn as isZodSecret, vr as normalizeAddonInitResult, w as createEventBusSliceSource, wn as NoCallerError, x as createDeviceProxy, xn as FilterRequiredError, y as DEVICE_SCOPED_CAPS, yn as BatchTooLargeError, z as CALLER_STAMPED_CAPABILITIES, zn as RECORD_BATCH_MAX_BYTES, zr as emitReadiness } from "./sleep-CARd6wZF.mjs";
2
2
  import { t as EventCategory } from "./event-category-DHXxB8t9.mjs";
3
3
  import { a as DeviceType, t as errMsg } from "./err-msg-BXKzRBwg.mjs";
4
4
  //#region src/generated/cap-input-defaults.ts
@@ -17,8 +17,6 @@ export declare const AirQualitySensorStatusSchema: z.ZodObject<{
17
17
  pm10: z.ZodOptional<z.ZodNumber>;
18
18
  aqi: z.ZodOptional<z.ZodNumber>;
19
19
  lastFetchedAt: z.ZodNumber;
20
- unit: z.ZodOptional<z.ZodString>;
21
- precision: z.ZodOptional<z.ZodNumber>;
22
20
  }, z.core.$strip>;
23
21
  export type AirQualitySensorStatus = z.infer<typeof AirQualitySensorStatusSchema>;
24
22
  export declare const airQualitySensorCapability: {
@@ -36,8 +34,6 @@ export declare const airQualitySensorCapability: {
36
34
  pm10: z.ZodOptional<z.ZodNumber>;
37
35
  aqi: z.ZodOptional<z.ZodNumber>;
38
36
  lastFetchedAt: z.ZodNumber;
39
- unit: z.ZodOptional<z.ZodString>;
40
- precision: z.ZodOptional<z.ZodNumber>;
41
37
  }, z.core.$strip>;
42
38
  readonly kind: 'push';
43
39
  };
@@ -48,8 +44,6 @@ export declare const airQualitySensorCapability: {
48
44
  pm10: z.ZodOptional<z.ZodNumber>;
49
45
  aqi: z.ZodOptional<z.ZodNumber>;
50
46
  lastFetchedAt: z.ZodNumber;
51
- unit: z.ZodOptional<z.ZodString>;
52
- precision: z.ZodOptional<z.ZodNumber>;
53
47
  }, z.core.$strip>;
54
48
  /**
55
49
  * Runtime-state durability: **restored** — as `numeric-sensor`.
@@ -75,12 +69,12 @@ export declare const airQualitySensorCapability: {
75
69
  };
76
70
  readonly pm25: {
77
71
  readonly kind: 'gauge';
78
- readonly unit: 'ug/m3';
72
+ readonly unit: 'µg/m³';
79
73
  readonly deadband: 1;
80
74
  };
81
75
  readonly pm10: {
82
76
  readonly kind: 'gauge';
83
- readonly unit: 'ug/m3';
77
+ readonly unit: 'µg/m³';
84
78
  readonly deadband: 1;
85
79
  };
86
80
  readonly aqi: {
@@ -6,10 +6,8 @@ import { DeviceType } from '../device/device-type.js';
6
6
  * entries with `device_class: illuminance`.
7
7
  */
8
8
  export declare const AmbientLightSensorStatusSchema: z.ZodObject<{
9
- lux: z.ZodNumber;
9
+ lux: z.ZodNullable<z.ZodNumber>;
10
10
  lastFetchedAt: z.ZodNumber;
11
- unit: z.ZodOptional<z.ZodString>;
12
- precision: z.ZodOptional<z.ZodNumber>;
13
11
  }, z.core.$strip>;
14
12
  export type AmbientLightSensorStatus = z.infer<typeof AmbientLightSensorStatusSchema>;
15
13
  export declare const ambientLightSensorCapability: {
@@ -21,18 +19,14 @@ export declare const ambientLightSensorCapability: {
21
19
  readonly methods: {};
22
20
  readonly status: {
23
21
  readonly schema: z.ZodObject<{
24
- lux: z.ZodNumber;
22
+ lux: z.ZodNullable<z.ZodNumber>;
25
23
  lastFetchedAt: z.ZodNumber;
26
- unit: z.ZodOptional<z.ZodString>;
27
- precision: z.ZodOptional<z.ZodNumber>;
28
24
  }, z.core.$strip>;
29
25
  readonly kind: 'push';
30
26
  };
31
27
  readonly runtimeState: z.ZodObject<{
32
- lux: z.ZodNumber;
28
+ lux: z.ZodNullable<z.ZodNumber>;
33
29
  lastFetchedAt: z.ZodNumber;
34
- unit: z.ZodOptional<z.ZodString>;
35
- precision: z.ZodOptional<z.ZodNumber>;
36
30
  }, z.core.$strip>;
37
31
  /**
38
32
  * Runtime-state durability: **restored** — as `numeric-sensor`.
@@ -57,10 +51,5 @@ export declare const ambientLightSensorCapability: {
57
51
  /** Clock fields: written, but excluded from the compare that decides
58
52
  * whether persisting is worth a SQLite commit. */
59
53
  readonly volatileStateFields: readonly ["lastFetchedAt"];
60
- readonly customize: {
61
- readonly version: 1;
62
- readonly advanced: 'derive';
63
- readonly targets: readonly [];
64
- };
65
54
  };
66
55
  export type IAmbientLightSensorProvider = InferProvider<typeof ambientLightSensorCapability>;
@@ -18,6 +18,7 @@ export declare const BatteryStatusSchema: z.ZodObject<{
18
18
  }>;
19
19
  sleeping: z.ZodBoolean;
20
20
  lastUpdated: z.ZodNumber;
21
+ volts: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
21
22
  lastContactAt: z.ZodOptional<z.ZodNumber>;
22
23
  lastFullRefreshAt: z.ZodOptional<z.ZodNumber>;
23
24
  binary: z.ZodOptional<z.ZodBoolean>;
@@ -89,6 +90,7 @@ export declare const batteryCapability: {
89
90
  }>;
90
91
  sleeping: z.ZodBoolean;
91
92
  lastUpdated: z.ZodNumber;
93
+ volts: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
92
94
  lastContactAt: z.ZodOptional<z.ZodNumber>;
93
95
  lastFullRefreshAt: z.ZodOptional<z.ZodNumber>;
94
96
  binary: z.ZodOptional<z.ZodBoolean>;
@@ -107,6 +109,7 @@ export declare const batteryCapability: {
107
109
  }>;
108
110
  sleeping: z.ZodBoolean;
109
111
  lastUpdated: z.ZodNumber;
112
+ volts: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
110
113
  lastContactAt: z.ZodOptional<z.ZodNumber>;
111
114
  lastFullRefreshAt: z.ZodOptional<z.ZodNumber>;
112
115
  binary: z.ZodOptional<z.ZodBoolean>;
@@ -138,6 +141,7 @@ export declare const batteryCapability: {
138
141
  }>;
139
142
  sleeping: z.ZodBoolean;
140
143
  lastUpdated: z.ZodNumber;
144
+ volts: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
141
145
  lastContactAt: z.ZodOptional<z.ZodNumber>;
142
146
  lastFullRefreshAt: z.ZodOptional<z.ZodNumber>;
143
147
  binary: z.ZodOptional<z.ZodBoolean>;
@@ -158,11 +162,14 @@ export declare const batteryCapability: {
158
162
  readonly kind: 'gauge';
159
163
  readonly unit: '%';
160
164
  };
165
+ readonly volts: {
166
+ readonly kind: 'gauge';
167
+ readonly unit: 'V';
168
+ };
161
169
  };
162
170
  };
163
171
  readonly customize: {
164
172
  readonly version: 1;
165
- readonly advanced: 'derive';
166
173
  readonly targets: readonly [{
167
174
  readonly id: 'percentage';
168
175
  readonly cardinality: 'scalar';
@@ -171,7 +178,7 @@ export declare const batteryCapability: {
171
178
  readonly stateField: 'percentage';
172
179
  };
173
180
  readonly deviceTypes: readonly [DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat];
174
- readonly apply: 'add-or-replace';
181
+ readonly apply: 'add';
175
182
  readonly path: 'percentage';
176
183
  readonly sources: readonly [{
177
184
  readonly kind: 'field';
@@ -55,10 +55,5 @@ export declare const binaryCapability: {
55
55
  /** Clock fields: written, but excluded from the compare that decides
56
56
  * whether persisting is worth a SQLite commit. */
57
57
  readonly volatileStateFields: readonly ["lastChangedAt"];
58
- readonly customize: {
59
- readonly version: 1;
60
- readonly advanced: 'derive';
61
- readonly targets: readonly [];
62
- };
63
58
  };
64
59
  export type IBinaryProvider = InferProvider<typeof binaryCapability>;
@@ -396,12 +396,11 @@ export type RuntimeStateDurability = 'session' | 'restored';
396
396
  export declare const DEFAULT_RUNTIME_STATE_DURABILITY: RuntimeStateDurability;
397
397
  /**
398
398
  * Unit of a recorded history series. A closed set: the History tab formats by
399
- * it. `'ug/m3'` is the ASCII-safe id of micrograms per cubic metre — render it
400
- * through {@link HISTORY_UNIT_LABELS}. A series whose unit is a per-device fact
401
- * names a sibling field with {@link CapabilityHistoryField.unitFrom} instead.
399
+ * it. The symbol is the quantity's stored base (D944), including `µg/m³` and
400
+ * `m/s`. A per-device quantity (`numeric-sensor`) has no fixed unit.
402
401
  */
403
- export type HistoryUnit = '%' | 'dBFS' | 'dBm' | '°C' | 'W' | 'kWh' | 'V' | 'A' | 'VA' | 'lx' | 'ppm' | 'ppb' | 'ug/m3' | 'hPa' | 'count' | 'ratio' | 'ms' | 's' | 'days' | 'bytes' | 'kbps' | 'fps';
404
- /** Display label per {@link HistoryUnit} (only `'ug/m3'` differs from its id). */
402
+ export type HistoryUnit = '%' | 'dBFS' | 'dBm' | '°C' | 'W' | 'kWh' | 'V' | 'A' | 'VA' | 'lx' | 'ppm' | 'ppb' | 'µg/m³' | 'hPa' | 'count' | 'ratio' | 'ms' | 's' | 'days' | 'bytes' | 'kbps' | 'fps' | 'm/s';
403
+ /** Display label per {@link HistoryUnit}. */
405
404
  export declare const HISTORY_UNIT_LABELS: Readonly<Record<HistoryUnit, string>>;
406
405
  /** One `runtimeState` field recorded as a history series. */
407
406
  export interface CapabilityHistoryField {
@@ -434,7 +433,8 @@ export interface CapabilityHistoryField {
434
433
  readonly unit?: HistoryUnit;
435
434
  /**
436
435
  * Path of a SIBLING `runtimeState` field (a string or enum) that carries this
437
- * device's unit — `weather.temperature` takes it from `temperatureUnit`. The
436
+ * device's quantity. A series stores the quantity base, so `unit` is that
437
+ * symbol (`°C`, `hPa`, `m/s`). `unitFrom` is not allowed. The
438
438
  * catalog records the path; the reader resolves it per device. Mutually
439
439
  * exclusive with {@link unit}.
440
440
  */
@@ -83,22 +83,18 @@ export declare function consumableFormOf(item: {
83
83
  readonly kind?: ConsumableKind;
84
84
  readonly form?: ConsumableForm;
85
85
  }): ConsumableForm;
86
- /** Units a remaining-life counter is reported in. Closed: the panel renders
87
- * each. */
88
- export declare const ConsumableRemainingUnitSchema: z.ZodEnum<{
89
- cycles: "cycles";
90
- days: "days";
91
- hours: "hours";
86
+ /** Whether `remaining.value` is a duration in seconds or a dimensionless count. */
87
+ export declare const ConsumableRemainingKindSchema: z.ZodEnum<{
88
+ count: "count";
89
+ duration: "duration";
92
90
  }>;
93
- export type ConsumableRemainingUnit = z.infer<typeof ConsumableRemainingUnitSchema>;
94
- /** Remaining life as a COUNT, not a percentage (the PetKit desiccant reports
95
- * days). `value` null = unknown (D393). */
91
+ export type ConsumableRemainingKind = z.infer<typeof ConsumableRemainingKindSchema>;
92
+ /** Remaining life. `value` null = unknown (D393). Duration is seconds. */
96
93
  export declare const ConsumableRemainingSchema: z.ZodObject<{
97
94
  value: z.ZodNullable<z.ZodNumber>;
98
- unit: z.ZodEnum<{
99
- cycles: "cycles";
100
- days: "days";
101
- hours: "hours";
95
+ kind: z.ZodEnum<{
96
+ count: "count";
97
+ duration: "duration";
102
98
  }>;
103
99
  }, z.core.$strip>;
104
100
  export type ConsumableRemaining = z.infer<typeof ConsumableRemainingSchema>;
@@ -133,10 +129,9 @@ export declare const ConsumableItemSchema: z.ZodObject<{
133
129
  resettable: z.ZodBoolean;
134
130
  remaining: z.ZodOptional<z.ZodObject<{
135
131
  value: z.ZodNullable<z.ZodNumber>;
136
- unit: z.ZodEnum<{
137
- cycles: "cycles";
138
- days: "days";
139
- hours: "hours";
132
+ kind: z.ZodEnum<{
133
+ count: "count";
134
+ duration: "duration";
140
135
  }>;
141
136
  }, z.core.$strip>>;
142
137
  }, z.core.$strip>;
@@ -167,10 +162,9 @@ export declare const ConsumablesStatusSchema: z.ZodObject<{
167
162
  resettable: z.ZodBoolean;
168
163
  remaining: z.ZodOptional<z.ZodObject<{
169
164
  value: z.ZodNullable<z.ZodNumber>;
170
- unit: z.ZodEnum<{
171
- cycles: "cycles";
172
- days: "days";
173
- hours: "hours";
165
+ kind: z.ZodEnum<{
166
+ count: "count";
167
+ duration: "duration";
174
168
  }>;
175
169
  }, z.core.$strip>>;
176
170
  }, z.core.$strip>>;
@@ -242,10 +236,9 @@ export declare const consumablesCapability: {
242
236
  resettable: z.ZodBoolean;
243
237
  remaining: z.ZodOptional<z.ZodObject<{
244
238
  value: z.ZodNullable<z.ZodNumber>;
245
- unit: z.ZodEnum<{
246
- cycles: "cycles";
247
- days: "days";
248
- hours: "hours";
239
+ kind: z.ZodEnum<{
240
+ count: "count";
241
+ duration: "duration";
249
242
  }>;
250
243
  }, z.core.$strip>>;
251
244
  }, z.core.$strip>>;
@@ -264,7 +257,7 @@ export declare const consumablesCapability: {
264
257
  resettable: boolean;
265
258
  remaining?: {
266
259
  value: number | null;
267
- unit: "cycles" | "days" | "hours";
260
+ kind: "count" | "duration";
268
261
  } | undefined;
269
262
  }[];
270
263
  lastChangedAt: number;
@@ -299,10 +292,9 @@ export declare const consumablesCapability: {
299
292
  resettable: z.ZodBoolean;
300
293
  remaining: z.ZodOptional<z.ZodObject<{
301
294
  value: z.ZodNullable<z.ZodNumber>;
302
- unit: z.ZodEnum<{
303
- cycles: "cycles";
304
- days: "days";
305
- hours: "hours";
295
+ kind: z.ZodEnum<{
296
+ count: "count";
297
+ duration: "duration";
306
298
  }>;
307
299
  }, z.core.$strip>>;
308
300
  }, z.core.$strip>;
@@ -317,7 +309,7 @@ export declare const consumablesCapability: {
317
309
  resettable: boolean;
318
310
  remaining?: {
319
311
  value: number | null;
320
- unit: "cycles" | "days" | "hours";
312
+ kind: "count" | "duration";
321
313
  } | undefined;
322
314
  };
323
315
  };
@@ -349,10 +341,9 @@ export declare const consumablesCapability: {
349
341
  resettable: z.ZodBoolean;
350
342
  remaining: z.ZodOptional<z.ZodObject<{
351
343
  value: z.ZodNullable<z.ZodNumber>;
352
- unit: z.ZodEnum<{
353
- cycles: "cycles";
354
- days: "days";
355
- hours: "hours";
344
+ kind: z.ZodEnum<{
345
+ count: "count";
346
+ duration: "duration";
356
347
  }>;
357
348
  }, z.core.$strip>>;
358
349
  }, z.core.$strip>>;
@@ -417,10 +408,9 @@ export declare const consumablesCapability: {
417
408
  resettable: z.ZodBoolean;
418
409
  remaining: z.ZodOptional<z.ZodObject<{
419
410
  value: z.ZodNullable<z.ZodNumber>;
420
- unit: z.ZodEnum<{
421
- cycles: "cycles";
422
- days: "days";
423
- hours: "hours";
411
+ kind: z.ZodEnum<{
412
+ count: "count";
413
+ duration: "duration";
424
414
  }>;
425
415
  }, z.core.$strip>>;
426
416
  }, z.core.$strip>;
@@ -457,7 +447,7 @@ export declare const consumablesCapability: {
457
447
  }[];
458
448
  literals: {
459
449
  path: string;
460
- values: ("cycles" | "days" | "hours")[];
450
+ values: ("count" | "duration")[];
461
451
  }[];
462
452
  } | {
463
453
  literals?: undefined;
@@ -507,7 +497,6 @@ export declare const consumablesCapability: {
507
497
  };
508
498
  readonly 'remaining.value': {
509
499
  readonly kind: 'gauge';
510
- readonly unitFrom: 'remaining.unit';
511
500
  readonly deadband: 1;
512
501
  readonly displayName: 'Remaining';
513
502
  };
@@ -46,10 +46,9 @@ export type ControlKind = z.infer<typeof ControlKindSchema>;
46
46
  * (empty array for the other kinds). It lives in the slice because
47
47
  * HA `select.*` entities may update their options at runtime.
48
48
  *
49
- * The `unit`/`min`/`max`/`step` fields are meaningful for
50
- * `kind === 'numeric'` and are absent (undefined) for all other
51
- * kinds. They are populated live from HA attributes on each state
52
- * push — consistent with `options` and the sensor-unit approach.
49
+ * Numeric `min` / `max` / `step` live in the slice and share the device
50
+ * quantity (`SourceInfo.quantity`, D944). Display precision is a read-time
51
+ * preference. A datetime control's shape is `SourceInfo.dateTimeShape`.
53
52
  */
54
53
  export declare const ControlStatusSchema: z.ZodObject<{
55
54
  kind: z.ZodEnum<{
@@ -61,16 +60,9 @@ export declare const ControlStatusSchema: z.ZodObject<{
61
60
  value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
62
61
  options: z.ZodArray<z.ZodString>;
63
62
  lastChangedAt: z.ZodNumber;
64
- unit: z.ZodOptional<z.ZodString>;
65
63
  min: z.ZodOptional<z.ZodNumber>;
66
64
  max: z.ZodOptional<z.ZodNumber>;
67
65
  step: z.ZodOptional<z.ZodNumber>;
68
- precision: z.ZodOptional<z.ZodNumber>;
69
- format: z.ZodOptional<z.ZodEnum<{
70
- date: "date";
71
- datetime: "datetime";
72
- time: "time";
73
- }>>;
74
66
  }, z.core.$strip>;
75
67
  export type ControlStatus = z.infer<typeof ControlStatusSchema>;
76
68
  declare const ControlSetValueInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -122,16 +114,9 @@ export declare const controlCapability: {
122
114
  value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
123
115
  options: z.ZodArray<z.ZodString>;
124
116
  lastChangedAt: z.ZodNumber;
125
- unit: z.ZodOptional<z.ZodString>;
126
117
  min: z.ZodOptional<z.ZodNumber>;
127
118
  max: z.ZodOptional<z.ZodNumber>;
128
119
  step: z.ZodOptional<z.ZodNumber>;
129
- precision: z.ZodOptional<z.ZodNumber>;
130
- format: z.ZodOptional<z.ZodEnum<{
131
- date: "date";
132
- datetime: "datetime";
133
- time: "time";
134
- }>>;
135
120
  }, z.core.$strip>;
136
121
  readonly kind: 'push';
137
122
  };
@@ -150,16 +135,9 @@ export declare const controlCapability: {
150
135
  value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
151
136
  options: z.ZodArray<z.ZodString>;
152
137
  lastChangedAt: z.ZodNumber;
153
- unit: z.ZodOptional<z.ZodString>;
154
138
  min: z.ZodOptional<z.ZodNumber>;
155
139
  max: z.ZodOptional<z.ZodNumber>;
156
140
  step: z.ZodOptional<z.ZodNumber>;
157
- precision: z.ZodOptional<z.ZodNumber>;
158
- format: z.ZodOptional<z.ZodEnum<{
159
- date: "date";
160
- datetime: "datetime";
161
- time: "time";
162
- }>>;
163
141
  }, z.core.$strip>;
164
142
  /**
165
143
  * Runtime-state durability: **session** — a generic control mirrors an external entity that re-publishes on connect; the options array is re-derived with it.
@@ -3899,6 +3899,7 @@ export declare const coreBlocksCapability: {
3899
3899
  "kind-mismatch": "kind-mismatch";
3900
3900
  "may-be-null": "may-be-null";
3901
3901
  "missing-field": "missing-field";
3902
+ "native-capability-replace": "native-capability-replace";
3902
3903
  "nested-field": "nested-field";
3903
3904
  "not-composable": "not-composable";
3904
3905
  "not-item-array": "not-item-array";
@@ -5,10 +5,35 @@
5
5
  import type { DeviceType } from '../device/device-type.js';
6
6
  import type { CameraSensorCustomizeMode, CustomizeApplyAuthority, CustomizeApplyMode, CustomizeCardinality, CustomizeCompanion, CustomizeEventEdge, CustomizeSourceReport, CustomizeValueKind } from './customize-spec.js';
7
7
  export type CustomizeCatalogValueKind = 'boolean' | 'number' | 'string' | 'enum';
8
+ export type CustomizeCatalogTransform = {
9
+ readonly kind: 'identity';
10
+ } | {
11
+ readonly kind: 'invert';
12
+ } | {
13
+ readonly kind: 'threshold';
14
+ readonly comparisons: readonly ('gte' | 'lte')[];
15
+ readonly comparison: 'gte' | 'lte';
16
+ readonly defaultThreshold: number;
17
+ readonly defaultStartDwellMs: number;
18
+ readonly defaultStopDwellMs: number;
19
+ readonly thresholdUnit?: string;
20
+ } | {
21
+ readonly kind: 'linear';
22
+ readonly defaultScale: number;
23
+ readonly defaultOffset: number;
24
+ readonly clampMin?: number;
25
+ readonly clampMax?: number;
26
+ } | {
27
+ readonly kind: 'enum-map';
28
+ readonly outputValues: readonly string[];
29
+ readonly unmapped: string | null;
30
+ };
8
31
  export interface CustomizeCatalogSource {
9
32
  readonly kind: string;
10
33
  readonly valueKinds?: readonly CustomizeValueKind[];
11
34
  readonly transformKinds: readonly string[];
35
+ /** Every declared parameter, including its default. The editor reads only this. */
36
+ readonly transforms: readonly CustomizeCatalogTransform[];
12
37
  readonly requiredUnit?: string;
13
38
  }
14
39
  export interface CustomizeCatalogLiteral {
@@ -47,6 +72,7 @@ export interface CustomizeCatalogTarget {
47
72
  readonly applyAuthority?: CustomizeApplyAuthority;
48
73
  readonly eventName?: string;
49
74
  readonly edges?: readonly CustomizeEventEdge[];
75
+ readonly defaultEdge?: CustomizeEventEdge;
50
76
  readonly timestampPath?: string;
51
77
  readonly counterPath?: string;
52
78
  readonly highWater?: 'composer-advance';
@@ -65,16 +91,8 @@ export interface CustomizeCatalogTarget {
65
91
  readonly sourceReport: CustomizeSourceReport;
66
92
  readonly advancedExpression: boolean;
67
93
  }
68
- export interface CustomizeCatalogAdvancedParameter {
69
- readonly path: string;
70
- readonly kind: CustomizeCatalogValueKind;
71
- readonly label: string;
72
- readonly unit?: string;
73
- readonly enumValues?: readonly string[];
74
- }
75
94
  export interface CustomizeCatalogEntry {
76
95
  readonly version: 1;
77
96
  readonly targets: readonly CustomizeCatalogTarget[];
78
- readonly advancedParameters: readonly CustomizeCatalogAdvancedParameter[];
79
97
  }
80
98
  export type CustomizeCatalog = Readonly<Record<string, CustomizeCatalogEntry>>;
@@ -9,12 +9,11 @@ import type { z } from 'zod';
9
9
  import type { DeviceType } from '../device/device-type.js';
10
10
  export type CustomizeCardinality = 'scalar' | 'keyedArray' | 'event';
11
11
  export type CustomizeValueKind = 'boolean' | 'number' | 'string' | 'enum';
12
- export type CustomizeApplyMode = 'add' | 'replace' | 'add-or-replace';
12
+ /** An extension is offered only when the device lacks the capability (D944). */
13
+ export type CustomizeApplyMode = 'add';
13
14
  export interface CapabilityCustomizeSpec {
14
15
  readonly version: 1;
15
16
  readonly targets: readonly CapabilityCustomizeTarget[];
16
- /** Opt-in advanced parameters: derive from runtime schema or an explicit path list (D939). */
17
- readonly advanced?: 'derive' | readonly string[];
18
17
  }
19
18
  export type CapabilityCustomizeTarget = ScalarCustomizeTarget | KeyedArrayCustomizeTarget | EventCustomizeTarget;
20
19
  export interface CustomizeVocabularyRef {
@@ -59,9 +58,12 @@ export interface IdentityTransformSpec {
59
58
  export interface InvertTransformSpec {
60
59
  readonly kind: 'invert';
61
60
  }
61
+ export type ThresholdComparison = 'gte' | 'lte';
62
62
  export interface ThresholdTransformSpec {
63
63
  readonly kind: 'threshold';
64
- readonly comparison: 'gte' | 'lte';
64
+ /** Comparisons the editor may offer. `comparison` is the default. */
65
+ readonly comparisons: readonly ThresholdComparison[];
66
+ readonly comparison: ThresholdComparison;
65
67
  readonly defaultThreshold: number;
66
68
  readonly defaultStartDwellMs: number;
67
69
  readonly defaultStopDwellMs: number;
@@ -180,7 +182,9 @@ export interface EventCustomizeTargetBase extends CustomizeTargetBase {
180
182
  */
181
183
  export interface PulseEventCustomizeTarget extends EventCustomizeTargetBase {
182
184
  readonly shape: 'pulse';
185
+ /** Edges the editor may offer. `defaultEdge` is the one a new pulse starts on. */
183
186
  readonly edges: readonly CustomizeEventEdge[];
187
+ readonly defaultEdge: CustomizeEventEdge;
184
188
  readonly timestampPath: string;
185
189
  readonly counterPath: string;
186
190
  /** The composer already tracks this path's advance (D670). */