@camstack/types 1.2.433 → 1.2.435

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/CHANGELOG.md +13 -0
  2. package/dist/addon.js +2 -2
  3. package/dist/addon.mjs +2 -2
  4. package/dist/automation/index.d.ts +3 -1
  5. package/dist/automation/recipe.d.ts +33 -3
  6. package/dist/automation/stationary-trigger.d.ts +48 -0
  7. package/dist/automation/trace.d.ts +4 -1
  8. package/dist/capabilities/actions.cap.d.ts +1 -0
  9. package/dist/capabilities/air-quality-sensor.cap.d.ts +8 -8
  10. package/dist/capabilities/ambient-light-sensor.cap.d.ts +4 -4
  11. package/dist/capabilities/battery.cap.d.ts +14 -14
  12. package/dist/capabilities/brightness.cap.d.ts +7 -7
  13. package/dist/capabilities/capability-definition.d.ts +3 -3
  14. package/dist/capabilities/color.cap.d.ts +6 -6
  15. package/dist/capabilities/core-blocks.cap.d.ts +156 -0
  16. package/dist/capabilities/device-history.cap.d.ts +2 -2
  17. package/dist/capabilities/dishwasher.cap.d.ts +11 -11
  18. package/dist/capabilities/fan-control.cap.d.ts +6 -6
  19. package/dist/capabilities/humidity-sensor.cap.d.ts +4 -4
  20. package/dist/capabilities/lawn-mower-control.cap.d.ts +3 -3
  21. package/dist/capabilities/media-player.cap.d.ts +8 -8
  22. package/dist/capabilities/meter.cap.d.ts +1 -1
  23. package/dist/capabilities/network-link.cap.d.ts +13 -13
  24. package/dist/capabilities/power-meter.cap.d.ts +22 -22
  25. package/dist/capabilities/presence.cap.d.ts +1 -15
  26. package/dist/capabilities/pressure-sensor.cap.d.ts +4 -4
  27. package/dist/capabilities/temperature-sensor.cap.d.ts +4 -4
  28. package/dist/capabilities/vacuum-control.cap.d.ts +3 -3
  29. package/dist/client.js +1 -1
  30. package/dist/client.mjs +1 -1
  31. package/dist/composition/composition-report.d.ts +1 -1
  32. package/dist/composition/examples.d.ts +1 -1
  33. package/dist/composition/helpers/appliance.d.ts +1 -1
  34. package/dist/{composition-CpAc0YfQ.js → composition-BZf_gqG7.js} +2 -2
  35. package/dist/{composition-Bb8iwHEJ.mjs → composition-CZImLpOI.mjs} +2 -2
  36. package/dist/device/base-device.d.ts +2 -2
  37. package/dist/device/device-runtime-state.d.ts +1 -1
  38. package/dist/device/device-state-handle.d.ts +1 -1
  39. package/dist/device/system-mirror.d.ts +1 -1
  40. package/dist/enums/event-category.d.ts +1 -1
  41. package/dist/enums.js +1 -1
  42. package/dist/enums.mjs +1 -1
  43. package/dist/{event-category-hdMR7CTW.mjs → event-category-DmZDPDf_.mjs} +1 -1
  44. package/dist/{event-category-BhzwWQCH.js → event-category-E17zaHjN.js} +1 -1
  45. package/dist/generated/addon-cap-facts.d.ts +1 -1
  46. package/dist/generated/customize-catalog.d.ts +15 -15
  47. package/dist/generated/history-catalog.d.ts +1 -1
  48. package/dist/index.d.ts +2 -2
  49. package/dist/index.js +673 -518
  50. package/dist/index.mjs +673 -519
  51. package/dist/interfaces/event-bus.d.ts +24 -3
  52. package/dist/node.js +1 -1
  53. package/dist/node.mjs +1 -1
  54. package/dist/{sleep-BHjNez61.mjs → sleep-Crlmu_tO.mjs} +27 -31
  55. package/dist/{sleep-5zRztaHa.js → sleep-DHitF_e4.js} +27 -31
  56. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,11 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.2.435] - 2026-10-28
11
+
12
+ ### Changed
13
+
14
+ - Device value fields are named after their quantity (power, level, speed, signal...) instead of their unit; run the quantity-field migration after updating
15
+
16
+ ## [1.2.434] - 2026-10-28
17
+
18
+ ### Added
19
+
20
+ - Automations can start on a parked object appearing or leaving, filtered by camera, class and zone, and check whether one is present
21
+
10
22
  ## [1.2.433] - 2026-10-28
11
23
 
12
24
  ### Changed
13
25
 
14
26
  - Unknown event kinds, state words and class names read as words instead of raw ids
27
+ - Automations can start on, and be conditioned by, a parked object (appeared or departed, with class and zone filters)
15
28
 
16
29
  ## [1.2.432] - 2026-10-28
17
30
 
package/dist/addon.js CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-5zRztaHa.js");
3
- const require_event_category = require("./event-category-BhzwWQCH.js");
2
+ const require_sleep = require("./sleep-DHitF_e4.js");
3
+ const require_event_category = require("./event-category-E17zaHjN.js");
4
4
  const require_err_msg = require("./err-msg-U7lLUMNz.js");
5
5
  //#region src/generated/cap-input-defaults.ts
6
6
  /**
package/dist/addon.mjs CHANGED
@@ -1,5 +1,5 @@
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-BHjNez61.mjs";
2
- import { t as EventCategory } from "./event-category-hdMR7CTW.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-Crlmu_tO.mjs";
2
+ import { t as EventCategory } from "./event-category-DmZDPDf_.mjs";
3
3
  import { a as DeviceType, t as errMsg } from "./err-msg-DIorGYeC.mjs";
4
4
  //#region src/generated/cap-input-defaults.ts
5
5
  /**
@@ -14,11 +14,13 @@ export type { ConditionEvaluation, ConditionReader, MirrorRefreshFetchers, Mirro
14
14
  export { collectMirrorSources, ConditionMirror, evaluateConditionTree, } from './condition-eval.js';
15
15
  export type { DetectionDecision, DetectionTrigger, DetectionVars, TrackLifecycleInput, } from './detection-trigger.js';
16
16
  export { DetectionTriggerFilter, detectionClassMatches, FIRED_MAX, FIRED_TTL_MS, } from './detection-trigger.js';
17
+ export type { StationaryChangedInput, StationaryDecision, StationaryTrigger, StationaryVars, } from './stationary-trigger.js';
18
+ export { evaluateStationaryTrigger } from './stationary-trigger.js';
17
19
  export type { CooldownInput, CooldownVerdict, RunGateAdmission } from './run-gate.js';
18
20
  export { RunGate } from './run-gate.js';
19
21
  export type { AutomationConditionTraceNode, AutomationRunOutcome, AutomationRunTrace, AutomationRunVerdict, AutomationStateDoc, AutomationStepTrace, AutomationTriggerTrace, TraceNodeOutcome, TraceValue, } from './trace.js';
20
22
  export { AutomationConditionTraceNodeSchema, EMPTY_AUTOMATION_STATE, mergeSkipTraces, AutomationRunOutcomeSchema, AutomationRunTraceSchema, AutomationRunVerdictSchema, AutomationStateDocSchema, AutomationStepTraceSchema, AutomationTriggerTraceSchema, appendTrace, buildTriggerTrace, isSkippedTrace, skipSignature, TraceNodeOutcomeSchema, TraceValueSchema, } from './trace.js';
21
- export type { ActionStep, AutomationAction, AutomationCondition, AutomationConditionAll, AutomationConditionAny, AutomationConditionExpression, AutomationConditionLeaf, AutomationConditionNot, AutomationConditionOperator, AutomationRecipe, AutomationRunMode, AutomationTrigger, } from './recipe.js';
23
+ export type { ActionStep, AutomationAction, AutomationCondition, AutomationConditionAll, AutomationConditionAny, AutomationConditionExpression, AutomationConditionLeaf, AutomationConditionNot, AutomationConditionOperator, AutomationConditionStationaryPresent, AutomationRecipe, AutomationRunMode, AutomationTrigger, } from './recipe.js';
22
24
  export { ActionStepSchema, AutomationActionSchema, AutomationCapStepSchema, AutomationWaitStepSchema, AutomationConditionOperatorSchema, AutomationConditionSchema, AutomationRecipeSchema, AutomationRunModeSchema, AutomationTriggerSchema, conditionDepth, countConditionLeaves, DEFAULT_TRACE_KEEP, MAX_TRACE_KEEP, MAX_CONDITION_DEPTH, MAX_CONDITION_LEAVES, validateRecipeBounds, } from './recipe.js';
23
25
  export * from './action.js';
24
26
  export * from './step-runner.js';
@@ -11,10 +11,10 @@
11
11
  *
12
12
  * Three vocabularies, each salvaged rather than invented:
13
13
  *
14
- * - **Triggers** — the only genuinely new surface. Six members, none of which
14
+ * - **Triggers** — the only genuinely new surface. Seven members, none of which
15
15
  * touches notification delivery. The NC keeps its four *pipeline* triggers;
16
16
  * these are device/time triggers and the two sets do not overlap.
17
- * - **Conditions** — `ALL`/`ANY`/`NOT` over two leaf kinds, bounded. The
17
+ * - **Conditions** — `ALL`/`ANY`/`NOT` over three leaf kinds, bounded. The
18
18
  * expression leaf is the bounded engine at `../expression/`, which is where
19
19
  * arithmetic between two device fields lives and the only place it lives.
20
20
  * - **Actions** — `NcRuleActionSchema`'s two steps, plus the `{kind:'code'}`
@@ -66,6 +66,18 @@ export interface AutomationConditionExpression {
66
66
  readonly expr: string;
67
67
  readonly bindings: Readonly<Record<string, ExpressionBindingSource>>;
68
68
  }
69
+ /**
70
+ * True when the camera currently has a PARKED object (stationary registry)
71
+ * matching `classes` (macro classes match like the detection trigger) in at
72
+ * least one of `zones`. Reads the zone-analytics snapshot through the same
73
+ * mirror as every other leaf, so a dropped event never decides it (D49).
74
+ */
75
+ export interface AutomationConditionStationaryPresent {
76
+ readonly kind: 'stationary-present';
77
+ readonly deviceId: number;
78
+ readonly classes?: readonly string[];
79
+ readonly zones?: readonly string[];
80
+ }
69
81
  export interface AutomationConditionAll {
70
82
  readonly kind: 'all';
71
83
  readonly children: readonly AutomationCondition[];
@@ -78,7 +90,7 @@ export interface AutomationConditionNot {
78
90
  readonly kind: 'not';
79
91
  readonly child: AutomationCondition;
80
92
  }
81
- export type AutomationCondition = AutomationConditionAll | AutomationConditionAny | AutomationConditionNot | AutomationConditionLeaf | AutomationConditionExpression;
93
+ export type AutomationCondition = AutomationConditionAll | AutomationConditionAny | AutomationConditionNot | AutomationConditionLeaf | AutomationConditionExpression | AutomationConditionStationaryPresent;
82
94
  export declare const AutomationConditionSchema: z.ZodType<AutomationCondition>;
83
95
  /**
84
96
  * What starts a run.
@@ -114,6 +126,15 @@ export declare const AutomationTriggerSchema: z.ZodDiscriminatedUnion<[z.ZodObje
114
126
  deviceIds: z.ZodArray<z.ZodNumber>;
115
127
  zones: z.ZodOptional<z.ZodArray<z.ZodString>>;
116
128
  minScore: z.ZodOptional<z.ZodNumber>;
129
+ }, z.core.$strip>, z.ZodObject<{
130
+ kind: z.ZodLiteral<"stationary">;
131
+ deviceIds: z.ZodArray<z.ZodNumber>;
132
+ classes: z.ZodOptional<z.ZodArray<z.ZodString>>;
133
+ zones: z.ZodOptional<z.ZodArray<z.ZodString>>;
134
+ phase: z.ZodEnum<{
135
+ appeared: "appeared";
136
+ departed: "departed";
137
+ }>;
117
138
  }, z.core.$strip>, z.ZodObject<{
118
139
  kind: z.ZodLiteral<"interval">;
119
140
  minutes: z.ZodNumber;
@@ -243,6 +264,15 @@ export declare const AutomationRecipeSchema: z.ZodObject<{
243
264
  deviceIds: z.ZodArray<z.ZodNumber>;
244
265
  zones: z.ZodOptional<z.ZodArray<z.ZodString>>;
245
266
  minScore: z.ZodOptional<z.ZodNumber>;
267
+ }, z.core.$strip>, z.ZodObject<{
268
+ kind: z.ZodLiteral<"stationary">;
269
+ deviceIds: z.ZodArray<z.ZodNumber>;
270
+ classes: z.ZodOptional<z.ZodArray<z.ZodString>>;
271
+ zones: z.ZodOptional<z.ZodArray<z.ZodString>>;
272
+ phase: z.ZodEnum<{
273
+ appeared: "appeared";
274
+ departed: "departed";
275
+ }>;
246
276
  }, z.core.$strip>, z.ZodObject<{
247
277
  kind: z.ZodLiteral<"interval">;
248
278
  minutes: z.ZodNumber;
@@ -0,0 +1,48 @@
1
+ /**
2
+ * The `stationary` trigger's per-event decision: does this parked-object change
3
+ * start a run, and if not, WHY not.
4
+ *
5
+ * Source: `EventCategory.PipelineAnalyticsStationaryChanged` — payload
6
+ * {@link PipelineAnalyticsStationaryChangedPayload} (`deviceId`, `entryId`,
7
+ * `className`, `phase` appeared|departed, `zones`). The device is in the DATA.
8
+ *
9
+ * Stateless: the registry emits one event per transition, so there is no
10
+ * once-per-subject set to keep (unlike `detection`, whose track emits many
11
+ * updates). A change of the OTHER phase is not this trigger's business and is
12
+ * ignored without a trace. Events are telemetry (D8): a dropped one delays or
13
+ * misses a fire, and nothing durable depends on it.
14
+ */
15
+ import type { PipelineAnalyticsStationaryChangedPayload } from '../interfaces/event-bus.js';
16
+ import type { AutomationTrigger } from './recipe.js';
17
+ export type StationaryTrigger = Extract<AutomationTrigger, {
18
+ kind: 'stationary';
19
+ }>;
20
+ /** The fields of a stationary-changed event the trigger reads (all `unknown`: off the bus). */
21
+ export interface StationaryChangedInput {
22
+ readonly deviceId?: unknown;
23
+ readonly entryId?: unknown;
24
+ readonly className?: unknown;
25
+ readonly phase?: unknown;
26
+ readonly zones?: unknown;
27
+ }
28
+ /** What a stationary run exposes to conditions and actions. */
29
+ export interface StationaryVars {
30
+ readonly deviceId: number;
31
+ readonly className: string;
32
+ readonly zones: readonly string[];
33
+ readonly phase: PipelineAnalyticsStationaryChangedPayload['phase'];
34
+ readonly entryId: string;
35
+ }
36
+ export type StationaryDecision = {
37
+ readonly kind: 'ignore';
38
+ readonly why: string;
39
+ } | {
40
+ readonly kind: 'reject';
41
+ readonly reason: string;
42
+ readonly vars: StationaryVars;
43
+ } | {
44
+ readonly kind: 'fire';
45
+ readonly reason: string;
46
+ readonly vars: StationaryVars;
47
+ };
48
+ export declare function evaluateStationaryTrigger(trigger: StationaryTrigger, event: StationaryChangedInput): StationaryDecision;
@@ -52,6 +52,7 @@ export declare const AutomationConditionTraceNodeSchema: z.ZodObject<{
52
52
  condition: "condition";
53
53
  expression: "expression";
54
54
  not: "not";
55
+ "stationary-present": "stationary-present";
55
56
  }>;
56
57
  outcome: z.ZodEnum<{
57
58
  fail: "fail";
@@ -131,6 +132,7 @@ export declare const AutomationRunTraceSchema: z.ZodObject<{
131
132
  condition: "condition";
132
133
  expression: "expression";
133
134
  not: "not";
135
+ "stationary-present": "stationary-present";
134
136
  }>;
135
137
  outcome: z.ZodEnum<{
136
138
  fail: "fail";
@@ -226,6 +228,7 @@ export declare const AutomationStateDocSchema: z.ZodObject<{
226
228
  condition: "condition";
227
229
  expression: "expression";
228
230
  not: "not";
231
+ "stationary-present": "stationary-present";
229
232
  }>;
230
233
  outcome: z.ZodEnum<{
231
234
  fail: "fail";
@@ -319,7 +322,7 @@ export declare function mergeSkipTraces(prev: AutomationRunTrace, next: Automati
319
322
  export declare function appendTrace(ring: readonly AutomationRunTrace[], trace: AutomationRunTrace, keep: number): AutomationRunTrace[];
320
323
  /**
321
324
  * The trigger stage of a trace from the bag a trigger handed to `run()`:
322
- * primitives only (a device-state `to` that is an object is left out), minus the
325
+ * primitives and short lists of them (a device-state `to` that is an object is left out), minus the
323
326
  * bookkeeping keys `kind` and `at`.
324
327
  */
325
328
  export declare function buildTriggerTrace(trigger: Readonly<Record<string, unknown>>, outcome: 'pass' | 'fail', reason: string): AutomationTriggerTrace;
@@ -157,6 +157,7 @@ export declare const actionsCapability: {
157
157
  condition: "condition";
158
158
  expression: "expression";
159
159
  not: "not";
160
+ "stationary-present": "stationary-present";
160
161
  }>;
161
162
  outcome: z.ZodEnum<{
162
163
  fail: "fail";
@@ -11,8 +11,8 @@ import { DeviceType } from '../device/device-type.js';
11
11
  * as siblings keeps a single timestamp + one slice subscription.
12
12
  */
13
13
  export declare const AirQualitySensorStatusSchema: z.ZodObject<{
14
- co2Ppm: z.ZodOptional<z.ZodNumber>;
15
- vocPpb: z.ZodOptional<z.ZodNumber>;
14
+ co2: z.ZodOptional<z.ZodNumber>;
15
+ voc: z.ZodOptional<z.ZodNumber>;
16
16
  pm25: z.ZodOptional<z.ZodNumber>;
17
17
  pm10: z.ZodOptional<z.ZodNumber>;
18
18
  aqi: z.ZodOptional<z.ZodNumber>;
@@ -28,8 +28,8 @@ export declare const airQualitySensorCapability: {
28
28
  readonly methods: {};
29
29
  readonly status: {
30
30
  readonly schema: z.ZodObject<{
31
- co2Ppm: z.ZodOptional<z.ZodNumber>;
32
- vocPpb: z.ZodOptional<z.ZodNumber>;
31
+ co2: z.ZodOptional<z.ZodNumber>;
32
+ voc: z.ZodOptional<z.ZodNumber>;
33
33
  pm25: z.ZodOptional<z.ZodNumber>;
34
34
  pm10: z.ZodOptional<z.ZodNumber>;
35
35
  aqi: z.ZodOptional<z.ZodNumber>;
@@ -38,8 +38,8 @@ export declare const airQualitySensorCapability: {
38
38
  readonly kind: 'push';
39
39
  };
40
40
  readonly runtimeState: z.ZodObject<{
41
- co2Ppm: z.ZodOptional<z.ZodNumber>;
42
- vocPpb: z.ZodOptional<z.ZodNumber>;
41
+ co2: z.ZodOptional<z.ZodNumber>;
42
+ voc: z.ZodOptional<z.ZodNumber>;
43
43
  pm25: z.ZodOptional<z.ZodNumber>;
44
44
  pm10: z.ZodOptional<z.ZodNumber>;
45
45
  aqi: z.ZodOptional<z.ZodNumber>;
@@ -57,12 +57,12 @@ export declare const airQualitySensorCapability: {
57
57
  */
58
58
  readonly history: {
59
59
  readonly fields: {
60
- readonly co2Ppm: {
60
+ readonly co2: {
61
61
  readonly kind: 'gauge';
62
62
  readonly unit: 'ppm';
63
63
  readonly deadband: 5;
64
64
  };
65
- readonly vocPpb: {
65
+ readonly voc: {
66
66
  readonly kind: 'gauge';
67
67
  readonly unit: 'ppb';
68
68
  readonly deadband: 5;
@@ -6,7 +6,7 @@ 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.ZodNullable<z.ZodNumber>;
9
+ illuminance: z.ZodNullable<z.ZodNumber>;
10
10
  lastFetchedAt: z.ZodNumber;
11
11
  }, z.core.$strip>;
12
12
  export type AmbientLightSensorStatus = z.infer<typeof AmbientLightSensorStatusSchema>;
@@ -19,13 +19,13 @@ export declare const ambientLightSensorCapability: {
19
19
  readonly methods: {};
20
20
  readonly status: {
21
21
  readonly schema: z.ZodObject<{
22
- lux: z.ZodNullable<z.ZodNumber>;
22
+ illuminance: z.ZodNullable<z.ZodNumber>;
23
23
  lastFetchedAt: z.ZodNumber;
24
24
  }, z.core.$strip>;
25
25
  readonly kind: 'push';
26
26
  };
27
27
  readonly runtimeState: z.ZodObject<{
28
- lux: z.ZodNullable<z.ZodNumber>;
28
+ illuminance: z.ZodNullable<z.ZodNumber>;
29
29
  lastFetchedAt: z.ZodNumber;
30
30
  }, z.core.$strip>;
31
31
  /**
@@ -40,7 +40,7 @@ export declare const ambientLightSensorCapability: {
40
40
  */
41
41
  readonly history: {
42
42
  readonly fields: {
43
- readonly lux: {
43
+ readonly illuminance: {
44
44
  readonly kind: 'gauge';
45
45
  readonly unit: 'lx';
46
46
  readonly deadbandPct: 10;
@@ -9,7 +9,7 @@ import { DeviceType } from '../device/device-type.js';
9
9
  * threshold.
10
10
  */
11
11
  export declare const BatteryStatusSchema: z.ZodObject<{
12
- percentage: z.ZodNullable<z.ZodNumber>;
12
+ level: z.ZodNullable<z.ZodNumber>;
13
13
  charging: z.ZodEnum<{
14
14
  dc: "dc";
15
15
  none: "none";
@@ -18,7 +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
+ voltage: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
22
22
  lastContactAt: z.ZodOptional<z.ZodNumber>;
23
23
  lastFullRefreshAt: z.ZodOptional<z.ZodNumber>;
24
24
  binary: z.ZodOptional<z.ZodBoolean>;
@@ -81,7 +81,7 @@ export declare const batteryCapability: {
81
81
  readonly data: z.ZodObject<{
82
82
  deviceId: z.ZodNumber;
83
83
  status: z.ZodObject<{
84
- percentage: z.ZodNullable<z.ZodNumber>;
84
+ level: z.ZodNullable<z.ZodNumber>;
85
85
  charging: z.ZodEnum<{
86
86
  dc: "dc";
87
87
  none: "none";
@@ -90,7 +90,7 @@ export declare const batteryCapability: {
90
90
  }>;
91
91
  sleeping: z.ZodBoolean;
92
92
  lastUpdated: z.ZodNumber;
93
- volts: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
93
+ voltage: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
94
94
  lastContactAt: z.ZodOptional<z.ZodNumber>;
95
95
  lastFullRefreshAt: z.ZodOptional<z.ZodNumber>;
96
96
  binary: z.ZodOptional<z.ZodBoolean>;
@@ -100,7 +100,7 @@ export declare const batteryCapability: {
100
100
  };
101
101
  readonly status: {
102
102
  readonly schema: z.ZodObject<{
103
- percentage: z.ZodNullable<z.ZodNumber>;
103
+ level: z.ZodNullable<z.ZodNumber>;
104
104
  charging: z.ZodEnum<{
105
105
  dc: "dc";
106
106
  none: "none";
@@ -109,14 +109,14 @@ export declare const batteryCapability: {
109
109
  }>;
110
110
  sleeping: z.ZodBoolean;
111
111
  lastUpdated: z.ZodNumber;
112
- volts: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
112
+ voltage: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
113
113
  lastContactAt: z.ZodOptional<z.ZodNumber>;
114
114
  lastFullRefreshAt: z.ZodOptional<z.ZodNumber>;
115
115
  binary: z.ZodOptional<z.ZodBoolean>;
116
116
  }, z.core.$strip>;
117
117
  readonly kind: 'push';
118
118
  readonly empty: {
119
- readonly percentage: null;
119
+ readonly level: null;
120
120
  readonly charging: 'unknown';
121
121
  readonly sleeping: false;
122
122
  readonly lastUpdated: 0;
@@ -132,7 +132,7 @@ export declare const batteryCapability: {
132
132
  * the underlying driver.
133
133
  */
134
134
  readonly runtimeState: z.ZodObject<{
135
- percentage: z.ZodNullable<z.ZodNumber>;
135
+ level: z.ZodNullable<z.ZodNumber>;
136
136
  charging: z.ZodEnum<{
137
137
  dc: "dc";
138
138
  none: "none";
@@ -141,7 +141,7 @@ export declare const batteryCapability: {
141
141
  }>;
142
142
  sleeping: z.ZodBoolean;
143
143
  lastUpdated: z.ZodNumber;
144
- volts: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
144
+ voltage: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
145
145
  lastContactAt: z.ZodOptional<z.ZodNumber>;
146
146
  lastFullRefreshAt: z.ZodOptional<z.ZodNumber>;
147
147
  binary: z.ZodOptional<z.ZodBoolean>;
@@ -158,11 +158,11 @@ export declare const batteryCapability: {
158
158
  */
159
159
  readonly history: {
160
160
  readonly fields: {
161
- readonly percentage: {
161
+ readonly level: {
162
162
  readonly kind: 'gauge';
163
163
  readonly unit: '%';
164
164
  };
165
- readonly volts: {
165
+ readonly voltage: {
166
166
  readonly kind: 'gauge';
167
167
  readonly unit: 'V';
168
168
  };
@@ -171,15 +171,15 @@ export declare const batteryCapability: {
171
171
  readonly customize: {
172
172
  readonly version: 1;
173
173
  readonly targets: readonly [{
174
- readonly id: 'percentage';
174
+ readonly id: 'level';
175
175
  readonly cardinality: 'scalar';
176
176
  readonly vocabulary: {
177
177
  readonly cap: 'battery';
178
- readonly stateField: 'percentage';
178
+ readonly stateField: 'level';
179
179
  };
180
180
  readonly deviceTypes: readonly [DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter];
181
181
  readonly apply: 'add';
182
- readonly path: 'percentage';
182
+ readonly path: 'level';
183
183
  readonly sources: readonly [{
184
184
  readonly kind: 'field';
185
185
  readonly valueKinds: readonly ["number", "string"];
@@ -8,13 +8,13 @@ import { DeviceType } from '../device/device-type.js';
8
8
  * controls to this single-method surface.
9
9
  *
10
10
  * The cap is intentionally minimal: a single `setBrightness({deviceId,
11
- * percentage})` mutation plus the auto-injected `getStatus`. Drivers
11
+ * level})` mutation plus the auto-injected `getStatus`. Drivers
12
12
  * that expose richer controls (color temperature, scenes, schedules)
13
13
  * should surface those via the device's `getSettingsUISchema()`
14
14
  * instead of bloating this cap.
15
15
  */
16
16
  export declare const BrightnessStatusSchema: z.ZodObject<{
17
- percentage: z.ZodNumber;
17
+ level: z.ZodNumber;
18
18
  lastChangedAt: z.ZodNumber;
19
19
  }, z.core.$strip>;
20
20
  export type BrightnessStatus = z.infer<typeof BrightnessStatusSchema>;
@@ -27,7 +27,7 @@ export declare const brightnessCapability: {
27
27
  readonly methods: {
28
28
  readonly setBrightness: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
29
29
  deviceId: z.ZodNumber;
30
- percentage: z.ZodNumber;
30
+ level: z.ZodNumber;
31
31
  }, z.core.$strip>, z.ZodVoid, "mutation">;
32
32
  };
33
33
  readonly events: {
@@ -39,14 +39,14 @@ export declare const brightnessCapability: {
39
39
  readonly onBrightnessChanged: {
40
40
  readonly data: z.ZodObject<{
41
41
  deviceId: z.ZodNumber;
42
- percentage: z.ZodNumber;
42
+ level: z.ZodNumber;
43
43
  lastChangedAt: z.ZodNumber;
44
44
  }, z.core.$strip>;
45
45
  };
46
46
  };
47
47
  readonly status: {
48
48
  readonly schema: z.ZodObject<{
49
- percentage: z.ZodNumber;
49
+ level: z.ZodNumber;
50
50
  lastChangedAt: z.ZodNumber;
51
51
  }, z.core.$strip>;
52
52
  readonly kind: 'command-driven';
@@ -57,7 +57,7 @@ export declare const brightnessCapability: {
57
57
  * sliders surface the current level without polling the provider.
58
58
  */
59
59
  readonly runtimeState: z.ZodObject<{
60
- percentage: z.ZodNumber;
60
+ level: z.ZodNumber;
61
61
  lastChangedAt: z.ZodNumber;
62
62
  }, z.core.$strip>;
63
63
  /**
@@ -72,7 +72,7 @@ export declare const brightnessCapability: {
72
72
  */
73
73
  readonly history: {
74
74
  readonly fields: {
75
- readonly percentage: {
75
+ readonly level: {
76
76
  readonly kind: 'gauge';
77
77
  readonly unit: '%';
78
78
  readonly minIntervalMs: 0;
@@ -406,7 +406,7 @@ export declare const HISTORY_UNIT_LABELS: Readonly<Record<HistoryUnit, string>>;
406
406
  export interface CapabilityHistoryField {
407
407
  /**
408
408
  * `gauge` — a level, averaged in a rollup. `counter` — a MONOTONIC hardware
409
- * meter only (`kwhTotal`); a drop is a reset, never a negative reading. A
409
+ * meter only (`energy`); a drop is a reset, never a negative reading. A
410
410
  * counter that restarts with the addon (`pressCountSinceStart`) is not one.
411
411
  * `boolean` — stored 0/1; a rollup gives the fraction of time true.
412
412
  * `enum` — a STATE (a `z.enum`, or a `z.string` whose values are learned):
@@ -444,7 +444,7 @@ export interface CapabilityHistoryField {
444
444
  readonly deadband?: number;
445
445
  /**
446
446
  * Drop a change smaller than this percentage of the last recorded value
447
- * (RELATIVE) — for a wide-range gauge such as lux. Applied together with
447
+ * (RELATIVE) — for a wide-range gauge such as illuminance. Applied together with
448
448
  * {@link deadband} when both are set: a change must clear both.
449
449
  */
450
450
  readonly deadbandPct?: number;
@@ -608,7 +608,7 @@ export interface CapabilityDefinition<TName extends string = string, TMethods ex
608
608
  * redeclare it, they just write through `this.runtimeState
609
609
  * .setCapState('<capName>', value)`. Examples:
610
610
  *
611
- * - `batteryCapability.runtimeState`: `{ percentage, charging,
611
+ * - `batteryCapability.runtimeState`: `{ level, charging,
612
612
  * sleeping, lastUpdated }`. A Reolink Argus, a sensor proxy,
613
613
  * an ONVIF battery cam — every provider stores the
614
614
  * same shape under `state.battery`.
@@ -51,7 +51,7 @@ declare const ColorInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
51
51
  }, z.core.$strip>;
52
52
  }, z.core.$strip>, z.ZodObject<{
53
53
  mode: z.ZodLiteral<"mired">;
54
- mireds: z.ZodNumber;
54
+ colorTemperature: z.ZodNumber;
55
55
  }, z.core.$strip>], "mode">;
56
56
  export declare const ColorStatusSchema: z.ZodObject<{
57
57
  mode: z.ZodEnum<{
@@ -69,7 +69,7 @@ export declare const ColorStatusSchema: z.ZodObject<{
69
69
  s: z.ZodNumber;
70
70
  v: z.ZodNumber;
71
71
  }, z.core.$strip>>;
72
- mireds: z.ZodOptional<z.ZodNumber>;
72
+ colorTemperature: z.ZodOptional<z.ZodNumber>;
73
73
  lastChangedAt: z.ZodNumber;
74
74
  }, z.core.$strip>;
75
75
  export type ColorStatus = z.infer<typeof ColorStatusSchema>;
@@ -102,7 +102,7 @@ export declare const colorCapability: {
102
102
  }, z.core.$strip>;
103
103
  }, z.core.$strip>, z.ZodObject<{
104
104
  mode: z.ZodLiteral<"mired">;
105
- mireds: z.ZodNumber;
105
+ colorTemperature: z.ZodNumber;
106
106
  }, z.core.$strip>], "mode">;
107
107
  }, z.core.$strip>, z.ZodVoid, "mutation">;
108
108
  };
@@ -130,7 +130,7 @@ export declare const colorCapability: {
130
130
  s: z.ZodNumber;
131
131
  v: z.ZodNumber;
132
132
  }, z.core.$strip>>;
133
- mireds: z.ZodOptional<z.ZodNumber>;
133
+ colorTemperature: z.ZodOptional<z.ZodNumber>;
134
134
  lastChangedAt: z.ZodNumber;
135
135
  }, z.core.$strip>;
136
136
  };
@@ -152,7 +152,7 @@ export declare const colorCapability: {
152
152
  s: z.ZodNumber;
153
153
  v: z.ZodNumber;
154
154
  }, z.core.$strip>>;
155
- mireds: z.ZodOptional<z.ZodNumber>;
155
+ colorTemperature: z.ZodOptional<z.ZodNumber>;
156
156
  lastChangedAt: z.ZodNumber;
157
157
  }, z.core.$strip>;
158
158
  readonly kind: 'command-driven';
@@ -178,7 +178,7 @@ export declare const colorCapability: {
178
178
  s: z.ZodNumber;
179
179
  v: z.ZodNumber;
180
180
  }, z.core.$strip>>;
181
- mireds: z.ZodOptional<z.ZodNumber>;
181
+ colorTemperature: z.ZodOptional<z.ZodNumber>;
182
182
  lastChangedAt: z.ZodNumber;
183
183
  }, z.core.$strip>;
184
184
  /**