@camstack/addon-export-hap 1.2.141 → 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 +899 -369
- package/dist/hap-export.addon.mjs +899 -369
- package/package.json +2 -2
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
|
|
@@ -9706,6 +9714,82 @@ var ArchivedDebugNoteQueryInputSchema = object({
|
|
|
9706
9714
|
/** Max rows returned, newest-first. */
|
|
9707
9715
|
limit: number().int().min(1).max(1e3).optional()
|
|
9708
9716
|
});
|
|
9717
|
+
var TrackRelationKindSchema = _enum(["same-subject", "different-subjects"]);
|
|
9718
|
+
var TrackSideSchema = _enum(["before", "after"]);
|
|
9719
|
+
var TrackPurityValueSchema = _enum(["mixed", "not-a-subject"]);
|
|
9720
|
+
var TrackRelationSchema = object({
|
|
9721
|
+
id: string(),
|
|
9722
|
+
deviceId: number().int(),
|
|
9723
|
+
leftTrackId: string(),
|
|
9724
|
+
rightTrackId: string(),
|
|
9725
|
+
leftSide: TrackSideSchema.nullable(),
|
|
9726
|
+
rightSide: TrackSideSchema.nullable(),
|
|
9727
|
+
relation: TrackRelationKindSchema,
|
|
9728
|
+
presence: literal("continuous").nullable(),
|
|
9729
|
+
leftStartedAt: number().int().nullable(),
|
|
9730
|
+
rightStartedAt: number().int().nullable(),
|
|
9731
|
+
createdAt: number().int(),
|
|
9732
|
+
updatedAt: number().int(),
|
|
9733
|
+
author: string().nullable()
|
|
9734
|
+
});
|
|
9735
|
+
var TrackPuritySchema = object({
|
|
9736
|
+
id: string(),
|
|
9737
|
+
deviceId: number().int(),
|
|
9738
|
+
sourceTrackId: string(),
|
|
9739
|
+
purity: TrackPurityValueSchema,
|
|
9740
|
+
switchAtMs: number().int().nullable(),
|
|
9741
|
+
startedAt: number().int().nullable(),
|
|
9742
|
+
createdAt: number().int(),
|
|
9743
|
+
updatedAt: number().int(),
|
|
9744
|
+
author: string().nullable()
|
|
9745
|
+
});
|
|
9746
|
+
var SetTrackRelationInputSchema = object({
|
|
9747
|
+
deviceId: number().int(),
|
|
9748
|
+
trackId: string().min(1),
|
|
9749
|
+
otherTrackId: string().min(1),
|
|
9750
|
+
relation: TrackRelationKindSchema,
|
|
9751
|
+
presence: literal("continuous").optional(),
|
|
9752
|
+
trackSide: TrackSideSchema.optional(),
|
|
9753
|
+
otherSide: TrackSideSchema.optional()
|
|
9754
|
+
});
|
|
9755
|
+
var ClearTrackRelationInputSchema = object({
|
|
9756
|
+
deviceId: number().int(),
|
|
9757
|
+
trackId: string().min(1),
|
|
9758
|
+
otherTrackId: string().min(1)
|
|
9759
|
+
});
|
|
9760
|
+
var ClearTrackRelationResultSchema = object({ cleared: boolean() });
|
|
9761
|
+
var SetTrackPurityInputSchema = object({
|
|
9762
|
+
deviceId: number().int(),
|
|
9763
|
+
trackId: string().min(1),
|
|
9764
|
+
purity: _enum([
|
|
9765
|
+
"pure",
|
|
9766
|
+
"mixed",
|
|
9767
|
+
"not-a-subject"
|
|
9768
|
+
]),
|
|
9769
|
+
switchAtMs: number().int().optional()
|
|
9770
|
+
});
|
|
9771
|
+
/** `null` when `pure` cleared the row. */
|
|
9772
|
+
var SetTrackPurityResultSchema = object({ purity: TrackPuritySchema.nullable() });
|
|
9773
|
+
var ListTrackRelationsInputSchema = object({
|
|
9774
|
+
deviceId: number().int(),
|
|
9775
|
+
trackId: string().optional(),
|
|
9776
|
+
since: number().int().optional(),
|
|
9777
|
+
until: number().int().optional(),
|
|
9778
|
+
limit: number().int().min(1).max(5e3).optional()
|
|
9779
|
+
});
|
|
9780
|
+
var ListTrackRelationsResultSchema = object({
|
|
9781
|
+
relations: array(TrackRelationSchema).readonly(),
|
|
9782
|
+
purities: array(TrackPuritySchema).readonly(),
|
|
9783
|
+
truncated: boolean()
|
|
9784
|
+
});
|
|
9785
|
+
_enum([
|
|
9786
|
+
"unknown-track",
|
|
9787
|
+
"cross-device",
|
|
9788
|
+
"self-relation",
|
|
9789
|
+
"contradiction",
|
|
9790
|
+
"switch-outside-track",
|
|
9791
|
+
"switch-needs-mixed"
|
|
9792
|
+
]);
|
|
9709
9793
|
/**
|
|
9710
9794
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
9711
9795
|
* recordings and events management surfaces.
|
|
@@ -9781,22 +9865,22 @@ var CLASS_MAP_MACRO_TARGETS = [
|
|
|
9781
9865
|
"package"
|
|
9782
9866
|
];
|
|
9783
9867
|
/**
|
|
9784
|
-
*
|
|
9785
|
-
*
|
|
9868
|
+
* The FIRST-LEVEL macro classes: those an object detector emits and that
|
|
9869
|
+
* an operator can select.
|
|
9786
9870
|
*
|
|
9787
|
-
*
|
|
9871
|
+
* They are the three offered by the `object-detection` step
|
|
9788
9872
|
* (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
|
|
9789
|
-
* `enabledMacroClasses`). `package`
|
|
9790
|
-
* `MACRO_LABELS` —
|
|
9791
|
-
* `package-detection`,
|
|
9792
|
-
*
|
|
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
|
|
9793
9877
|
* (suitcase/backpack/handbag) lasciando spento il detector dedicato.
|
|
9794
9878
|
*
|
|
9795
|
-
*
|
|
9796
|
-
*
|
|
9797
|
-
* (`types/detection.ts`);
|
|
9798
|
-
* (`RecordingTriggers.objectClasses`)
|
|
9799
|
-
*
|
|
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.
|
|
9800
9884
|
*/
|
|
9801
9885
|
var FIRST_LEVEL_MACRO_CLASSES = [
|
|
9802
9886
|
"person",
|
|
@@ -9861,17 +9945,17 @@ var RecordingStorageModeSchema = _enum([
|
|
|
9861
9945
|
"on-device-decision"
|
|
9862
9946
|
]);
|
|
9863
9947
|
/**
|
|
9864
|
-
*
|
|
9865
|
-
*
|
|
9948
|
+
* The macro classes that can open a recording window — the same
|
|
9949
|
+
* three offered by the `object-detection` step, from ONE list
|
|
9866
9950
|
* ({@link FIRST_LEVEL_MACRO_CLASSES}).
|
|
9867
9951
|
*/
|
|
9868
9952
|
var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
|
|
9869
9953
|
/**
|
|
9870
|
-
* True
|
|
9954
|
+
* True when `values` does not repeat an element.
|
|
9871
9955
|
*
|
|
9872
|
-
*
|
|
9873
|
-
*
|
|
9874
|
-
*
|
|
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`.
|
|
9875
9959
|
*/
|
|
9876
9960
|
var noDuplicates = (values) => new Set(values).size === values.length;
|
|
9877
9961
|
/** Which detectors trigger an `events`-mode band. */
|
|
@@ -9879,34 +9963,34 @@ var RecordingTriggersSchema = object({
|
|
|
9879
9963
|
motion: boolean().optional(),
|
|
9880
9964
|
audioThresholdDbfs: number().optional(),
|
|
9881
9965
|
/**
|
|
9882
|
-
*
|
|
9883
|
-
*
|
|
9884
|
-
*
|
|
9885
|
-
*
|
|
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.
|
|
9886
9970
|
*
|
|
9887
|
-
*
|
|
9888
|
-
*
|
|
9889
|
-
* `minConfidence<Macro>`
|
|
9890
|
-
* (`source: 'onboard'`)
|
|
9891
|
-
*
|
|
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`.
|
|
9892
9976
|
*/
|
|
9893
9977
|
objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
|
|
9894
9978
|
/**
|
|
9895
|
-
*
|
|
9896
|
-
*
|
|
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
|
|
9897
9981
|
* `objectClasses`.
|
|
9898
9982
|
*
|
|
9899
|
-
*
|
|
9900
|
-
*
|
|
9901
|
-
*
|
|
9902
|
-
*
|
|
9903
|
-
* 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.
|
|
9904
9988
|
*
|
|
9905
|
-
*
|
|
9906
|
-
* `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`)
|
|
9907
|
-
*
|
|
9908
|
-
*
|
|
9909
|
-
*
|
|
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.
|
|
9910
9994
|
*/
|
|
9911
9995
|
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
|
|
9912
9996
|
});
|
|
@@ -11049,7 +11133,7 @@ var DecoderSessionConfigSchema = object({
|
|
|
11049
11133
|
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
11050
11134
|
* thing: the logging settings document on the `system` cap. Two authorities
|
|
11051
11135
|
* over the values is the exact defect
|
|
11052
|
-
* `docs/design/plans/2026-08-26-
|
|
11136
|
+
* `docs/design/plans/2026-08-26-per-component-logging.md` was written to
|
|
11053
11137
|
* remove; re-introducing it from the cure side would be grotesque.
|
|
11054
11138
|
*
|
|
11055
11139
|
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
@@ -12413,6 +12497,68 @@ method(object({
|
|
|
12413
12497
|
password: string()
|
|
12414
12498
|
}), AuthResultSchema.nullable(), { kind: "mutation" }), method(object({ state: string() }), string()), method(record(string(), string()), AuthResultSchema, { kind: "mutation" }), method(object({ token: string() }), AuthResultSchema.nullable());
|
|
12415
12499
|
/**
|
|
12500
|
+
* How long one snapshot may take end to end: the pinned copy of the whole
|
|
12501
|
+
* database plus `PRAGMA integrity_check` over the copy, on the hub's slowest
|
|
12502
|
+
* disk. ~800 MB at a pessimistic 10 MB/s is under 3 minutes; the bound is
|
|
12503
|
+
* generous because a timeout fails the whole backup run.
|
|
12504
|
+
*/
|
|
12505
|
+
var DATABASE_SNAPSHOT_TIMEOUT_MS = 30 * 6e4;
|
|
12506
|
+
/**
|
|
12507
|
+
* The databases an owner snapshots — declared by the OWNER, so a caller never
|
|
12508
|
+
* guesses which file is live from what sits beside it (a cleanly closed
|
|
12509
|
+
* database has no sidecars and is just as owned). Paths are absolute on the
|
|
12510
|
+
* owner's host.
|
|
12511
|
+
*/
|
|
12512
|
+
var DatabaseSnapshotTargetsSchema = object({ databases: array(object({ livePath: string() })) });
|
|
12513
|
+
/** One b-tree table of the snapshot and the rows it holds. */
|
|
12514
|
+
var DatabaseSnapshotTableSchema = object({
|
|
12515
|
+
name: string(),
|
|
12516
|
+
rows: number().int().nonnegative()
|
|
12517
|
+
});
|
|
12518
|
+
/**
|
|
12519
|
+
* What the owner wrote. Every path is ABSOLUTE on the owner's host — the
|
|
12520
|
+
* caller pins the call to its own node, so it can read the file; a caller
|
|
12521
|
+
* that finds the path outside its own data root refuses it rather than
|
|
12522
|
+
* archiving something it cannot place.
|
|
12523
|
+
*/
|
|
12524
|
+
var DatabaseSnapshotResultSchema = object({
|
|
12525
|
+
/** The live database the snapshot copies. Never to be copied as a file. */
|
|
12526
|
+
livePath: string(),
|
|
12527
|
+
/** The verified copy: `<livePath>` + {@link DATABASE_SNAPSHOT_SUFFIX}. */
|
|
12528
|
+
snapshotPath: string(),
|
|
12529
|
+
sizeBytes: number().int().nonnegative(),
|
|
12530
|
+
pageCount: number().int().nonnegative(),
|
|
12531
|
+
pageSize: number().int().positive(),
|
|
12532
|
+
/**
|
|
12533
|
+
* Every b-tree table with its row count. Read inside the SAME read
|
|
12534
|
+
* transaction the copy was taken from, and found EQUAL on the copy — so
|
|
12535
|
+
* this is the content of the snapshot, not an estimate of the source.
|
|
12536
|
+
*/
|
|
12537
|
+
tables: array(DatabaseSnapshotTableSchema),
|
|
12538
|
+
/** Wall time of the pinned copy (row counts included). */
|
|
12539
|
+
copyMs: number().nonnegative(),
|
|
12540
|
+
/** Wall time of the checks on the copy (`integrity_check`, row counts). */
|
|
12541
|
+
verifyMs: number().nonnegative(),
|
|
12542
|
+
/** When the pinned read transaction began (ms epoch) — the snapshot's instant. */
|
|
12543
|
+
takenAt: number()
|
|
12544
|
+
});
|
|
12545
|
+
/**
|
|
12546
|
+
* A snapshot as an ARCHIVE records it (`ArchiveManifest.sqliteSnapshots`):
|
|
12547
|
+
* the same facts, with both paths relative to the archive root (the node's
|
|
12548
|
+
* data dir), because an archive outlives the host that made it.
|
|
12549
|
+
*/
|
|
12550
|
+
var ArchiveSqliteSnapshotSchema = DatabaseSnapshotResultSchema.extend({
|
|
12551
|
+
/** Archive-relative path of the live database the archive does NOT carry. */
|
|
12552
|
+
livePath: string(),
|
|
12553
|
+
/** Archive-relative path of the verified copy it carries in its place. */
|
|
12554
|
+
snapshotPath: string()
|
|
12555
|
+
});
|
|
12556
|
+
method(object({}), DatabaseSnapshotTargetsSchema, { auth: "admin" }), method(object({}), DatabaseSnapshotResultSchema, {
|
|
12557
|
+
kind: "mutation",
|
|
12558
|
+
auth: "admin",
|
|
12559
|
+
timeoutMs: DATABASE_SNAPSHOT_TIMEOUT_MS
|
|
12560
|
+
});
|
|
12561
|
+
/**
|
|
12416
12562
|
* Orchestrator-side destination metadata. The orchestrator computes
|
|
12417
12563
|
* `id = <addonId>:<subId>` from its provider lookup so consumers
|
|
12418
12564
|
* (admin UI, restore flow) see one canonical key.
|
|
@@ -12523,7 +12669,12 @@ var ArchiveManifestSchema = object({
|
|
|
12523
12669
|
locations: array(string()),
|
|
12524
12670
|
entries: array(ArchiveEntrySchema),
|
|
12525
12671
|
totalBytes: number(),
|
|
12526
|
-
totalFiles: number()
|
|
12672
|
+
totalFiles: number(),
|
|
12673
|
+
/**
|
|
12674
|
+
* Live SQLite databases this archive carries as their OWNER's verified
|
|
12675
|
+
* snapshot instead of as files (D693). Absent on archives made before.
|
|
12676
|
+
*/
|
|
12677
|
+
sqliteSnapshots: array(ArchiveSqliteSnapshotSchema).optional()
|
|
12527
12678
|
});
|
|
12528
12679
|
var LocationStatSchema = object({
|
|
12529
12680
|
name: string(),
|
|
@@ -13947,6 +14098,116 @@ var CompositionBlockStateSchema = object({
|
|
|
13947
14098
|
reason: string().optional(),
|
|
13948
14099
|
fields: array(CompositionFieldStateSchema)
|
|
13949
14100
|
});
|
|
14101
|
+
var ComposerBlockSchema = object({
|
|
14102
|
+
id: string().min(1),
|
|
14103
|
+
name: string().min(1).max(120),
|
|
14104
|
+
enabled: boolean(),
|
|
14105
|
+
updatedAt: number(),
|
|
14106
|
+
composition: CompositionSchema
|
|
14107
|
+
});
|
|
14108
|
+
/**
|
|
14109
|
+
* A stored composition row that no longer PARSES — a schema a release
|
|
14110
|
+
* tightened, a row written by a newer build. Sent by id so the composer keeps
|
|
14111
|
+
* its device as a placeholder and reports the block `failed` naming the parse
|
|
14112
|
+
* error. Leaving it out would read, twice, exactly like a delete (D49).
|
|
14113
|
+
*/
|
|
14114
|
+
var ComposerUnreadableBlockSchema = object({
|
|
14115
|
+
id: string().min(1),
|
|
14116
|
+
/** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
|
|
14117
|
+
name: string().nullable(),
|
|
14118
|
+
/** The parse error, in the operator's words. */
|
|
14119
|
+
error: string()
|
|
14120
|
+
});
|
|
14121
|
+
method(object({
|
|
14122
|
+
/** The shared Blocks integration; null until `core-blocks` has reconciled it. */
|
|
14123
|
+
integrationId: string().nullable(),
|
|
14124
|
+
/** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
|
|
14125
|
+
storeLoaded: boolean(),
|
|
14126
|
+
blocks: array(ComposerBlockSchema),
|
|
14127
|
+
/** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
|
|
14128
|
+
restartBlockIds: array(string()),
|
|
14129
|
+
/** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
|
|
14130
|
+
unreadableBlocks: array(ComposerUnreadableBlockSchema)
|
|
14131
|
+
}), object({
|
|
14132
|
+
blocks: array(object({
|
|
14133
|
+
blockId: string(),
|
|
14134
|
+
status: CompositionRunStatusSchema,
|
|
14135
|
+
reason: string().optional()
|
|
14136
|
+
})),
|
|
14137
|
+
/**
|
|
14138
|
+
* False when the composer declared and withdrew NOTHING (store not loaded,
|
|
14139
|
+
* integration unknown, its own rows unread or read empty once). An empty
|
|
14140
|
+
* apply the caller owes is paid off only by one the composer acted on (D49).
|
|
14141
|
+
*/
|
|
14142
|
+
acted: boolean()
|
|
14143
|
+
}), {
|
|
14144
|
+
kind: "mutation",
|
|
14145
|
+
auth: "admin"
|
|
14146
|
+
}), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
|
|
14147
|
+
var NUMBER = {
|
|
14148
|
+
kind: "fixed",
|
|
14149
|
+
result: ["number"]
|
|
14150
|
+
};
|
|
14151
|
+
var BOOLEAN = {
|
|
14152
|
+
kind: "fixed",
|
|
14153
|
+
result: ["boolean"]
|
|
14154
|
+
};
|
|
14155
|
+
Object.freeze({
|
|
14156
|
+
min: NUMBER,
|
|
14157
|
+
max: NUMBER,
|
|
14158
|
+
abs: NUMBER,
|
|
14159
|
+
floor: NUMBER,
|
|
14160
|
+
ceil: NUMBER,
|
|
14161
|
+
sqrt: NUMBER,
|
|
14162
|
+
round: NUMBER,
|
|
14163
|
+
pow: NUMBER,
|
|
14164
|
+
clamp: NUMBER,
|
|
14165
|
+
avg: NUMBER,
|
|
14166
|
+
sum: NUMBER,
|
|
14167
|
+
age: NUMBER,
|
|
14168
|
+
convert: NUMBER,
|
|
14169
|
+
coalesce: { kind: "coalesce" },
|
|
14170
|
+
any: BOOLEAN,
|
|
14171
|
+
all: BOOLEAN,
|
|
14172
|
+
within: BOOLEAN,
|
|
14173
|
+
latest: {
|
|
14174
|
+
kind: "fixed",
|
|
14175
|
+
result: ["number", "null"]
|
|
14176
|
+
},
|
|
14177
|
+
number: {
|
|
14178
|
+
kind: "fixed",
|
|
14179
|
+
result: ["number", "null"]
|
|
14180
|
+
},
|
|
14181
|
+
rose: {
|
|
14182
|
+
kind: "fixed",
|
|
14183
|
+
result: ["number", "null"]
|
|
14184
|
+
},
|
|
14185
|
+
count: NUMBER
|
|
14186
|
+
});
|
|
14187
|
+
`${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
|
|
14188
|
+
/**
|
|
14189
|
+
* What a composition may BUILD on a device type (G2, D676): the caps a new
|
|
14190
|
+
* device of that type, or an existing one that lacks them, can be given. The
|
|
14191
|
+
* blockers are the validator's own refusal codes, and a spec compares this
|
|
14192
|
+
* listing with `planComposition` for every capability — the editor can never
|
|
14193
|
+
* offer a feature the save would refuse for the same reason.
|
|
14194
|
+
*/
|
|
14195
|
+
var ComposableFieldSchema = object({
|
|
14196
|
+
path: string(),
|
|
14197
|
+
kind: CompositionFieldKindSchema,
|
|
14198
|
+
nullable: boolean(),
|
|
14199
|
+
required: boolean(),
|
|
14200
|
+
enumValues: array(string()).optional()
|
|
14201
|
+
});
|
|
14202
|
+
var ComposableCapabilitiesSchema = object({ caps: array(object({
|
|
14203
|
+
cap: string(),
|
|
14204
|
+
fields: array(ComposableFieldSchema),
|
|
14205
|
+
/** Present for an item-array cap (`consumables.items`). */
|
|
14206
|
+
itemArray: object({
|
|
14207
|
+
path: string(),
|
|
14208
|
+
keyField: string()
|
|
14209
|
+
}).optional()
|
|
14210
|
+
})) });
|
|
13950
14211
|
/** Where a block runs. The operator chooses — a block driving a device on an
|
|
13951
14212
|
* agent is the reason placement is not fixed to the hub. */
|
|
13952
14213
|
var CoreBlockPlacementSchema = union([literal("hub"), string().min(1)]);
|
|
@@ -14111,7 +14372,7 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
|
|
|
14111
14372
|
}), method(object({ blockId: string() }), CompositionGetReadSchema, { auth: "admin" }), method(object({}), CompositionListReadSchema, { auth: "admin" }), method(object({
|
|
14112
14373
|
addonId: string().min(1),
|
|
14113
14374
|
stableId: string().min(1)
|
|
14114
|
-
}), CompositionCustomizationReadSchema, { auth: "admin" }), method(object({
|
|
14375
|
+
}), CompositionCustomizationReadSchema, { auth: "admin" }), method(object({ deviceType: _enum(DeviceType) }), ComposableCapabilitiesSchema, { auth: "admin" }), method(object({
|
|
14115
14376
|
composition: CompositionSchema,
|
|
14116
14377
|
blockId: string().optional()
|
|
14117
14378
|
}), CompositionValidationSchema, {
|
|
@@ -14119,52 +14380,6 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
|
|
|
14119
14380
|
auth: "admin",
|
|
14120
14381
|
access: "view"
|
|
14121
14382
|
});
|
|
14122
|
-
var ComposerBlockSchema = object({
|
|
14123
|
-
id: string().min(1),
|
|
14124
|
-
name: string().min(1).max(120),
|
|
14125
|
-
enabled: boolean(),
|
|
14126
|
-
updatedAt: number(),
|
|
14127
|
-
composition: CompositionSchema
|
|
14128
|
-
});
|
|
14129
|
-
/**
|
|
14130
|
-
* A stored composition row that no longer PARSES — a schema a release
|
|
14131
|
-
* tightened, a row written by a newer build. Sent by id so the composer keeps
|
|
14132
|
-
* its device as a placeholder and reports the block `failed` naming the parse
|
|
14133
|
-
* error. Leaving it out would read, twice, exactly like a delete (D49).
|
|
14134
|
-
*/
|
|
14135
|
-
var ComposerUnreadableBlockSchema = object({
|
|
14136
|
-
id: string().min(1),
|
|
14137
|
-
/** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
|
|
14138
|
-
name: string().nullable(),
|
|
14139
|
-
/** The parse error, in the operator's words. */
|
|
14140
|
-
error: string()
|
|
14141
|
-
});
|
|
14142
|
-
method(object({
|
|
14143
|
-
/** The shared Blocks integration; null until `core-blocks` has reconciled it. */
|
|
14144
|
-
integrationId: string().nullable(),
|
|
14145
|
-
/** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
|
|
14146
|
-
storeLoaded: boolean(),
|
|
14147
|
-
blocks: array(ComposerBlockSchema),
|
|
14148
|
-
/** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
|
|
14149
|
-
restartBlockIds: array(string()),
|
|
14150
|
-
/** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
|
|
14151
|
-
unreadableBlocks: array(ComposerUnreadableBlockSchema)
|
|
14152
|
-
}), object({
|
|
14153
|
-
blocks: array(object({
|
|
14154
|
-
blockId: string(),
|
|
14155
|
-
status: CompositionRunStatusSchema,
|
|
14156
|
-
reason: string().optional()
|
|
14157
|
-
})),
|
|
14158
|
-
/**
|
|
14159
|
-
* False when the composer declared and withdrew NOTHING (store not loaded,
|
|
14160
|
-
* integration unknown, its own rows unread or read empty once). An empty
|
|
14161
|
-
* apply the caller owes is paid off only by one the composer acted on (D49).
|
|
14162
|
-
*/
|
|
14163
|
-
acted: boolean()
|
|
14164
|
-
}), {
|
|
14165
|
-
kind: "mutation",
|
|
14166
|
-
auth: "admin"
|
|
14167
|
-
}), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
|
|
14168
14383
|
/**
|
|
14169
14384
|
* `custom-model-registry` — collection cap exposing operator-registered
|
|
14170
14385
|
* custom detection models. Each provider (today: `addon-model-studio`)
|
|
@@ -14459,7 +14674,7 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
14459
14674
|
*
|
|
14460
14675
|
* ⚠ An earlier version of this comment blamed Zod stripping, and that
|
|
14461
14676
|
* was wrong — corrected 2026-08-26 after the hop map
|
|
14462
|
-
* (`docs/design/2026-08-26-
|
|
14677
|
+
* (`docs/design/2026-08-26-topic-hop-map.md`) traced the path.
|
|
14463
14678
|
* There is **no Zod parse at all** between the door and the engine: the
|
|
14464
14679
|
* dispatcher forwards the payload verbatim and UDS carries it whole. A
|
|
14465
14680
|
* field declared here reaches `SqliteSettingsBackend` either way.
|
|
@@ -15296,7 +15511,17 @@ var SiteZoneSchema = object({
|
|
|
15296
15511
|
var ProviderStatusSchema = object({
|
|
15297
15512
|
connected: boolean(),
|
|
15298
15513
|
deviceCount: number(),
|
|
15299
|
-
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()
|
|
15300
15525
|
});
|
|
15301
15526
|
object({
|
|
15302
15527
|
externalId: string(),
|
|
@@ -16094,6 +16319,121 @@ method(object({
|
|
|
16094
16319
|
deviceIds: array(number()).readonly(),
|
|
16095
16320
|
caps: array(string()).readonly().optional()
|
|
16096
16321
|
}), record(string(), record(string(), unknown().nullable())));
|
|
16322
|
+
var ExtensionSlotIdSchema = _enum(["linked-devices"]);
|
|
16323
|
+
DeviceType.Camera;
|
|
16324
|
+
/** A slot's editable value, discriminated on `slot`. */
|
|
16325
|
+
var ExtensionSlotValueSchema = discriminatedUnion("slot", [LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
|
|
16326
|
+
DeviceType.Camera;
|
|
16327
|
+
var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
|
|
16328
|
+
state: literal("unreachable"),
|
|
16329
|
+
reason: string()
|
|
16330
|
+
})]);
|
|
16331
|
+
/** One provider of slots — the D554 source-listing row. */
|
|
16332
|
+
var ExtensionSourceSchema = object({
|
|
16333
|
+
/** The routing prefix of every `slotRef` this provider serves. */
|
|
16334
|
+
source: string(),
|
|
16335
|
+
label: string(),
|
|
16336
|
+
/** Stamped by the dispatcher from the registry (D557). */
|
|
16337
|
+
addonId: string().optional(),
|
|
16338
|
+
availability: ExtensionSourceAvailabilitySchema
|
|
16339
|
+
});
|
|
16340
|
+
/**
|
|
16341
|
+
* How one picked source stands. `missing` — no such device (deleted, or an id
|
|
16342
|
+
* that never existed); `foreign` — a device the slot's owner cannot read from
|
|
16343
|
+
* (a source owned by another addon); `unavailable` — it exists but is not a
|
|
16344
|
+
* valid source now (a container, which is never a pick). A source in any of
|
|
16345
|
+
* these states is SHOWN, never silently dropped or re-pointed.
|
|
16346
|
+
*/
|
|
16347
|
+
var ExtensionSourceHealthSchema = _enum([
|
|
16348
|
+
"ok",
|
|
16349
|
+
"missing",
|
|
16350
|
+
"foreign",
|
|
16351
|
+
"unavailable"
|
|
16352
|
+
]);
|
|
16353
|
+
var ExtensionSlotSourceSchema = object({
|
|
16354
|
+
deviceId: number().int(),
|
|
16355
|
+
/** The device's name, or null when it could not be resolved (`missing`). */
|
|
16356
|
+
name: string().nullable(),
|
|
16357
|
+
health: ExtensionSourceHealthSchema,
|
|
16358
|
+
detail: string().optional()
|
|
16359
|
+
});
|
|
16360
|
+
/**
|
|
16361
|
+
* A DIFFERENT authority that gates whether the slot's sources do anything —
|
|
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).
|
|
16367
|
+
*/
|
|
16368
|
+
var ExtensionSlotActivationSchema = object({
|
|
16369
|
+
state: _enum([
|
|
16370
|
+
"active",
|
|
16371
|
+
"inactive",
|
|
16372
|
+
"unknown"
|
|
16373
|
+
]),
|
|
16374
|
+
authority: string(),
|
|
16375
|
+
detail: string().optional()
|
|
16376
|
+
});
|
|
16377
|
+
var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
|
|
16378
|
+
state: literal("ok"),
|
|
16379
|
+
/** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
|
|
16380
|
+
slotRef: string(),
|
|
16381
|
+
slot: ExtensionSlotIdSchema,
|
|
16382
|
+
/** Names the store written (D62), e.g. `device-manager:_linkedDeviceIds`. */
|
|
16383
|
+
authority: string(),
|
|
16384
|
+
activation: ExtensionSlotActivationSchema.nullable(),
|
|
16385
|
+
value: ExtensionSlotValueSchema,
|
|
16386
|
+
sources: array(ExtensionSlotSourceSchema),
|
|
16387
|
+
/**
|
|
16388
|
+
* Devices the owner links to the host ON ITS OWN, by structure, and that
|
|
16389
|
+
* are therefore not in `value` (D655): a camera's device-tree children, and
|
|
16390
|
+
* the child a picked container stands for (D356 — a container is never a
|
|
16391
|
+
* pick, its children are). Read-only; the editor shows them and may offer
|
|
16392
|
+
* per-device options on them (the linked-devices tracked-event opt-in).
|
|
16393
|
+
* Absent when the owner links nothing beyond the picks, and from an owner
|
|
16394
|
+
* older than D655.
|
|
16395
|
+
*/
|
|
16396
|
+
impliedSources: array(ExtensionSlotSourceSchema).optional()
|
|
16397
|
+
}), object({
|
|
16398
|
+
state: literal("unreachable"),
|
|
16399
|
+
addonId: string(),
|
|
16400
|
+
reason: string()
|
|
16401
|
+
})]);
|
|
16402
|
+
var ExtensionCandidatesSchema = object({ candidates: array(object({
|
|
16403
|
+
deviceId: number().int(),
|
|
16404
|
+
name: string(),
|
|
16405
|
+
type: string(),
|
|
16406
|
+
location: string().nullable(),
|
|
16407
|
+
/** The container a child belongs to — "Spotlight 2" alone does not say which. */
|
|
16408
|
+
parentName: string().nullable(),
|
|
16409
|
+
/** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
|
|
16410
|
+
suggested: boolean(),
|
|
16411
|
+
/** Why it is suggested ("same location"), null when it is not. */
|
|
16412
|
+
reason: string().nullable()
|
|
16413
|
+
})) });
|
|
16414
|
+
/**
|
|
16415
|
+
* What a write did. `none` — applied in place. `host` / `parent` — the owner
|
|
16416
|
+
* reloaded the host (or, for an accessory child, its parent) because the
|
|
16417
|
+
* write changed what the host REGISTERS. A slot never adds a capability to its
|
|
16418
|
+
* host — that is a composition (D663) — so today's owners answer `none`.
|
|
16419
|
+
*/
|
|
16420
|
+
var ExtensionSetResultSchema = object({
|
|
16421
|
+
applied: literal(true),
|
|
16422
|
+
reload: _enum([
|
|
16423
|
+
"none",
|
|
16424
|
+
"host",
|
|
16425
|
+
"parent"
|
|
16426
|
+
])
|
|
16427
|
+
});
|
|
16428
|
+
var ExtensionSlotRefInputSchema = object({
|
|
16429
|
+
deviceId: number().int(),
|
|
16430
|
+
slotRef: string().min(1)
|
|
16431
|
+
});
|
|
16432
|
+
var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
|
|
16433
|
+
method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)), method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)), method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema), method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
|
|
16434
|
+
kind: "mutation",
|
|
16435
|
+
auth: "admin"
|
|
16436
|
+
});
|
|
16097
16437
|
/**
|
|
16098
16438
|
* Per-field ownership (D663). A composition may CLAIM fields of a native
|
|
16099
16439
|
* cap's runtime-state slice on an existing device: `replace` overlays the
|
|
@@ -16317,7 +16657,7 @@ method(object({
|
|
|
16317
16657
|
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
16318
16658
|
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
16319
16659
|
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
16320
|
-
* 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
|
|
16321
16661
|
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
16322
16662
|
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
16323
16663
|
* be READ.
|
|
@@ -19066,17 +19406,25 @@ var NcScheduleSchema = object({
|
|
|
19066
19406
|
*/
|
|
19067
19407
|
var NcSystemEventDeliveryModeSchema = _enum(["instant", "summary"]);
|
|
19068
19408
|
/**
|
|
19409
|
+
* How a summary window is SENT (D698): `rule` (absent) = ONE notification with
|
|
19410
|
+
* every section; `section` = one notification per section with something to
|
|
19411
|
+
* say (an unavailable section included), each titled by its section.
|
|
19412
|
+
*/
|
|
19413
|
+
var NcStateSummarySplitSchema = _enum(["rule", "section"]);
|
|
19414
|
+
/**
|
|
19069
19415
|
* `summary`: the rule sends NOTHING per event. When a window of `schedule`
|
|
19070
19416
|
* CLOSES, it sends one notification with the current state of its kinds
|
|
19071
19417
|
* (low batteries, consumables to replace, devices offline, updates
|
|
19072
|
-
* available, ...), after its own filters
|
|
19418
|
+
* available, ...), after its own filters — or, with `split: 'section'`
|
|
19419
|
+
* (D698), one notification per section. Nothing to report sends nothing.
|
|
19073
19420
|
* The schedule is the ordinary `NcSchedule` (weekly windows, IANA timezone,
|
|
19074
19421
|
* midnight crossing); the send time is each window's END. Refused on the
|
|
19075
19422
|
* `alarm` family, which stays instant (`systemEventDeliveryProblems`).
|
|
19076
19423
|
*/
|
|
19077
19424
|
var NcSystemEventDeliverySchema = discriminatedUnion("mode", [object({ mode: literal("instant") }), object({
|
|
19078
19425
|
mode: literal("summary"),
|
|
19079
|
-
schedule: NcScheduleSchema
|
|
19426
|
+
schedule: NcScheduleSchema,
|
|
19427
|
+
split: NcStateSummarySplitSchema.optional()
|
|
19080
19428
|
})]);
|
|
19081
19429
|
/** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
|
|
19082
19430
|
var NcPlateMatcherSchema = object({
|
|
@@ -19216,8 +19564,14 @@ var NcSensorTransitionSchema = _enum(["raised", "cleared"]);
|
|
|
19216
19564
|
/** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
|
|
19217
19565
|
var NcZoneConditionSchema = object({
|
|
19218
19566
|
ids: array(string().min(1)).min(1),
|
|
19219
|
-
/**
|
|
19220
|
-
|
|
19567
|
+
/**
|
|
19568
|
+
* LEGACY quantifier over `ids`. Absent = `any` (at least one visited), which
|
|
19569
|
+
* is what both editors mean and all they write since D690: "all of" was
|
|
19570
|
+
* removed from the editors because on an immediate rule it asked one
|
|
19571
|
+
* detection to stand in every zone at once. Still ACCEPTED, and `all` still
|
|
19572
|
+
* evaluated, so a stored rule keeps parsing and meaning what it meant.
|
|
19573
|
+
*/
|
|
19574
|
+
match: _enum(["any", "all"]).optional()
|
|
19221
19575
|
});
|
|
19222
19576
|
/**
|
|
19223
19577
|
* The P1 condition set — a flat AND of groups; absent group = pass;
|
|
@@ -19721,10 +20075,12 @@ var NcMediaPolicySchema = object({
|
|
|
19721
20075
|
/**
|
|
19722
20076
|
* Cooldown GRANULARITY over the subject's class — how much a fired
|
|
19723
20077
|
* notification suppresses.
|
|
19724
|
-
* - `
|
|
19725
|
-
*
|
|
19726
|
-
*
|
|
19727
|
-
*
|
|
20078
|
+
* - `per-class` (default, and the absent value since 2026-10-01 — D36) — an
|
|
20079
|
+
* independent window per detected class: cat→dog fires at once, cat→cat
|
|
20080
|
+
* still waits.
|
|
20081
|
+
* - `shared` — one window for the whole rule/scope: a cat silences the next
|
|
20082
|
+
* dog for `cooldownSec`. Only written when an operator picks it; it is no
|
|
20083
|
+
* longer what an unset rule means.
|
|
19728
20084
|
*
|
|
19729
20085
|
* AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
|
|
19730
20086
|
* must not be swallowed by a bark's window (the precedent this generalizes —
|
|
@@ -19739,8 +20095,11 @@ var NcThrottleSchema = object({
|
|
|
19739
20095
|
/**
|
|
19740
20096
|
* Class granularity of the cooldown key. Optional rather than defaulted:
|
|
19741
20097
|
* a Zod default does NOT run on the addon→addon cap path, so a persisted
|
|
19742
|
-
* rule authored before this field simply carries none
|
|
19743
|
-
*
|
|
20098
|
+
* rule authored before this field simply carries none. The engine used to
|
|
20099
|
+
* read absent as `shared` (D36); since 2026-10-01 it reads absent as
|
|
20100
|
+
* `per-class` — the operator's default — and only an explicit `shared`
|
|
20101
|
+
* still means `shared`. See `cooldownKey` / `keysPerClass` in the rule
|
|
20102
|
+
* engine, and D36's dated note.
|
|
19744
20103
|
*/
|
|
19745
20104
|
granularity: NcThrottleGranularitySchema.optional()
|
|
19746
20105
|
});
|
|
@@ -20064,11 +20423,23 @@ var NcStateSummaryPreviewSectionSchema = object({
|
|
|
20064
20423
|
reason: string().optional()
|
|
20065
20424
|
});
|
|
20066
20425
|
/**
|
|
20426
|
+
* One notification a previewed summary would send (D698): the whole summary on
|
|
20427
|
+
* a `rule` split (no `section`), one section's on a `section` split.
|
|
20428
|
+
*/
|
|
20429
|
+
var NcStateSummaryPreviewRowSchema = object({
|
|
20430
|
+
section: string().optional(),
|
|
20431
|
+
/** The section's name on a per-section row; every reported section's, joined, on a combined one. */
|
|
20432
|
+
title: string(),
|
|
20433
|
+
text: string(),
|
|
20434
|
+
count: number().int().nonnegative()
|
|
20435
|
+
});
|
|
20436
|
+
/**
|
|
20067
20437
|
* The summary a rule would send now. `empty` = nothing to report and every
|
|
20068
20438
|
* section read: such a summary is NOT sent. `dropped` counts the open states
|
|
20069
20439
|
* the rule's own filters (or a camera mute) left out, by reason.
|
|
20070
20440
|
* `excludedGroups` names the kind groups selected that have no state to report
|
|
20071
|
-
* (backups & exports).
|
|
20441
|
+
* (backups & exports). `split` and `rows` (D698) say how it would be sent —
|
|
20442
|
+
* optional, so an older hub's answer still parses.
|
|
20072
20443
|
*/
|
|
20073
20444
|
var NcStateSummaryPreviewSchema = object({
|
|
20074
20445
|
empty: boolean(),
|
|
@@ -20076,7 +20447,9 @@ var NcStateSummaryPreviewSchema = object({
|
|
|
20076
20447
|
text: string(),
|
|
20077
20448
|
sections: array(NcStateSummaryPreviewSectionSchema),
|
|
20078
20449
|
dropped: record(string(), number().int().nonnegative()),
|
|
20079
|
-
excludedGroups: array(string())
|
|
20450
|
+
excludedGroups: array(string()),
|
|
20451
|
+
split: NcStateSummarySplitSchema.optional(),
|
|
20452
|
+
rows: array(NcStateSummaryPreviewRowSchema).optional()
|
|
20080
20453
|
});
|
|
20081
20454
|
var NcTestResultSchema = object({
|
|
20082
20455
|
recordId: string(),
|
|
@@ -20491,6 +20864,29 @@ object({
|
|
|
20491
20864
|
firstAt: number(),
|
|
20492
20865
|
lastAt: number()
|
|
20493
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
|
+
});
|
|
20494
20890
|
/**
|
|
20495
20891
|
* The per-mode lists, at most one per mode. Two lists for one mode have no
|
|
20496
20892
|
* meaning a reader could agree on (union? the last one?), so they are refused
|
|
@@ -20499,10 +20895,10 @@ object({
|
|
|
20499
20895
|
var NcAlarmNonBlockingListSchema = array(object({
|
|
20500
20896
|
mode: AlarmArmModeSchema,
|
|
20501
20897
|
deviceIds: array(number().int()).max(200)
|
|
20502
|
-
})).max(8).refine(
|
|
20898
|
+
})).max(8).refine(uniqueModes, { message: "nonBlocking: at most one list per arm mode" });
|
|
20503
20899
|
/**
|
|
20504
|
-
* The three durations
|
|
20505
|
-
* 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.
|
|
20506
20902
|
*
|
|
20507
20903
|
* They live on the NOTIFICATION-RULES cap, not on `alarm-panel`, on purpose:
|
|
20508
20904
|
* `alarm-panel` is `deviceNative` and its other provider mirrors somebody
|
|
@@ -20512,15 +20908,15 @@ var NcAlarmNonBlockingListSchema = array(object({
|
|
|
20512
20908
|
*/
|
|
20513
20909
|
var NcAlarmSettingsSchema = object({
|
|
20514
20910
|
/** Grace period between arming and the mode taking effect. 0 = immediate. */
|
|
20515
|
-
exitDelaySec:
|
|
20911
|
+
exitDelaySec: NcAlarmDelaySecSchema,
|
|
20516
20912
|
/** Grace period between a trigger and the alarm firing. 0 = immediate. */
|
|
20517
|
-
entryDelaySec:
|
|
20913
|
+
entryDelaySec: NcAlarmDelaySecSchema,
|
|
20518
20914
|
/**
|
|
20519
20915
|
* How long `triggered` lasts before the panel re-arms itself.
|
|
20520
20916
|
* **0 = until an operator disarms it** — the behaviour before this field
|
|
20521
20917
|
* existed, and therefore what an untouched install keeps doing.
|
|
20522
20918
|
*/
|
|
20523
|
-
triggeredDurationSec:
|
|
20919
|
+
triggeredDurationSec: NcAlarmTriggeredSecSchema,
|
|
20524
20920
|
/**
|
|
20525
20921
|
* Deprecated by D630 — every transition is announced. Parsed, never read;
|
|
20526
20922
|
* remove after one release. Optional so an older admin's patch (which still
|
|
@@ -20543,17 +20939,30 @@ var NcAlarmSettingsSchema = object({
|
|
|
20543
20939
|
* per mode is meaningful. Defaulted to `[]` so a blob stored before D630
|
|
20544
20940
|
* parses as "every opening blocks" — the behaviour it was written under.
|
|
20545
20941
|
*/
|
|
20546
|
-
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([])
|
|
20547
20949
|
});
|
|
20548
20950
|
/**
|
|
20549
20951
|
* Every field optional — a tab edits one control at a time.
|
|
20550
20952
|
*
|
|
20551
|
-
* `nonBlocking`
|
|
20552
|
-
* remove an inner `.default()`, so a patch that never
|
|
20553
|
-
* parse to `
|
|
20554
|
-
* (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.
|
|
20555
20958
|
*/
|
|
20556
|
-
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" });
|
|
20557
20966
|
/**
|
|
20558
20967
|
* What one arm mode actually arms, DERIVED from the enabled rules gated on it.
|
|
20559
20968
|
* Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
|
|
@@ -20653,6 +21062,28 @@ var NcAlarmConfigSchema = object({
|
|
|
20653
21062
|
*/
|
|
20654
21063
|
live: NcAlarmLiveSchema.optional()
|
|
20655
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
|
+
});
|
|
20656
21087
|
/**
|
|
20657
21088
|
* ONE rule's demand on ONE camera's clip ring.
|
|
20658
21089
|
*
|
|
@@ -20743,7 +21174,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
|
|
|
20743
21174
|
}), method(object({}), NcAlarmConfigSchema, { auth: "admin" }), method(object({ patch: NcAlarmSettingsPatchSchema }), NcAlarmConfigSchema, {
|
|
20744
21175
|
kind: "mutation",
|
|
20745
21176
|
auth: "admin"
|
|
20746
|
-
});
|
|
21177
|
+
}), method(NcAlarmSensorsInputSchema, NcAlarmSensorsSchema, { auth: "admin" });
|
|
20747
21178
|
/**
|
|
20748
21179
|
* Zod schemas for persisted record types.
|
|
20749
21180
|
*
|
|
@@ -21090,12 +21521,26 @@ var CameraSensorRefSchema = object({
|
|
|
21090
21521
|
function cameraSensorRefKey(ref) {
|
|
21091
21522
|
return `${ref.addonId}/${ref.stableId}`;
|
|
21092
21523
|
}
|
|
21093
|
-
/**
|
|
21094
|
-
|
|
21095
|
-
|
|
21096
|
-
|
|
21097
|
-
|
|
21098
|
-
|
|
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) => {
|
|
21099
21544
|
const seen = /* @__PURE__ */ new Set();
|
|
21100
21545
|
value.sensors.forEach((ref, index) => {
|
|
21101
21546
|
const key = cameraSensorRefKey(ref);
|
|
@@ -21107,39 +21552,41 @@ object({
|
|
|
21107
21552
|
seen.add(key);
|
|
21108
21553
|
});
|
|
21109
21554
|
});
|
|
21110
|
-
|
|
21555
|
+
/** Every attachment names its mode; an older orchestrator that does not is in addition. */
|
|
21556
|
+
var AttachmentFields = {
|
|
21111
21557
|
addonId: string(),
|
|
21112
|
-
stableId: string()
|
|
21558
|
+
stableId: string(),
|
|
21559
|
+
mode: CameraSensorModeSchema.default(DEFAULT_CAMERA_SENSOR_MODE)
|
|
21113
21560
|
};
|
|
21114
21561
|
var CameraSensorAttachmentSchema = discriminatedUnion("state", [
|
|
21115
21562
|
object({
|
|
21116
|
-
...
|
|
21563
|
+
...AttachmentFields,
|
|
21117
21564
|
state: literal("ready"),
|
|
21118
21565
|
deviceId: number(),
|
|
21119
21566
|
name: string(),
|
|
21120
21567
|
caps: array(string()).readonly()
|
|
21121
21568
|
}),
|
|
21122
21569
|
object({
|
|
21123
|
-
...
|
|
21570
|
+
...AttachmentFields,
|
|
21124
21571
|
state: literal("offline"),
|
|
21125
21572
|
deviceId: number(),
|
|
21126
21573
|
name: string(),
|
|
21127
21574
|
reason: _enum(["offline", "disabled"])
|
|
21128
21575
|
}),
|
|
21129
21576
|
object({
|
|
21130
|
-
...
|
|
21577
|
+
...AttachmentFields,
|
|
21131
21578
|
state: literal("missing"),
|
|
21132
21579
|
reason: string()
|
|
21133
21580
|
}),
|
|
21134
21581
|
object({
|
|
21135
|
-
...
|
|
21582
|
+
...AttachmentFields,
|
|
21136
21583
|
state: literal("unsupported"),
|
|
21137
21584
|
deviceId: number(),
|
|
21138
21585
|
name: string(),
|
|
21139
21586
|
reason: string()
|
|
21140
21587
|
}),
|
|
21141
21588
|
object({
|
|
21142
|
-
...
|
|
21589
|
+
...AttachmentFields,
|
|
21143
21590
|
state: literal("unreadable"),
|
|
21144
21591
|
reason: string()
|
|
21145
21592
|
})
|
|
@@ -21152,17 +21599,49 @@ var CameraSensorAttachmentSchema = discriminatedUnion("state", [
|
|
|
21152
21599
|
* say.
|
|
21153
21600
|
*/
|
|
21154
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
|
+
});
|
|
21155
21627
|
var CameraSensorsStatusSchema = discriminatedUnion("state", [
|
|
21156
|
-
object({
|
|
21628
|
+
object({
|
|
21629
|
+
state: literal("not-configured"),
|
|
21630
|
+
cameraLevel: CameraRawLevelSchema.optional()
|
|
21631
|
+
}),
|
|
21157
21632
|
object({
|
|
21158
21633
|
state: literal("unreadable"),
|
|
21159
|
-
reason: string()
|
|
21634
|
+
reason: string(),
|
|
21635
|
+
cameraLevel: CameraRawLevelSchema.optional()
|
|
21160
21636
|
}),
|
|
21161
21637
|
object({
|
|
21162
21638
|
state: literal("configured"),
|
|
21163
|
-
|
|
21639
|
+
cameraLevel: CameraRawLevelSchema.optional(),
|
|
21164
21640
|
sensors: array(CameraSensorAttachmentSchema).readonly(),
|
|
21165
|
-
|
|
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()
|
|
21166
21645
|
})
|
|
21167
21646
|
]);
|
|
21168
21647
|
Object.freeze({
|
|
@@ -21847,14 +22326,14 @@ var TrackSchema = object({
|
|
|
21847
22326
|
* `derive-returned-null tile=standin`,
|
|
21848
22327
|
* `native-tile tile=native no-key-frame-at-close`, …) written at close and
|
|
21849
22328
|
* CLEARED by the late-keyFrame upgrade when a native tile lands after all.
|
|
21850
|
-
* 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
|
|
21851
22330
|
* tile is a face/plate stand-in, a raster crop, or an icon.
|
|
21852
22331
|
*
|
|
21853
22332
|
* **`no-key-frame-at-close` (D400).** The line used to be written ONLY when
|
|
21854
22333
|
* the TILE ranked below native, so a track whose thumbnail landed natively
|
|
21855
22334
|
* while its key frame missed carried no reason at all — three of the four
|
|
21856
22335
|
* `MISSING_KEYFRAME` tracks in the 2026-09-07 operator audit were exactly
|
|
21857
|
-
* 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.
|
|
21858
22337
|
* The key frame is the head of a cascade (`keyFrame ⇒ keyFrameSmall ⇒ the
|
|
21859
22338
|
* lastFrame copy source`), so its absence is now on this line whatever the
|
|
21860
22339
|
* tile ended up being.
|
|
@@ -21941,7 +22420,7 @@ var MotionEventSchema = object({
|
|
|
21941
22420
|
/**
|
|
21942
22421
|
* Ms offsets from `timestamp` (the episode's own first rising edge, so the
|
|
21943
22422
|
* first entry is always `0`) of every genuine off→on transition the
|
|
21944
|
-
* 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
|
|
21945
22424
|
* push: a firmware source that keepalives at ~1 Hz for the whole burst
|
|
21946
22425
|
* (Reolink, Hikvision) produces exactly one edge; a source that reports an
|
|
21947
22426
|
* explicit `false` mid-episode and then resumes before the quiet window
|
|
@@ -22997,7 +23476,8 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
22997
23476
|
trackIds: array(string()).min(1)
|
|
22998
23477
|
}), object({
|
|
22999
23478
|
deleted: number().int(),
|
|
23000
|
-
failed: array(string()).readonly()
|
|
23479
|
+
failed: array(string()).readonly(),
|
|
23480
|
+
sparedMediaIds: array(number().int()).readonly().optional()
|
|
23001
23481
|
}), {
|
|
23002
23482
|
kind: "mutation",
|
|
23003
23483
|
auth: "admin"
|
|
@@ -23006,7 +23486,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
23006
23486
|
deviceId: number(),
|
|
23007
23487
|
trackId: string(),
|
|
23008
23488
|
flags: TrackFlagsPatchSchema
|
|
23009
|
-
}), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
|
|
23489
|
+
}), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(SetTrackRelationInputSchema, TrackRelationSchema, { kind: "mutation" }), method(ClearTrackRelationInputSchema, ClearTrackRelationResultSchema, { kind: "mutation" }), method(SetTrackPurityInputSchema, SetTrackPurityResultSchema, { kind: "mutation" }), method(ListTrackRelationsInputSchema, ListTrackRelationsResultSchema, { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
|
|
23010
23490
|
kind: "query",
|
|
23011
23491
|
auth: "admin"
|
|
23012
23492
|
}), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
|
|
@@ -24352,8 +24832,10 @@ var RunnerCameraConfigSchema = object({
|
|
|
24352
24832
|
* - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
|
|
24353
24833
|
* analyzer providers) running on decoded frames in this runner.
|
|
24354
24834
|
* - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
|
|
24355
|
-
* analytics). The provider emits ProviderMotion
|
|
24356
|
-
*
|
|
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`.
|
|
24357
24839
|
*/
|
|
24358
24840
|
motionSources: MotionSourcesSchema.default(["analyzer"]),
|
|
24359
24841
|
/**
|
|
@@ -24530,7 +25012,15 @@ var RunnerLocalLoadSchema = object({
|
|
|
24530
25012
|
hasGpu: boolean(),
|
|
24531
25013
|
inferenceBackend: string().optional(),
|
|
24532
25014
|
cpuCores: number().optional()
|
|
24533
|
-
})
|
|
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()
|
|
24534
25024
|
});
|
|
24535
25025
|
/**
|
|
24536
25026
|
* Aggregate runtime metrics for the runner's whole local pool. Mirrors the
|
|
@@ -25164,7 +25654,64 @@ var NodeInferenceDevicesSchema = object({
|
|
|
25164
25654
|
reachable: boolean(),
|
|
25165
25655
|
devices: array(NodeInferenceDeviceSchema).readonly()
|
|
25166
25656
|
});
|
|
25167
|
-
|
|
25657
|
+
/**
|
|
25658
|
+
* Pipeline Orchestrator capability — global load balancer + camera dispatcher.
|
|
25659
|
+
*
|
|
25660
|
+
* Lives on the hub. Tracks the camera-to-agent assignment map, listens to
|
|
25661
|
+
* device lifecycle events, queries each runner's capacity + hardware
|
|
25662
|
+
* profile, and dispatches `attachCamera` / `detachCamera` cap calls to the
|
|
25663
|
+
* appropriate runner instances. Persists assignments via the multi-level
|
|
25664
|
+
* settings store so they survive hub restarts.
|
|
25665
|
+
*
|
|
25666
|
+
* Strictly the control plane: never sees a frame, never calls inference,
|
|
25667
|
+
* never drains queues. The runner does that work locally on each agent.
|
|
25668
|
+
*/
|
|
25669
|
+
/**
|
|
25670
|
+
* The input of `setCameraSensors` (G5, D676): the ONE typed write path of a
|
|
25671
|
+
* camera's attached sensors (D672). `config: null` removes the attachment —
|
|
25672
|
+
* the camera reads `not-configured` again, never `unreadable`.
|
|
25673
|
+
*/
|
|
25674
|
+
var SetCameraSensorsInputSchema = object({
|
|
25675
|
+
deviceId: number().int().nonnegative(),
|
|
25676
|
+
/** `null` removes the attachment: the camera goes back to `not-configured`. */
|
|
25677
|
+
config: CameraSensorsConfigSchema.nullable()
|
|
25678
|
+
});
|
|
25679
|
+
/**
|
|
25680
|
+
* Why an early occupancy look (D691) was not scheduled.
|
|
25681
|
+
*
|
|
25682
|
+
* - `unknown-camera` — no session was ever dispatched for it, so there is no
|
|
25683
|
+
* node and no config to attach a burst with.
|
|
25684
|
+
* - `out-of-range` — the ask is negative or further out than the orchestrator
|
|
25685
|
+
* will hold a timer for; the parked-object cadence is the answer there.
|
|
25686
|
+
* - `no-burst-producer` — this build has no burst producer at all.
|
|
25687
|
+
* - `already-looked` — this camera's ONE early look since its last session has
|
|
25688
|
+
* been spent. A look's own burst can re-arm a flickering flip, and a look
|
|
25689
|
+
* per arm would chain a burst every ~30 s forever (review H2); the next
|
|
25690
|
+
* real session re-arms the budget.
|
|
25691
|
+
*/
|
|
25692
|
+
var OccupancyLookRefusalSchema = _enum([
|
|
25693
|
+
"unknown-camera",
|
|
25694
|
+
"out-of-range",
|
|
25695
|
+
"no-burst-producer",
|
|
25696
|
+
"already-looked"
|
|
25697
|
+
]);
|
|
25698
|
+
method(object({
|
|
25699
|
+
deviceId: number().int().nonnegative(),
|
|
25700
|
+
/** How long from NOW until the pending flip's sustain window ends. RELATIVE,
|
|
25701
|
+
* so the caller's clock and the orchestrator's never have to agree. */
|
|
25702
|
+
afterMs: number().finite(),
|
|
25703
|
+
/** Why, for the log. */
|
|
25704
|
+
reason: string()
|
|
25705
|
+
}), object({
|
|
25706
|
+
scheduled: boolean(),
|
|
25707
|
+
/** When `scheduled`: how long until the burst is dialled. */
|
|
25708
|
+
dueInMs: number().optional(),
|
|
25709
|
+
/** When not `scheduled`: why. */
|
|
25710
|
+
refusedBecause: OccupancyLookRefusalSchema.optional()
|
|
25711
|
+
}), {
|
|
25712
|
+
kind: "mutation",
|
|
25713
|
+
auth: "admin"
|
|
25714
|
+
}), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
|
|
25168
25715
|
kind: "mutation",
|
|
25169
25716
|
auth: "admin"
|
|
25170
25717
|
}), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
|
|
@@ -25318,7 +25865,10 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
|
|
|
25318
25865
|
}), CameraSwitchGroupSchema, {
|
|
25319
25866
|
kind: "mutation",
|
|
25320
25867
|
auth: "admin"
|
|
25321
|
-
}), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(
|
|
25868
|
+
}), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(SetCameraSensorsInputSchema, object({ success: literal(true) }), {
|
|
25869
|
+
kind: "mutation",
|
|
25870
|
+
auth: "admin"
|
|
25871
|
+
}), method(_void(), DiskReconcileJobSchema, {
|
|
25322
25872
|
kind: "mutation",
|
|
25323
25873
|
auth: "admin"
|
|
25324
25874
|
}), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
|
|
@@ -27106,7 +27656,7 @@ var ClipPlaybackSchema = object({
|
|
|
27106
27656
|
* **One authorised yes is one wake.** `next-natural` — take the clip the next
|
|
27107
27657
|
* time the camera is awake for its own reasons — is deliberately not a member:
|
|
27108
27658
|
* it was proposed, it is free on the battery, and the operator declined it on
|
|
27109
|
-
* 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],
|
|
27110
27660
|
* D558 "Considered and not taken").
|
|
27111
27661
|
*/
|
|
27112
27662
|
var ClipWakeSchema = _enum(["authorised"]);
|
|
@@ -27373,7 +27923,7 @@ var videoclipsCapability = {
|
|
|
27373
27923
|
* **It is a SECTION of the Recording tab, at the end of it — not a tab of
|
|
27374
27924
|
* its own.** It shipped as a `clips` top-tab and the operator rejected the
|
|
27375
27925
|
* placement: *"utilizzerei la stessa tab recordings, lì abbiamo già tutto il
|
|
27376
|
-
* 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
|
|
27377
27927
|
* already holds the recorder's panel, the schedule bands and the unified
|
|
27378
27928
|
* retention policy; footage the camera itself holds is the same question,
|
|
27379
27929
|
* asked of a different store. `order: 100` puts it after all of them with
|
|
@@ -27434,7 +27984,7 @@ var videoclipsCapability = {
|
|
|
27434
27984
|
* It replaced `sources?: string[]`, a VIEW filter over source ids that
|
|
27435
27985
|
* assumed the answer was a fan-out over everything a camera has. The
|
|
27436
27986
|
* operator settled otherwise on 2026-09-20 — *"l'utilizzatore è uno
|
|
27437
|
-
* 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
|
|
27438
27988
|
* nothing to filter out of it.
|
|
27439
27989
|
*/
|
|
27440
27990
|
provider: string().min(1)
|
|
@@ -27687,138 +28237,6 @@ var videoclipsCapability = {
|
|
|
27687
28237
|
})
|
|
27688
28238
|
}
|
|
27689
28239
|
};
|
|
27690
|
-
object({
|
|
27691
|
-
/** Ms epoch of the last press. null = never observed since this provider started. */
|
|
27692
|
-
lastPressedAt: number().nullable(),
|
|
27693
|
-
/** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
|
|
27694
|
-
pressCountSinceStart: number()
|
|
27695
|
-
});
|
|
27696
|
-
object({
|
|
27697
|
-
deviceId: number(),
|
|
27698
|
-
timestamp: number()
|
|
27699
|
-
});
|
|
27700
|
-
/**
|
|
27701
|
-
* The `doorbell-source` extension slot's editable value (D648): the camera's
|
|
27702
|
-
* virtual-doorbell trigger devices, exactly what the wrapper's
|
|
27703
|
-
* `doorbellSources` persists (as `{ deviceId }` records).
|
|
27704
|
-
*/
|
|
27705
|
-
var DoorbellSourceSlotValueSchema = object({ deviceIds: array(number().int().positive()) });
|
|
27706
|
-
DeviceType.Camera;
|
|
27707
|
-
DeviceType.Button, DeviceType.Camera;
|
|
27708
|
-
var ExtensionSlotIdSchema = _enum(["doorbell-source", "linked-devices"]);
|
|
27709
|
-
DeviceType.Camera, DeviceType.Camera;
|
|
27710
|
-
/** A slot's editable value, discriminated on `slot`. */
|
|
27711
|
-
var ExtensionSlotValueSchema = discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
|
|
27712
|
-
DeviceType.Camera;
|
|
27713
|
-
var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
|
|
27714
|
-
state: literal("unreachable"),
|
|
27715
|
-
reason: string()
|
|
27716
|
-
})]);
|
|
27717
|
-
/** One provider of slots — the D554 source-listing row. */
|
|
27718
|
-
var ExtensionSourceSchema = object({
|
|
27719
|
-
/** The routing prefix of every `slotRef` this provider serves. */
|
|
27720
|
-
source: string(),
|
|
27721
|
-
label: string(),
|
|
27722
|
-
/** Stamped by the dispatcher from the registry (D557). */
|
|
27723
|
-
addonId: string().optional(),
|
|
27724
|
-
availability: ExtensionSourceAvailabilitySchema
|
|
27725
|
-
});
|
|
27726
|
-
/**
|
|
27727
|
-
* How one picked source stands. `missing` — no such device (deleted, or an id
|
|
27728
|
-
* that never existed); `foreign` — a device the slot's owner cannot read from
|
|
27729
|
-
* (a source owned by another addon); `unavailable` — it exists but is not a
|
|
27730
|
-
* valid source now (a container, which is never a pick). A source in any of
|
|
27731
|
-
* these states is SHOWN, never silently dropped or re-pointed.
|
|
27732
|
-
*/
|
|
27733
|
-
var ExtensionSourceHealthSchema = _enum([
|
|
27734
|
-
"ok",
|
|
27735
|
-
"missing",
|
|
27736
|
-
"foreign",
|
|
27737
|
-
"unavailable"
|
|
27738
|
-
]);
|
|
27739
|
-
var ExtensionSlotSourceSchema = object({
|
|
27740
|
-
deviceId: number().int(),
|
|
27741
|
-
/** The device's name, or null when it could not be resolved (`missing`). */
|
|
27742
|
-
name: string().nullable(),
|
|
27743
|
-
health: ExtensionSourceHealthSchema,
|
|
27744
|
-
detail: string().optional()
|
|
27745
|
-
});
|
|
27746
|
-
/**
|
|
27747
|
-
* A DIFFERENT authority that gates whether the slot's sources do anything —
|
|
27748
|
-
* reported read-only, named, never written through this contract (D62). The
|
|
27749
|
-
* virtual doorbell's sources ring only while the wrapper is bound to the
|
|
27750
|
-
* camera, and that binding belongs to `deviceManager.setWrapperActive`.
|
|
27751
|
-
* `unknown` means the gate could not be read; it is not "inactive" (D315).
|
|
27752
|
-
*/
|
|
27753
|
-
var ExtensionSlotActivationSchema = object({
|
|
27754
|
-
state: _enum([
|
|
27755
|
-
"active",
|
|
27756
|
-
"inactive",
|
|
27757
|
-
"unknown"
|
|
27758
|
-
]),
|
|
27759
|
-
authority: string(),
|
|
27760
|
-
detail: string().optional()
|
|
27761
|
-
});
|
|
27762
|
-
var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
|
|
27763
|
-
state: literal("ok"),
|
|
27764
|
-
/** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
|
|
27765
|
-
slotRef: string(),
|
|
27766
|
-
slot: ExtensionSlotIdSchema,
|
|
27767
|
-
/** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
|
|
27768
|
-
authority: string(),
|
|
27769
|
-
activation: ExtensionSlotActivationSchema.nullable(),
|
|
27770
|
-
value: ExtensionSlotValueSchema,
|
|
27771
|
-
sources: array(ExtensionSlotSourceSchema),
|
|
27772
|
-
/**
|
|
27773
|
-
* Devices the owner links to the host ON ITS OWN, by structure, and that
|
|
27774
|
-
* are therefore not in `value` (D655): a camera's device-tree children, and
|
|
27775
|
-
* the child a picked container stands for (D356 — a container is never a
|
|
27776
|
-
* pick, its children are). Read-only; the editor shows them and may offer
|
|
27777
|
-
* per-device options on them (the linked-devices tracked-event opt-in).
|
|
27778
|
-
* Absent when the owner links nothing beyond the picks, and from an owner
|
|
27779
|
-
* older than D655.
|
|
27780
|
-
*/
|
|
27781
|
-
impliedSources: array(ExtensionSlotSourceSchema).optional()
|
|
27782
|
-
}), object({
|
|
27783
|
-
state: literal("unreachable"),
|
|
27784
|
-
addonId: string(),
|
|
27785
|
-
reason: string()
|
|
27786
|
-
})]);
|
|
27787
|
-
var ExtensionCandidatesSchema = object({ candidates: array(object({
|
|
27788
|
-
deviceId: number().int(),
|
|
27789
|
-
name: string(),
|
|
27790
|
-
type: string(),
|
|
27791
|
-
location: string().nullable(),
|
|
27792
|
-
/** The container a child belongs to — "Spotlight 2" alone does not say which. */
|
|
27793
|
-
parentName: string().nullable(),
|
|
27794
|
-
/** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
|
|
27795
|
-
suggested: boolean(),
|
|
27796
|
-
/** Why it is suggested ("same location"), null when it is not. */
|
|
27797
|
-
reason: string().nullable()
|
|
27798
|
-
})) });
|
|
27799
|
-
/**
|
|
27800
|
-
* What a write did. `none` — applied in place. `host` / `parent` — the owner
|
|
27801
|
-
* reloaded the host (or, for an accessory child, its parent) because the
|
|
27802
|
-
* write changed what the host REGISTERS. A slot never adds a capability to its
|
|
27803
|
-
* host — that is a composition (D663) — so today's owners answer `none`.
|
|
27804
|
-
*/
|
|
27805
|
-
var ExtensionSetResultSchema = object({
|
|
27806
|
-
applied: literal(true),
|
|
27807
|
-
reload: _enum([
|
|
27808
|
-
"none",
|
|
27809
|
-
"host",
|
|
27810
|
-
"parent"
|
|
27811
|
-
])
|
|
27812
|
-
});
|
|
27813
|
-
var ExtensionSlotRefInputSchema = object({
|
|
27814
|
-
deviceId: number().int(),
|
|
27815
|
-
slotRef: string().min(1)
|
|
27816
|
-
});
|
|
27817
|
-
var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
|
|
27818
|
-
method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)), method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)), method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema), method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
|
|
27819
|
-
kind: "mutation",
|
|
27820
|
-
auth: "admin"
|
|
27821
|
-
});
|
|
27822
28240
|
/**
|
|
27823
28241
|
* Optional client-side hints sent at session creation to help the provider
|
|
27824
28242
|
* pick the best native source. All fields optional — a viewer that knows
|
|
@@ -29656,6 +30074,17 @@ object({
|
|
|
29656
30074
|
deviceId: number(),
|
|
29657
30075
|
status: DeviceStatusSchema
|
|
29658
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;
|
|
29659
30088
|
/**
|
|
29660
30089
|
* Enum-state sensor — a string value picked from a finite option set.
|
|
29661
30090
|
* Drives HA `sensor` entries with `state_class: enum` (HVAC action
|
|
@@ -31316,9 +31745,9 @@ var MotionStatusSchema = object({
|
|
|
31316
31745
|
/** Ms epoch of the last detected-true observation. Null if never detected. */
|
|
31317
31746
|
lastDetectedAt: number().nullable(),
|
|
31318
31747
|
/**
|
|
31319
|
-
* `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device
|
|
31320
|
-
* `null` while false and on every `Sensor`
|
|
31321
|
-
* 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.
|
|
31322
31751
|
*
|
|
31323
31752
|
* ## Reading this field still arms nothing
|
|
31324
31753
|
*
|
|
@@ -31336,38 +31765,41 @@ var MotionStatusSchema = object({
|
|
|
31336
31765
|
* `addon-export-alexa/src/motion-clear-hold.ts` and
|
|
31337
31766
|
* `addon-export-hap`'s `RESET_DEBOUNCE_MS` both do.
|
|
31338
31767
|
*
|
|
31339
|
-
* ## Who writes it
|
|
31340
|
-
*
|
|
31341
|
-
* - **Cameras** — the
|
|
31342
|
-
*
|
|
31343
|
-
* `
|
|
31344
|
-
* `
|
|
31345
|
-
*
|
|
31346
|
-
*
|
|
31347
|
-
* a
|
|
31348
|
-
*
|
|
31349
|
-
*
|
|
31350
|
-
*
|
|
31351
|
-
*
|
|
31352
|
-
*
|
|
31353
|
-
*
|
|
31354
|
-
*
|
|
31355
|
-
*
|
|
31356
|
-
*
|
|
31357
|
-
* `
|
|
31358
|
-
*
|
|
31359
|
-
*
|
|
31360
|
-
*
|
|
31361
|
-
*
|
|
31362
|
-
*
|
|
31363
|
-
*
|
|
31364
|
-
* This predates D475 and is not fixed there: the fix touches every
|
|
31365
|
-
* camera provider. Recorded in D475's Consequences. Do not restore the
|
|
31366
|
-
* "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.
|
|
31367
31793
|
*/
|
|
31368
31794
|
autoClearAfterMs: number().nullable()
|
|
31369
31795
|
});
|
|
31370
|
-
|
|
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({
|
|
31371
31803
|
deviceId: number(),
|
|
31372
31804
|
detected: boolean(),
|
|
31373
31805
|
timestamp: number(),
|
|
@@ -33832,7 +34264,7 @@ var ReadGopBytesResultSchema = object({
|
|
|
33832
34264
|
/**
|
|
33833
34265
|
* A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
|
|
33834
34266
|
* twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
|
|
33835
|
-
* 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`):
|
|
33836
34268
|
* a replay needs several seconds of native pixels, not one frame.
|
|
33837
34269
|
*
|
|
33838
34270
|
* `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
|
|
@@ -36473,47 +36905,6 @@ DeviceType.Camera, method(object({
|
|
|
36473
36905
|
detection: array(ZoneRuleSchema).readonly(),
|
|
36474
36906
|
package: array(ZoneRuleSchema).readonly()
|
|
36475
36907
|
});
|
|
36476
|
-
var NUMBER = {
|
|
36477
|
-
kind: "fixed",
|
|
36478
|
-
result: ["number"]
|
|
36479
|
-
};
|
|
36480
|
-
var BOOLEAN = {
|
|
36481
|
-
kind: "fixed",
|
|
36482
|
-
result: ["boolean"]
|
|
36483
|
-
};
|
|
36484
|
-
Object.freeze({
|
|
36485
|
-
min: NUMBER,
|
|
36486
|
-
max: NUMBER,
|
|
36487
|
-
abs: NUMBER,
|
|
36488
|
-
floor: NUMBER,
|
|
36489
|
-
ceil: NUMBER,
|
|
36490
|
-
sqrt: NUMBER,
|
|
36491
|
-
round: NUMBER,
|
|
36492
|
-
pow: NUMBER,
|
|
36493
|
-
clamp: NUMBER,
|
|
36494
|
-
avg: NUMBER,
|
|
36495
|
-
sum: NUMBER,
|
|
36496
|
-
age: NUMBER,
|
|
36497
|
-
convert: NUMBER,
|
|
36498
|
-
coalesce: { kind: "coalesce" },
|
|
36499
|
-
any: BOOLEAN,
|
|
36500
|
-
all: BOOLEAN,
|
|
36501
|
-
within: BOOLEAN,
|
|
36502
|
-
latest: {
|
|
36503
|
-
kind: "fixed",
|
|
36504
|
-
result: ["number", "null"]
|
|
36505
|
-
},
|
|
36506
|
-
number: {
|
|
36507
|
-
kind: "fixed",
|
|
36508
|
-
result: ["number", "null"]
|
|
36509
|
-
},
|
|
36510
|
-
rose: {
|
|
36511
|
-
kind: "fixed",
|
|
36512
|
-
result: ["number", "null"]
|
|
36513
|
-
},
|
|
36514
|
-
count: NUMBER
|
|
36515
|
-
});
|
|
36516
|
-
`${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
|
|
36517
36908
|
/**
|
|
36518
36909
|
* Accessory device helpers — shared across drivers.
|
|
36519
36910
|
*
|
|
@@ -38936,6 +39327,12 @@ Object.freeze({
|
|
|
38936
39327
|
addonId: null,
|
|
38937
39328
|
access: "view"
|
|
38938
39329
|
},
|
|
39330
|
+
"coreBlocks.listComposableCaps": {
|
|
39331
|
+
capName: "core-blocks",
|
|
39332
|
+
capScope: "system",
|
|
39333
|
+
addonId: null,
|
|
39334
|
+
access: "view"
|
|
39335
|
+
},
|
|
38939
39336
|
"coreBlocks.listCompositions": {
|
|
38940
39337
|
capName: "core-blocks",
|
|
38941
39338
|
capScope: "system",
|
|
@@ -39014,6 +39411,18 @@ Object.freeze({
|
|
|
39014
39411
|
addonId: null,
|
|
39015
39412
|
access: "view"
|
|
39016
39413
|
},
|
|
39414
|
+
"databaseSnapshot.listDatabases": {
|
|
39415
|
+
capName: "database-snapshot",
|
|
39416
|
+
capScope: "system",
|
|
39417
|
+
addonId: null,
|
|
39418
|
+
access: "view"
|
|
39419
|
+
},
|
|
39420
|
+
"databaseSnapshot.writeSnapshot": {
|
|
39421
|
+
capName: "database-snapshot",
|
|
39422
|
+
capScope: "system",
|
|
39423
|
+
addonId: null,
|
|
39424
|
+
access: "create"
|
|
39425
|
+
},
|
|
39017
39426
|
"dataStoreProvider.aggregate": {
|
|
39018
39427
|
capName: "data-store-provider",
|
|
39019
39428
|
capScope: "system",
|
|
@@ -41474,6 +41883,12 @@ Object.freeze({
|
|
|
41474
41883
|
addonId: null,
|
|
41475
41884
|
access: "view"
|
|
41476
41885
|
},
|
|
41886
|
+
"notificationRules.getAlarmSensors": {
|
|
41887
|
+
capName: "notification-rules",
|
|
41888
|
+
capScope: "system",
|
|
41889
|
+
addonId: null,
|
|
41890
|
+
access: "view"
|
|
41891
|
+
},
|
|
41477
41892
|
"notificationRules.getClipRetentionAsks": {
|
|
41478
41893
|
capName: "notification-rules",
|
|
41479
41894
|
capScope: "system",
|
|
@@ -41750,6 +42165,12 @@ Object.freeze({
|
|
|
41750
42165
|
addonId: null,
|
|
41751
42166
|
access: "create"
|
|
41752
42167
|
},
|
|
42168
|
+
"pipelineAnalytics.clearTrackRelation": {
|
|
42169
|
+
capName: "pipeline-analytics",
|
|
42170
|
+
capScope: "device",
|
|
42171
|
+
addonId: null,
|
|
42172
|
+
access: "delete"
|
|
42173
|
+
},
|
|
41753
42174
|
"pipelineAnalytics.clearTracks": {
|
|
41754
42175
|
capName: "pipeline-analytics",
|
|
41755
42176
|
capScope: "device",
|
|
@@ -42002,6 +42423,12 @@ Object.freeze({
|
|
|
42002
42423
|
addonId: null,
|
|
42003
42424
|
access: "view"
|
|
42004
42425
|
},
|
|
42426
|
+
"pipelineAnalytics.listTrackRelations": {
|
|
42427
|
+
capName: "pipeline-analytics",
|
|
42428
|
+
capScope: "device",
|
|
42429
|
+
addonId: null,
|
|
42430
|
+
access: "view"
|
|
42431
|
+
},
|
|
42005
42432
|
"pipelineAnalytics.listTracks": {
|
|
42006
42433
|
capName: "pipeline-analytics",
|
|
42007
42434
|
capScope: "device",
|
|
@@ -42116,6 +42543,18 @@ Object.freeze({
|
|
|
42116
42543
|
addonId: null,
|
|
42117
42544
|
access: "create"
|
|
42118
42545
|
},
|
|
42546
|
+
"pipelineAnalytics.setTrackPurity": {
|
|
42547
|
+
capName: "pipeline-analytics",
|
|
42548
|
+
capScope: "device",
|
|
42549
|
+
addonId: null,
|
|
42550
|
+
access: "create"
|
|
42551
|
+
},
|
|
42552
|
+
"pipelineAnalytics.setTrackRelation": {
|
|
42553
|
+
capName: "pipeline-analytics",
|
|
42554
|
+
capScope: "device",
|
|
42555
|
+
addonId: null,
|
|
42556
|
+
access: "create"
|
|
42557
|
+
},
|
|
42119
42558
|
"pipelineAnalytics.startStorageMigrationMove": {
|
|
42120
42559
|
capName: "pipeline-analytics",
|
|
42121
42560
|
capScope: "device",
|
|
@@ -42554,6 +42993,12 @@ Object.freeze({
|
|
|
42554
42993
|
addonId: null,
|
|
42555
42994
|
access: "delete"
|
|
42556
42995
|
},
|
|
42996
|
+
"pipelineOrchestrator.requestOccupancyLook": {
|
|
42997
|
+
capName: "pipeline-orchestrator",
|
|
42998
|
+
capScope: "system",
|
|
42999
|
+
addonId: null,
|
|
43000
|
+
access: "create"
|
|
43001
|
+
},
|
|
42557
43002
|
"pipelineOrchestrator.resetNodePipelineDefaults": {
|
|
42558
43003
|
capName: "pipeline-orchestrator",
|
|
42559
43004
|
capScope: "system",
|
|
@@ -42620,6 +43065,12 @@ Object.freeze({
|
|
|
42620
43065
|
addonId: null,
|
|
42621
43066
|
access: "create"
|
|
42622
43067
|
},
|
|
43068
|
+
"pipelineOrchestrator.setCameraSensors": {
|
|
43069
|
+
capName: "pipeline-orchestrator",
|
|
43070
|
+
capScope: "system",
|
|
43071
|
+
addonId: null,
|
|
43072
|
+
access: "create"
|
|
43073
|
+
},
|
|
42623
43074
|
"pipelineOrchestrator.setCameraStepOverride": {
|
|
42624
43075
|
capName: "pipeline-orchestrator",
|
|
42625
43076
|
capScope: "system",
|
|
@@ -45921,6 +46372,11 @@ Object.freeze({
|
|
|
45921
46372
|
form: "single",
|
|
45922
46373
|
optional: false
|
|
45923
46374
|
}],
|
|
46375
|
+
"notificationRules.getAlarmSensors": [{
|
|
46376
|
+
name: "deviceIds",
|
|
46377
|
+
form: "array",
|
|
46378
|
+
optional: false
|
|
46379
|
+
}],
|
|
45924
46380
|
"notificationRules.setDeviceMuted": [{
|
|
45925
46381
|
name: "deviceId",
|
|
45926
46382
|
form: "single",
|
|
@@ -46030,6 +46486,11 @@ Object.freeze({
|
|
|
46030
46486
|
form: "single",
|
|
46031
46487
|
optional: false
|
|
46032
46488
|
}],
|
|
46489
|
+
"pipelineAnalytics.clearTrackRelation": [{
|
|
46490
|
+
name: "deviceId",
|
|
46491
|
+
form: "single",
|
|
46492
|
+
optional: false
|
|
46493
|
+
}],
|
|
46033
46494
|
"pipelineAnalytics.clearTracks": [{
|
|
46034
46495
|
name: "deviceId",
|
|
46035
46496
|
form: "single",
|
|
@@ -46180,6 +46641,11 @@ Object.freeze({
|
|
|
46180
46641
|
form: "single",
|
|
46181
46642
|
optional: false
|
|
46182
46643
|
}],
|
|
46644
|
+
"pipelineAnalytics.listTrackRelations": [{
|
|
46645
|
+
name: "deviceId",
|
|
46646
|
+
form: "single",
|
|
46647
|
+
optional: false
|
|
46648
|
+
}],
|
|
46183
46649
|
"pipelineAnalytics.listTracks": [{
|
|
46184
46650
|
name: "deviceId",
|
|
46185
46651
|
form: "single",
|
|
@@ -46250,6 +46716,16 @@ Object.freeze({
|
|
|
46250
46716
|
form: "single",
|
|
46251
46717
|
optional: false
|
|
46252
46718
|
}],
|
|
46719
|
+
"pipelineAnalytics.setTrackPurity": [{
|
|
46720
|
+
name: "deviceId",
|
|
46721
|
+
form: "single",
|
|
46722
|
+
optional: false
|
|
46723
|
+
}],
|
|
46724
|
+
"pipelineAnalytics.setTrackRelation": [{
|
|
46725
|
+
name: "deviceId",
|
|
46726
|
+
form: "single",
|
|
46727
|
+
optional: false
|
|
46728
|
+
}],
|
|
46253
46729
|
"pipelineAnalytics.wipeAllAnalytics": [{
|
|
46254
46730
|
name: "deviceId",
|
|
46255
46731
|
form: "single",
|
|
@@ -46320,6 +46796,11 @@ Object.freeze({
|
|
|
46320
46796
|
form: "single",
|
|
46321
46797
|
optional: false
|
|
46322
46798
|
}],
|
|
46799
|
+
"pipelineOrchestrator.requestOccupancyLook": [{
|
|
46800
|
+
name: "deviceId",
|
|
46801
|
+
form: "single",
|
|
46802
|
+
optional: false
|
|
46803
|
+
}],
|
|
46323
46804
|
"pipelineOrchestrator.resolvePipeline": [{
|
|
46324
46805
|
name: "deviceId",
|
|
46325
46806
|
form: "single",
|
|
@@ -46330,6 +46811,11 @@ Object.freeze({
|
|
|
46330
46811
|
form: "single",
|
|
46331
46812
|
optional: false
|
|
46332
46813
|
}],
|
|
46814
|
+
"pipelineOrchestrator.setCameraSensors": [{
|
|
46815
|
+
name: "deviceId",
|
|
46816
|
+
form: "single",
|
|
46817
|
+
optional: false
|
|
46818
|
+
}],
|
|
46333
46819
|
"pipelineOrchestrator.setCameraStepOverride": [{
|
|
46334
46820
|
name: "deviceId",
|
|
46335
46821
|
form: "single",
|
|
@@ -47476,6 +47962,18 @@ var STATE_SUMMARY_VARS = [
|
|
|
47476
47962
|
systemEventKinds: [...SUMMARISABLE],
|
|
47477
47963
|
systemEventDeliveries: ["summary"]
|
|
47478
47964
|
},
|
|
47965
|
+
{
|
|
47966
|
+
name: "summarySection",
|
|
47967
|
+
label: "Summary: this section",
|
|
47968
|
+
description: "The section a per-section summary row is about (D698); on a summary sent as one message, every section it reports, comma-separated.",
|
|
47969
|
+
example: "Batterie scariche",
|
|
47970
|
+
group: "system",
|
|
47971
|
+
families: ["rule"],
|
|
47972
|
+
fields: [...RULE_TEXT],
|
|
47973
|
+
kinds: ["system"],
|
|
47974
|
+
systemEventKinds: [...SUMMARISABLE],
|
|
47975
|
+
systemEventDeliveries: ["summary"]
|
|
47976
|
+
},
|
|
47479
47977
|
...STATE_SUMMARY_SECTION_VARS.map((v) => ({
|
|
47480
47978
|
name: v.name,
|
|
47481
47979
|
label: v.label,
|
|
@@ -47552,6 +48050,37 @@ var STATE_SUMMARY_VARS = [
|
|
|
47552
48050
|
[...RULE_TEXT],
|
|
47553
48051
|
...STATE_SUMMARY_VARS
|
|
47554
48052
|
];
|
|
48053
|
+
new Set([
|
|
48054
|
+
"disarmed",
|
|
48055
|
+
"armed_home",
|
|
48056
|
+
"armed_away",
|
|
48057
|
+
"armed_night",
|
|
48058
|
+
"armed_vacation",
|
|
48059
|
+
"armed_custom_bypass",
|
|
48060
|
+
"arming",
|
|
48061
|
+
"disarming",
|
|
48062
|
+
"pending",
|
|
48063
|
+
"triggered",
|
|
48064
|
+
"open",
|
|
48065
|
+
"opening",
|
|
48066
|
+
"closing",
|
|
48067
|
+
"closed",
|
|
48068
|
+
"stopped",
|
|
48069
|
+
"locked",
|
|
48070
|
+
"unlocked",
|
|
48071
|
+
"locking",
|
|
48072
|
+
"unlocking",
|
|
48073
|
+
"jammed",
|
|
48074
|
+
"on",
|
|
48075
|
+
"off",
|
|
48076
|
+
"home",
|
|
48077
|
+
"not_home",
|
|
48078
|
+
"matched",
|
|
48079
|
+
"diverged",
|
|
48080
|
+
"unknown",
|
|
48081
|
+
"latched",
|
|
48082
|
+
"live"
|
|
48083
|
+
]);
|
|
47555
48084
|
/**
|
|
47556
48085
|
* TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
|
|
47557
48086
|
*
|
|
@@ -47645,7 +48174,7 @@ var PreviewTextField = string().max(200);
|
|
|
47645
48174
|
* Whether the notification's preview is a STILL or a short animation.
|
|
47646
48175
|
*
|
|
47647
48176
|
* The operator's ask, verbatim: *"inviato come gif o video (come per le altre
|
|
47648
|
-
* 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
|
|
47649
48178
|
* night reads better as three seconds of motion than as one frame of it. Both
|
|
47650
48179
|
* modes get the SAME treatment (blurred frame, large centred title); `'gif'`
|
|
47651
48180
|
* simply applies it to a dozen frames sampled across the render and assembles
|
|
@@ -47783,6 +48312,7 @@ TimelapseRuleInputSchema.extend({
|
|
|
47783
48312
|
createdAt: number(),
|
|
47784
48313
|
updatedAt: number()
|
|
47785
48314
|
});
|
|
48315
|
+
MotionOnMotionChangedDataSchema.omit({ triggeredBy: true });
|
|
47786
48316
|
object({
|
|
47787
48317
|
/**
|
|
47788
48318
|
* Fraction of the box's own size added on EACH side before cutting.
|