@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
|
@@ -38,7 +38,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
38
38
|
var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
39
39
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
40
40
|
//#endregion
|
|
41
|
-
//#region ../types/dist/event-category-
|
|
41
|
+
//#region ../types/dist/event-category-BGmz_oxW.mjs
|
|
42
42
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
43
43
|
EventCategory["SystemBoot"] = "system.boot";
|
|
44
44
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -571,6 +571,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
571
571
|
*/
|
|
572
572
|
EventCategory["PipelineAudioInferenceResult"] = "pipeline.audio-inference-result";
|
|
573
573
|
EventCategory["DetectionPhaseTransition"] = "detection.phase-transition";
|
|
574
|
+
/**
|
|
575
|
+
* A camera provider's RAW onboard motion push (D673): the `MotionOnMotionChanged`
|
|
576
|
+
* data shape without `triggeredBy`, built by `providerMotionEvent`. Its one
|
|
577
|
+
* consumer is the orchestrator's camera-sensors bridge, which re-emits the
|
|
578
|
+
* camera's EFFECTIVE onboard motion as `MotionOnMotionChanged` (a pass-through
|
|
579
|
+
* for a camera with no attached sensor). Providers must not emit
|
|
580
|
+
* `MotionOnMotionChanged` themselves; `scripts/check-onboard-motion-emitters.ts`
|
|
581
|
+
* keeps it so (camera-grid is a named, deferred exception).
|
|
582
|
+
*/
|
|
574
583
|
EventCategory["ProviderMotion"] = "provider.motion";
|
|
575
584
|
EventCategory["ProviderDetection"] = "provider.detection";
|
|
576
585
|
EventCategory["EnrichmentEmbeddingStored"] = "enrichment.embedding.stored";
|
|
@@ -5409,7 +5418,7 @@ var ZodIssueCode = {
|
|
|
5409
5418
|
var ZodFirstPartyTypeKind;
|
|
5410
5419
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5411
5420
|
//#endregion
|
|
5412
|
-
//#region ../types/dist/sleep-
|
|
5421
|
+
//#region ../types/dist/sleep-CDCONfkt.mjs
|
|
5413
5422
|
/**
|
|
5414
5423
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5415
5424
|
* window to float samples (D455).
|
|
@@ -7507,7 +7516,7 @@ function errMsg$16(err) {
|
|
|
7507
7516
|
return String(err);
|
|
7508
7517
|
}
|
|
7509
7518
|
//#endregion
|
|
7510
|
-
//#region ../types/dist/composition-
|
|
7519
|
+
//#region ../types/dist/composition-D7ULvLdD.mjs
|
|
7511
7520
|
var AUDIO_ENCODER_BY_CODEC = {
|
|
7512
7521
|
opus: "libopus",
|
|
7513
7522
|
aac: "aac",
|
|
@@ -8156,21 +8165,20 @@ function portable(target) {
|
|
|
8156
8165
|
}
|
|
8157
8166
|
portable("linux64"), portable("linuxarm64"), portable("macarm64"), portable("mac64");
|
|
8158
8167
|
/**
|
|
8159
|
-
*
|
|
8160
|
-
*
|
|
8168
|
+
* THE table "which boolean of this device type counts as HIGH", and the
|
|
8169
|
+
* pure evaluator of its EDGE.
|
|
8161
8170
|
*
|
|
8162
|
-
*
|
|
8163
|
-
*
|
|
8164
|
-
*
|
|
8165
|
-
*
|
|
8166
|
-
*
|
|
8167
|
-
*
|
|
8168
|
-
* SPOSTA qui e il doorbell la ri-esporta.
|
|
8171
|
+
* ONE table for everyone who asks "is this device HIGH?": the
|
|
8172
|
+
* recorder's `RecordingTriggers.sensorDeviceIds` trigger, the post-analysis
|
|
8173
|
+
* sensor markers, the orchestrator's camera-sensors bridge and
|
|
8174
|
+
* the sources of a composite doorbell (`doorbellFeatureSources`, D671).
|
|
8175
|
+
* A second copy would diverge at the first cap added, and the symptom — "the
|
|
8176
|
+
* sensor rings the doorbell but does not record" — is exactly D62.
|
|
8169
8177
|
*
|
|
8170
|
-
* ⚠
|
|
8171
|
-
*
|
|
8172
|
-
*
|
|
8173
|
-
*
|
|
8178
|
+
* ⚠ NOT `DEVICE_STATE_READERS` (`catalogs/device-state-vocabulary.ts`), and the
|
|
8179
|
+
* two must not be unified: that one answers "what is the state WORD for a
|
|
8180
|
+
* rule" (and includes `presence`, `cover`, `alarm-panel`), this one "which
|
|
8181
|
+
* boolean's EDGE counts". Deliberately different vocabularies.
|
|
8174
8182
|
*/
|
|
8175
8183
|
/**
|
|
8176
8184
|
* Known binary / switch source caps → the boolean slice field whose
|
|
@@ -9696,6 +9704,82 @@ var ArchivedDebugNoteQueryInputSchema = object({
|
|
|
9696
9704
|
/** Max rows returned, newest-first. */
|
|
9697
9705
|
limit: number().int().min(1).max(1e3).optional()
|
|
9698
9706
|
});
|
|
9707
|
+
var TrackRelationKindSchema = _enum(["same-subject", "different-subjects"]);
|
|
9708
|
+
var TrackSideSchema = _enum(["before", "after"]);
|
|
9709
|
+
var TrackPurityValueSchema = _enum(["mixed", "not-a-subject"]);
|
|
9710
|
+
var TrackRelationSchema = object({
|
|
9711
|
+
id: string(),
|
|
9712
|
+
deviceId: number().int(),
|
|
9713
|
+
leftTrackId: string(),
|
|
9714
|
+
rightTrackId: string(),
|
|
9715
|
+
leftSide: TrackSideSchema.nullable(),
|
|
9716
|
+
rightSide: TrackSideSchema.nullable(),
|
|
9717
|
+
relation: TrackRelationKindSchema,
|
|
9718
|
+
presence: literal("continuous").nullable(),
|
|
9719
|
+
leftStartedAt: number().int().nullable(),
|
|
9720
|
+
rightStartedAt: number().int().nullable(),
|
|
9721
|
+
createdAt: number().int(),
|
|
9722
|
+
updatedAt: number().int(),
|
|
9723
|
+
author: string().nullable()
|
|
9724
|
+
});
|
|
9725
|
+
var TrackPuritySchema = object({
|
|
9726
|
+
id: string(),
|
|
9727
|
+
deviceId: number().int(),
|
|
9728
|
+
sourceTrackId: string(),
|
|
9729
|
+
purity: TrackPurityValueSchema,
|
|
9730
|
+
switchAtMs: number().int().nullable(),
|
|
9731
|
+
startedAt: number().int().nullable(),
|
|
9732
|
+
createdAt: number().int(),
|
|
9733
|
+
updatedAt: number().int(),
|
|
9734
|
+
author: string().nullable()
|
|
9735
|
+
});
|
|
9736
|
+
var SetTrackRelationInputSchema = object({
|
|
9737
|
+
deviceId: number().int(),
|
|
9738
|
+
trackId: string().min(1),
|
|
9739
|
+
otherTrackId: string().min(1),
|
|
9740
|
+
relation: TrackRelationKindSchema,
|
|
9741
|
+
presence: literal("continuous").optional(),
|
|
9742
|
+
trackSide: TrackSideSchema.optional(),
|
|
9743
|
+
otherSide: TrackSideSchema.optional()
|
|
9744
|
+
});
|
|
9745
|
+
var ClearTrackRelationInputSchema = object({
|
|
9746
|
+
deviceId: number().int(),
|
|
9747
|
+
trackId: string().min(1),
|
|
9748
|
+
otherTrackId: string().min(1)
|
|
9749
|
+
});
|
|
9750
|
+
var ClearTrackRelationResultSchema = object({ cleared: boolean() });
|
|
9751
|
+
var SetTrackPurityInputSchema = object({
|
|
9752
|
+
deviceId: number().int(),
|
|
9753
|
+
trackId: string().min(1),
|
|
9754
|
+
purity: _enum([
|
|
9755
|
+
"pure",
|
|
9756
|
+
"mixed",
|
|
9757
|
+
"not-a-subject"
|
|
9758
|
+
]),
|
|
9759
|
+
switchAtMs: number().int().optional()
|
|
9760
|
+
});
|
|
9761
|
+
/** `null` when `pure` cleared the row. */
|
|
9762
|
+
var SetTrackPurityResultSchema = object({ purity: TrackPuritySchema.nullable() });
|
|
9763
|
+
var ListTrackRelationsInputSchema = object({
|
|
9764
|
+
deviceId: number().int(),
|
|
9765
|
+
trackId: string().optional(),
|
|
9766
|
+
since: number().int().optional(),
|
|
9767
|
+
until: number().int().optional(),
|
|
9768
|
+
limit: number().int().min(1).max(5e3).optional()
|
|
9769
|
+
});
|
|
9770
|
+
var ListTrackRelationsResultSchema = object({
|
|
9771
|
+
relations: array(TrackRelationSchema).readonly(),
|
|
9772
|
+
purities: array(TrackPuritySchema).readonly(),
|
|
9773
|
+
truncated: boolean()
|
|
9774
|
+
});
|
|
9775
|
+
_enum([
|
|
9776
|
+
"unknown-track",
|
|
9777
|
+
"cross-device",
|
|
9778
|
+
"self-relation",
|
|
9779
|
+
"contradiction",
|
|
9780
|
+
"switch-outside-track",
|
|
9781
|
+
"switch-needs-mixed"
|
|
9782
|
+
]);
|
|
9699
9783
|
/**
|
|
9700
9784
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
9701
9785
|
* recordings and events management surfaces.
|
|
@@ -9771,22 +9855,22 @@ var CLASS_MAP_MACRO_TARGETS = [
|
|
|
9771
9855
|
"package"
|
|
9772
9856
|
];
|
|
9773
9857
|
/**
|
|
9774
|
-
*
|
|
9775
|
-
*
|
|
9858
|
+
* The FIRST-LEVEL macro classes: those an object detector emits and that
|
|
9859
|
+
* an operator can select.
|
|
9776
9860
|
*
|
|
9777
|
-
*
|
|
9861
|
+
* They are the three offered by the `object-detection` step
|
|
9778
9862
|
* (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
|
|
9779
|
-
* `enabledMacroClasses`). `package`
|
|
9780
|
-
* `MACRO_LABELS` —
|
|
9781
|
-
* `package-detection`,
|
|
9782
|
-
*
|
|
9863
|
+
* `enabledMacroClasses`). `package` is in {@link CLASS_MAP_MACRO_TARGETS} and in
|
|
9864
|
+
* `MACRO_LABELS` — it is a true macro — but NOT here: it belongs to the step
|
|
9865
|
+
* `package-detection`, whose enablement is driven by zones, and offering the
|
|
9866
|
+
* same word twice has already made an operator turn on the COCO proxy
|
|
9783
9867
|
* (suitcase/backpack/handbag) lasciando spento il detector dedicato.
|
|
9784
9868
|
*
|
|
9785
|
-
*
|
|
9786
|
-
*
|
|
9787
|
-
* (`types/detection.ts`);
|
|
9788
|
-
* (`RecordingTriggers.objectClasses`)
|
|
9789
|
-
*
|
|
9869
|
+
* ONE list. Before today the same three were hand-written in the step's offer
|
|
9870
|
+
* and a second time as the union `FirstLevelMacro`
|
|
9871
|
+
* (`types/detection.ts`); a third copy for the recording trigger
|
|
9872
|
+
* (`RecordingTriggers.objectClasses`) would have made the later divergence
|
|
9873
|
+
* invisible.
|
|
9790
9874
|
*/
|
|
9791
9875
|
var FIRST_LEVEL_MACRO_CLASSES = [
|
|
9792
9876
|
"person",
|
|
@@ -9851,17 +9935,17 @@ var RecordingStorageModeSchema = _enum([
|
|
|
9851
9935
|
"on-device-decision"
|
|
9852
9936
|
]);
|
|
9853
9937
|
/**
|
|
9854
|
-
*
|
|
9855
|
-
*
|
|
9938
|
+
* The macro classes that can open a recording window — the same
|
|
9939
|
+
* three offered by the `object-detection` step, from ONE list
|
|
9856
9940
|
* ({@link FIRST_LEVEL_MACRO_CLASSES}).
|
|
9857
9941
|
*/
|
|
9858
9942
|
var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
|
|
9859
9943
|
/**
|
|
9860
|
-
* True
|
|
9944
|
+
* True when `values` does not repeat an element.
|
|
9861
9945
|
*
|
|
9862
|
-
*
|
|
9863
|
-
*
|
|
9864
|
-
*
|
|
9946
|
+
* A duplicate is not harmless: every entry of `objectClasses` / `sensorDeviceIds`
|
|
9947
|
+
* becomes a SOURCE in `bandTriggerSources`, and the same source twice
|
|
9948
|
+
* would count its windows twice in `segmentMissedByMs`.
|
|
9865
9949
|
*/
|
|
9866
9950
|
var noDuplicates = (values) => new Set(values).size === values.length;
|
|
9867
9951
|
/** Which detectors trigger an `events`-mode band. */
|
|
@@ -9869,34 +9953,34 @@ var RecordingTriggersSchema = object({
|
|
|
9869
9953
|
motion: boolean().optional(),
|
|
9870
9954
|
audioThresholdDbfs: number().optional(),
|
|
9871
9955
|
/**
|
|
9872
|
-
*
|
|
9873
|
-
*
|
|
9874
|
-
*
|
|
9875
|
-
*
|
|
9956
|
+
* The macro classes whose detection opens a window. ABSENT = the source
|
|
9957
|
+
* is not listened to; an EMPTY array is rejected, because "events band, object
|
|
9958
|
+
* trigger on, no class" is the same shape "enabled and records
|
|
9959
|
+
* nothing, forever" that `eventsBandCanEverDemand` is written against.
|
|
9876
9960
|
*
|
|
9877
|
-
*
|
|
9878
|
-
*
|
|
9879
|
-
* `minConfidence<Macro>`
|
|
9880
|
-
* (`source: 'onboard'`)
|
|
9881
|
-
*
|
|
9961
|
+
* The signal read is ALREADY FILTERED: only `source: 'pipeline'` detections, i.e.
|
|
9962
|
+
* those that went through `enabledMacroClasses`, the
|
|
9963
|
+
* `minConfidence<Macro>` and the full-frame guard. The camera's onboard AI
|
|
9964
|
+
* (`source: 'onboard'`) goes through none of those gates and does NOT open
|
|
9965
|
+
* windows — see `recorder/object-trigger.ts`.
|
|
9882
9966
|
*/
|
|
9883
9967
|
objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
|
|
9884
9968
|
/**
|
|
9885
|
-
*
|
|
9886
|
-
*
|
|
9969
|
+
* The LINKED devices whose RISING EDGE opens a window. Absent = the source
|
|
9970
|
+
* is not listened to; an empty array is rejected for the same reason as
|
|
9887
9971
|
* `objectClasses`.
|
|
9888
9972
|
*
|
|
9889
|
-
*
|
|
9890
|
-
*
|
|
9891
|
-
*
|
|
9892
|
-
*
|
|
9893
|
-
* device (D12) —
|
|
9973
|
+
* These are SOURCE device ids, not cameras: the band names them, so the
|
|
9974
|
+
* hot path (`DeviceStateChanged`, at bus rate across the whole fleet)
|
|
9975
|
+
* does no RPC. The OFFER from which the operator picks them is another question, and
|
|
9976
|
+
* is resolved with `deviceManager.getLinkedDevices` + `getBindingsBatch` per
|
|
9977
|
+
* device (D12) — never a global list of caps.
|
|
9894
9978
|
*
|
|
9895
|
-
*
|
|
9896
|
-
* `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`)
|
|
9897
|
-
*
|
|
9898
|
-
*
|
|
9899
|
-
*
|
|
9979
|
+
* What "high" means depends on the device TYPE and is not decided here:
|
|
9980
|
+
* `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) is THE table,
|
|
9981
|
+
* the same one as the composite doorbell (D671). And it is the EDGE, not
|
|
9982
|
+
* the level: a contact found already open at runner restart does not
|
|
9983
|
+
* record.
|
|
9900
9984
|
*/
|
|
9901
9985
|
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
|
|
9902
9986
|
});
|
|
@@ -11039,7 +11123,7 @@ var DecoderSessionConfigSchema = object({
|
|
|
11039
11123
|
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
11040
11124
|
* thing: the logging settings document on the `system` cap. Two authorities
|
|
11041
11125
|
* over the values is the exact defect
|
|
11042
|
-
* `docs/design/plans/2026-08-26-
|
|
11126
|
+
* `docs/design/plans/2026-08-26-per-component-logging.md` was written to
|
|
11043
11127
|
* remove; re-introducing it from the cure side would be grotesque.
|
|
11044
11128
|
*
|
|
11045
11129
|
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
@@ -12403,6 +12487,68 @@ method(object({
|
|
|
12403
12487
|
password: string()
|
|
12404
12488
|
}), AuthResultSchema.nullable(), { kind: "mutation" }), method(object({ state: string() }), string()), method(record(string(), string()), AuthResultSchema, { kind: "mutation" }), method(object({ token: string() }), AuthResultSchema.nullable());
|
|
12405
12489
|
/**
|
|
12490
|
+
* How long one snapshot may take end to end: the pinned copy of the whole
|
|
12491
|
+
* database plus `PRAGMA integrity_check` over the copy, on the hub's slowest
|
|
12492
|
+
* disk. ~800 MB at a pessimistic 10 MB/s is under 3 minutes; the bound is
|
|
12493
|
+
* generous because a timeout fails the whole backup run.
|
|
12494
|
+
*/
|
|
12495
|
+
var DATABASE_SNAPSHOT_TIMEOUT_MS = 30 * 6e4;
|
|
12496
|
+
/**
|
|
12497
|
+
* The databases an owner snapshots — declared by the OWNER, so a caller never
|
|
12498
|
+
* guesses which file is live from what sits beside it (a cleanly closed
|
|
12499
|
+
* database has no sidecars and is just as owned). Paths are absolute on the
|
|
12500
|
+
* owner's host.
|
|
12501
|
+
*/
|
|
12502
|
+
var DatabaseSnapshotTargetsSchema = object({ databases: array(object({ livePath: string() })) });
|
|
12503
|
+
/** One b-tree table of the snapshot and the rows it holds. */
|
|
12504
|
+
var DatabaseSnapshotTableSchema = object({
|
|
12505
|
+
name: string(),
|
|
12506
|
+
rows: number().int().nonnegative()
|
|
12507
|
+
});
|
|
12508
|
+
/**
|
|
12509
|
+
* What the owner wrote. Every path is ABSOLUTE on the owner's host — the
|
|
12510
|
+
* caller pins the call to its own node, so it can read the file; a caller
|
|
12511
|
+
* that finds the path outside its own data root refuses it rather than
|
|
12512
|
+
* archiving something it cannot place.
|
|
12513
|
+
*/
|
|
12514
|
+
var DatabaseSnapshotResultSchema = object({
|
|
12515
|
+
/** The live database the snapshot copies. Never to be copied as a file. */
|
|
12516
|
+
livePath: string(),
|
|
12517
|
+
/** The verified copy: `<livePath>` + {@link DATABASE_SNAPSHOT_SUFFIX}. */
|
|
12518
|
+
snapshotPath: string(),
|
|
12519
|
+
sizeBytes: number().int().nonnegative(),
|
|
12520
|
+
pageCount: number().int().nonnegative(),
|
|
12521
|
+
pageSize: number().int().positive(),
|
|
12522
|
+
/**
|
|
12523
|
+
* Every b-tree table with its row count. Read inside the SAME read
|
|
12524
|
+
* transaction the copy was taken from, and found EQUAL on the copy — so
|
|
12525
|
+
* this is the content of the snapshot, not an estimate of the source.
|
|
12526
|
+
*/
|
|
12527
|
+
tables: array(DatabaseSnapshotTableSchema),
|
|
12528
|
+
/** Wall time of the pinned copy (row counts included). */
|
|
12529
|
+
copyMs: number().nonnegative(),
|
|
12530
|
+
/** Wall time of the checks on the copy (`integrity_check`, row counts). */
|
|
12531
|
+
verifyMs: number().nonnegative(),
|
|
12532
|
+
/** When the pinned read transaction began (ms epoch) — the snapshot's instant. */
|
|
12533
|
+
takenAt: number()
|
|
12534
|
+
});
|
|
12535
|
+
/**
|
|
12536
|
+
* A snapshot as an ARCHIVE records it (`ArchiveManifest.sqliteSnapshots`):
|
|
12537
|
+
* the same facts, with both paths relative to the archive root (the node's
|
|
12538
|
+
* data dir), because an archive outlives the host that made it.
|
|
12539
|
+
*/
|
|
12540
|
+
var ArchiveSqliteSnapshotSchema = DatabaseSnapshotResultSchema.extend({
|
|
12541
|
+
/** Archive-relative path of the live database the archive does NOT carry. */
|
|
12542
|
+
livePath: string(),
|
|
12543
|
+
/** Archive-relative path of the verified copy it carries in its place. */
|
|
12544
|
+
snapshotPath: string()
|
|
12545
|
+
});
|
|
12546
|
+
method(object({}), DatabaseSnapshotTargetsSchema, { auth: "admin" }), method(object({}), DatabaseSnapshotResultSchema, {
|
|
12547
|
+
kind: "mutation",
|
|
12548
|
+
auth: "admin",
|
|
12549
|
+
timeoutMs: DATABASE_SNAPSHOT_TIMEOUT_MS
|
|
12550
|
+
});
|
|
12551
|
+
/**
|
|
12406
12552
|
* Orchestrator-side destination metadata. The orchestrator computes
|
|
12407
12553
|
* `id = <addonId>:<subId>` from its provider lookup so consumers
|
|
12408
12554
|
* (admin UI, restore flow) see one canonical key.
|
|
@@ -12513,7 +12659,12 @@ var ArchiveManifestSchema = object({
|
|
|
12513
12659
|
locations: array(string()),
|
|
12514
12660
|
entries: array(ArchiveEntrySchema),
|
|
12515
12661
|
totalBytes: number(),
|
|
12516
|
-
totalFiles: number()
|
|
12662
|
+
totalFiles: number(),
|
|
12663
|
+
/**
|
|
12664
|
+
* Live SQLite databases this archive carries as their OWNER's verified
|
|
12665
|
+
* snapshot instead of as files (D693). Absent on archives made before.
|
|
12666
|
+
*/
|
|
12667
|
+
sqliteSnapshots: array(ArchiveSqliteSnapshotSchema).optional()
|
|
12517
12668
|
});
|
|
12518
12669
|
var LocationStatSchema = object({
|
|
12519
12670
|
name: string(),
|
|
@@ -13937,6 +14088,116 @@ var CompositionBlockStateSchema = object({
|
|
|
13937
14088
|
reason: string().optional(),
|
|
13938
14089
|
fields: array(CompositionFieldStateSchema)
|
|
13939
14090
|
});
|
|
14091
|
+
var ComposerBlockSchema = object({
|
|
14092
|
+
id: string().min(1),
|
|
14093
|
+
name: string().min(1).max(120),
|
|
14094
|
+
enabled: boolean(),
|
|
14095
|
+
updatedAt: number(),
|
|
14096
|
+
composition: CompositionSchema
|
|
14097
|
+
});
|
|
14098
|
+
/**
|
|
14099
|
+
* A stored composition row that no longer PARSES — a schema a release
|
|
14100
|
+
* tightened, a row written by a newer build. Sent by id so the composer keeps
|
|
14101
|
+
* its device as a placeholder and reports the block `failed` naming the parse
|
|
14102
|
+
* error. Leaving it out would read, twice, exactly like a delete (D49).
|
|
14103
|
+
*/
|
|
14104
|
+
var ComposerUnreadableBlockSchema = object({
|
|
14105
|
+
id: string().min(1),
|
|
14106
|
+
/** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
|
|
14107
|
+
name: string().nullable(),
|
|
14108
|
+
/** The parse error, in the operator's words. */
|
|
14109
|
+
error: string()
|
|
14110
|
+
});
|
|
14111
|
+
method(object({
|
|
14112
|
+
/** The shared Blocks integration; null until `core-blocks` has reconciled it. */
|
|
14113
|
+
integrationId: string().nullable(),
|
|
14114
|
+
/** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
|
|
14115
|
+
storeLoaded: boolean(),
|
|
14116
|
+
blocks: array(ComposerBlockSchema),
|
|
14117
|
+
/** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
|
|
14118
|
+
restartBlockIds: array(string()),
|
|
14119
|
+
/** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
|
|
14120
|
+
unreadableBlocks: array(ComposerUnreadableBlockSchema)
|
|
14121
|
+
}), object({
|
|
14122
|
+
blocks: array(object({
|
|
14123
|
+
blockId: string(),
|
|
14124
|
+
status: CompositionRunStatusSchema,
|
|
14125
|
+
reason: string().optional()
|
|
14126
|
+
})),
|
|
14127
|
+
/**
|
|
14128
|
+
* False when the composer declared and withdrew NOTHING (store not loaded,
|
|
14129
|
+
* integration unknown, its own rows unread or read empty once). An empty
|
|
14130
|
+
* apply the caller owes is paid off only by one the composer acted on (D49).
|
|
14131
|
+
*/
|
|
14132
|
+
acted: boolean()
|
|
14133
|
+
}), {
|
|
14134
|
+
kind: "mutation",
|
|
14135
|
+
auth: "admin"
|
|
14136
|
+
}), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
|
|
14137
|
+
var NUMBER = {
|
|
14138
|
+
kind: "fixed",
|
|
14139
|
+
result: ["number"]
|
|
14140
|
+
};
|
|
14141
|
+
var BOOLEAN = {
|
|
14142
|
+
kind: "fixed",
|
|
14143
|
+
result: ["boolean"]
|
|
14144
|
+
};
|
|
14145
|
+
Object.freeze({
|
|
14146
|
+
min: NUMBER,
|
|
14147
|
+
max: NUMBER,
|
|
14148
|
+
abs: NUMBER,
|
|
14149
|
+
floor: NUMBER,
|
|
14150
|
+
ceil: NUMBER,
|
|
14151
|
+
sqrt: NUMBER,
|
|
14152
|
+
round: NUMBER,
|
|
14153
|
+
pow: NUMBER,
|
|
14154
|
+
clamp: NUMBER,
|
|
14155
|
+
avg: NUMBER,
|
|
14156
|
+
sum: NUMBER,
|
|
14157
|
+
age: NUMBER,
|
|
14158
|
+
convert: NUMBER,
|
|
14159
|
+
coalesce: { kind: "coalesce" },
|
|
14160
|
+
any: BOOLEAN,
|
|
14161
|
+
all: BOOLEAN,
|
|
14162
|
+
within: BOOLEAN,
|
|
14163
|
+
latest: {
|
|
14164
|
+
kind: "fixed",
|
|
14165
|
+
result: ["number", "null"]
|
|
14166
|
+
},
|
|
14167
|
+
number: {
|
|
14168
|
+
kind: "fixed",
|
|
14169
|
+
result: ["number", "null"]
|
|
14170
|
+
},
|
|
14171
|
+
rose: {
|
|
14172
|
+
kind: "fixed",
|
|
14173
|
+
result: ["number", "null"]
|
|
14174
|
+
},
|
|
14175
|
+
count: NUMBER
|
|
14176
|
+
});
|
|
14177
|
+
`${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
|
|
14178
|
+
/**
|
|
14179
|
+
* What a composition may BUILD on a device type (G2, D676): the caps a new
|
|
14180
|
+
* device of that type, or an existing one that lacks them, can be given. The
|
|
14181
|
+
* blockers are the validator's own refusal codes, and a spec compares this
|
|
14182
|
+
* listing with `planComposition` for every capability — the editor can never
|
|
14183
|
+
* offer a feature the save would refuse for the same reason.
|
|
14184
|
+
*/
|
|
14185
|
+
var ComposableFieldSchema = object({
|
|
14186
|
+
path: string(),
|
|
14187
|
+
kind: CompositionFieldKindSchema,
|
|
14188
|
+
nullable: boolean(),
|
|
14189
|
+
required: boolean(),
|
|
14190
|
+
enumValues: array(string()).optional()
|
|
14191
|
+
});
|
|
14192
|
+
var ComposableCapabilitiesSchema = object({ caps: array(object({
|
|
14193
|
+
cap: string(),
|
|
14194
|
+
fields: array(ComposableFieldSchema),
|
|
14195
|
+
/** Present for an item-array cap (`consumables.items`). */
|
|
14196
|
+
itemArray: object({
|
|
14197
|
+
path: string(),
|
|
14198
|
+
keyField: string()
|
|
14199
|
+
}).optional()
|
|
14200
|
+
})) });
|
|
13940
14201
|
/** Where a block runs. The operator chooses — a block driving a device on an
|
|
13941
14202
|
* agent is the reason placement is not fixed to the hub. */
|
|
13942
14203
|
var CoreBlockPlacementSchema = union([literal("hub"), string().min(1)]);
|
|
@@ -14101,7 +14362,7 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
|
|
|
14101
14362
|
}), method(object({ blockId: string() }), CompositionGetReadSchema, { auth: "admin" }), method(object({}), CompositionListReadSchema, { auth: "admin" }), method(object({
|
|
14102
14363
|
addonId: string().min(1),
|
|
14103
14364
|
stableId: string().min(1)
|
|
14104
|
-
}), CompositionCustomizationReadSchema, { auth: "admin" }), method(object({
|
|
14365
|
+
}), CompositionCustomizationReadSchema, { auth: "admin" }), method(object({ deviceType: _enum(DeviceType) }), ComposableCapabilitiesSchema, { auth: "admin" }), method(object({
|
|
14105
14366
|
composition: CompositionSchema,
|
|
14106
14367
|
blockId: string().optional()
|
|
14107
14368
|
}), CompositionValidationSchema, {
|
|
@@ -14109,52 +14370,6 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
|
|
|
14109
14370
|
auth: "admin",
|
|
14110
14371
|
access: "view"
|
|
14111
14372
|
});
|
|
14112
|
-
var ComposerBlockSchema = object({
|
|
14113
|
-
id: string().min(1),
|
|
14114
|
-
name: string().min(1).max(120),
|
|
14115
|
-
enabled: boolean(),
|
|
14116
|
-
updatedAt: number(),
|
|
14117
|
-
composition: CompositionSchema
|
|
14118
|
-
});
|
|
14119
|
-
/**
|
|
14120
|
-
* A stored composition row that no longer PARSES — a schema a release
|
|
14121
|
-
* tightened, a row written by a newer build. Sent by id so the composer keeps
|
|
14122
|
-
* its device as a placeholder and reports the block `failed` naming the parse
|
|
14123
|
-
* error. Leaving it out would read, twice, exactly like a delete (D49).
|
|
14124
|
-
*/
|
|
14125
|
-
var ComposerUnreadableBlockSchema = object({
|
|
14126
|
-
id: string().min(1),
|
|
14127
|
-
/** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
|
|
14128
|
-
name: string().nullable(),
|
|
14129
|
-
/** The parse error, in the operator's words. */
|
|
14130
|
-
error: string()
|
|
14131
|
-
});
|
|
14132
|
-
method(object({
|
|
14133
|
-
/** The shared Blocks integration; null until `core-blocks` has reconciled it. */
|
|
14134
|
-
integrationId: string().nullable(),
|
|
14135
|
-
/** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
|
|
14136
|
-
storeLoaded: boolean(),
|
|
14137
|
-
blocks: array(ComposerBlockSchema),
|
|
14138
|
-
/** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
|
|
14139
|
-
restartBlockIds: array(string()),
|
|
14140
|
-
/** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
|
|
14141
|
-
unreadableBlocks: array(ComposerUnreadableBlockSchema)
|
|
14142
|
-
}), object({
|
|
14143
|
-
blocks: array(object({
|
|
14144
|
-
blockId: string(),
|
|
14145
|
-
status: CompositionRunStatusSchema,
|
|
14146
|
-
reason: string().optional()
|
|
14147
|
-
})),
|
|
14148
|
-
/**
|
|
14149
|
-
* False when the composer declared and withdrew NOTHING (store not loaded,
|
|
14150
|
-
* integration unknown, its own rows unread or read empty once). An empty
|
|
14151
|
-
* apply the caller owes is paid off only by one the composer acted on (D49).
|
|
14152
|
-
*/
|
|
14153
|
-
acted: boolean()
|
|
14154
|
-
}), {
|
|
14155
|
-
kind: "mutation",
|
|
14156
|
-
auth: "admin"
|
|
14157
|
-
}), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
|
|
14158
14373
|
/**
|
|
14159
14374
|
* `custom-model-registry` — collection cap exposing operator-registered
|
|
14160
14375
|
* custom detection models. Each provider (today: `addon-model-studio`)
|
|
@@ -14449,7 +14664,7 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
14449
14664
|
*
|
|
14450
14665
|
* ⚠ An earlier version of this comment blamed Zod stripping, and that
|
|
14451
14666
|
* was wrong — corrected 2026-08-26 after the hop map
|
|
14452
|
-
* (`docs/design/2026-08-26-
|
|
14667
|
+
* (`docs/design/2026-08-26-topic-hop-map.md`) traced the path.
|
|
14453
14668
|
* There is **no Zod parse at all** between the door and the engine: the
|
|
14454
14669
|
* dispatcher forwards the payload verbatim and UDS carries it whole. A
|
|
14455
14670
|
* field declared here reaches `SqliteSettingsBackend` either way.
|
|
@@ -15286,7 +15501,17 @@ var SiteZoneSchema = object({
|
|
|
15286
15501
|
var ProviderStatusSchema = object({
|
|
15287
15502
|
connected: boolean(),
|
|
15288
15503
|
deviceCount: number(),
|
|
15289
|
-
error: string().optional()
|
|
15504
|
+
error: string().optional(),
|
|
15505
|
+
/**
|
|
15506
|
+
* `'orchestrator'`: this provider writes NO camera's `motion` runtime slice
|
|
15507
|
+
* — the orchestrator is its only writer (D696). Set by `BaseDeviceProvider`,
|
|
15508
|
+
* which every provider bundles, so only a provider BUILT from D696-amended
|
|
15509
|
+
* code says it. ABSENT means an older provider that may still write it (raw
|
|
15510
|
+
* VMD writes, a boot seed), and the orchestrator's provider gate keeps that
|
|
15511
|
+
* provider's cameras unwritten (`camera-sensors/motion-slice-provider-gate.ts`)
|
|
15512
|
+
* — the provider twin of the runner's `getLocalLoad().motionSliceWriter`.
|
|
15513
|
+
*/
|
|
15514
|
+
motionSliceWriter: literal("orchestrator").optional()
|
|
15290
15515
|
});
|
|
15291
15516
|
object({
|
|
15292
15517
|
externalId: string(),
|
|
@@ -16084,6 +16309,121 @@ method(object({
|
|
|
16084
16309
|
deviceIds: array(number()).readonly(),
|
|
16085
16310
|
caps: array(string()).readonly().optional()
|
|
16086
16311
|
}), record(string(), record(string(), unknown().nullable())));
|
|
16312
|
+
var ExtensionSlotIdSchema = _enum(["linked-devices"]);
|
|
16313
|
+
DeviceType.Camera;
|
|
16314
|
+
/** A slot's editable value, discriminated on `slot`. */
|
|
16315
|
+
var ExtensionSlotValueSchema = discriminatedUnion("slot", [LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
|
|
16316
|
+
DeviceType.Camera;
|
|
16317
|
+
var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
|
|
16318
|
+
state: literal("unreachable"),
|
|
16319
|
+
reason: string()
|
|
16320
|
+
})]);
|
|
16321
|
+
/** One provider of slots — the D554 source-listing row. */
|
|
16322
|
+
var ExtensionSourceSchema = object({
|
|
16323
|
+
/** The routing prefix of every `slotRef` this provider serves. */
|
|
16324
|
+
source: string(),
|
|
16325
|
+
label: string(),
|
|
16326
|
+
/** Stamped by the dispatcher from the registry (D557). */
|
|
16327
|
+
addonId: string().optional(),
|
|
16328
|
+
availability: ExtensionSourceAvailabilitySchema
|
|
16329
|
+
});
|
|
16330
|
+
/**
|
|
16331
|
+
* How one picked source stands. `missing` — no such device (deleted, or an id
|
|
16332
|
+
* that never existed); `foreign` — a device the slot's owner cannot read from
|
|
16333
|
+
* (a source owned by another addon); `unavailable` — it exists but is not a
|
|
16334
|
+
* valid source now (a container, which is never a pick). A source in any of
|
|
16335
|
+
* these states is SHOWN, never silently dropped or re-pointed.
|
|
16336
|
+
*/
|
|
16337
|
+
var ExtensionSourceHealthSchema = _enum([
|
|
16338
|
+
"ok",
|
|
16339
|
+
"missing",
|
|
16340
|
+
"foreign",
|
|
16341
|
+
"unavailable"
|
|
16342
|
+
]);
|
|
16343
|
+
var ExtensionSlotSourceSchema = object({
|
|
16344
|
+
deviceId: number().int(),
|
|
16345
|
+
/** The device's name, or null when it could not be resolved (`missing`). */
|
|
16346
|
+
name: string().nullable(),
|
|
16347
|
+
health: ExtensionSourceHealthSchema,
|
|
16348
|
+
detail: string().optional()
|
|
16349
|
+
});
|
|
16350
|
+
/**
|
|
16351
|
+
* A DIFFERENT authority that gates whether the slot's sources do anything —
|
|
16352
|
+
* reported read-only, named, never written through this contract (D62) — e.g.
|
|
16353
|
+
* a slot whose sources act only while a wrapper is bound to the host, a
|
|
16354
|
+
* binding that belongs to `deviceManager.setWrapperActive`. No slot reports
|
|
16355
|
+
* one today (`linked-devices` answers `null`). `unknown` means the gate could
|
|
16356
|
+
* not be read; it is not "inactive" (D315).
|
|
16357
|
+
*/
|
|
16358
|
+
var ExtensionSlotActivationSchema = object({
|
|
16359
|
+
state: _enum([
|
|
16360
|
+
"active",
|
|
16361
|
+
"inactive",
|
|
16362
|
+
"unknown"
|
|
16363
|
+
]),
|
|
16364
|
+
authority: string(),
|
|
16365
|
+
detail: string().optional()
|
|
16366
|
+
});
|
|
16367
|
+
var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
|
|
16368
|
+
state: literal("ok"),
|
|
16369
|
+
/** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
|
|
16370
|
+
slotRef: string(),
|
|
16371
|
+
slot: ExtensionSlotIdSchema,
|
|
16372
|
+
/** Names the store written (D62), e.g. `device-manager:_linkedDeviceIds`. */
|
|
16373
|
+
authority: string(),
|
|
16374
|
+
activation: ExtensionSlotActivationSchema.nullable(),
|
|
16375
|
+
value: ExtensionSlotValueSchema,
|
|
16376
|
+
sources: array(ExtensionSlotSourceSchema),
|
|
16377
|
+
/**
|
|
16378
|
+
* Devices the owner links to the host ON ITS OWN, by structure, and that
|
|
16379
|
+
* are therefore not in `value` (D655): a camera's device-tree children, and
|
|
16380
|
+
* the child a picked container stands for (D356 — a container is never a
|
|
16381
|
+
* pick, its children are). Read-only; the editor shows them and may offer
|
|
16382
|
+
* per-device options on them (the linked-devices tracked-event opt-in).
|
|
16383
|
+
* Absent when the owner links nothing beyond the picks, and from an owner
|
|
16384
|
+
* older than D655.
|
|
16385
|
+
*/
|
|
16386
|
+
impliedSources: array(ExtensionSlotSourceSchema).optional()
|
|
16387
|
+
}), object({
|
|
16388
|
+
state: literal("unreachable"),
|
|
16389
|
+
addonId: string(),
|
|
16390
|
+
reason: string()
|
|
16391
|
+
})]);
|
|
16392
|
+
var ExtensionCandidatesSchema = object({ candidates: array(object({
|
|
16393
|
+
deviceId: number().int(),
|
|
16394
|
+
name: string(),
|
|
16395
|
+
type: string(),
|
|
16396
|
+
location: string().nullable(),
|
|
16397
|
+
/** The container a child belongs to — "Spotlight 2" alone does not say which. */
|
|
16398
|
+
parentName: string().nullable(),
|
|
16399
|
+
/** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
|
|
16400
|
+
suggested: boolean(),
|
|
16401
|
+
/** Why it is suggested ("same location"), null when it is not. */
|
|
16402
|
+
reason: string().nullable()
|
|
16403
|
+
})) });
|
|
16404
|
+
/**
|
|
16405
|
+
* What a write did. `none` — applied in place. `host` / `parent` — the owner
|
|
16406
|
+
* reloaded the host (or, for an accessory child, its parent) because the
|
|
16407
|
+
* write changed what the host REGISTERS. A slot never adds a capability to its
|
|
16408
|
+
* host — that is a composition (D663) — so today's owners answer `none`.
|
|
16409
|
+
*/
|
|
16410
|
+
var ExtensionSetResultSchema = object({
|
|
16411
|
+
applied: literal(true),
|
|
16412
|
+
reload: _enum([
|
|
16413
|
+
"none",
|
|
16414
|
+
"host",
|
|
16415
|
+
"parent"
|
|
16416
|
+
])
|
|
16417
|
+
});
|
|
16418
|
+
var ExtensionSlotRefInputSchema = object({
|
|
16419
|
+
deviceId: number().int(),
|
|
16420
|
+
slotRef: string().min(1)
|
|
16421
|
+
});
|
|
16422
|
+
var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
|
|
16423
|
+
method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)), method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)), method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema), method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
|
|
16424
|
+
kind: "mutation",
|
|
16425
|
+
auth: "admin"
|
|
16426
|
+
});
|
|
16087
16427
|
/**
|
|
16088
16428
|
* Per-field ownership (D663). A composition may CLAIM fields of a native
|
|
16089
16429
|
* cap's runtime-state slice on an existing device: `replace` overlays the
|
|
@@ -16307,7 +16647,7 @@ method(object({
|
|
|
16307
16647
|
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
16308
16648
|
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
16309
16649
|
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
16310
|
-
* ricontrolliamo tutti questi punti"
|
|
16650
|
+
* 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
|
|
16311
16651
|
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
16312
16652
|
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
16313
16653
|
* be READ.
|
|
@@ -19056,17 +19396,25 @@ var NcScheduleSchema = object({
|
|
|
19056
19396
|
*/
|
|
19057
19397
|
var NcSystemEventDeliveryModeSchema = _enum(["instant", "summary"]);
|
|
19058
19398
|
/**
|
|
19399
|
+
* How a summary window is SENT (D698): `rule` (absent) = ONE notification with
|
|
19400
|
+
* every section; `section` = one notification per section with something to
|
|
19401
|
+
* say (an unavailable section included), each titled by its section.
|
|
19402
|
+
*/
|
|
19403
|
+
var NcStateSummarySplitSchema = _enum(["rule", "section"]);
|
|
19404
|
+
/**
|
|
19059
19405
|
* `summary`: the rule sends NOTHING per event. When a window of `schedule`
|
|
19060
19406
|
* CLOSES, it sends one notification with the current state of its kinds
|
|
19061
19407
|
* (low batteries, consumables to replace, devices offline, updates
|
|
19062
|
-
* available, ...), after its own filters
|
|
19408
|
+
* available, ...), after its own filters — or, with `split: 'section'`
|
|
19409
|
+
* (D698), one notification per section. Nothing to report sends nothing.
|
|
19063
19410
|
* The schedule is the ordinary `NcSchedule` (weekly windows, IANA timezone,
|
|
19064
19411
|
* midnight crossing); the send time is each window's END. Refused on the
|
|
19065
19412
|
* `alarm` family, which stays instant (`systemEventDeliveryProblems`).
|
|
19066
19413
|
*/
|
|
19067
19414
|
var NcSystemEventDeliverySchema = discriminatedUnion("mode", [object({ mode: literal("instant") }), object({
|
|
19068
19415
|
mode: literal("summary"),
|
|
19069
|
-
schedule: NcScheduleSchema
|
|
19416
|
+
schedule: NcScheduleSchema,
|
|
19417
|
+
split: NcStateSummarySplitSchema.optional()
|
|
19070
19418
|
})]);
|
|
19071
19419
|
/** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
|
|
19072
19420
|
var NcPlateMatcherSchema = object({
|
|
@@ -19206,8 +19554,14 @@ var NcSensorTransitionSchema = _enum(["raised", "cleared"]);
|
|
|
19206
19554
|
/** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
|
|
19207
19555
|
var NcZoneConditionSchema = object({
|
|
19208
19556
|
ids: array(string().min(1)).min(1),
|
|
19209
|
-
/**
|
|
19210
|
-
|
|
19557
|
+
/**
|
|
19558
|
+
* LEGACY quantifier over `ids`. Absent = `any` (at least one visited), which
|
|
19559
|
+
* is what both editors mean and all they write since D690: "all of" was
|
|
19560
|
+
* removed from the editors because on an immediate rule it asked one
|
|
19561
|
+
* detection to stand in every zone at once. Still ACCEPTED, and `all` still
|
|
19562
|
+
* evaluated, so a stored rule keeps parsing and meaning what it meant.
|
|
19563
|
+
*/
|
|
19564
|
+
match: _enum(["any", "all"]).optional()
|
|
19211
19565
|
});
|
|
19212
19566
|
/**
|
|
19213
19567
|
* The P1 condition set — a flat AND of groups; absent group = pass;
|
|
@@ -19711,10 +20065,12 @@ var NcMediaPolicySchema = object({
|
|
|
19711
20065
|
/**
|
|
19712
20066
|
* Cooldown GRANULARITY over the subject's class — how much a fired
|
|
19713
20067
|
* notification suppresses.
|
|
19714
|
-
* - `
|
|
19715
|
-
*
|
|
19716
|
-
*
|
|
19717
|
-
*
|
|
20068
|
+
* - `per-class` (default, and the absent value since 2026-10-01 — D36) — an
|
|
20069
|
+
* independent window per detected class: cat→dog fires at once, cat→cat
|
|
20070
|
+
* still waits.
|
|
20071
|
+
* - `shared` — one window for the whole rule/scope: a cat silences the next
|
|
20072
|
+
* dog for `cooldownSec`. Only written when an operator picks it; it is no
|
|
20073
|
+
* longer what an unset rule means.
|
|
19718
20074
|
*
|
|
19719
20075
|
* AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
|
|
19720
20076
|
* must not be swallowed by a bark's window (the precedent this generalizes —
|
|
@@ -19729,8 +20085,11 @@ var NcThrottleSchema = object({
|
|
|
19729
20085
|
/**
|
|
19730
20086
|
* Class granularity of the cooldown key. Optional rather than defaulted:
|
|
19731
20087
|
* a Zod default does NOT run on the addon→addon cap path, so a persisted
|
|
19732
|
-
* rule authored before this field simply carries none
|
|
19733
|
-
*
|
|
20088
|
+
* rule authored before this field simply carries none. The engine used to
|
|
20089
|
+
* read absent as `shared` (D36); since 2026-10-01 it reads absent as
|
|
20090
|
+
* `per-class` — the operator's default — and only an explicit `shared`
|
|
20091
|
+
* still means `shared`. See `cooldownKey` / `keysPerClass` in the rule
|
|
20092
|
+
* engine, and D36's dated note.
|
|
19734
20093
|
*/
|
|
19735
20094
|
granularity: NcThrottleGranularitySchema.optional()
|
|
19736
20095
|
});
|
|
@@ -20054,11 +20413,23 @@ var NcStateSummaryPreviewSectionSchema = object({
|
|
|
20054
20413
|
reason: string().optional()
|
|
20055
20414
|
});
|
|
20056
20415
|
/**
|
|
20416
|
+
* One notification a previewed summary would send (D698): the whole summary on
|
|
20417
|
+
* a `rule` split (no `section`), one section's on a `section` split.
|
|
20418
|
+
*/
|
|
20419
|
+
var NcStateSummaryPreviewRowSchema = object({
|
|
20420
|
+
section: string().optional(),
|
|
20421
|
+
/** The section's name on a per-section row; every reported section's, joined, on a combined one. */
|
|
20422
|
+
title: string(),
|
|
20423
|
+
text: string(),
|
|
20424
|
+
count: number().int().nonnegative()
|
|
20425
|
+
});
|
|
20426
|
+
/**
|
|
20057
20427
|
* The summary a rule would send now. `empty` = nothing to report and every
|
|
20058
20428
|
* section read: such a summary is NOT sent. `dropped` counts the open states
|
|
20059
20429
|
* the rule's own filters (or a camera mute) left out, by reason.
|
|
20060
20430
|
* `excludedGroups` names the kind groups selected that have no state to report
|
|
20061
|
-
* (backups & exports).
|
|
20431
|
+
* (backups & exports). `split` and `rows` (D698) say how it would be sent —
|
|
20432
|
+
* optional, so an older hub's answer still parses.
|
|
20062
20433
|
*/
|
|
20063
20434
|
var NcStateSummaryPreviewSchema = object({
|
|
20064
20435
|
empty: boolean(),
|
|
@@ -20066,7 +20437,9 @@ var NcStateSummaryPreviewSchema = object({
|
|
|
20066
20437
|
text: string(),
|
|
20067
20438
|
sections: array(NcStateSummaryPreviewSectionSchema),
|
|
20068
20439
|
dropped: record(string(), number().int().nonnegative()),
|
|
20069
|
-
excludedGroups: array(string())
|
|
20440
|
+
excludedGroups: array(string()),
|
|
20441
|
+
split: NcStateSummarySplitSchema.optional(),
|
|
20442
|
+
rows: array(NcStateSummaryPreviewRowSchema).optional()
|
|
20070
20443
|
});
|
|
20071
20444
|
var NcTestResultSchema = object({
|
|
20072
20445
|
recordId: string(),
|
|
@@ -20481,6 +20854,29 @@ object({
|
|
|
20481
20854
|
firstAt: number(),
|
|
20482
20855
|
lastAt: number()
|
|
20483
20856
|
});
|
|
20857
|
+
var NC_ALARM_TRIGGERED_MAX_SEC = 3600;
|
|
20858
|
+
var NcAlarmDelaySecSchema = number().int().min(0).max(600);
|
|
20859
|
+
var NcAlarmTriggeredSecSchema = number().int().min(0).max(NC_ALARM_TRIGGERED_MAX_SEC);
|
|
20860
|
+
var uniqueModes = (entries) => new Set(entries.map((e) => e.mode)).size === entries.length;
|
|
20861
|
+
var NcAlarmModeDelaysListSchema = array(object({
|
|
20862
|
+
mode: AlarmArmModeSchema,
|
|
20863
|
+
exitDelaySec: NcAlarmDelaySecSchema.optional(),
|
|
20864
|
+
entryDelaySec: NcAlarmDelaySecSchema.optional(),
|
|
20865
|
+
triggeredDurationSec: NcAlarmTriggeredSecSchema.optional()
|
|
20866
|
+
})).max(8).refine(uniqueModes, { message: "modeDelays: at most one entry per arm mode" });
|
|
20867
|
+
var NcAlarmModeDelaysEditListSchema = array(object({
|
|
20868
|
+
mode: AlarmArmModeSchema,
|
|
20869
|
+
exitDelaySec: NcAlarmDelaySecSchema.nullable().optional(),
|
|
20870
|
+
entryDelaySec: NcAlarmDelaySecSchema.nullable().optional(),
|
|
20871
|
+
triggeredDurationSec: NcAlarmTriggeredSecSchema.nullable().optional()
|
|
20872
|
+
})).max(8).refine(uniqueModes, { message: "modeDelays: at most one edit per arm mode" });
|
|
20873
|
+
/** One switch of the alarm table: put ONE device on, or take it off, ONE mode's list. */
|
|
20874
|
+
var NcAlarmNonBlockingEditSchema = object({
|
|
20875
|
+
mode: AlarmArmModeSchema,
|
|
20876
|
+
deviceId: number().int().positive(),
|
|
20877
|
+
/** true = on the list (may be open, does not block); false = off the list (blocks). */
|
|
20878
|
+
nonBlocking: boolean()
|
|
20879
|
+
});
|
|
20484
20880
|
/**
|
|
20485
20881
|
* The per-mode lists, at most one per mode. Two lists for one mode have no
|
|
20486
20882
|
* meaning a reader could agree on (union? the last one?), so they are refused
|
|
@@ -20489,10 +20885,10 @@ object({
|
|
|
20489
20885
|
var NcAlarmNonBlockingListSchema = array(object({
|
|
20490
20886
|
mode: AlarmArmModeSchema,
|
|
20491
20887
|
deviceIds: array(number().int()).max(200)
|
|
20492
|
-
})).max(8).refine(
|
|
20888
|
+
})).max(8).refine(uniqueModes, { message: "nonBlocking: at most one list per arm mode" });
|
|
20493
20889
|
/**
|
|
20494
|
-
* The three durations
|
|
20495
|
-
* transitions, and which openings each mode tolerates.
|
|
20890
|
+
* The three durations — global, and per mode since D697 — the panel's state
|
|
20891
|
+
* machine runs on, who hears about its transitions, and which openings each mode tolerates.
|
|
20496
20892
|
*
|
|
20497
20893
|
* They live on the NOTIFICATION-RULES cap, not on `alarm-panel`, on purpose:
|
|
20498
20894
|
* `alarm-panel` is `deviceNative` and its other provider mirrors somebody
|
|
@@ -20502,15 +20898,15 @@ var NcAlarmNonBlockingListSchema = array(object({
|
|
|
20502
20898
|
*/
|
|
20503
20899
|
var NcAlarmSettingsSchema = object({
|
|
20504
20900
|
/** Grace period between arming and the mode taking effect. 0 = immediate. */
|
|
20505
|
-
exitDelaySec:
|
|
20901
|
+
exitDelaySec: NcAlarmDelaySecSchema,
|
|
20506
20902
|
/** Grace period between a trigger and the alarm firing. 0 = immediate. */
|
|
20507
|
-
entryDelaySec:
|
|
20903
|
+
entryDelaySec: NcAlarmDelaySecSchema,
|
|
20508
20904
|
/**
|
|
20509
20905
|
* How long `triggered` lasts before the panel re-arms itself.
|
|
20510
20906
|
* **0 = until an operator disarms it** — the behaviour before this field
|
|
20511
20907
|
* existed, and therefore what an untouched install keeps doing.
|
|
20512
20908
|
*/
|
|
20513
|
-
triggeredDurationSec:
|
|
20909
|
+
triggeredDurationSec: NcAlarmTriggeredSecSchema,
|
|
20514
20910
|
/**
|
|
20515
20911
|
* Deprecated by D630 — every transition is announced. Parsed, never read;
|
|
20516
20912
|
* remove after one release. Optional so an older admin's patch (which still
|
|
@@ -20533,17 +20929,30 @@ var NcAlarmSettingsSchema = object({
|
|
|
20533
20929
|
* per mode is meaningful. Defaulted to `[]` so a blob stored before D630
|
|
20534
20930
|
* parses as "every opening blocks" — the behaviour it was written under.
|
|
20535
20931
|
*/
|
|
20536
|
-
nonBlocking: NcAlarmNonBlockingListSchema.default([])
|
|
20932
|
+
nonBlocking: NcAlarmNonBlockingListSchema.default([]),
|
|
20933
|
+
/**
|
|
20934
|
+
* Per arm mode, the delays that mode OVERRIDES (D697). A mode with no entry, or an entry
|
|
20935
|
+
* without a field, uses the global value above — so `[]`, the default, is exactly the
|
|
20936
|
+
* behaviour of a blob stored before this field existed. Read through `resolveModeDelays`.
|
|
20937
|
+
*/
|
|
20938
|
+
modeDelays: NcAlarmModeDelaysListSchema.default([])
|
|
20537
20939
|
});
|
|
20538
20940
|
/**
|
|
20539
20941
|
* Every field optional — a tab edits one control at a time.
|
|
20540
20942
|
*
|
|
20541
|
-
* `nonBlocking`
|
|
20542
|
-
* remove an inner `.default()`, so a patch that never
|
|
20543
|
-
* parse to `
|
|
20544
|
-
* (the same trap {@link NcRulePatchSchema} documents).
|
|
20943
|
+
* `nonBlocking` and `modeDelays` are re-declared WITHOUT their defaults:
|
|
20944
|
+
* `.partial()` does not remove an inner `.default()`, so a patch that never
|
|
20945
|
+
* named the field would parse to `[]` and wipe every mode's list on an
|
|
20946
|
+
* unrelated edit (the same trap {@link NcRulePatchSchema} documents). Here
|
|
20947
|
+
* `modeDelays` means EDITS, not the stored overrides.
|
|
20545
20948
|
*/
|
|
20546
|
-
var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.extend({
|
|
20949
|
+
var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.extend({
|
|
20950
|
+
nonBlocking: NcAlarmNonBlockingListSchema,
|
|
20951
|
+
/** Per-mode, per-field edits — NOT the whole list (see NcAlarmModeDelaysEditSchema). */
|
|
20952
|
+
modeDelays: NcAlarmModeDelaysEditListSchema,
|
|
20953
|
+
/** ONE membership change; the panel applies it to the list it holds at its turn. */
|
|
20954
|
+
nonBlockingEdit: NcAlarmNonBlockingEditSchema
|
|
20955
|
+
}).partial().refine((p) => p.nonBlocking === void 0 || p.nonBlockingEdit === void 0, { message: "nonBlocking and nonBlockingEdit are exclusive — send the whole lists or one edit" });
|
|
20547
20956
|
/**
|
|
20548
20957
|
* What one arm mode actually arms, DERIVED from the enabled rules gated on it.
|
|
20549
20958
|
* Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
|
|
@@ -20643,6 +21052,28 @@ var NcAlarmConfigSchema = object({
|
|
|
20643
21052
|
*/
|
|
20644
21053
|
live: NcAlarmLiveSchema.optional()
|
|
20645
21054
|
});
|
|
21055
|
+
var NcAlarmSensorReadingSchema = _enum([
|
|
21056
|
+
"open",
|
|
21057
|
+
"closed",
|
|
21058
|
+
"unknown",
|
|
21059
|
+
"not-opening"
|
|
21060
|
+
]);
|
|
21061
|
+
/** One device's state as the alarm reads it — the classifier the arm check uses. */
|
|
21062
|
+
var NcAlarmSensorStateSchema = object({
|
|
21063
|
+
deviceId: number().int().positive(),
|
|
21064
|
+
reading: NcAlarmSensorReadingSchema,
|
|
21065
|
+
/** The word as read (`open`, `closed`, `unlocked`, `stopped`, …); null when unknown / not an opening. */
|
|
21066
|
+
state: string().nullable(),
|
|
21067
|
+
/** Why `unknown`: the read failed, or the slice holds no word its cap defines (a placeholder included). */
|
|
21068
|
+
unknownWhy: _enum(["read-failed", "unknown-word"]).nullable(),
|
|
21069
|
+
/** The device manager's liveness as the centre mirrors it; null = not known. */
|
|
21070
|
+
online: boolean().nullable()
|
|
21071
|
+
});
|
|
21072
|
+
var NcAlarmSensorsInputSchema = object({ deviceIds: array(number().int().positive()).max(500) });
|
|
21073
|
+
var NcAlarmSensorsSchema = object({
|
|
21074
|
+
sensors: array(NcAlarmSensorStateSchema),
|
|
21075
|
+
readAt: number().int().nonnegative()
|
|
21076
|
+
});
|
|
20646
21077
|
/**
|
|
20647
21078
|
* ONE rule's demand on ONE camera's clip ring.
|
|
20648
21079
|
*
|
|
@@ -20733,7 +21164,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
|
|
|
20733
21164
|
}), method(object({}), NcAlarmConfigSchema, { auth: "admin" }), method(object({ patch: NcAlarmSettingsPatchSchema }), NcAlarmConfigSchema, {
|
|
20734
21165
|
kind: "mutation",
|
|
20735
21166
|
auth: "admin"
|
|
20736
|
-
});
|
|
21167
|
+
}), method(NcAlarmSensorsInputSchema, NcAlarmSensorsSchema, { auth: "admin" });
|
|
20737
21168
|
/**
|
|
20738
21169
|
* Zod schemas for persisted record types.
|
|
20739
21170
|
*
|
|
@@ -21080,12 +21511,26 @@ var CameraSensorRefSchema = object({
|
|
|
21080
21511
|
function cameraSensorRefKey(ref) {
|
|
21081
21512
|
return `${ref.addonId}/${ref.stableId}`;
|
|
21082
21513
|
}
|
|
21083
|
-
/**
|
|
21084
|
-
|
|
21085
|
-
|
|
21086
|
-
|
|
21087
|
-
|
|
21088
|
-
|
|
21514
|
+
/**
|
|
21515
|
+
* A sensor's mode (D673). `in-addition`: its motion is the camera's motion too.
|
|
21516
|
+
* `replace`: its motion is the camera's, and while one is READY the camera's
|
|
21517
|
+
* own motion no longer counts on its own. `confirm`: while one is READY the
|
|
21518
|
+
* camera's own motion counts only while a confirm sensor is active — with or
|
|
21519
|
+
* without a replace sensor (spec C2, the controller's ruling on Q1).
|
|
21520
|
+
*/
|
|
21521
|
+
var CameraSensorModeSchema = _enum([
|
|
21522
|
+
"in-addition",
|
|
21523
|
+
"confirm",
|
|
21524
|
+
"replace"
|
|
21525
|
+
]);
|
|
21526
|
+
/** A stored sensor with no mode — every CS-1 row — is in addition. */
|
|
21527
|
+
var DEFAULT_CAMERA_SENSOR_MODE = "in-addition";
|
|
21528
|
+
/**
|
|
21529
|
+
* A camera's attached sensors. A CS-1 row carried an envelope
|
|
21530
|
+
* `mode: 'in-addition'`: `z.object` drops it on parse, and the PARSED value is
|
|
21531
|
+
* what the write stores (D672 rule 3), so it is never written again.
|
|
21532
|
+
*/
|
|
21533
|
+
var CameraSensorsConfigSchema = object({ sensors: array(CameraSensorRefSchema.extend({ mode: CameraSensorModeSchema.default(DEFAULT_CAMERA_SENSOR_MODE) })).min(1).max(8) }).superRefine((value, ctx) => {
|
|
21089
21534
|
const seen = /* @__PURE__ */ new Set();
|
|
21090
21535
|
value.sensors.forEach((ref, index) => {
|
|
21091
21536
|
const key = cameraSensorRefKey(ref);
|
|
@@ -21097,39 +21542,41 @@ object({
|
|
|
21097
21542
|
seen.add(key);
|
|
21098
21543
|
});
|
|
21099
21544
|
});
|
|
21100
|
-
|
|
21545
|
+
/** Every attachment names its mode; an older orchestrator that does not is in addition. */
|
|
21546
|
+
var AttachmentFields = {
|
|
21101
21547
|
addonId: string(),
|
|
21102
|
-
stableId: string()
|
|
21548
|
+
stableId: string(),
|
|
21549
|
+
mode: CameraSensorModeSchema.default(DEFAULT_CAMERA_SENSOR_MODE)
|
|
21103
21550
|
};
|
|
21104
21551
|
var CameraSensorAttachmentSchema = discriminatedUnion("state", [
|
|
21105
21552
|
object({
|
|
21106
|
-
...
|
|
21553
|
+
...AttachmentFields,
|
|
21107
21554
|
state: literal("ready"),
|
|
21108
21555
|
deviceId: number(),
|
|
21109
21556
|
name: string(),
|
|
21110
21557
|
caps: array(string()).readonly()
|
|
21111
21558
|
}),
|
|
21112
21559
|
object({
|
|
21113
|
-
...
|
|
21560
|
+
...AttachmentFields,
|
|
21114
21561
|
state: literal("offline"),
|
|
21115
21562
|
deviceId: number(),
|
|
21116
21563
|
name: string(),
|
|
21117
21564
|
reason: _enum(["offline", "disabled"])
|
|
21118
21565
|
}),
|
|
21119
21566
|
object({
|
|
21120
|
-
...
|
|
21567
|
+
...AttachmentFields,
|
|
21121
21568
|
state: literal("missing"),
|
|
21122
21569
|
reason: string()
|
|
21123
21570
|
}),
|
|
21124
21571
|
object({
|
|
21125
|
-
...
|
|
21572
|
+
...AttachmentFields,
|
|
21126
21573
|
state: literal("unsupported"),
|
|
21127
21574
|
deviceId: number(),
|
|
21128
21575
|
name: string(),
|
|
21129
21576
|
reason: string()
|
|
21130
21577
|
}),
|
|
21131
21578
|
object({
|
|
21132
|
-
...
|
|
21579
|
+
...AttachmentFields,
|
|
21133
21580
|
state: literal("unreadable"),
|
|
21134
21581
|
reason: string()
|
|
21135
21582
|
})
|
|
@@ -21142,17 +21589,49 @@ var CameraSensorAttachmentSchema = discriminatedUnion("state", [
|
|
|
21142
21589
|
* say.
|
|
21143
21590
|
*/
|
|
21144
21591
|
var CameraSensorsNotForwardedSchema = _enum(["onboard-not-listed", "no-active-detection"]);
|
|
21592
|
+
/** Whether the camera's OWN motion counts on its own (D673 C2), from its READY sensors (C3). */
|
|
21593
|
+
var CameraOwnMotionSchema = _enum([
|
|
21594
|
+
"always",
|
|
21595
|
+
"when-confirmed",
|
|
21596
|
+
"never"
|
|
21597
|
+
]);
|
|
21598
|
+
/** Confirm / Replace cannot suppress this camera's motion: its provider still emits it directly (D673 C13). */
|
|
21599
|
+
var CameraSensorsNotEnforcedSchema = _enum(["provider-not-split"]);
|
|
21600
|
+
/**
|
|
21601
|
+
* The camera's OWN onboard motion (D696): the raw input the bridge combines,
|
|
21602
|
+
* never the effective value. The camera's `motion` slice is the effective one,
|
|
21603
|
+
* so a view of the camera's own row reads this.
|
|
21604
|
+
* - `atMs`: when the bridge received the camera's last own edge.
|
|
21605
|
+
* - `detected`: evaluated WHEN THE STATUS IS ASKED — the last edge said `true`
|
|
21606
|
+
* AND it is younger than the window the bridge counts the camera's own motion
|
|
21607
|
+
* for (`motionCooldownMs`, floored at two sustain ticks). A camera that never
|
|
21608
|
+
* sends a clear (heartbeats only) therefore reads `false` once no push came
|
|
21609
|
+
* within the window; a status read is a snapshot, so a live view re-asks.
|
|
21610
|
+
* Absent = this orchestrator has not received the camera's own motion since it
|
|
21611
|
+
* started (unknown, never "quiet"), or an orchestrator older than D696.
|
|
21612
|
+
*/
|
|
21613
|
+
var CameraRawLevelSchema = object({
|
|
21614
|
+
detected: boolean(),
|
|
21615
|
+
atMs: number()
|
|
21616
|
+
});
|
|
21145
21617
|
var CameraSensorsStatusSchema = discriminatedUnion("state", [
|
|
21146
|
-
object({
|
|
21618
|
+
object({
|
|
21619
|
+
state: literal("not-configured"),
|
|
21620
|
+
cameraLevel: CameraRawLevelSchema.optional()
|
|
21621
|
+
}),
|
|
21147
21622
|
object({
|
|
21148
21623
|
state: literal("unreadable"),
|
|
21149
|
-
reason: string()
|
|
21624
|
+
reason: string(),
|
|
21625
|
+
cameraLevel: CameraRawLevelSchema.optional()
|
|
21150
21626
|
}),
|
|
21151
21627
|
object({
|
|
21152
21628
|
state: literal("configured"),
|
|
21153
|
-
|
|
21629
|
+
cameraLevel: CameraRawLevelSchema.optional(),
|
|
21154
21630
|
sensors: array(CameraSensorAttachmentSchema).readonly(),
|
|
21155
|
-
|
|
21631
|
+
/** Absent = an orchestrator older than CS-2: it does not say (D315). */
|
|
21632
|
+
cameraMotion: CameraOwnMotionSchema.optional(),
|
|
21633
|
+
notForwarded: CameraSensorsNotForwardedSchema.optional(),
|
|
21634
|
+
notEnforced: CameraSensorsNotEnforcedSchema.optional()
|
|
21156
21635
|
})
|
|
21157
21636
|
]);
|
|
21158
21637
|
Object.freeze({
|
|
@@ -21837,14 +22316,14 @@ var TrackSchema = object({
|
|
|
21837
22316
|
* `derive-returned-null tile=standin`,
|
|
21838
22317
|
* `native-tile tile=native no-key-frame-at-close`, …) written at close and
|
|
21839
22318
|
* CLEARED by the late-keyFrame upgrade when a native tile lands after all.
|
|
21840
|
-
* The operator-facing answer to "perché manca l'immagine?" on a track whose
|
|
22319
|
+
* The operator-facing answer to "perché manca l'immagine?" [why is the image missing?] on a track whose
|
|
21841
22320
|
* tile is a face/plate stand-in, a raster crop, or an icon.
|
|
21842
22321
|
*
|
|
21843
22322
|
* **`no-key-frame-at-close` (D400).** The line used to be written ONLY when
|
|
21844
22323
|
* the TILE ranked below native, so a track whose thumbnail landed natively
|
|
21845
22324
|
* while its key frame missed carried no reason at all — three of the four
|
|
21846
22325
|
* `MISSING_KEYFRAME` tracks in the 2026-09-07 operator audit were exactly
|
|
21847
|
-
* that shape, and their "niente ultimo" had no cause anywhere on the row.
|
|
22326
|
+
* that shape, and their "niente ultimo" [no last frame] had no cause anywhere on the row.
|
|
21848
22327
|
* The key frame is the head of a cascade (`keyFrame ⇒ keyFrameSmall ⇒ the
|
|
21849
22328
|
* lastFrame copy source`), so its absence is now on this line whatever the
|
|
21850
22329
|
* tile ended up being.
|
|
@@ -21931,7 +22410,7 @@ var MotionEventSchema = object({
|
|
|
21931
22410
|
/**
|
|
21932
22411
|
* Ms offsets from `timestamp` (the episode's own first rising edge, so the
|
|
21933
22412
|
* first entry is always `0`) of every genuine off→on transition the
|
|
21934
|
-
* episode saw — "ogni evento on si deve salvare" (D475). NOT one entry per
|
|
22413
|
+
* episode saw — "ogni evento on si deve salvare" [every ON event must be saved] (D475). NOT one entry per
|
|
21935
22414
|
* push: a firmware source that keepalives at ~1 Hz for the whole burst
|
|
21936
22415
|
* (Reolink, Hikvision) produces exactly one edge; a source that reports an
|
|
21937
22416
|
* explicit `false` mid-episode and then resumes before the quiet window
|
|
@@ -22987,7 +23466,8 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
22987
23466
|
trackIds: array(string()).min(1)
|
|
22988
23467
|
}), object({
|
|
22989
23468
|
deleted: number().int(),
|
|
22990
|
-
failed: array(string()).readonly()
|
|
23469
|
+
failed: array(string()).readonly(),
|
|
23470
|
+
sparedMediaIds: array(number().int()).readonly().optional()
|
|
22991
23471
|
}), {
|
|
22992
23472
|
kind: "mutation",
|
|
22993
23473
|
auth: "admin"
|
|
@@ -22996,7 +23476,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
22996
23476
|
deviceId: number(),
|
|
22997
23477
|
trackId: string(),
|
|
22998
23478
|
flags: TrackFlagsPatchSchema
|
|
22999
|
-
}), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
|
|
23479
|
+
}), 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, {
|
|
23000
23480
|
kind: "query",
|
|
23001
23481
|
auth: "admin"
|
|
23002
23482
|
}), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
|
|
@@ -24342,8 +24822,10 @@ var RunnerCameraConfigSchema = object({
|
|
|
24342
24822
|
* - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
|
|
24343
24823
|
* analyzer providers) running on decoded frames in this runner.
|
|
24344
24824
|
* - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
|
|
24345
|
-
* analytics). The provider emits ProviderMotion
|
|
24346
|
-
*
|
|
24825
|
+
* analytics). The provider emits its raw push as `ProviderMotion`
|
|
24826
|
+
* (D673); the orchestrator's camera-sensors bridge re-emits the camera's
|
|
24827
|
+
* effective motion as `MotionOnMotionChanged`, which is what reaches
|
|
24828
|
+
* `reportMotion`.
|
|
24347
24829
|
*/
|
|
24348
24830
|
motionSources: MotionSourcesSchema.default(["analyzer"]),
|
|
24349
24831
|
/**
|
|
@@ -24520,7 +25002,15 @@ var RunnerLocalLoadSchema = object({
|
|
|
24520
25002
|
hasGpu: boolean(),
|
|
24521
25003
|
inferenceBackend: string().optional(),
|
|
24522
25004
|
cpuCores: number().optional()
|
|
24523
|
-
})
|
|
25005
|
+
}),
|
|
25006
|
+
/**
|
|
25007
|
+
* Who writes a camera's `motion` runtime slice (D696). `'orchestrator'`: this
|
|
25008
|
+
* runner never writes it. ABSENT = a runner older than D696, which still
|
|
25009
|
+
* writes the slice from its phase machine; the orchestrator does not write
|
|
25010
|
+
* while any runner node is absent-or-unanswered, so one slice never has two
|
|
25011
|
+
* writers.
|
|
25012
|
+
*/
|
|
25013
|
+
motionSliceWriter: literal("orchestrator").optional()
|
|
24524
25014
|
});
|
|
24525
25015
|
/**
|
|
24526
25016
|
* Aggregate runtime metrics for the runner's whole local pool. Mirrors the
|
|
@@ -25154,7 +25644,64 @@ var NodeInferenceDevicesSchema = object({
|
|
|
25154
25644
|
reachable: boolean(),
|
|
25155
25645
|
devices: array(NodeInferenceDeviceSchema).readonly()
|
|
25156
25646
|
});
|
|
25157
|
-
|
|
25647
|
+
/**
|
|
25648
|
+
* Pipeline Orchestrator capability — global load balancer + camera dispatcher.
|
|
25649
|
+
*
|
|
25650
|
+
* Lives on the hub. Tracks the camera-to-agent assignment map, listens to
|
|
25651
|
+
* device lifecycle events, queries each runner's capacity + hardware
|
|
25652
|
+
* profile, and dispatches `attachCamera` / `detachCamera` cap calls to the
|
|
25653
|
+
* appropriate runner instances. Persists assignments via the multi-level
|
|
25654
|
+
* settings store so they survive hub restarts.
|
|
25655
|
+
*
|
|
25656
|
+
* Strictly the control plane: never sees a frame, never calls inference,
|
|
25657
|
+
* never drains queues. The runner does that work locally on each agent.
|
|
25658
|
+
*/
|
|
25659
|
+
/**
|
|
25660
|
+
* The input of `setCameraSensors` (G5, D676): the ONE typed write path of a
|
|
25661
|
+
* camera's attached sensors (D672). `config: null` removes the attachment —
|
|
25662
|
+
* the camera reads `not-configured` again, never `unreadable`.
|
|
25663
|
+
*/
|
|
25664
|
+
var SetCameraSensorsInputSchema = object({
|
|
25665
|
+
deviceId: number().int().nonnegative(),
|
|
25666
|
+
/** `null` removes the attachment: the camera goes back to `not-configured`. */
|
|
25667
|
+
config: CameraSensorsConfigSchema.nullable()
|
|
25668
|
+
});
|
|
25669
|
+
/**
|
|
25670
|
+
* Why an early occupancy look (D691) was not scheduled.
|
|
25671
|
+
*
|
|
25672
|
+
* - `unknown-camera` — no session was ever dispatched for it, so there is no
|
|
25673
|
+
* node and no config to attach a burst with.
|
|
25674
|
+
* - `out-of-range` — the ask is negative or further out than the orchestrator
|
|
25675
|
+
* will hold a timer for; the parked-object cadence is the answer there.
|
|
25676
|
+
* - `no-burst-producer` — this build has no burst producer at all.
|
|
25677
|
+
* - `already-looked` — this camera's ONE early look since its last session has
|
|
25678
|
+
* been spent. A look's own burst can re-arm a flickering flip, and a look
|
|
25679
|
+
* per arm would chain a burst every ~30 s forever (review H2); the next
|
|
25680
|
+
* real session re-arms the budget.
|
|
25681
|
+
*/
|
|
25682
|
+
var OccupancyLookRefusalSchema = _enum([
|
|
25683
|
+
"unknown-camera",
|
|
25684
|
+
"out-of-range",
|
|
25685
|
+
"no-burst-producer",
|
|
25686
|
+
"already-looked"
|
|
25687
|
+
]);
|
|
25688
|
+
method(object({
|
|
25689
|
+
deviceId: number().int().nonnegative(),
|
|
25690
|
+
/** How long from NOW until the pending flip's sustain window ends. RELATIVE,
|
|
25691
|
+
* so the caller's clock and the orchestrator's never have to agree. */
|
|
25692
|
+
afterMs: number().finite(),
|
|
25693
|
+
/** Why, for the log. */
|
|
25694
|
+
reason: string()
|
|
25695
|
+
}), object({
|
|
25696
|
+
scheduled: boolean(),
|
|
25697
|
+
/** When `scheduled`: how long until the burst is dialled. */
|
|
25698
|
+
dueInMs: number().optional(),
|
|
25699
|
+
/** When not `scheduled`: why. */
|
|
25700
|
+
refusedBecause: OccupancyLookRefusalSchema.optional()
|
|
25701
|
+
}), {
|
|
25702
|
+
kind: "mutation",
|
|
25703
|
+
auth: "admin"
|
|
25704
|
+
}), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
|
|
25158
25705
|
kind: "mutation",
|
|
25159
25706
|
auth: "admin"
|
|
25160
25707
|
}), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
|
|
@@ -25308,7 +25855,10 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
|
|
|
25308
25855
|
}), CameraSwitchGroupSchema, {
|
|
25309
25856
|
kind: "mutation",
|
|
25310
25857
|
auth: "admin"
|
|
25311
|
-
}), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(
|
|
25858
|
+
}), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(SetCameraSensorsInputSchema, object({ success: literal(true) }), {
|
|
25859
|
+
kind: "mutation",
|
|
25860
|
+
auth: "admin"
|
|
25861
|
+
}), method(_void(), DiskReconcileJobSchema, {
|
|
25312
25862
|
kind: "mutation",
|
|
25313
25863
|
auth: "admin"
|
|
25314
25864
|
}), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
|
|
@@ -27096,7 +27646,7 @@ var ClipPlaybackSchema = object({
|
|
|
27096
27646
|
* **One authorised yes is one wake.** `next-natural` — take the clip the next
|
|
27097
27647
|
* time the camera is awake for its own reasons — is deliberately not a member:
|
|
27098
27648
|
* it was proposed, it is free on the battery, and the operator declined it on
|
|
27099
|
-
* 2026-09-20 (*"Quando un export viene richiesto si sveglia la camera."
|
|
27649
|
+
* 2026-09-20 (*"Quando un export viene richiesto si sveglia la camera."* [When an export is requested the camera wakes up],
|
|
27100
27650
|
* D558 "Considered and not taken").
|
|
27101
27651
|
*/
|
|
27102
27652
|
var ClipWakeSchema = _enum(["authorised"]);
|
|
@@ -27363,7 +27913,7 @@ var videoclipsCapability = {
|
|
|
27363
27913
|
* **It is a SECTION of the Recording tab, at the end of it — not a tab of
|
|
27364
27914
|
* its own.** It shipped as a `clips` top-tab and the operator rejected the
|
|
27365
27915
|
* placement: *"utilizzerei la stessa tab recordings, lì abbiamo già tutto il
|
|
27366
|
-
* necessario, una nuova sezione alla fine per le clips"
|
|
27916
|
+
* 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
|
|
27367
27917
|
* already holds the recorder's panel, the schedule bands and the unified
|
|
27368
27918
|
* retention policy; footage the camera itself holds is the same question,
|
|
27369
27919
|
* asked of a different store. `order: 100` puts it after all of them with
|
|
@@ -27424,7 +27974,7 @@ var videoclipsCapability = {
|
|
|
27424
27974
|
* It replaced `sources?: string[]`, a VIEW filter over source ids that
|
|
27425
27975
|
* assumed the answer was a fan-out over everything a camera has. The
|
|
27426
27976
|
* operator settled otherwise on 2026-09-20 — *"l'utilizzatore è uno
|
|
27427
|
-
* solo"* — so the list is asked of one provider at a time and there is
|
|
27977
|
+
* solo"* [there is only one user] — so the list is asked of one provider at a time and there is
|
|
27428
27978
|
* nothing to filter out of it.
|
|
27429
27979
|
*/
|
|
27430
27980
|
provider: string().min(1)
|
|
@@ -27677,138 +28227,6 @@ var videoclipsCapability = {
|
|
|
27677
28227
|
})
|
|
27678
28228
|
}
|
|
27679
28229
|
};
|
|
27680
|
-
object({
|
|
27681
|
-
/** Ms epoch of the last press. null = never observed since this provider started. */
|
|
27682
|
-
lastPressedAt: number().nullable(),
|
|
27683
|
-
/** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
|
|
27684
|
-
pressCountSinceStart: number()
|
|
27685
|
-
});
|
|
27686
|
-
object({
|
|
27687
|
-
deviceId: number(),
|
|
27688
|
-
timestamp: number()
|
|
27689
|
-
});
|
|
27690
|
-
/**
|
|
27691
|
-
* The `doorbell-source` extension slot's editable value (D648): the camera's
|
|
27692
|
-
* virtual-doorbell trigger devices, exactly what the wrapper's
|
|
27693
|
-
* `doorbellSources` persists (as `{ deviceId }` records).
|
|
27694
|
-
*/
|
|
27695
|
-
var DoorbellSourceSlotValueSchema = object({ deviceIds: array(number().int().positive()) });
|
|
27696
|
-
DeviceType.Camera;
|
|
27697
|
-
DeviceType.Button, DeviceType.Camera;
|
|
27698
|
-
var ExtensionSlotIdSchema = _enum(["doorbell-source", "linked-devices"]);
|
|
27699
|
-
DeviceType.Camera, DeviceType.Camera;
|
|
27700
|
-
/** A slot's editable value, discriminated on `slot`. */
|
|
27701
|
-
var ExtensionSlotValueSchema = discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
|
|
27702
|
-
DeviceType.Camera;
|
|
27703
|
-
var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
|
|
27704
|
-
state: literal("unreachable"),
|
|
27705
|
-
reason: string()
|
|
27706
|
-
})]);
|
|
27707
|
-
/** One provider of slots — the D554 source-listing row. */
|
|
27708
|
-
var ExtensionSourceSchema = object({
|
|
27709
|
-
/** The routing prefix of every `slotRef` this provider serves. */
|
|
27710
|
-
source: string(),
|
|
27711
|
-
label: string(),
|
|
27712
|
-
/** Stamped by the dispatcher from the registry (D557). */
|
|
27713
|
-
addonId: string().optional(),
|
|
27714
|
-
availability: ExtensionSourceAvailabilitySchema
|
|
27715
|
-
});
|
|
27716
|
-
/**
|
|
27717
|
-
* How one picked source stands. `missing` — no such device (deleted, or an id
|
|
27718
|
-
* that never existed); `foreign` — a device the slot's owner cannot read from
|
|
27719
|
-
* (a source owned by another addon); `unavailable` — it exists but is not a
|
|
27720
|
-
* valid source now (a container, which is never a pick). A source in any of
|
|
27721
|
-
* these states is SHOWN, never silently dropped or re-pointed.
|
|
27722
|
-
*/
|
|
27723
|
-
var ExtensionSourceHealthSchema = _enum([
|
|
27724
|
-
"ok",
|
|
27725
|
-
"missing",
|
|
27726
|
-
"foreign",
|
|
27727
|
-
"unavailable"
|
|
27728
|
-
]);
|
|
27729
|
-
var ExtensionSlotSourceSchema = object({
|
|
27730
|
-
deviceId: number().int(),
|
|
27731
|
-
/** The device's name, or null when it could not be resolved (`missing`). */
|
|
27732
|
-
name: string().nullable(),
|
|
27733
|
-
health: ExtensionSourceHealthSchema,
|
|
27734
|
-
detail: string().optional()
|
|
27735
|
-
});
|
|
27736
|
-
/**
|
|
27737
|
-
* A DIFFERENT authority that gates whether the slot's sources do anything —
|
|
27738
|
-
* reported read-only, named, never written through this contract (D62). The
|
|
27739
|
-
* virtual doorbell's sources ring only while the wrapper is bound to the
|
|
27740
|
-
* camera, and that binding belongs to `deviceManager.setWrapperActive`.
|
|
27741
|
-
* `unknown` means the gate could not be read; it is not "inactive" (D315).
|
|
27742
|
-
*/
|
|
27743
|
-
var ExtensionSlotActivationSchema = object({
|
|
27744
|
-
state: _enum([
|
|
27745
|
-
"active",
|
|
27746
|
-
"inactive",
|
|
27747
|
-
"unknown"
|
|
27748
|
-
]),
|
|
27749
|
-
authority: string(),
|
|
27750
|
-
detail: string().optional()
|
|
27751
|
-
});
|
|
27752
|
-
var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
|
|
27753
|
-
state: literal("ok"),
|
|
27754
|
-
/** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
|
|
27755
|
-
slotRef: string(),
|
|
27756
|
-
slot: ExtensionSlotIdSchema,
|
|
27757
|
-
/** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
|
|
27758
|
-
authority: string(),
|
|
27759
|
-
activation: ExtensionSlotActivationSchema.nullable(),
|
|
27760
|
-
value: ExtensionSlotValueSchema,
|
|
27761
|
-
sources: array(ExtensionSlotSourceSchema),
|
|
27762
|
-
/**
|
|
27763
|
-
* Devices the owner links to the host ON ITS OWN, by structure, and that
|
|
27764
|
-
* are therefore not in `value` (D655): a camera's device-tree children, and
|
|
27765
|
-
* the child a picked container stands for (D356 — a container is never a
|
|
27766
|
-
* pick, its children are). Read-only; the editor shows them and may offer
|
|
27767
|
-
* per-device options on them (the linked-devices tracked-event opt-in).
|
|
27768
|
-
* Absent when the owner links nothing beyond the picks, and from an owner
|
|
27769
|
-
* older than D655.
|
|
27770
|
-
*/
|
|
27771
|
-
impliedSources: array(ExtensionSlotSourceSchema).optional()
|
|
27772
|
-
}), object({
|
|
27773
|
-
state: literal("unreachable"),
|
|
27774
|
-
addonId: string(),
|
|
27775
|
-
reason: string()
|
|
27776
|
-
})]);
|
|
27777
|
-
var ExtensionCandidatesSchema = object({ candidates: array(object({
|
|
27778
|
-
deviceId: number().int(),
|
|
27779
|
-
name: string(),
|
|
27780
|
-
type: string(),
|
|
27781
|
-
location: string().nullable(),
|
|
27782
|
-
/** The container a child belongs to — "Spotlight 2" alone does not say which. */
|
|
27783
|
-
parentName: string().nullable(),
|
|
27784
|
-
/** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
|
|
27785
|
-
suggested: boolean(),
|
|
27786
|
-
/** Why it is suggested ("same location"), null when it is not. */
|
|
27787
|
-
reason: string().nullable()
|
|
27788
|
-
})) });
|
|
27789
|
-
/**
|
|
27790
|
-
* What a write did. `none` — applied in place. `host` / `parent` — the owner
|
|
27791
|
-
* reloaded the host (or, for an accessory child, its parent) because the
|
|
27792
|
-
* write changed what the host REGISTERS. A slot never adds a capability to its
|
|
27793
|
-
* host — that is a composition (D663) — so today's owners answer `none`.
|
|
27794
|
-
*/
|
|
27795
|
-
var ExtensionSetResultSchema = object({
|
|
27796
|
-
applied: literal(true),
|
|
27797
|
-
reload: _enum([
|
|
27798
|
-
"none",
|
|
27799
|
-
"host",
|
|
27800
|
-
"parent"
|
|
27801
|
-
])
|
|
27802
|
-
});
|
|
27803
|
-
var ExtensionSlotRefInputSchema = object({
|
|
27804
|
-
deviceId: number().int(),
|
|
27805
|
-
slotRef: string().min(1)
|
|
27806
|
-
});
|
|
27807
|
-
var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
|
|
27808
|
-
method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)), method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)), method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema), method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
|
|
27809
|
-
kind: "mutation",
|
|
27810
|
-
auth: "admin"
|
|
27811
|
-
});
|
|
27812
28230
|
/**
|
|
27813
28231
|
* Optional client-side hints sent at session creation to help the provider
|
|
27814
28232
|
* pick the best native source. All fields optional — a viewer that knows
|
|
@@ -29646,6 +30064,17 @@ object({
|
|
|
29646
30064
|
deviceId: number(),
|
|
29647
30065
|
status: DeviceStatusSchema
|
|
29648
30066
|
});
|
|
30067
|
+
object({
|
|
30068
|
+
/** Ms epoch of the last press. null = never observed since this provider started. */
|
|
30069
|
+
lastPressedAt: number().nullable(),
|
|
30070
|
+
/** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
|
|
30071
|
+
pressCountSinceStart: number()
|
|
30072
|
+
});
|
|
30073
|
+
object({
|
|
30074
|
+
deviceId: number(),
|
|
30075
|
+
timestamp: number()
|
|
30076
|
+
});
|
|
30077
|
+
DeviceType.Button, DeviceType.Camera;
|
|
29649
30078
|
/**
|
|
29650
30079
|
* Enum-state sensor — a string value picked from a finite option set.
|
|
29651
30080
|
* Drives HA `sensor` entries with `state_class: enum` (HVAC action
|
|
@@ -31306,9 +31735,9 @@ var MotionStatusSchema = object({
|
|
|
31306
31735
|
/** Ms epoch of the last detected-true observation. Null if never detected. */
|
|
31307
31736
|
lastDetectedAt: number().nullable(),
|
|
31308
31737
|
/**
|
|
31309
|
-
* `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device
|
|
31310
|
-
* `null` while false and on every `Sensor`
|
|
31311
|
-
* constant's doc for the one-authority rule.
|
|
31738
|
+
* `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device (the
|
|
31739
|
+
* orchestrator writes it, D696), `null` while false and on every `Sensor`
|
|
31740
|
+
* device (D475) — see that constant's doc for the one-authority rule.
|
|
31312
31741
|
*
|
|
31313
31742
|
* ## Reading this field still arms nothing
|
|
31314
31743
|
*
|
|
@@ -31326,38 +31755,41 @@ var MotionStatusSchema = object({
|
|
|
31326
31755
|
* `addon-export-alexa/src/motion-clear-hold.ts` and
|
|
31327
31756
|
* `addon-export-hap`'s `RESET_DEBOUNCE_MS` both do.
|
|
31328
31757
|
*
|
|
31329
|
-
* ## Who writes it
|
|
31330
|
-
*
|
|
31331
|
-
* - **Cameras** — the
|
|
31332
|
-
*
|
|
31333
|
-
* `
|
|
31334
|
-
* `
|
|
31335
|
-
*
|
|
31336
|
-
*
|
|
31337
|
-
* a
|
|
31338
|
-
*
|
|
31339
|
-
*
|
|
31340
|
-
*
|
|
31341
|
-
*
|
|
31342
|
-
*
|
|
31343
|
-
*
|
|
31344
|
-
*
|
|
31345
|
-
*
|
|
31346
|
-
*
|
|
31347
|
-
* `
|
|
31348
|
-
*
|
|
31349
|
-
*
|
|
31350
|
-
*
|
|
31351
|
-
*
|
|
31352
|
-
*
|
|
31353
|
-
*
|
|
31354
|
-
* This predates D475 and is not fixed there: the fix touches every
|
|
31355
|
-
* camera provider. Recorded in D475's Consequences. Do not restore the
|
|
31356
|
-
* "sole writer" wording without also removing the other writers.
|
|
31758
|
+
* ## Who writes it (D696)
|
|
31759
|
+
*
|
|
31760
|
+
* - **Cameras** — the orchestrator, and nothing else. It writes the camera's
|
|
31761
|
+
* EFFECTIVE motion (`addon-pipeline-orchestrator`
|
|
31762
|
+
* `camera-sensors/motion-slice.ts`), alongside the effective
|
|
31763
|
+
* `MotionOnMotionChanged` it emits or receives: the camera-sensors bridge
|
|
31764
|
+
* for a split camera, an unsplit emitter's direct event, the analyzer and
|
|
31765
|
+
* device activity, as the camera's `motionSources` counts them. A source
|
|
31766
|
+
* that never sends a clear falls one window after its last `true`.
|
|
31767
|
+
* `lastDetectedAt` moves only on an effective rise. No camera provider
|
|
31768
|
+
* writes this slice (not even a boot seed), and neither does the runner's
|
|
31769
|
+
* phase machine: its phase is "a session is attached" for every on-motion
|
|
31770
|
+
* session, not motion, and it now has its own `DetectionPhaseTransition`.
|
|
31771
|
+
* A provider's `isDetected` answers from the hub's slice.
|
|
31772
|
+
* - **Sensors** (Home Assistant binary sensors, Homematic, Matter, Alexa
|
|
31773
|
+
* imports) — the provider pushes both edges itself, from the upstream
|
|
31774
|
+
* system's own state change. That is the sensor's own fact.
|
|
31775
|
+
*
|
|
31776
|
+
* `scripts/check-onboard-motion-emitters.ts` refuses any other writer of a
|
|
31777
|
+
* `motion` slice; each sensor writer is a named exemption.
|
|
31778
|
+
*
|
|
31779
|
+
* This replaces the D475 §4 rule ("the phase machine is the sole writer").
|
|
31780
|
+
* That rule was never true: Hikvision and Amcrest wrote the slice raw beside
|
|
31781
|
+
* it, every provider seeded it at boot, and every session left it
|
|
31782
|
+
* `detected: true` after its detach.
|
|
31357
31783
|
*/
|
|
31358
31784
|
autoClearAfterMs: number().nullable()
|
|
31359
31785
|
});
|
|
31360
|
-
|
|
31786
|
+
/**
|
|
31787
|
+
* Payload of `motion.onMotionChanged` event + the corresponding bus
|
|
31788
|
+
* event `EventCategory.MotionOnMotionChanged`. Single source of truth
|
|
31789
|
+
* — both the cap event surface and the bus payload type alias to this
|
|
31790
|
+
* schema.
|
|
31791
|
+
*/
|
|
31792
|
+
var MotionOnMotionChangedDataSchema = object({
|
|
31361
31793
|
deviceId: number(),
|
|
31362
31794
|
detected: boolean(),
|
|
31363
31795
|
timestamp: number(),
|
|
@@ -33822,7 +34254,7 @@ var ReadGopBytesResultSchema = object({
|
|
|
33822
34254
|
/**
|
|
33823
34255
|
* A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
|
|
33824
34256
|
* twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
|
|
33825
|
-
* replay clip's `recording` source (`docs/design/plans/2026-08-26-replay-
|
|
34257
|
+
* replay clip's `recording` source (`docs/design/plans/2026-08-26-clip-replay-on-pipeline.md`):
|
|
33826
34258
|
* a replay needs several seconds of native pixels, not one frame.
|
|
33827
34259
|
*
|
|
33828
34260
|
* `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
|
|
@@ -36463,47 +36895,6 @@ DeviceType.Camera, method(object({
|
|
|
36463
36895
|
detection: array(ZoneRuleSchema).readonly(),
|
|
36464
36896
|
package: array(ZoneRuleSchema).readonly()
|
|
36465
36897
|
});
|
|
36466
|
-
var NUMBER = {
|
|
36467
|
-
kind: "fixed",
|
|
36468
|
-
result: ["number"]
|
|
36469
|
-
};
|
|
36470
|
-
var BOOLEAN = {
|
|
36471
|
-
kind: "fixed",
|
|
36472
|
-
result: ["boolean"]
|
|
36473
|
-
};
|
|
36474
|
-
Object.freeze({
|
|
36475
|
-
min: NUMBER,
|
|
36476
|
-
max: NUMBER,
|
|
36477
|
-
abs: NUMBER,
|
|
36478
|
-
floor: NUMBER,
|
|
36479
|
-
ceil: NUMBER,
|
|
36480
|
-
sqrt: NUMBER,
|
|
36481
|
-
round: NUMBER,
|
|
36482
|
-
pow: NUMBER,
|
|
36483
|
-
clamp: NUMBER,
|
|
36484
|
-
avg: NUMBER,
|
|
36485
|
-
sum: NUMBER,
|
|
36486
|
-
age: NUMBER,
|
|
36487
|
-
convert: NUMBER,
|
|
36488
|
-
coalesce: { kind: "coalesce" },
|
|
36489
|
-
any: BOOLEAN,
|
|
36490
|
-
all: BOOLEAN,
|
|
36491
|
-
within: BOOLEAN,
|
|
36492
|
-
latest: {
|
|
36493
|
-
kind: "fixed",
|
|
36494
|
-
result: ["number", "null"]
|
|
36495
|
-
},
|
|
36496
|
-
number: {
|
|
36497
|
-
kind: "fixed",
|
|
36498
|
-
result: ["number", "null"]
|
|
36499
|
-
},
|
|
36500
|
-
rose: {
|
|
36501
|
-
kind: "fixed",
|
|
36502
|
-
result: ["number", "null"]
|
|
36503
|
-
},
|
|
36504
|
-
count: NUMBER
|
|
36505
|
-
});
|
|
36506
|
-
`${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
|
|
36507
36898
|
/**
|
|
36508
36899
|
* Accessory device helpers — shared across drivers.
|
|
36509
36900
|
*
|
|
@@ -38926,6 +39317,12 @@ Object.freeze({
|
|
|
38926
39317
|
addonId: null,
|
|
38927
39318
|
access: "view"
|
|
38928
39319
|
},
|
|
39320
|
+
"coreBlocks.listComposableCaps": {
|
|
39321
|
+
capName: "core-blocks",
|
|
39322
|
+
capScope: "system",
|
|
39323
|
+
addonId: null,
|
|
39324
|
+
access: "view"
|
|
39325
|
+
},
|
|
38929
39326
|
"coreBlocks.listCompositions": {
|
|
38930
39327
|
capName: "core-blocks",
|
|
38931
39328
|
capScope: "system",
|
|
@@ -39004,6 +39401,18 @@ Object.freeze({
|
|
|
39004
39401
|
addonId: null,
|
|
39005
39402
|
access: "view"
|
|
39006
39403
|
},
|
|
39404
|
+
"databaseSnapshot.listDatabases": {
|
|
39405
|
+
capName: "database-snapshot",
|
|
39406
|
+
capScope: "system",
|
|
39407
|
+
addonId: null,
|
|
39408
|
+
access: "view"
|
|
39409
|
+
},
|
|
39410
|
+
"databaseSnapshot.writeSnapshot": {
|
|
39411
|
+
capName: "database-snapshot",
|
|
39412
|
+
capScope: "system",
|
|
39413
|
+
addonId: null,
|
|
39414
|
+
access: "create"
|
|
39415
|
+
},
|
|
39007
39416
|
"dataStoreProvider.aggregate": {
|
|
39008
39417
|
capName: "data-store-provider",
|
|
39009
39418
|
capScope: "system",
|
|
@@ -41464,6 +41873,12 @@ Object.freeze({
|
|
|
41464
41873
|
addonId: null,
|
|
41465
41874
|
access: "view"
|
|
41466
41875
|
},
|
|
41876
|
+
"notificationRules.getAlarmSensors": {
|
|
41877
|
+
capName: "notification-rules",
|
|
41878
|
+
capScope: "system",
|
|
41879
|
+
addonId: null,
|
|
41880
|
+
access: "view"
|
|
41881
|
+
},
|
|
41467
41882
|
"notificationRules.getClipRetentionAsks": {
|
|
41468
41883
|
capName: "notification-rules",
|
|
41469
41884
|
capScope: "system",
|
|
@@ -41740,6 +42155,12 @@ Object.freeze({
|
|
|
41740
42155
|
addonId: null,
|
|
41741
42156
|
access: "create"
|
|
41742
42157
|
},
|
|
42158
|
+
"pipelineAnalytics.clearTrackRelation": {
|
|
42159
|
+
capName: "pipeline-analytics",
|
|
42160
|
+
capScope: "device",
|
|
42161
|
+
addonId: null,
|
|
42162
|
+
access: "delete"
|
|
42163
|
+
},
|
|
41743
42164
|
"pipelineAnalytics.clearTracks": {
|
|
41744
42165
|
capName: "pipeline-analytics",
|
|
41745
42166
|
capScope: "device",
|
|
@@ -41992,6 +42413,12 @@ Object.freeze({
|
|
|
41992
42413
|
addonId: null,
|
|
41993
42414
|
access: "view"
|
|
41994
42415
|
},
|
|
42416
|
+
"pipelineAnalytics.listTrackRelations": {
|
|
42417
|
+
capName: "pipeline-analytics",
|
|
42418
|
+
capScope: "device",
|
|
42419
|
+
addonId: null,
|
|
42420
|
+
access: "view"
|
|
42421
|
+
},
|
|
41995
42422
|
"pipelineAnalytics.listTracks": {
|
|
41996
42423
|
capName: "pipeline-analytics",
|
|
41997
42424
|
capScope: "device",
|
|
@@ -42106,6 +42533,18 @@ Object.freeze({
|
|
|
42106
42533
|
addonId: null,
|
|
42107
42534
|
access: "create"
|
|
42108
42535
|
},
|
|
42536
|
+
"pipelineAnalytics.setTrackPurity": {
|
|
42537
|
+
capName: "pipeline-analytics",
|
|
42538
|
+
capScope: "device",
|
|
42539
|
+
addonId: null,
|
|
42540
|
+
access: "create"
|
|
42541
|
+
},
|
|
42542
|
+
"pipelineAnalytics.setTrackRelation": {
|
|
42543
|
+
capName: "pipeline-analytics",
|
|
42544
|
+
capScope: "device",
|
|
42545
|
+
addonId: null,
|
|
42546
|
+
access: "create"
|
|
42547
|
+
},
|
|
42109
42548
|
"pipelineAnalytics.startStorageMigrationMove": {
|
|
42110
42549
|
capName: "pipeline-analytics",
|
|
42111
42550
|
capScope: "device",
|
|
@@ -42544,6 +42983,12 @@ Object.freeze({
|
|
|
42544
42983
|
addonId: null,
|
|
42545
42984
|
access: "delete"
|
|
42546
42985
|
},
|
|
42986
|
+
"pipelineOrchestrator.requestOccupancyLook": {
|
|
42987
|
+
capName: "pipeline-orchestrator",
|
|
42988
|
+
capScope: "system",
|
|
42989
|
+
addonId: null,
|
|
42990
|
+
access: "create"
|
|
42991
|
+
},
|
|
42547
42992
|
"pipelineOrchestrator.resetNodePipelineDefaults": {
|
|
42548
42993
|
capName: "pipeline-orchestrator",
|
|
42549
42994
|
capScope: "system",
|
|
@@ -42610,6 +43055,12 @@ Object.freeze({
|
|
|
42610
43055
|
addonId: null,
|
|
42611
43056
|
access: "create"
|
|
42612
43057
|
},
|
|
43058
|
+
"pipelineOrchestrator.setCameraSensors": {
|
|
43059
|
+
capName: "pipeline-orchestrator",
|
|
43060
|
+
capScope: "system",
|
|
43061
|
+
addonId: null,
|
|
43062
|
+
access: "create"
|
|
43063
|
+
},
|
|
42613
43064
|
"pipelineOrchestrator.setCameraStepOverride": {
|
|
42614
43065
|
capName: "pipeline-orchestrator",
|
|
42615
43066
|
capScope: "system",
|
|
@@ -45911,6 +46362,11 @@ Object.freeze({
|
|
|
45911
46362
|
form: "single",
|
|
45912
46363
|
optional: false
|
|
45913
46364
|
}],
|
|
46365
|
+
"notificationRules.getAlarmSensors": [{
|
|
46366
|
+
name: "deviceIds",
|
|
46367
|
+
form: "array",
|
|
46368
|
+
optional: false
|
|
46369
|
+
}],
|
|
45914
46370
|
"notificationRules.setDeviceMuted": [{
|
|
45915
46371
|
name: "deviceId",
|
|
45916
46372
|
form: "single",
|
|
@@ -46020,6 +46476,11 @@ Object.freeze({
|
|
|
46020
46476
|
form: "single",
|
|
46021
46477
|
optional: false
|
|
46022
46478
|
}],
|
|
46479
|
+
"pipelineAnalytics.clearTrackRelation": [{
|
|
46480
|
+
name: "deviceId",
|
|
46481
|
+
form: "single",
|
|
46482
|
+
optional: false
|
|
46483
|
+
}],
|
|
46023
46484
|
"pipelineAnalytics.clearTracks": [{
|
|
46024
46485
|
name: "deviceId",
|
|
46025
46486
|
form: "single",
|
|
@@ -46170,6 +46631,11 @@ Object.freeze({
|
|
|
46170
46631
|
form: "single",
|
|
46171
46632
|
optional: false
|
|
46172
46633
|
}],
|
|
46634
|
+
"pipelineAnalytics.listTrackRelations": [{
|
|
46635
|
+
name: "deviceId",
|
|
46636
|
+
form: "single",
|
|
46637
|
+
optional: false
|
|
46638
|
+
}],
|
|
46173
46639
|
"pipelineAnalytics.listTracks": [{
|
|
46174
46640
|
name: "deviceId",
|
|
46175
46641
|
form: "single",
|
|
@@ -46240,6 +46706,16 @@ Object.freeze({
|
|
|
46240
46706
|
form: "single",
|
|
46241
46707
|
optional: false
|
|
46242
46708
|
}],
|
|
46709
|
+
"pipelineAnalytics.setTrackPurity": [{
|
|
46710
|
+
name: "deviceId",
|
|
46711
|
+
form: "single",
|
|
46712
|
+
optional: false
|
|
46713
|
+
}],
|
|
46714
|
+
"pipelineAnalytics.setTrackRelation": [{
|
|
46715
|
+
name: "deviceId",
|
|
46716
|
+
form: "single",
|
|
46717
|
+
optional: false
|
|
46718
|
+
}],
|
|
46243
46719
|
"pipelineAnalytics.wipeAllAnalytics": [{
|
|
46244
46720
|
name: "deviceId",
|
|
46245
46721
|
form: "single",
|
|
@@ -46310,6 +46786,11 @@ Object.freeze({
|
|
|
46310
46786
|
form: "single",
|
|
46311
46787
|
optional: false
|
|
46312
46788
|
}],
|
|
46789
|
+
"pipelineOrchestrator.requestOccupancyLook": [{
|
|
46790
|
+
name: "deviceId",
|
|
46791
|
+
form: "single",
|
|
46792
|
+
optional: false
|
|
46793
|
+
}],
|
|
46313
46794
|
"pipelineOrchestrator.resolvePipeline": [{
|
|
46314
46795
|
name: "deviceId",
|
|
46315
46796
|
form: "single",
|
|
@@ -46320,6 +46801,11 @@ Object.freeze({
|
|
|
46320
46801
|
form: "single",
|
|
46321
46802
|
optional: false
|
|
46322
46803
|
}],
|
|
46804
|
+
"pipelineOrchestrator.setCameraSensors": [{
|
|
46805
|
+
name: "deviceId",
|
|
46806
|
+
form: "single",
|
|
46807
|
+
optional: false
|
|
46808
|
+
}],
|
|
46323
46809
|
"pipelineOrchestrator.setCameraStepOverride": [{
|
|
46324
46810
|
name: "deviceId",
|
|
46325
46811
|
form: "single",
|
|
@@ -47466,6 +47952,18 @@ var STATE_SUMMARY_VARS = [
|
|
|
47466
47952
|
systemEventKinds: [...SUMMARISABLE],
|
|
47467
47953
|
systemEventDeliveries: ["summary"]
|
|
47468
47954
|
},
|
|
47955
|
+
{
|
|
47956
|
+
name: "summarySection",
|
|
47957
|
+
label: "Summary: this section",
|
|
47958
|
+
description: "The section a per-section summary row is about (D698); on a summary sent as one message, every section it reports, comma-separated.",
|
|
47959
|
+
example: "Batterie scariche",
|
|
47960
|
+
group: "system",
|
|
47961
|
+
families: ["rule"],
|
|
47962
|
+
fields: [...RULE_TEXT],
|
|
47963
|
+
kinds: ["system"],
|
|
47964
|
+
systemEventKinds: [...SUMMARISABLE],
|
|
47965
|
+
systemEventDeliveries: ["summary"]
|
|
47966
|
+
},
|
|
47469
47967
|
...STATE_SUMMARY_SECTION_VARS.map((v) => ({
|
|
47470
47968
|
name: v.name,
|
|
47471
47969
|
label: v.label,
|
|
@@ -47542,6 +48040,37 @@ var STATE_SUMMARY_VARS = [
|
|
|
47542
48040
|
[...RULE_TEXT],
|
|
47543
48041
|
...STATE_SUMMARY_VARS
|
|
47544
48042
|
];
|
|
48043
|
+
new Set([
|
|
48044
|
+
"disarmed",
|
|
48045
|
+
"armed_home",
|
|
48046
|
+
"armed_away",
|
|
48047
|
+
"armed_night",
|
|
48048
|
+
"armed_vacation",
|
|
48049
|
+
"armed_custom_bypass",
|
|
48050
|
+
"arming",
|
|
48051
|
+
"disarming",
|
|
48052
|
+
"pending",
|
|
48053
|
+
"triggered",
|
|
48054
|
+
"open",
|
|
48055
|
+
"opening",
|
|
48056
|
+
"closing",
|
|
48057
|
+
"closed",
|
|
48058
|
+
"stopped",
|
|
48059
|
+
"locked",
|
|
48060
|
+
"unlocked",
|
|
48061
|
+
"locking",
|
|
48062
|
+
"unlocking",
|
|
48063
|
+
"jammed",
|
|
48064
|
+
"on",
|
|
48065
|
+
"off",
|
|
48066
|
+
"home",
|
|
48067
|
+
"not_home",
|
|
48068
|
+
"matched",
|
|
48069
|
+
"diverged",
|
|
48070
|
+
"unknown",
|
|
48071
|
+
"latched",
|
|
48072
|
+
"live"
|
|
48073
|
+
]);
|
|
47545
48074
|
/**
|
|
47546
48075
|
* TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
|
|
47547
48076
|
*
|
|
@@ -47635,7 +48164,7 @@ var PreviewTextField = string().max(200);
|
|
|
47635
48164
|
* Whether the notification's preview is a STILL or a short animation.
|
|
47636
48165
|
*
|
|
47637
48166
|
* The operator's ask, verbatim: *"inviato come gif o video (come per le altre
|
|
47638
|
-
* rule)"* — the other rules already offer an animated preview, and a ten-hour
|
|
48167
|
+
* rule)"* [sent as a gif or video (as for the other rules)] — the other rules already offer an animated preview, and a ten-hour
|
|
47639
48168
|
* night reads better as three seconds of motion than as one frame of it. Both
|
|
47640
48169
|
* modes get the SAME treatment (blurred frame, large centred title); `'gif'`
|
|
47641
48170
|
* simply applies it to a dozen frames sampled across the render and assembles
|
|
@@ -47773,6 +48302,7 @@ TimelapseRuleInputSchema.extend({
|
|
|
47773
48302
|
createdAt: number(),
|
|
47774
48303
|
updatedAt: number()
|
|
47775
48304
|
});
|
|
48305
|
+
MotionOnMotionChangedDataSchema.omit({ triggeredBy: true });
|
|
47776
48306
|
object({
|
|
47777
48307
|
/**
|
|
47778
48308
|
* Fraction of the box's own size added on EACH side before cutting.
|