@camstack/addon-export-hap 1.2.142 → 1.2.143
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hap-export.addon.js +300 -157
- package/dist/hap-export.addon.mjs +300 -157
- package/package.json +1 -1
package/dist/hap-export.addon.js
CHANGED
|
@@ -48,7 +48,7 @@ node_fs_promises = __toESM(node_fs_promises, 1);
|
|
|
48
48
|
let node_events = require("node:events");
|
|
49
49
|
let node_dgram = require("node:dgram");
|
|
50
50
|
let node_os = require("node:os");
|
|
51
|
-
//#region ../types/dist/event-category-
|
|
51
|
+
//#region ../types/dist/event-category-BGmz_oxW.mjs
|
|
52
52
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
53
53
|
EventCategory["SystemBoot"] = "system.boot";
|
|
54
54
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -581,6 +581,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
581
581
|
*/
|
|
582
582
|
EventCategory["PipelineAudioInferenceResult"] = "pipeline.audio-inference-result";
|
|
583
583
|
EventCategory["DetectionPhaseTransition"] = "detection.phase-transition";
|
|
584
|
+
/**
|
|
585
|
+
* A camera provider's RAW onboard motion push (D673): the `MotionOnMotionChanged`
|
|
586
|
+
* data shape without `triggeredBy`, built by `providerMotionEvent`. Its one
|
|
587
|
+
* consumer is the orchestrator's camera-sensors bridge, which re-emits the
|
|
588
|
+
* camera's EFFECTIVE onboard motion as `MotionOnMotionChanged` (a pass-through
|
|
589
|
+
* for a camera with no attached sensor). Providers must not emit
|
|
590
|
+
* `MotionOnMotionChanged` themselves; `scripts/check-onboard-motion-emitters.ts`
|
|
591
|
+
* keeps it so (camera-grid is a named, deferred exception).
|
|
592
|
+
*/
|
|
584
593
|
EventCategory["ProviderMotion"] = "provider.motion";
|
|
585
594
|
EventCategory["ProviderDetection"] = "provider.detection";
|
|
586
595
|
EventCategory["EnrichmentEmbeddingStored"] = "enrichment.embedding.stored";
|
|
@@ -5419,7 +5428,7 @@ var ZodIssueCode = {
|
|
|
5419
5428
|
var ZodFirstPartyTypeKind;
|
|
5420
5429
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5421
5430
|
//#endregion
|
|
5422
|
-
//#region ../types/dist/sleep-
|
|
5431
|
+
//#region ../types/dist/sleep-CDCONfkt.mjs
|
|
5423
5432
|
/**
|
|
5424
5433
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5425
5434
|
* window to float samples (D455).
|
|
@@ -7517,7 +7526,7 @@ function errMsg$16(err) {
|
|
|
7517
7526
|
return String(err);
|
|
7518
7527
|
}
|
|
7519
7528
|
//#endregion
|
|
7520
|
-
//#region ../types/dist/composition-
|
|
7529
|
+
//#region ../types/dist/composition-D7ULvLdD.mjs
|
|
7521
7530
|
var AUDIO_ENCODER_BY_CODEC = {
|
|
7522
7531
|
opus: "libopus",
|
|
7523
7532
|
aac: "aac",
|
|
@@ -8166,21 +8175,20 @@ function portable(target) {
|
|
|
8166
8175
|
}
|
|
8167
8176
|
portable("linux64"), portable("linuxarm64"), portable("macarm64"), portable("mac64");
|
|
8168
8177
|
/**
|
|
8169
|
-
*
|
|
8170
|
-
*
|
|
8178
|
+
* THE table "which boolean of this device type counts as HIGH", and the
|
|
8179
|
+
* pure evaluator of its EDGE.
|
|
8171
8180
|
*
|
|
8172
|
-
*
|
|
8173
|
-
*
|
|
8174
|
-
*
|
|
8175
|
-
*
|
|
8176
|
-
*
|
|
8177
|
-
*
|
|
8178
|
-
* SPOSTA qui e il doorbell la ri-esporta.
|
|
8181
|
+
* ONE table for everyone who asks "is this device HIGH?": the
|
|
8182
|
+
* recorder's `RecordingTriggers.sensorDeviceIds` trigger, the post-analysis
|
|
8183
|
+
* sensor markers, the orchestrator's camera-sensors bridge and
|
|
8184
|
+
* the sources of a composite doorbell (`doorbellFeatureSources`, D671).
|
|
8185
|
+
* A second copy would diverge at the first cap added, and the symptom — "the
|
|
8186
|
+
* sensor rings the doorbell but does not record" — is exactly D62.
|
|
8179
8187
|
*
|
|
8180
|
-
* ⚠
|
|
8181
|
-
*
|
|
8182
|
-
*
|
|
8183
|
-
*
|
|
8188
|
+
* ⚠ NOT `DEVICE_STATE_READERS` (`catalogs/device-state-vocabulary.ts`), and the
|
|
8189
|
+
* two must not be unified: that one answers "what is the state WORD for a
|
|
8190
|
+
* rule" (and includes `presence`, `cover`, `alarm-panel`), this one "which
|
|
8191
|
+
* boolean's EDGE counts". Deliberately different vocabularies.
|
|
8184
8192
|
*/
|
|
8185
8193
|
/**
|
|
8186
8194
|
* Known binary / switch source caps → the boolean slice field whose
|
|
@@ -9857,22 +9865,22 @@ var CLASS_MAP_MACRO_TARGETS = [
|
|
|
9857
9865
|
"package"
|
|
9858
9866
|
];
|
|
9859
9867
|
/**
|
|
9860
|
-
*
|
|
9861
|
-
*
|
|
9868
|
+
* The FIRST-LEVEL macro classes: those an object detector emits and that
|
|
9869
|
+
* an operator can select.
|
|
9862
9870
|
*
|
|
9863
|
-
*
|
|
9871
|
+
* They are the three offered by the `object-detection` step
|
|
9864
9872
|
* (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
|
|
9865
|
-
* `enabledMacroClasses`). `package`
|
|
9866
|
-
* `MACRO_LABELS` —
|
|
9867
|
-
* `package-detection`,
|
|
9868
|
-
*
|
|
9873
|
+
* `enabledMacroClasses`). `package` is in {@link CLASS_MAP_MACRO_TARGETS} and in
|
|
9874
|
+
* `MACRO_LABELS` — it is a true macro — but NOT here: it belongs to the step
|
|
9875
|
+
* `package-detection`, whose enablement is driven by zones, and offering the
|
|
9876
|
+
* same word twice has already made an operator turn on the COCO proxy
|
|
9869
9877
|
* (suitcase/backpack/handbag) lasciando spento il detector dedicato.
|
|
9870
9878
|
*
|
|
9871
|
-
*
|
|
9872
|
-
*
|
|
9873
|
-
* (`types/detection.ts`);
|
|
9874
|
-
* (`RecordingTriggers.objectClasses`)
|
|
9875
|
-
*
|
|
9879
|
+
* ONE list. Before today the same three were hand-written in the step's offer
|
|
9880
|
+
* and a second time as the union `FirstLevelMacro`
|
|
9881
|
+
* (`types/detection.ts`); a third copy for the recording trigger
|
|
9882
|
+
* (`RecordingTriggers.objectClasses`) would have made the later divergence
|
|
9883
|
+
* invisible.
|
|
9876
9884
|
*/
|
|
9877
9885
|
var FIRST_LEVEL_MACRO_CLASSES = [
|
|
9878
9886
|
"person",
|
|
@@ -9937,17 +9945,17 @@ var RecordingStorageModeSchema = _enum([
|
|
|
9937
9945
|
"on-device-decision"
|
|
9938
9946
|
]);
|
|
9939
9947
|
/**
|
|
9940
|
-
*
|
|
9941
|
-
*
|
|
9948
|
+
* The macro classes that can open a recording window — the same
|
|
9949
|
+
* three offered by the `object-detection` step, from ONE list
|
|
9942
9950
|
* ({@link FIRST_LEVEL_MACRO_CLASSES}).
|
|
9943
9951
|
*/
|
|
9944
9952
|
var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
|
|
9945
9953
|
/**
|
|
9946
|
-
* True
|
|
9954
|
+
* True when `values` does not repeat an element.
|
|
9947
9955
|
*
|
|
9948
|
-
*
|
|
9949
|
-
*
|
|
9950
|
-
*
|
|
9956
|
+
* A duplicate is not harmless: every entry of `objectClasses` / `sensorDeviceIds`
|
|
9957
|
+
* becomes a SOURCE in `bandTriggerSources`, and the same source twice
|
|
9958
|
+
* would count its windows twice in `segmentMissedByMs`.
|
|
9951
9959
|
*/
|
|
9952
9960
|
var noDuplicates = (values) => new Set(values).size === values.length;
|
|
9953
9961
|
/** Which detectors trigger an `events`-mode band. */
|
|
@@ -9955,34 +9963,34 @@ var RecordingTriggersSchema = object({
|
|
|
9955
9963
|
motion: boolean().optional(),
|
|
9956
9964
|
audioThresholdDbfs: number().optional(),
|
|
9957
9965
|
/**
|
|
9958
|
-
*
|
|
9959
|
-
*
|
|
9960
|
-
*
|
|
9961
|
-
*
|
|
9966
|
+
* The macro classes whose detection opens a window. ABSENT = the source
|
|
9967
|
+
* is not listened to; an EMPTY array is rejected, because "events band, object
|
|
9968
|
+
* trigger on, no class" is the same shape "enabled and records
|
|
9969
|
+
* nothing, forever" that `eventsBandCanEverDemand` is written against.
|
|
9962
9970
|
*
|
|
9963
|
-
*
|
|
9964
|
-
*
|
|
9965
|
-
* `minConfidence<Macro>`
|
|
9966
|
-
* (`source: 'onboard'`)
|
|
9967
|
-
*
|
|
9971
|
+
* The signal read is ALREADY FILTERED: only `source: 'pipeline'` detections, i.e.
|
|
9972
|
+
* those that went through `enabledMacroClasses`, the
|
|
9973
|
+
* `minConfidence<Macro>` and the full-frame guard. The camera's onboard AI
|
|
9974
|
+
* (`source: 'onboard'`) goes through none of those gates and does NOT open
|
|
9975
|
+
* windows — see `recorder/object-trigger.ts`.
|
|
9968
9976
|
*/
|
|
9969
9977
|
objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
|
|
9970
9978
|
/**
|
|
9971
|
-
*
|
|
9972
|
-
*
|
|
9979
|
+
* The LINKED devices whose RISING EDGE opens a window. Absent = the source
|
|
9980
|
+
* is not listened to; an empty array is rejected for the same reason as
|
|
9973
9981
|
* `objectClasses`.
|
|
9974
9982
|
*
|
|
9975
|
-
*
|
|
9976
|
-
*
|
|
9977
|
-
*
|
|
9978
|
-
*
|
|
9979
|
-
* device (D12) —
|
|
9983
|
+
* These are SOURCE device ids, not cameras: the band names them, so the
|
|
9984
|
+
* hot path (`DeviceStateChanged`, at bus rate across the whole fleet)
|
|
9985
|
+
* does no RPC. The OFFER from which the operator picks them is another question, and
|
|
9986
|
+
* is resolved with `deviceManager.getLinkedDevices` + `getBindingsBatch` per
|
|
9987
|
+
* device (D12) — never a global list of caps.
|
|
9980
9988
|
*
|
|
9981
|
-
*
|
|
9982
|
-
* `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`)
|
|
9983
|
-
*
|
|
9984
|
-
*
|
|
9985
|
-
*
|
|
9989
|
+
* What "high" means depends on the device TYPE and is not decided here:
|
|
9990
|
+
* `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) is THE table,
|
|
9991
|
+
* the same one as the composite doorbell (D671). And it is the EDGE, not
|
|
9992
|
+
* the level: a contact found already open at runner restart does not
|
|
9993
|
+
* record.
|
|
9986
9994
|
*/
|
|
9987
9995
|
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
|
|
9988
9996
|
});
|
|
@@ -11125,7 +11133,7 @@ var DecoderSessionConfigSchema = object({
|
|
|
11125
11133
|
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
11126
11134
|
* thing: the logging settings document on the `system` cap. Two authorities
|
|
11127
11135
|
* over the values is the exact defect
|
|
11128
|
-
* `docs/design/plans/2026-08-26-
|
|
11136
|
+
* `docs/design/plans/2026-08-26-per-component-logging.md` was written to
|
|
11129
11137
|
* remove; re-introducing it from the cure side would be grotesque.
|
|
11130
11138
|
*
|
|
11131
11139
|
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
@@ -14666,7 +14674,7 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
14666
14674
|
*
|
|
14667
14675
|
* ⚠ An earlier version of this comment blamed Zod stripping, and that
|
|
14668
14676
|
* was wrong — corrected 2026-08-26 after the hop map
|
|
14669
|
-
* (`docs/design/2026-08-26-
|
|
14677
|
+
* (`docs/design/2026-08-26-topic-hop-map.md`) traced the path.
|
|
14670
14678
|
* There is **no Zod parse at all** between the door and the engine: the
|
|
14671
14679
|
* dispatcher forwards the payload verbatim and UDS carries it whole. A
|
|
14672
14680
|
* field declared here reaches `SqliteSettingsBackend` either way.
|
|
@@ -15503,7 +15511,17 @@ var SiteZoneSchema = object({
|
|
|
15503
15511
|
var ProviderStatusSchema = object({
|
|
15504
15512
|
connected: boolean(),
|
|
15505
15513
|
deviceCount: number(),
|
|
15506
|
-
error: string().optional()
|
|
15514
|
+
error: string().optional(),
|
|
15515
|
+
/**
|
|
15516
|
+
* `'orchestrator'`: this provider writes NO camera's `motion` runtime slice
|
|
15517
|
+
* — the orchestrator is its only writer (D696). Set by `BaseDeviceProvider`,
|
|
15518
|
+
* which every provider bundles, so only a provider BUILT from D696-amended
|
|
15519
|
+
* code says it. ABSENT means an older provider that may still write it (raw
|
|
15520
|
+
* VMD writes, a boot seed), and the orchestrator's provider gate keeps that
|
|
15521
|
+
* provider's cameras unwritten (`camera-sensors/motion-slice-provider-gate.ts`)
|
|
15522
|
+
* — the provider twin of the runner's `getLocalLoad().motionSliceWriter`.
|
|
15523
|
+
*/
|
|
15524
|
+
motionSliceWriter: literal("orchestrator").optional()
|
|
15507
15525
|
});
|
|
15508
15526
|
object({
|
|
15509
15527
|
externalId: string(),
|
|
@@ -16301,28 +16319,10 @@ method(object({
|
|
|
16301
16319
|
deviceIds: array(number()).readonly(),
|
|
16302
16320
|
caps: array(string()).readonly().optional()
|
|
16303
16321
|
}), record(string(), record(string(), unknown().nullable())));
|
|
16304
|
-
|
|
16305
|
-
/** Ms epoch of the last press. null = never observed since this provider started. */
|
|
16306
|
-
lastPressedAt: number().nullable(),
|
|
16307
|
-
/** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
|
|
16308
|
-
pressCountSinceStart: number()
|
|
16309
|
-
});
|
|
16310
|
-
object({
|
|
16311
|
-
deviceId: number(),
|
|
16312
|
-
timestamp: number()
|
|
16313
|
-
});
|
|
16314
|
-
/**
|
|
16315
|
-
* The `doorbell-source` extension slot's editable value (D648): the camera's
|
|
16316
|
-
* virtual-doorbell trigger devices, exactly what the wrapper's
|
|
16317
|
-
* `doorbellSources` persists (as `{ deviceId }` records).
|
|
16318
|
-
*/
|
|
16319
|
-
var DoorbellSourceSlotValueSchema = object({ deviceIds: array(number().int().positive()) });
|
|
16322
|
+
var ExtensionSlotIdSchema = _enum(["linked-devices"]);
|
|
16320
16323
|
DeviceType.Camera;
|
|
16321
|
-
DeviceType.Button, DeviceType.Camera;
|
|
16322
|
-
var ExtensionSlotIdSchema = _enum(["doorbell-source", "linked-devices"]);
|
|
16323
|
-
DeviceType.Camera, DeviceType.Camera;
|
|
16324
16324
|
/** A slot's editable value, discriminated on `slot`. */
|
|
16325
|
-
var ExtensionSlotValueSchema = discriminatedUnion("slot", [
|
|
16325
|
+
var ExtensionSlotValueSchema = discriminatedUnion("slot", [LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
|
|
16326
16326
|
DeviceType.Camera;
|
|
16327
16327
|
var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
|
|
16328
16328
|
state: literal("unreachable"),
|
|
@@ -16359,10 +16359,11 @@ var ExtensionSlotSourceSchema = object({
|
|
|
16359
16359
|
});
|
|
16360
16360
|
/**
|
|
16361
16361
|
* A DIFFERENT authority that gates whether the slot's sources do anything —
|
|
16362
|
-
* reported read-only, named, never written through this contract (D62).
|
|
16363
|
-
*
|
|
16364
|
-
*
|
|
16365
|
-
* `unknown` means the gate could
|
|
16362
|
+
* reported read-only, named, never written through this contract (D62) — e.g.
|
|
16363
|
+
* a slot whose sources act only while a wrapper is bound to the host, a
|
|
16364
|
+
* binding that belongs to `deviceManager.setWrapperActive`. No slot reports
|
|
16365
|
+
* one today (`linked-devices` answers `null`). `unknown` means the gate could
|
|
16366
|
+
* not be read; it is not "inactive" (D315).
|
|
16366
16367
|
*/
|
|
16367
16368
|
var ExtensionSlotActivationSchema = object({
|
|
16368
16369
|
state: _enum([
|
|
@@ -16378,7 +16379,7 @@ var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
|
|
|
16378
16379
|
/** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
|
|
16379
16380
|
slotRef: string(),
|
|
16380
16381
|
slot: ExtensionSlotIdSchema,
|
|
16381
|
-
/** Names the store written (D62), e.g. `
|
|
16382
|
+
/** Names the store written (D62), e.g. `device-manager:_linkedDeviceIds`. */
|
|
16382
16383
|
authority: string(),
|
|
16383
16384
|
activation: ExtensionSlotActivationSchema.nullable(),
|
|
16384
16385
|
value: ExtensionSlotValueSchema,
|
|
@@ -16656,7 +16657,7 @@ method(object({
|
|
|
16656
16657
|
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
16657
16658
|
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
16658
16659
|
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
16659
|
-
* ricontrolliamo tutti questi punti"
|
|
16660
|
+
* ricontrolliamo tutti questi punti"* [can we instrument these errors in the meantime? That way next round we recheck all these points]. Reading them meant grepping Loki and
|
|
16660
16661
|
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
16661
16662
|
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
16662
16663
|
* be READ.
|
|
@@ -20863,6 +20864,29 @@ object({
|
|
|
20863
20864
|
firstAt: number(),
|
|
20864
20865
|
lastAt: number()
|
|
20865
20866
|
});
|
|
20867
|
+
var NC_ALARM_TRIGGERED_MAX_SEC = 3600;
|
|
20868
|
+
var NcAlarmDelaySecSchema = number().int().min(0).max(600);
|
|
20869
|
+
var NcAlarmTriggeredSecSchema = number().int().min(0).max(NC_ALARM_TRIGGERED_MAX_SEC);
|
|
20870
|
+
var uniqueModes = (entries) => new Set(entries.map((e) => e.mode)).size === entries.length;
|
|
20871
|
+
var NcAlarmModeDelaysListSchema = array(object({
|
|
20872
|
+
mode: AlarmArmModeSchema,
|
|
20873
|
+
exitDelaySec: NcAlarmDelaySecSchema.optional(),
|
|
20874
|
+
entryDelaySec: NcAlarmDelaySecSchema.optional(),
|
|
20875
|
+
triggeredDurationSec: NcAlarmTriggeredSecSchema.optional()
|
|
20876
|
+
})).max(8).refine(uniqueModes, { message: "modeDelays: at most one entry per arm mode" });
|
|
20877
|
+
var NcAlarmModeDelaysEditListSchema = array(object({
|
|
20878
|
+
mode: AlarmArmModeSchema,
|
|
20879
|
+
exitDelaySec: NcAlarmDelaySecSchema.nullable().optional(),
|
|
20880
|
+
entryDelaySec: NcAlarmDelaySecSchema.nullable().optional(),
|
|
20881
|
+
triggeredDurationSec: NcAlarmTriggeredSecSchema.nullable().optional()
|
|
20882
|
+
})).max(8).refine(uniqueModes, { message: "modeDelays: at most one edit per arm mode" });
|
|
20883
|
+
/** One switch of the alarm table: put ONE device on, or take it off, ONE mode's list. */
|
|
20884
|
+
var NcAlarmNonBlockingEditSchema = object({
|
|
20885
|
+
mode: AlarmArmModeSchema,
|
|
20886
|
+
deviceId: number().int().positive(),
|
|
20887
|
+
/** true = on the list (may be open, does not block); false = off the list (blocks). */
|
|
20888
|
+
nonBlocking: boolean()
|
|
20889
|
+
});
|
|
20866
20890
|
/**
|
|
20867
20891
|
* The per-mode lists, at most one per mode. Two lists for one mode have no
|
|
20868
20892
|
* meaning a reader could agree on (union? the last one?), so they are refused
|
|
@@ -20871,10 +20895,10 @@ object({
|
|
|
20871
20895
|
var NcAlarmNonBlockingListSchema = array(object({
|
|
20872
20896
|
mode: AlarmArmModeSchema,
|
|
20873
20897
|
deviceIds: array(number().int()).max(200)
|
|
20874
|
-
})).max(8).refine(
|
|
20898
|
+
})).max(8).refine(uniqueModes, { message: "nonBlocking: at most one list per arm mode" });
|
|
20875
20899
|
/**
|
|
20876
|
-
* The three durations
|
|
20877
|
-
* transitions, and which openings each mode tolerates.
|
|
20900
|
+
* The three durations — global, and per mode since D697 — the panel's state
|
|
20901
|
+
* machine runs on, who hears about its transitions, and which openings each mode tolerates.
|
|
20878
20902
|
*
|
|
20879
20903
|
* They live on the NOTIFICATION-RULES cap, not on `alarm-panel`, on purpose:
|
|
20880
20904
|
* `alarm-panel` is `deviceNative` and its other provider mirrors somebody
|
|
@@ -20884,15 +20908,15 @@ var NcAlarmNonBlockingListSchema = array(object({
|
|
|
20884
20908
|
*/
|
|
20885
20909
|
var NcAlarmSettingsSchema = object({
|
|
20886
20910
|
/** Grace period between arming and the mode taking effect. 0 = immediate. */
|
|
20887
|
-
exitDelaySec:
|
|
20911
|
+
exitDelaySec: NcAlarmDelaySecSchema,
|
|
20888
20912
|
/** Grace period between a trigger and the alarm firing. 0 = immediate. */
|
|
20889
|
-
entryDelaySec:
|
|
20913
|
+
entryDelaySec: NcAlarmDelaySecSchema,
|
|
20890
20914
|
/**
|
|
20891
20915
|
* How long `triggered` lasts before the panel re-arms itself.
|
|
20892
20916
|
* **0 = until an operator disarms it** — the behaviour before this field
|
|
20893
20917
|
* existed, and therefore what an untouched install keeps doing.
|
|
20894
20918
|
*/
|
|
20895
|
-
triggeredDurationSec:
|
|
20919
|
+
triggeredDurationSec: NcAlarmTriggeredSecSchema,
|
|
20896
20920
|
/**
|
|
20897
20921
|
* Deprecated by D630 — every transition is announced. Parsed, never read;
|
|
20898
20922
|
* remove after one release. Optional so an older admin's patch (which still
|
|
@@ -20915,17 +20939,30 @@ var NcAlarmSettingsSchema = object({
|
|
|
20915
20939
|
* per mode is meaningful. Defaulted to `[]` so a blob stored before D630
|
|
20916
20940
|
* parses as "every opening blocks" — the behaviour it was written under.
|
|
20917
20941
|
*/
|
|
20918
|
-
nonBlocking: NcAlarmNonBlockingListSchema.default([])
|
|
20942
|
+
nonBlocking: NcAlarmNonBlockingListSchema.default([]),
|
|
20943
|
+
/**
|
|
20944
|
+
* Per arm mode, the delays that mode OVERRIDES (D697). A mode with no entry, or an entry
|
|
20945
|
+
* without a field, uses the global value above — so `[]`, the default, is exactly the
|
|
20946
|
+
* behaviour of a blob stored before this field existed. Read through `resolveModeDelays`.
|
|
20947
|
+
*/
|
|
20948
|
+
modeDelays: NcAlarmModeDelaysListSchema.default([])
|
|
20919
20949
|
});
|
|
20920
20950
|
/**
|
|
20921
20951
|
* Every field optional — a tab edits one control at a time.
|
|
20922
20952
|
*
|
|
20923
|
-
* `nonBlocking`
|
|
20924
|
-
* remove an inner `.default()`, so a patch that never
|
|
20925
|
-
* parse to `
|
|
20926
|
-
* (the same trap {@link NcRulePatchSchema} documents).
|
|
20953
|
+
* `nonBlocking` and `modeDelays` are re-declared WITHOUT their defaults:
|
|
20954
|
+
* `.partial()` does not remove an inner `.default()`, so a patch that never
|
|
20955
|
+
* named the field would parse to `[]` and wipe every mode's list on an
|
|
20956
|
+
* unrelated edit (the same trap {@link NcRulePatchSchema} documents). Here
|
|
20957
|
+
* `modeDelays` means EDITS, not the stored overrides.
|
|
20927
20958
|
*/
|
|
20928
|
-
var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.extend({
|
|
20959
|
+
var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.extend({
|
|
20960
|
+
nonBlocking: NcAlarmNonBlockingListSchema,
|
|
20961
|
+
/** Per-mode, per-field edits — NOT the whole list (see NcAlarmModeDelaysEditSchema). */
|
|
20962
|
+
modeDelays: NcAlarmModeDelaysEditListSchema,
|
|
20963
|
+
/** ONE membership change; the panel applies it to the list it holds at its turn. */
|
|
20964
|
+
nonBlockingEdit: NcAlarmNonBlockingEditSchema
|
|
20965
|
+
}).partial().refine((p) => p.nonBlocking === void 0 || p.nonBlockingEdit === void 0, { message: "nonBlocking and nonBlockingEdit are exclusive — send the whole lists or one edit" });
|
|
20929
20966
|
/**
|
|
20930
20967
|
* What one arm mode actually arms, DERIVED from the enabled rules gated on it.
|
|
20931
20968
|
* Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
|
|
@@ -21025,6 +21062,28 @@ var NcAlarmConfigSchema = object({
|
|
|
21025
21062
|
*/
|
|
21026
21063
|
live: NcAlarmLiveSchema.optional()
|
|
21027
21064
|
});
|
|
21065
|
+
var NcAlarmSensorReadingSchema = _enum([
|
|
21066
|
+
"open",
|
|
21067
|
+
"closed",
|
|
21068
|
+
"unknown",
|
|
21069
|
+
"not-opening"
|
|
21070
|
+
]);
|
|
21071
|
+
/** One device's state as the alarm reads it — the classifier the arm check uses. */
|
|
21072
|
+
var NcAlarmSensorStateSchema = object({
|
|
21073
|
+
deviceId: number().int().positive(),
|
|
21074
|
+
reading: NcAlarmSensorReadingSchema,
|
|
21075
|
+
/** The word as read (`open`, `closed`, `unlocked`, `stopped`, …); null when unknown / not an opening. */
|
|
21076
|
+
state: string().nullable(),
|
|
21077
|
+
/** Why `unknown`: the read failed, or the slice holds no word its cap defines (a placeholder included). */
|
|
21078
|
+
unknownWhy: _enum(["read-failed", "unknown-word"]).nullable(),
|
|
21079
|
+
/** The device manager's liveness as the centre mirrors it; null = not known. */
|
|
21080
|
+
online: boolean().nullable()
|
|
21081
|
+
});
|
|
21082
|
+
var NcAlarmSensorsInputSchema = object({ deviceIds: array(number().int().positive()).max(500) });
|
|
21083
|
+
var NcAlarmSensorsSchema = object({
|
|
21084
|
+
sensors: array(NcAlarmSensorStateSchema),
|
|
21085
|
+
readAt: number().int().nonnegative()
|
|
21086
|
+
});
|
|
21028
21087
|
/**
|
|
21029
21088
|
* ONE rule's demand on ONE camera's clip ring.
|
|
21030
21089
|
*
|
|
@@ -21115,7 +21174,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
|
|
|
21115
21174
|
}), method(object({}), NcAlarmConfigSchema, { auth: "admin" }), method(object({ patch: NcAlarmSettingsPatchSchema }), NcAlarmConfigSchema, {
|
|
21116
21175
|
kind: "mutation",
|
|
21117
21176
|
auth: "admin"
|
|
21118
|
-
});
|
|
21177
|
+
}), method(NcAlarmSensorsInputSchema, NcAlarmSensorsSchema, { auth: "admin" });
|
|
21119
21178
|
/**
|
|
21120
21179
|
* Zod schemas for persisted record types.
|
|
21121
21180
|
*
|
|
@@ -21462,12 +21521,26 @@ var CameraSensorRefSchema = object({
|
|
|
21462
21521
|
function cameraSensorRefKey(ref) {
|
|
21463
21522
|
return `${ref.addonId}/${ref.stableId}`;
|
|
21464
21523
|
}
|
|
21465
|
-
/**
|
|
21466
|
-
|
|
21467
|
-
|
|
21468
|
-
|
|
21469
|
-
|
|
21470
|
-
|
|
21524
|
+
/**
|
|
21525
|
+
* A sensor's mode (D673). `in-addition`: its motion is the camera's motion too.
|
|
21526
|
+
* `replace`: its motion is the camera's, and while one is READY the camera's
|
|
21527
|
+
* own motion no longer counts on its own. `confirm`: while one is READY the
|
|
21528
|
+
* camera's own motion counts only while a confirm sensor is active — with or
|
|
21529
|
+
* without a replace sensor (spec C2, the controller's ruling on Q1).
|
|
21530
|
+
*/
|
|
21531
|
+
var CameraSensorModeSchema = _enum([
|
|
21532
|
+
"in-addition",
|
|
21533
|
+
"confirm",
|
|
21534
|
+
"replace"
|
|
21535
|
+
]);
|
|
21536
|
+
/** A stored sensor with no mode — every CS-1 row — is in addition. */
|
|
21537
|
+
var DEFAULT_CAMERA_SENSOR_MODE = "in-addition";
|
|
21538
|
+
/**
|
|
21539
|
+
* A camera's attached sensors. A CS-1 row carried an envelope
|
|
21540
|
+
* `mode: 'in-addition'`: `z.object` drops it on parse, and the PARSED value is
|
|
21541
|
+
* what the write stores (D672 rule 3), so it is never written again.
|
|
21542
|
+
*/
|
|
21543
|
+
var CameraSensorsConfigSchema = object({ sensors: array(CameraSensorRefSchema.extend({ mode: CameraSensorModeSchema.default(DEFAULT_CAMERA_SENSOR_MODE) })).min(1).max(8) }).superRefine((value, ctx) => {
|
|
21471
21544
|
const seen = /* @__PURE__ */ new Set();
|
|
21472
21545
|
value.sensors.forEach((ref, index) => {
|
|
21473
21546
|
const key = cameraSensorRefKey(ref);
|
|
@@ -21479,39 +21552,41 @@ var CameraSensorsConfigSchema = object({
|
|
|
21479
21552
|
seen.add(key);
|
|
21480
21553
|
});
|
|
21481
21554
|
});
|
|
21482
|
-
|
|
21555
|
+
/** Every attachment names its mode; an older orchestrator that does not is in addition. */
|
|
21556
|
+
var AttachmentFields = {
|
|
21483
21557
|
addonId: string(),
|
|
21484
|
-
stableId: string()
|
|
21558
|
+
stableId: string(),
|
|
21559
|
+
mode: CameraSensorModeSchema.default(DEFAULT_CAMERA_SENSOR_MODE)
|
|
21485
21560
|
};
|
|
21486
21561
|
var CameraSensorAttachmentSchema = discriminatedUnion("state", [
|
|
21487
21562
|
object({
|
|
21488
|
-
...
|
|
21563
|
+
...AttachmentFields,
|
|
21489
21564
|
state: literal("ready"),
|
|
21490
21565
|
deviceId: number(),
|
|
21491
21566
|
name: string(),
|
|
21492
21567
|
caps: array(string()).readonly()
|
|
21493
21568
|
}),
|
|
21494
21569
|
object({
|
|
21495
|
-
...
|
|
21570
|
+
...AttachmentFields,
|
|
21496
21571
|
state: literal("offline"),
|
|
21497
21572
|
deviceId: number(),
|
|
21498
21573
|
name: string(),
|
|
21499
21574
|
reason: _enum(["offline", "disabled"])
|
|
21500
21575
|
}),
|
|
21501
21576
|
object({
|
|
21502
|
-
...
|
|
21577
|
+
...AttachmentFields,
|
|
21503
21578
|
state: literal("missing"),
|
|
21504
21579
|
reason: string()
|
|
21505
21580
|
}),
|
|
21506
21581
|
object({
|
|
21507
|
-
...
|
|
21582
|
+
...AttachmentFields,
|
|
21508
21583
|
state: literal("unsupported"),
|
|
21509
21584
|
deviceId: number(),
|
|
21510
21585
|
name: string(),
|
|
21511
21586
|
reason: string()
|
|
21512
21587
|
}),
|
|
21513
21588
|
object({
|
|
21514
|
-
...
|
|
21589
|
+
...AttachmentFields,
|
|
21515
21590
|
state: literal("unreadable"),
|
|
21516
21591
|
reason: string()
|
|
21517
21592
|
})
|
|
@@ -21524,17 +21599,49 @@ var CameraSensorAttachmentSchema = discriminatedUnion("state", [
|
|
|
21524
21599
|
* say.
|
|
21525
21600
|
*/
|
|
21526
21601
|
var CameraSensorsNotForwardedSchema = _enum(["onboard-not-listed", "no-active-detection"]);
|
|
21602
|
+
/** Whether the camera's OWN motion counts on its own (D673 C2), from its READY sensors (C3). */
|
|
21603
|
+
var CameraOwnMotionSchema = _enum([
|
|
21604
|
+
"always",
|
|
21605
|
+
"when-confirmed",
|
|
21606
|
+
"never"
|
|
21607
|
+
]);
|
|
21608
|
+
/** Confirm / Replace cannot suppress this camera's motion: its provider still emits it directly (D673 C13). */
|
|
21609
|
+
var CameraSensorsNotEnforcedSchema = _enum(["provider-not-split"]);
|
|
21610
|
+
/**
|
|
21611
|
+
* The camera's OWN onboard motion (D696): the raw input the bridge combines,
|
|
21612
|
+
* never the effective value. The camera's `motion` slice is the effective one,
|
|
21613
|
+
* so a view of the camera's own row reads this.
|
|
21614
|
+
* - `atMs`: when the bridge received the camera's last own edge.
|
|
21615
|
+
* - `detected`: evaluated WHEN THE STATUS IS ASKED — the last edge said `true`
|
|
21616
|
+
* AND it is younger than the window the bridge counts the camera's own motion
|
|
21617
|
+
* for (`motionCooldownMs`, floored at two sustain ticks). A camera that never
|
|
21618
|
+
* sends a clear (heartbeats only) therefore reads `false` once no push came
|
|
21619
|
+
* within the window; a status read is a snapshot, so a live view re-asks.
|
|
21620
|
+
* Absent = this orchestrator has not received the camera's own motion since it
|
|
21621
|
+
* started (unknown, never "quiet"), or an orchestrator older than D696.
|
|
21622
|
+
*/
|
|
21623
|
+
var CameraRawLevelSchema = object({
|
|
21624
|
+
detected: boolean(),
|
|
21625
|
+
atMs: number()
|
|
21626
|
+
});
|
|
21527
21627
|
var CameraSensorsStatusSchema = discriminatedUnion("state", [
|
|
21528
|
-
object({
|
|
21628
|
+
object({
|
|
21629
|
+
state: literal("not-configured"),
|
|
21630
|
+
cameraLevel: CameraRawLevelSchema.optional()
|
|
21631
|
+
}),
|
|
21529
21632
|
object({
|
|
21530
21633
|
state: literal("unreadable"),
|
|
21531
|
-
reason: string()
|
|
21634
|
+
reason: string(),
|
|
21635
|
+
cameraLevel: CameraRawLevelSchema.optional()
|
|
21532
21636
|
}),
|
|
21533
21637
|
object({
|
|
21534
21638
|
state: literal("configured"),
|
|
21535
|
-
|
|
21639
|
+
cameraLevel: CameraRawLevelSchema.optional(),
|
|
21536
21640
|
sensors: array(CameraSensorAttachmentSchema).readonly(),
|
|
21537
|
-
|
|
21641
|
+
/** Absent = an orchestrator older than CS-2: it does not say (D315). */
|
|
21642
|
+
cameraMotion: CameraOwnMotionSchema.optional(),
|
|
21643
|
+
notForwarded: CameraSensorsNotForwardedSchema.optional(),
|
|
21644
|
+
notEnforced: CameraSensorsNotEnforcedSchema.optional()
|
|
21538
21645
|
})
|
|
21539
21646
|
]);
|
|
21540
21647
|
Object.freeze({
|
|
@@ -22219,14 +22326,14 @@ var TrackSchema = object({
|
|
|
22219
22326
|
* `derive-returned-null tile=standin`,
|
|
22220
22327
|
* `native-tile tile=native no-key-frame-at-close`, …) written at close and
|
|
22221
22328
|
* CLEARED by the late-keyFrame upgrade when a native tile lands after all.
|
|
22222
|
-
* The operator-facing answer to "perché manca l'immagine?" on a track whose
|
|
22329
|
+
* The operator-facing answer to "perché manca l'immagine?" [why is the image missing?] on a track whose
|
|
22223
22330
|
* tile is a face/plate stand-in, a raster crop, or an icon.
|
|
22224
22331
|
*
|
|
22225
22332
|
* **`no-key-frame-at-close` (D400).** The line used to be written ONLY when
|
|
22226
22333
|
* the TILE ranked below native, so a track whose thumbnail landed natively
|
|
22227
22334
|
* while its key frame missed carried no reason at all — three of the four
|
|
22228
22335
|
* `MISSING_KEYFRAME` tracks in the 2026-09-07 operator audit were exactly
|
|
22229
|
-
* that shape, and their "niente ultimo" had no cause anywhere on the row.
|
|
22336
|
+
* that shape, and their "niente ultimo" [no last frame] had no cause anywhere on the row.
|
|
22230
22337
|
* The key frame is the head of a cascade (`keyFrame ⇒ keyFrameSmall ⇒ the
|
|
22231
22338
|
* lastFrame copy source`), so its absence is now on this line whatever the
|
|
22232
22339
|
* tile ended up being.
|
|
@@ -22313,7 +22420,7 @@ var MotionEventSchema = object({
|
|
|
22313
22420
|
/**
|
|
22314
22421
|
* Ms offsets from `timestamp` (the episode's own first rising edge, so the
|
|
22315
22422
|
* first entry is always `0`) of every genuine off→on transition the
|
|
22316
|
-
* episode saw — "ogni evento on si deve salvare" (D475). NOT one entry per
|
|
22423
|
+
* episode saw — "ogni evento on si deve salvare" [every ON event must be saved] (D475). NOT one entry per
|
|
22317
22424
|
* push: a firmware source that keepalives at ~1 Hz for the whole burst
|
|
22318
22425
|
* (Reolink, Hikvision) produces exactly one edge; a source that reports an
|
|
22319
22426
|
* explicit `false` mid-episode and then resumes before the quiet window
|
|
@@ -24725,8 +24832,10 @@ var RunnerCameraConfigSchema = object({
|
|
|
24725
24832
|
* - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
|
|
24726
24833
|
* analyzer providers) running on decoded frames in this runner.
|
|
24727
24834
|
* - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
|
|
24728
|
-
* analytics). The provider emits ProviderMotion
|
|
24729
|
-
*
|
|
24835
|
+
* analytics). The provider emits its raw push as `ProviderMotion`
|
|
24836
|
+
* (D673); the orchestrator's camera-sensors bridge re-emits the camera's
|
|
24837
|
+
* effective motion as `MotionOnMotionChanged`, which is what reaches
|
|
24838
|
+
* `reportMotion`.
|
|
24730
24839
|
*/
|
|
24731
24840
|
motionSources: MotionSourcesSchema.default(["analyzer"]),
|
|
24732
24841
|
/**
|
|
@@ -24903,7 +25012,15 @@ var RunnerLocalLoadSchema = object({
|
|
|
24903
25012
|
hasGpu: boolean(),
|
|
24904
25013
|
inferenceBackend: string().optional(),
|
|
24905
25014
|
cpuCores: number().optional()
|
|
24906
|
-
})
|
|
25015
|
+
}),
|
|
25016
|
+
/**
|
|
25017
|
+
* Who writes a camera's `motion` runtime slice (D696). `'orchestrator'`: this
|
|
25018
|
+
* runner never writes it. ABSENT = a runner older than D696, which still
|
|
25019
|
+
* writes the slice from its phase machine; the orchestrator does not write
|
|
25020
|
+
* while any runner node is absent-or-unanswered, so one slice never has two
|
|
25021
|
+
* writers.
|
|
25022
|
+
*/
|
|
25023
|
+
motionSliceWriter: literal("orchestrator").optional()
|
|
24907
25024
|
});
|
|
24908
25025
|
/**
|
|
24909
25026
|
* Aggregate runtime metrics for the runner's whole local pool. Mirrors the
|
|
@@ -27539,7 +27656,7 @@ var ClipPlaybackSchema = object({
|
|
|
27539
27656
|
* **One authorised yes is one wake.** `next-natural` — take the clip the next
|
|
27540
27657
|
* time the camera is awake for its own reasons — is deliberately not a member:
|
|
27541
27658
|
* it was proposed, it is free on the battery, and the operator declined it on
|
|
27542
|
-
* 2026-09-20 (*"Quando un export viene richiesto si sveglia la camera."
|
|
27659
|
+
* 2026-09-20 (*"Quando un export viene richiesto si sveglia la camera."* [When an export is requested the camera wakes up],
|
|
27543
27660
|
* D558 "Considered and not taken").
|
|
27544
27661
|
*/
|
|
27545
27662
|
var ClipWakeSchema = _enum(["authorised"]);
|
|
@@ -27806,7 +27923,7 @@ var videoclipsCapability = {
|
|
|
27806
27923
|
* **It is a SECTION of the Recording tab, at the end of it — not a tab of
|
|
27807
27924
|
* its own.** It shipped as a `clips` top-tab and the operator rejected the
|
|
27808
27925
|
* placement: *"utilizzerei la stessa tab recordings, lì abbiamo già tutto il
|
|
27809
|
-
* necessario, una nuova sezione alla fine per le clips"
|
|
27926
|
+
* necessario, una nuova sezione alla fine per le clips"* [I would use the same recordings tab, there we already have everything necessary, a new section at the end for the clips]. The Recording tab
|
|
27810
27927
|
* already holds the recorder's panel, the schedule bands and the unified
|
|
27811
27928
|
* retention policy; footage the camera itself holds is the same question,
|
|
27812
27929
|
* asked of a different store. `order: 100` puts it after all of them with
|
|
@@ -27867,7 +27984,7 @@ var videoclipsCapability = {
|
|
|
27867
27984
|
* It replaced `sources?: string[]`, a VIEW filter over source ids that
|
|
27868
27985
|
* assumed the answer was a fan-out over everything a camera has. The
|
|
27869
27986
|
* operator settled otherwise on 2026-09-20 — *"l'utilizzatore è uno
|
|
27870
|
-
* solo"* — so the list is asked of one provider at a time and there is
|
|
27987
|
+
* solo"* [there is only one user] — so the list is asked of one provider at a time and there is
|
|
27871
27988
|
* nothing to filter out of it.
|
|
27872
27989
|
*/
|
|
27873
27990
|
provider: string().min(1)
|
|
@@ -29957,6 +30074,17 @@ object({
|
|
|
29957
30074
|
deviceId: number(),
|
|
29958
30075
|
status: DeviceStatusSchema
|
|
29959
30076
|
});
|
|
30077
|
+
object({
|
|
30078
|
+
/** Ms epoch of the last press. null = never observed since this provider started. */
|
|
30079
|
+
lastPressedAt: number().nullable(),
|
|
30080
|
+
/** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
|
|
30081
|
+
pressCountSinceStart: number()
|
|
30082
|
+
});
|
|
30083
|
+
object({
|
|
30084
|
+
deviceId: number(),
|
|
30085
|
+
timestamp: number()
|
|
30086
|
+
});
|
|
30087
|
+
DeviceType.Button, DeviceType.Camera;
|
|
29960
30088
|
/**
|
|
29961
30089
|
* Enum-state sensor — a string value picked from a finite option set.
|
|
29962
30090
|
* Drives HA `sensor` entries with `state_class: enum` (HVAC action
|
|
@@ -31617,9 +31745,9 @@ var MotionStatusSchema = object({
|
|
|
31617
31745
|
/** Ms epoch of the last detected-true observation. Null if never detected. */
|
|
31618
31746
|
lastDetectedAt: number().nullable(),
|
|
31619
31747
|
/**
|
|
31620
|
-
* `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device
|
|
31621
|
-
* `null` while false and on every `Sensor`
|
|
31622
|
-
* constant's doc for the one-authority rule.
|
|
31748
|
+
* `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device (the
|
|
31749
|
+
* orchestrator writes it, D696), `null` while false and on every `Sensor`
|
|
31750
|
+
* device (D475) — see that constant's doc for the one-authority rule.
|
|
31623
31751
|
*
|
|
31624
31752
|
* ## Reading this field still arms nothing
|
|
31625
31753
|
*
|
|
@@ -31637,38 +31765,41 @@ var MotionStatusSchema = object({
|
|
|
31637
31765
|
* `addon-export-alexa/src/motion-clear-hold.ts` and
|
|
31638
31766
|
* `addon-export-hap`'s `RESET_DEBOUNCE_MS` both do.
|
|
31639
31767
|
*
|
|
31640
|
-
* ## Who writes it
|
|
31641
|
-
*
|
|
31642
|
-
* - **Cameras** — the
|
|
31643
|
-
*
|
|
31644
|
-
* `
|
|
31645
|
-
* `
|
|
31646
|
-
*
|
|
31647
|
-
*
|
|
31648
|
-
* a
|
|
31649
|
-
*
|
|
31650
|
-
*
|
|
31651
|
-
*
|
|
31652
|
-
*
|
|
31653
|
-
*
|
|
31654
|
-
*
|
|
31655
|
-
*
|
|
31656
|
-
*
|
|
31657
|
-
*
|
|
31658
|
-
* `
|
|
31659
|
-
*
|
|
31660
|
-
*
|
|
31661
|
-
*
|
|
31662
|
-
*
|
|
31663
|
-
*
|
|
31664
|
-
*
|
|
31665
|
-
* This predates D475 and is not fixed there: the fix touches every
|
|
31666
|
-
* camera provider. Recorded in D475's Consequences. Do not restore the
|
|
31667
|
-
* "sole writer" wording without also removing the other writers.
|
|
31768
|
+
* ## Who writes it (D696)
|
|
31769
|
+
*
|
|
31770
|
+
* - **Cameras** — the orchestrator, and nothing else. It writes the camera's
|
|
31771
|
+
* EFFECTIVE motion (`addon-pipeline-orchestrator`
|
|
31772
|
+
* `camera-sensors/motion-slice.ts`), alongside the effective
|
|
31773
|
+
* `MotionOnMotionChanged` it emits or receives: the camera-sensors bridge
|
|
31774
|
+
* for a split camera, an unsplit emitter's direct event, the analyzer and
|
|
31775
|
+
* device activity, as the camera's `motionSources` counts them. A source
|
|
31776
|
+
* that never sends a clear falls one window after its last `true`.
|
|
31777
|
+
* `lastDetectedAt` moves only on an effective rise. No camera provider
|
|
31778
|
+
* writes this slice (not even a boot seed), and neither does the runner's
|
|
31779
|
+
* phase machine: its phase is "a session is attached" for every on-motion
|
|
31780
|
+
* session, not motion, and it now has its own `DetectionPhaseTransition`.
|
|
31781
|
+
* A provider's `isDetected` answers from the hub's slice.
|
|
31782
|
+
* - **Sensors** (Home Assistant binary sensors, Homematic, Matter, Alexa
|
|
31783
|
+
* imports) — the provider pushes both edges itself, from the upstream
|
|
31784
|
+
* system's own state change. That is the sensor's own fact.
|
|
31785
|
+
*
|
|
31786
|
+
* `scripts/check-onboard-motion-emitters.ts` refuses any other writer of a
|
|
31787
|
+
* `motion` slice; each sensor writer is a named exemption.
|
|
31788
|
+
*
|
|
31789
|
+
* This replaces the D475 §4 rule ("the phase machine is the sole writer").
|
|
31790
|
+
* That rule was never true: Hikvision and Amcrest wrote the slice raw beside
|
|
31791
|
+
* it, every provider seeded it at boot, and every session left it
|
|
31792
|
+
* `detected: true` after its detach.
|
|
31668
31793
|
*/
|
|
31669
31794
|
autoClearAfterMs: number().nullable()
|
|
31670
31795
|
});
|
|
31671
|
-
|
|
31796
|
+
/**
|
|
31797
|
+
* Payload of `motion.onMotionChanged` event + the corresponding bus
|
|
31798
|
+
* event `EventCategory.MotionOnMotionChanged`. Single source of truth
|
|
31799
|
+
* — both the cap event surface and the bus payload type alias to this
|
|
31800
|
+
* schema.
|
|
31801
|
+
*/
|
|
31802
|
+
var MotionOnMotionChangedDataSchema = object({
|
|
31672
31803
|
deviceId: number(),
|
|
31673
31804
|
detected: boolean(),
|
|
31674
31805
|
timestamp: number(),
|
|
@@ -34133,7 +34264,7 @@ var ReadGopBytesResultSchema = object({
|
|
|
34133
34264
|
/**
|
|
34134
34265
|
* A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
|
|
34135
34266
|
* twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
|
|
34136
|
-
* replay clip's `recording` source (`docs/design/plans/2026-08-26-replay-
|
|
34267
|
+
* replay clip's `recording` source (`docs/design/plans/2026-08-26-clip-replay-on-pipeline.md`):
|
|
34137
34268
|
* a replay needs several seconds of native pixels, not one frame.
|
|
34138
34269
|
*
|
|
34139
34270
|
* `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
|
|
@@ -41752,6 +41883,12 @@ Object.freeze({
|
|
|
41752
41883
|
addonId: null,
|
|
41753
41884
|
access: "view"
|
|
41754
41885
|
},
|
|
41886
|
+
"notificationRules.getAlarmSensors": {
|
|
41887
|
+
capName: "notification-rules",
|
|
41888
|
+
capScope: "system",
|
|
41889
|
+
addonId: null,
|
|
41890
|
+
access: "view"
|
|
41891
|
+
},
|
|
41755
41892
|
"notificationRules.getClipRetentionAsks": {
|
|
41756
41893
|
capName: "notification-rules",
|
|
41757
41894
|
capScope: "system",
|
|
@@ -46235,6 +46372,11 @@ Object.freeze({
|
|
|
46235
46372
|
form: "single",
|
|
46236
46373
|
optional: false
|
|
46237
46374
|
}],
|
|
46375
|
+
"notificationRules.getAlarmSensors": [{
|
|
46376
|
+
name: "deviceIds",
|
|
46377
|
+
form: "array",
|
|
46378
|
+
optional: false
|
|
46379
|
+
}],
|
|
46238
46380
|
"notificationRules.setDeviceMuted": [{
|
|
46239
46381
|
name: "deviceId",
|
|
46240
46382
|
form: "single",
|
|
@@ -48032,7 +48174,7 @@ var PreviewTextField = string().max(200);
|
|
|
48032
48174
|
* Whether the notification's preview is a STILL or a short animation.
|
|
48033
48175
|
*
|
|
48034
48176
|
* The operator's ask, verbatim: *"inviato come gif o video (come per le altre
|
|
48035
|
-
* rule)"* — the other rules already offer an animated preview, and a ten-hour
|
|
48177
|
+
* rule)"* [sent as a gif or video (as for the other rules)] — the other rules already offer an animated preview, and a ten-hour
|
|
48036
48178
|
* night reads better as three seconds of motion than as one frame of it. Both
|
|
48037
48179
|
* modes get the SAME treatment (blurred frame, large centred title); `'gif'`
|
|
48038
48180
|
* simply applies it to a dozen frames sampled across the render and assembles
|
|
@@ -48170,6 +48312,7 @@ TimelapseRuleInputSchema.extend({
|
|
|
48170
48312
|
createdAt: number(),
|
|
48171
48313
|
updatedAt: number()
|
|
48172
48314
|
});
|
|
48315
|
+
MotionOnMotionChangedDataSchema.omit({ triggeredBy: true });
|
|
48173
48316
|
object({
|
|
48174
48317
|
/**
|
|
48175
48318
|
* Fraction of the box's own size added on EACH side before cutting.
|