@camstack/addon-provider-homeassistant 1.2.149 → 1.2.151
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/addon.js +1 -1
- package/dist/addon.mjs +1 -1
- package/dist/{dist-BHAS4ZKN.js → dist-Cn_fSOpM.js} +486 -340
- package/dist/{dist-CpKTdyca.mjs → dist-DFsf2z4Q.mjs} +486 -340
- package/dist/ha-export/ha-export.addon.js +2 -2
- package/dist/ha-export/ha-export.addon.mjs +2 -2
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../types/dist/event-category-
|
|
1
|
+
//#region ../types/dist/event-category-BGmz_oxW.mjs
|
|
2
2
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
3
3
|
EventCategory["SystemBoot"] = "system.boot";
|
|
4
4
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -531,6 +531,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
531
531
|
*/
|
|
532
532
|
EventCategory["PipelineAudioInferenceResult"] = "pipeline.audio-inference-result";
|
|
533
533
|
EventCategory["DetectionPhaseTransition"] = "detection.phase-transition";
|
|
534
|
+
/**
|
|
535
|
+
* A camera provider's RAW onboard motion push (D673): the `MotionOnMotionChanged`
|
|
536
|
+
* data shape without `triggeredBy`, built by `providerMotionEvent`. Its one
|
|
537
|
+
* consumer is the orchestrator's camera-sensors bridge, which re-emits the
|
|
538
|
+
* camera's EFFECTIVE onboard motion as `MotionOnMotionChanged` (a pass-through
|
|
539
|
+
* for a camera with no attached sensor). Providers must not emit
|
|
540
|
+
* `MotionOnMotionChanged` themselves; `scripts/check-onboard-motion-emitters.ts`
|
|
541
|
+
* keeps it so (camera-grid is a named, deferred exception).
|
|
542
|
+
*/
|
|
534
543
|
EventCategory["ProviderMotion"] = "provider.motion";
|
|
535
544
|
EventCategory["ProviderDetection"] = "provider.detection";
|
|
536
545
|
EventCategory["EnrichmentEmbeddingStored"] = "enrichment.embedding.stored";
|
|
@@ -5369,7 +5378,7 @@ var ZodIssueCode = {
|
|
|
5369
5378
|
var ZodFirstPartyTypeKind;
|
|
5370
5379
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5371
5380
|
//#endregion
|
|
5372
|
-
//#region ../types/dist/sleep-
|
|
5381
|
+
//#region ../types/dist/sleep-CDCONfkt.mjs
|
|
5373
5382
|
/**
|
|
5374
5383
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5375
5384
|
* window to float samples (D455).
|
|
@@ -7471,7 +7480,7 @@ function errMsg(err) {
|
|
|
7471
7480
|
return String(err);
|
|
7472
7481
|
}
|
|
7473
7482
|
//#endregion
|
|
7474
|
-
//#region ../types/dist/composition-
|
|
7483
|
+
//#region ../types/dist/composition-43aqsZQj.mjs
|
|
7475
7484
|
/**
|
|
7476
7485
|
* The ffmpeg build every CamStack node downloads, per platform and arch.
|
|
7477
7486
|
*
|
|
@@ -7528,13 +7537,12 @@ portable("linux64"), portable("linuxarm64"), portable("macarm64"), portable("mac
|
|
|
7528
7537
|
* LA tabella "quale booleano di questo tipo di device conta come ALTO", e il
|
|
7529
7538
|
* valutatore puro del suo FRONTE.
|
|
7530
7539
|
*
|
|
7531
|
-
*
|
|
7532
|
-
*
|
|
7533
|
-
*
|
|
7534
|
-
*
|
|
7535
|
-
*
|
|
7536
|
-
* fa suonare il campanello ma non registra" — è esattamente D62.
|
|
7537
|
-
* SPOSTA qui e il doorbell la ri-esporta.
|
|
7540
|
+
* UNA tabella per tutti quelli che chiedono "questo device è ALTO?": il
|
|
7541
|
+
* trigger `RecordingTriggers.sensorDeviceIds` del recorder, i marker dei
|
|
7542
|
+
* sensori della post-analysis, il bridge camera-sensors dell'orchestratore e
|
|
7543
|
+
* le sorgenti di un campanello composto (`doorbellFeatureSources`, D671).
|
|
7544
|
+
* Una seconda copia divergerebbe alla prima cap aggiunta, e il sintomo — "il
|
|
7545
|
+
* sensore fa suonare il campanello ma non registra" — è esattamente D62.
|
|
7538
7546
|
*
|
|
7539
7547
|
* ⚠ NON è `DEVICE_STATE_READERS` (`catalogs/device-state-vocabulary.ts`), e le
|
|
7540
7548
|
* due non vanno unificate: quella risponde a "qual è la PAROLA di stato per una
|
|
@@ -7560,8 +7568,6 @@ var SOURCE_CAP_ACTIVE_FIELD = {
|
|
|
7560
7568
|
vibration: "detected",
|
|
7561
7569
|
tamper: "tampered"
|
|
7562
7570
|
};
|
|
7563
|
-
/** Cap names whose presence in a device's bindings qualify it as a source. */
|
|
7564
|
-
var SOURCE_CAPS = Object.keys(SOURCE_CAP_ACTIVE_FIELD);
|
|
7565
7571
|
/**
|
|
7566
7572
|
* Error types for the safe expression engine. Two distinct classes so callers
|
|
7567
7573
|
* can tell a compile-time (grammar) failure from a runtime (evaluation)
|
|
@@ -9415,7 +9421,7 @@ var RecordingTriggersSchema = object({
|
|
|
9415
9421
|
*
|
|
9416
9422
|
* Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
|
|
9417
9423
|
* `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
|
|
9418
|
-
* la stessa
|
|
9424
|
+
* la stessa del campanello composto (D671). Ed è il FRONTE, non
|
|
9419
9425
|
* il livello: un contatto trovato già aperto al riavvio del runner non fa
|
|
9420
9426
|
* registrare.
|
|
9421
9427
|
*/
|
|
@@ -11789,6 +11795,68 @@ method(object({
|
|
|
11789
11795
|
password: string()
|
|
11790
11796
|
}), AuthResultSchema.nullable(), { kind: "mutation" }), method(object({ state: string() }), string()), method(record(string(), string()), AuthResultSchema, { kind: "mutation" }), method(object({ token: string() }), AuthResultSchema.nullable());
|
|
11791
11797
|
/**
|
|
11798
|
+
* How long one snapshot may take end to end: the pinned copy of the whole
|
|
11799
|
+
* database plus `PRAGMA integrity_check` over the copy, on the hub's slowest
|
|
11800
|
+
* disk. ~800 MB at a pessimistic 10 MB/s is under 3 minutes; the bound is
|
|
11801
|
+
* generous because a timeout fails the whole backup run.
|
|
11802
|
+
*/
|
|
11803
|
+
var DATABASE_SNAPSHOT_TIMEOUT_MS = 30 * 6e4;
|
|
11804
|
+
/**
|
|
11805
|
+
* The databases an owner snapshots — declared by the OWNER, so a caller never
|
|
11806
|
+
* guesses which file is live from what sits beside it (a cleanly closed
|
|
11807
|
+
* database has no sidecars and is just as owned). Paths are absolute on the
|
|
11808
|
+
* owner's host.
|
|
11809
|
+
*/
|
|
11810
|
+
var DatabaseSnapshotTargetsSchema = object({ databases: array(object({ livePath: string() })) });
|
|
11811
|
+
/** One b-tree table of the snapshot and the rows it holds. */
|
|
11812
|
+
var DatabaseSnapshotTableSchema = object({
|
|
11813
|
+
name: string(),
|
|
11814
|
+
rows: number().int().nonnegative()
|
|
11815
|
+
});
|
|
11816
|
+
/**
|
|
11817
|
+
* What the owner wrote. Every path is ABSOLUTE on the owner's host — the
|
|
11818
|
+
* caller pins the call to its own node, so it can read the file; a caller
|
|
11819
|
+
* that finds the path outside its own data root refuses it rather than
|
|
11820
|
+
* archiving something it cannot place.
|
|
11821
|
+
*/
|
|
11822
|
+
var DatabaseSnapshotResultSchema = object({
|
|
11823
|
+
/** The live database the snapshot copies. Never to be copied as a file. */
|
|
11824
|
+
livePath: string(),
|
|
11825
|
+
/** The verified copy: `<livePath>` + {@link DATABASE_SNAPSHOT_SUFFIX}. */
|
|
11826
|
+
snapshotPath: string(),
|
|
11827
|
+
sizeBytes: number().int().nonnegative(),
|
|
11828
|
+
pageCount: number().int().nonnegative(),
|
|
11829
|
+
pageSize: number().int().positive(),
|
|
11830
|
+
/**
|
|
11831
|
+
* Every b-tree table with its row count. Read inside the SAME read
|
|
11832
|
+
* transaction the copy was taken from, and found EQUAL on the copy — so
|
|
11833
|
+
* this is the content of the snapshot, not an estimate of the source.
|
|
11834
|
+
*/
|
|
11835
|
+
tables: array(DatabaseSnapshotTableSchema),
|
|
11836
|
+
/** Wall time of the pinned copy (row counts included). */
|
|
11837
|
+
copyMs: number().nonnegative(),
|
|
11838
|
+
/** Wall time of the checks on the copy (`integrity_check`, row counts). */
|
|
11839
|
+
verifyMs: number().nonnegative(),
|
|
11840
|
+
/** When the pinned read transaction began (ms epoch) — the snapshot's instant. */
|
|
11841
|
+
takenAt: number()
|
|
11842
|
+
});
|
|
11843
|
+
/**
|
|
11844
|
+
* A snapshot as an ARCHIVE records it (`ArchiveManifest.sqliteSnapshots`):
|
|
11845
|
+
* the same facts, with both paths relative to the archive root (the node's
|
|
11846
|
+
* data dir), because an archive outlives the host that made it.
|
|
11847
|
+
*/
|
|
11848
|
+
var ArchiveSqliteSnapshotSchema = DatabaseSnapshotResultSchema.extend({
|
|
11849
|
+
/** Archive-relative path of the live database the archive does NOT carry. */
|
|
11850
|
+
livePath: string(),
|
|
11851
|
+
/** Archive-relative path of the verified copy it carries in its place. */
|
|
11852
|
+
snapshotPath: string()
|
|
11853
|
+
});
|
|
11854
|
+
method(object({}), DatabaseSnapshotTargetsSchema, { auth: "admin" }), method(object({}), DatabaseSnapshotResultSchema, {
|
|
11855
|
+
kind: "mutation",
|
|
11856
|
+
auth: "admin",
|
|
11857
|
+
timeoutMs: DATABASE_SNAPSHOT_TIMEOUT_MS
|
|
11858
|
+
});
|
|
11859
|
+
/**
|
|
11792
11860
|
* Orchestrator-side destination metadata. The orchestrator computes
|
|
11793
11861
|
* `id = <addonId>:<subId>` from its provider lookup so consumers
|
|
11794
11862
|
* (admin UI, restore flow) see one canonical key.
|
|
@@ -11899,7 +11967,12 @@ var ArchiveManifestSchema = object({
|
|
|
11899
11967
|
locations: array(string()),
|
|
11900
11968
|
entries: array(ArchiveEntrySchema),
|
|
11901
11969
|
totalBytes: number(),
|
|
11902
|
-
totalFiles: number()
|
|
11970
|
+
totalFiles: number(),
|
|
11971
|
+
/**
|
|
11972
|
+
* Live SQLite databases this archive carries as their OWNER's verified
|
|
11973
|
+
* snapshot instead of as files (D693). Absent on archives made before.
|
|
11974
|
+
*/
|
|
11975
|
+
sqliteSnapshots: array(ArchiveSqliteSnapshotSchema).optional()
|
|
11903
11976
|
});
|
|
11904
11977
|
var LocationStatSchema = object({
|
|
11905
11978
|
name: string(),
|
|
@@ -13474,6 +13547,52 @@ var CompositionBlockStateSchema = object({
|
|
|
13474
13547
|
reason: string().optional(),
|
|
13475
13548
|
fields: array(CompositionFieldStateSchema)
|
|
13476
13549
|
});
|
|
13550
|
+
var ComposerBlockSchema = object({
|
|
13551
|
+
id: string().min(1),
|
|
13552
|
+
name: string().min(1).max(120),
|
|
13553
|
+
enabled: boolean(),
|
|
13554
|
+
updatedAt: number(),
|
|
13555
|
+
composition: CompositionSchema
|
|
13556
|
+
});
|
|
13557
|
+
/**
|
|
13558
|
+
* A stored composition row that no longer PARSES — a schema a release
|
|
13559
|
+
* tightened, a row written by a newer build. Sent by id so the composer keeps
|
|
13560
|
+
* its device as a placeholder and reports the block `failed` naming the parse
|
|
13561
|
+
* error. Leaving it out would read, twice, exactly like a delete (D49).
|
|
13562
|
+
*/
|
|
13563
|
+
var ComposerUnreadableBlockSchema = object({
|
|
13564
|
+
id: string().min(1),
|
|
13565
|
+
/** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
|
|
13566
|
+
name: string().nullable(),
|
|
13567
|
+
/** The parse error, in the operator's words. */
|
|
13568
|
+
error: string()
|
|
13569
|
+
});
|
|
13570
|
+
method(object({
|
|
13571
|
+
/** The shared Blocks integration; null until `core-blocks` has reconciled it. */
|
|
13572
|
+
integrationId: string().nullable(),
|
|
13573
|
+
/** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
|
|
13574
|
+
storeLoaded: boolean(),
|
|
13575
|
+
blocks: array(ComposerBlockSchema),
|
|
13576
|
+
/** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
|
|
13577
|
+
restartBlockIds: array(string()),
|
|
13578
|
+
/** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
|
|
13579
|
+
unreadableBlocks: array(ComposerUnreadableBlockSchema)
|
|
13580
|
+
}), object({
|
|
13581
|
+
blocks: array(object({
|
|
13582
|
+
blockId: string(),
|
|
13583
|
+
status: CompositionRunStatusSchema,
|
|
13584
|
+
reason: string().optional()
|
|
13585
|
+
})),
|
|
13586
|
+
/**
|
|
13587
|
+
* False when the composer declared and withdrew NOTHING (store not loaded,
|
|
13588
|
+
* integration unknown, its own rows unread or read empty once). An empty
|
|
13589
|
+
* apply the caller owes is paid off only by one the composer acted on (D49).
|
|
13590
|
+
*/
|
|
13591
|
+
acted: boolean()
|
|
13592
|
+
}), {
|
|
13593
|
+
kind: "mutation",
|
|
13594
|
+
auth: "admin"
|
|
13595
|
+
}), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
|
|
13477
13596
|
var NUMBER = {
|
|
13478
13597
|
kind: "fixed",
|
|
13479
13598
|
result: ["number"]
|
|
@@ -13710,52 +13829,6 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
|
|
|
13710
13829
|
auth: "admin",
|
|
13711
13830
|
access: "view"
|
|
13712
13831
|
});
|
|
13713
|
-
var ComposerBlockSchema = object({
|
|
13714
|
-
id: string().min(1),
|
|
13715
|
-
name: string().min(1).max(120),
|
|
13716
|
-
enabled: boolean(),
|
|
13717
|
-
updatedAt: number(),
|
|
13718
|
-
composition: CompositionSchema
|
|
13719
|
-
});
|
|
13720
|
-
/**
|
|
13721
|
-
* A stored composition row that no longer PARSES — a schema a release
|
|
13722
|
-
* tightened, a row written by a newer build. Sent by id so the composer keeps
|
|
13723
|
-
* its device as a placeholder and reports the block `failed` naming the parse
|
|
13724
|
-
* error. Leaving it out would read, twice, exactly like a delete (D49).
|
|
13725
|
-
*/
|
|
13726
|
-
var ComposerUnreadableBlockSchema = object({
|
|
13727
|
-
id: string().min(1),
|
|
13728
|
-
/** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
|
|
13729
|
-
name: string().nullable(),
|
|
13730
|
-
/** The parse error, in the operator's words. */
|
|
13731
|
-
error: string()
|
|
13732
|
-
});
|
|
13733
|
-
method(object({
|
|
13734
|
-
/** The shared Blocks integration; null until `core-blocks` has reconciled it. */
|
|
13735
|
-
integrationId: string().nullable(),
|
|
13736
|
-
/** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
|
|
13737
|
-
storeLoaded: boolean(),
|
|
13738
|
-
blocks: array(ComposerBlockSchema),
|
|
13739
|
-
/** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
|
|
13740
|
-
restartBlockIds: array(string()),
|
|
13741
|
-
/** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
|
|
13742
|
-
unreadableBlocks: array(ComposerUnreadableBlockSchema)
|
|
13743
|
-
}), object({
|
|
13744
|
-
blocks: array(object({
|
|
13745
|
-
blockId: string(),
|
|
13746
|
-
status: CompositionRunStatusSchema,
|
|
13747
|
-
reason: string().optional()
|
|
13748
|
-
})),
|
|
13749
|
-
/**
|
|
13750
|
-
* False when the composer declared and withdrew NOTHING (store not loaded,
|
|
13751
|
-
* integration unknown, its own rows unread or read empty once). An empty
|
|
13752
|
-
* apply the caller owes is paid off only by one the composer acted on (D49).
|
|
13753
|
-
*/
|
|
13754
|
-
acted: boolean()
|
|
13755
|
-
}), {
|
|
13756
|
-
kind: "mutation",
|
|
13757
|
-
auth: "admin"
|
|
13758
|
-
}), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
|
|
13759
13832
|
/**
|
|
13760
13833
|
* `custom-model-registry` — collection cap exposing operator-registered
|
|
13761
13834
|
* custom detection models. Each provider (today: `addon-model-studio`)
|
|
@@ -16026,6 +16099,121 @@ method(object({
|
|
|
16026
16099
|
deviceIds: array(number()).readonly(),
|
|
16027
16100
|
caps: array(string()).readonly().optional()
|
|
16028
16101
|
}), record(string(), record(string(), unknown().nullable())));
|
|
16102
|
+
var ExtensionSlotIdSchema = _enum(["linked-devices"]);
|
|
16103
|
+
DeviceType.Camera;
|
|
16104
|
+
/** A slot's editable value, discriminated on `slot`. */
|
|
16105
|
+
var ExtensionSlotValueSchema = discriminatedUnion("slot", [LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
|
|
16106
|
+
DeviceType.Camera;
|
|
16107
|
+
var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
|
|
16108
|
+
state: literal("unreachable"),
|
|
16109
|
+
reason: string()
|
|
16110
|
+
})]);
|
|
16111
|
+
/** One provider of slots — the D554 source-listing row. */
|
|
16112
|
+
var ExtensionSourceSchema = object({
|
|
16113
|
+
/** The routing prefix of every `slotRef` this provider serves. */
|
|
16114
|
+
source: string(),
|
|
16115
|
+
label: string(),
|
|
16116
|
+
/** Stamped by the dispatcher from the registry (D557). */
|
|
16117
|
+
addonId: string().optional(),
|
|
16118
|
+
availability: ExtensionSourceAvailabilitySchema
|
|
16119
|
+
});
|
|
16120
|
+
/**
|
|
16121
|
+
* How one picked source stands. `missing` — no such device (deleted, or an id
|
|
16122
|
+
* that never existed); `foreign` — a device the slot's owner cannot read from
|
|
16123
|
+
* (a source owned by another addon); `unavailable` — it exists but is not a
|
|
16124
|
+
* valid source now (a container, which is never a pick). A source in any of
|
|
16125
|
+
* these states is SHOWN, never silently dropped or re-pointed.
|
|
16126
|
+
*/
|
|
16127
|
+
var ExtensionSourceHealthSchema = _enum([
|
|
16128
|
+
"ok",
|
|
16129
|
+
"missing",
|
|
16130
|
+
"foreign",
|
|
16131
|
+
"unavailable"
|
|
16132
|
+
]);
|
|
16133
|
+
var ExtensionSlotSourceSchema = object({
|
|
16134
|
+
deviceId: number().int(),
|
|
16135
|
+
/** The device's name, or null when it could not be resolved (`missing`). */
|
|
16136
|
+
name: string().nullable(),
|
|
16137
|
+
health: ExtensionSourceHealthSchema,
|
|
16138
|
+
detail: string().optional()
|
|
16139
|
+
});
|
|
16140
|
+
/**
|
|
16141
|
+
* A DIFFERENT authority that gates whether the slot's sources do anything —
|
|
16142
|
+
* reported read-only, named, never written through this contract (D62) — e.g.
|
|
16143
|
+
* a slot whose sources act only while a wrapper is bound to the host, a
|
|
16144
|
+
* binding that belongs to `deviceManager.setWrapperActive`. No slot reports
|
|
16145
|
+
* one today (`linked-devices` answers `null`). `unknown` means the gate could
|
|
16146
|
+
* not be read; it is not "inactive" (D315).
|
|
16147
|
+
*/
|
|
16148
|
+
var ExtensionSlotActivationSchema = object({
|
|
16149
|
+
state: _enum([
|
|
16150
|
+
"active",
|
|
16151
|
+
"inactive",
|
|
16152
|
+
"unknown"
|
|
16153
|
+
]),
|
|
16154
|
+
authority: string(),
|
|
16155
|
+
detail: string().optional()
|
|
16156
|
+
});
|
|
16157
|
+
var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
|
|
16158
|
+
state: literal("ok"),
|
|
16159
|
+
/** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
|
|
16160
|
+
slotRef: string(),
|
|
16161
|
+
slot: ExtensionSlotIdSchema,
|
|
16162
|
+
/** Names the store written (D62), e.g. `device-manager:_linkedDeviceIds`. */
|
|
16163
|
+
authority: string(),
|
|
16164
|
+
activation: ExtensionSlotActivationSchema.nullable(),
|
|
16165
|
+
value: ExtensionSlotValueSchema,
|
|
16166
|
+
sources: array(ExtensionSlotSourceSchema),
|
|
16167
|
+
/**
|
|
16168
|
+
* Devices the owner links to the host ON ITS OWN, by structure, and that
|
|
16169
|
+
* are therefore not in `value` (D655): a camera's device-tree children, and
|
|
16170
|
+
* the child a picked container stands for (D356 — a container is never a
|
|
16171
|
+
* pick, its children are). Read-only; the editor shows them and may offer
|
|
16172
|
+
* per-device options on them (the linked-devices tracked-event opt-in).
|
|
16173
|
+
* Absent when the owner links nothing beyond the picks, and from an owner
|
|
16174
|
+
* older than D655.
|
|
16175
|
+
*/
|
|
16176
|
+
impliedSources: array(ExtensionSlotSourceSchema).optional()
|
|
16177
|
+
}), object({
|
|
16178
|
+
state: literal("unreachable"),
|
|
16179
|
+
addonId: string(),
|
|
16180
|
+
reason: string()
|
|
16181
|
+
})]);
|
|
16182
|
+
var ExtensionCandidatesSchema = object({ candidates: array(object({
|
|
16183
|
+
deviceId: number().int(),
|
|
16184
|
+
name: string(),
|
|
16185
|
+
type: string(),
|
|
16186
|
+
location: string().nullable(),
|
|
16187
|
+
/** The container a child belongs to — "Spotlight 2" alone does not say which. */
|
|
16188
|
+
parentName: string().nullable(),
|
|
16189
|
+
/** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
|
|
16190
|
+
suggested: boolean(),
|
|
16191
|
+
/** Why it is suggested ("same location"), null when it is not. */
|
|
16192
|
+
reason: string().nullable()
|
|
16193
|
+
})) });
|
|
16194
|
+
/**
|
|
16195
|
+
* What a write did. `none` — applied in place. `host` / `parent` — the owner
|
|
16196
|
+
* reloaded the host (or, for an accessory child, its parent) because the
|
|
16197
|
+
* write changed what the host REGISTERS. A slot never adds a capability to its
|
|
16198
|
+
* host — that is a composition (D663) — so today's owners answer `none`.
|
|
16199
|
+
*/
|
|
16200
|
+
var ExtensionSetResultSchema = object({
|
|
16201
|
+
applied: literal(true),
|
|
16202
|
+
reload: _enum([
|
|
16203
|
+
"none",
|
|
16204
|
+
"host",
|
|
16205
|
+
"parent"
|
|
16206
|
+
])
|
|
16207
|
+
});
|
|
16208
|
+
var ExtensionSlotRefInputSchema = object({
|
|
16209
|
+
deviceId: number().int(),
|
|
16210
|
+
slotRef: string().min(1)
|
|
16211
|
+
});
|
|
16212
|
+
var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
|
|
16213
|
+
method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)), method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)), method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema), method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
|
|
16214
|
+
kind: "mutation",
|
|
16215
|
+
auth: "admin"
|
|
16216
|
+
});
|
|
16029
16217
|
/**
|
|
16030
16218
|
* Per-field ownership (D663). A composition may CLAIM fields of a native
|
|
16031
16219
|
* cap's runtime-state slice on an existing device: `replace` overlays the
|
|
@@ -19050,17 +19238,25 @@ var NcScheduleSchema = object({
|
|
|
19050
19238
|
*/
|
|
19051
19239
|
var NcSystemEventDeliveryModeSchema = _enum(["instant", "summary"]);
|
|
19052
19240
|
/**
|
|
19241
|
+
* How a summary window is SENT (D698): `rule` (absent) = ONE notification with
|
|
19242
|
+
* every section; `section` = one notification per section with something to
|
|
19243
|
+
* say (an unavailable section included), each titled by its section.
|
|
19244
|
+
*/
|
|
19245
|
+
var NcStateSummarySplitSchema = _enum(["rule", "section"]);
|
|
19246
|
+
/**
|
|
19053
19247
|
* `summary`: the rule sends NOTHING per event. When a window of `schedule`
|
|
19054
19248
|
* CLOSES, it sends one notification with the current state of its kinds
|
|
19055
19249
|
* (low batteries, consumables to replace, devices offline, updates
|
|
19056
|
-
* available, ...), after its own filters
|
|
19250
|
+
* available, ...), after its own filters — or, with `split: 'section'`
|
|
19251
|
+
* (D698), one notification per section. Nothing to report sends nothing.
|
|
19057
19252
|
* The schedule is the ordinary `NcSchedule` (weekly windows, IANA timezone,
|
|
19058
19253
|
* midnight crossing); the send time is each window's END. Refused on the
|
|
19059
19254
|
* `alarm` family, which stays instant (`systemEventDeliveryProblems`).
|
|
19060
19255
|
*/
|
|
19061
19256
|
var NcSystemEventDeliverySchema = discriminatedUnion("mode", [object({ mode: literal("instant") }), object({
|
|
19062
19257
|
mode: literal("summary"),
|
|
19063
|
-
schedule: NcScheduleSchema
|
|
19258
|
+
schedule: NcScheduleSchema,
|
|
19259
|
+
split: NcStateSummarySplitSchema.optional()
|
|
19064
19260
|
})]);
|
|
19065
19261
|
/** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
|
|
19066
19262
|
var NcPlateMatcherSchema = object({
|
|
@@ -19711,10 +19907,12 @@ var NcMediaPolicySchema = object({
|
|
|
19711
19907
|
/**
|
|
19712
19908
|
* Cooldown GRANULARITY over the subject's class — how much a fired
|
|
19713
19909
|
* notification suppresses.
|
|
19714
|
-
* - `
|
|
19715
|
-
*
|
|
19716
|
-
*
|
|
19717
|
-
*
|
|
19910
|
+
* - `per-class` (default, and the absent value since 2026-10-01 — D36) — an
|
|
19911
|
+
* independent window per detected class: cat→dog fires at once, cat→cat
|
|
19912
|
+
* still waits.
|
|
19913
|
+
* - `shared` — one window for the whole rule/scope: a cat silences the next
|
|
19914
|
+
* dog for `cooldownSec`. Only written when an operator picks it; it is no
|
|
19915
|
+
* longer what an unset rule means.
|
|
19718
19916
|
*
|
|
19719
19917
|
* AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
|
|
19720
19918
|
* must not be swallowed by a bark's window (the precedent this generalizes —
|
|
@@ -19729,8 +19927,11 @@ var NcThrottleSchema = object({
|
|
|
19729
19927
|
/**
|
|
19730
19928
|
* Class granularity of the cooldown key. Optional rather than defaulted:
|
|
19731
19929
|
* 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
|
-
*
|
|
19930
|
+
* rule authored before this field simply carries none. The engine used to
|
|
19931
|
+
* read absent as `shared` (D36); since 2026-10-01 it reads absent as
|
|
19932
|
+
* `per-class` — the operator's default — and only an explicit `shared`
|
|
19933
|
+
* still means `shared`. See `cooldownKey` / `keysPerClass` in the rule
|
|
19934
|
+
* engine, and D36's dated note.
|
|
19734
19935
|
*/
|
|
19735
19936
|
granularity: NcThrottleGranularitySchema.optional()
|
|
19736
19937
|
});
|
|
@@ -20054,11 +20255,23 @@ var NcStateSummaryPreviewSectionSchema = object({
|
|
|
20054
20255
|
reason: string().optional()
|
|
20055
20256
|
});
|
|
20056
20257
|
/**
|
|
20258
|
+
* One notification a previewed summary would send (D698): the whole summary on
|
|
20259
|
+
* a `rule` split (no `section`), one section's on a `section` split.
|
|
20260
|
+
*/
|
|
20261
|
+
var NcStateSummaryPreviewRowSchema = object({
|
|
20262
|
+
section: string().optional(),
|
|
20263
|
+
/** The section's name on a per-section row; every reported section's, joined, on a combined one. */
|
|
20264
|
+
title: string(),
|
|
20265
|
+
text: string(),
|
|
20266
|
+
count: number().int().nonnegative()
|
|
20267
|
+
});
|
|
20268
|
+
/**
|
|
20057
20269
|
* The summary a rule would send now. `empty` = nothing to report and every
|
|
20058
20270
|
* section read: such a summary is NOT sent. `dropped` counts the open states
|
|
20059
20271
|
* the rule's own filters (or a camera mute) left out, by reason.
|
|
20060
20272
|
* `excludedGroups` names the kind groups selected that have no state to report
|
|
20061
|
-
* (backups & exports).
|
|
20273
|
+
* (backups & exports). `split` and `rows` (D698) say how it would be sent —
|
|
20274
|
+
* optional, so an older hub's answer still parses.
|
|
20062
20275
|
*/
|
|
20063
20276
|
var NcStateSummaryPreviewSchema = object({
|
|
20064
20277
|
empty: boolean(),
|
|
@@ -20066,7 +20279,9 @@ var NcStateSummaryPreviewSchema = object({
|
|
|
20066
20279
|
text: string(),
|
|
20067
20280
|
sections: array(NcStateSummaryPreviewSectionSchema),
|
|
20068
20281
|
dropped: record(string(), number().int().nonnegative()),
|
|
20069
|
-
excludedGroups: array(string())
|
|
20282
|
+
excludedGroups: array(string()),
|
|
20283
|
+
split: NcStateSummarySplitSchema.optional(),
|
|
20284
|
+
rows: array(NcStateSummaryPreviewRowSchema).optional()
|
|
20070
20285
|
});
|
|
20071
20286
|
var NcTestResultSchema = object({
|
|
20072
20287
|
recordId: string(),
|
|
@@ -21096,12 +21311,26 @@ var CameraSensorRefSchema = object({
|
|
|
21096
21311
|
function cameraSensorRefKey(ref) {
|
|
21097
21312
|
return `${ref.addonId}/${ref.stableId}`;
|
|
21098
21313
|
}
|
|
21099
|
-
/**
|
|
21100
|
-
|
|
21101
|
-
|
|
21102
|
-
|
|
21103
|
-
|
|
21104
|
-
|
|
21314
|
+
/**
|
|
21315
|
+
* A sensor's mode (D673). `in-addition`: its motion is the camera's motion too.
|
|
21316
|
+
* `replace`: its motion is the camera's, and while one is READY the camera's
|
|
21317
|
+
* own motion no longer counts on its own. `confirm`: while one is READY the
|
|
21318
|
+
* camera's own motion counts only while a confirm sensor is active — with or
|
|
21319
|
+
* without a replace sensor (spec C2, the controller's ruling on Q1).
|
|
21320
|
+
*/
|
|
21321
|
+
var CameraSensorModeSchema = _enum([
|
|
21322
|
+
"in-addition",
|
|
21323
|
+
"confirm",
|
|
21324
|
+
"replace"
|
|
21325
|
+
]);
|
|
21326
|
+
/** A stored sensor with no mode — every CS-1 row — is in addition. */
|
|
21327
|
+
var DEFAULT_CAMERA_SENSOR_MODE = "in-addition";
|
|
21328
|
+
/**
|
|
21329
|
+
* A camera's attached sensors. A CS-1 row carried an envelope
|
|
21330
|
+
* `mode: 'in-addition'`: `z.object` drops it on parse, and the PARSED value is
|
|
21331
|
+
* what the write stores (D672 rule 3), so it is never written again.
|
|
21332
|
+
*/
|
|
21333
|
+
var CameraSensorsConfigSchema = object({ sensors: array(CameraSensorRefSchema.extend({ mode: CameraSensorModeSchema.default(DEFAULT_CAMERA_SENSOR_MODE) })).min(1).max(8) }).superRefine((value, ctx) => {
|
|
21105
21334
|
const seen = /* @__PURE__ */ new Set();
|
|
21106
21335
|
value.sensors.forEach((ref, index) => {
|
|
21107
21336
|
const key = cameraSensorRefKey(ref);
|
|
@@ -21113,39 +21342,41 @@ var CameraSensorsConfigSchema = object({
|
|
|
21113
21342
|
seen.add(key);
|
|
21114
21343
|
});
|
|
21115
21344
|
});
|
|
21116
|
-
|
|
21345
|
+
/** Every attachment names its mode; an older orchestrator that does not is in addition. */
|
|
21346
|
+
var AttachmentFields = {
|
|
21117
21347
|
addonId: string(),
|
|
21118
|
-
stableId: string()
|
|
21348
|
+
stableId: string(),
|
|
21349
|
+
mode: CameraSensorModeSchema.default(DEFAULT_CAMERA_SENSOR_MODE)
|
|
21119
21350
|
};
|
|
21120
21351
|
var CameraSensorAttachmentSchema = discriminatedUnion("state", [
|
|
21121
21352
|
object({
|
|
21122
|
-
...
|
|
21353
|
+
...AttachmentFields,
|
|
21123
21354
|
state: literal("ready"),
|
|
21124
21355
|
deviceId: number(),
|
|
21125
21356
|
name: string(),
|
|
21126
21357
|
caps: array(string()).readonly()
|
|
21127
21358
|
}),
|
|
21128
21359
|
object({
|
|
21129
|
-
...
|
|
21360
|
+
...AttachmentFields,
|
|
21130
21361
|
state: literal("offline"),
|
|
21131
21362
|
deviceId: number(),
|
|
21132
21363
|
name: string(),
|
|
21133
21364
|
reason: _enum(["offline", "disabled"])
|
|
21134
21365
|
}),
|
|
21135
21366
|
object({
|
|
21136
|
-
...
|
|
21367
|
+
...AttachmentFields,
|
|
21137
21368
|
state: literal("missing"),
|
|
21138
21369
|
reason: string()
|
|
21139
21370
|
}),
|
|
21140
21371
|
object({
|
|
21141
|
-
...
|
|
21372
|
+
...AttachmentFields,
|
|
21142
21373
|
state: literal("unsupported"),
|
|
21143
21374
|
deviceId: number(),
|
|
21144
21375
|
name: string(),
|
|
21145
21376
|
reason: string()
|
|
21146
21377
|
}),
|
|
21147
21378
|
object({
|
|
21148
|
-
...
|
|
21379
|
+
...AttachmentFields,
|
|
21149
21380
|
state: literal("unreadable"),
|
|
21150
21381
|
reason: string()
|
|
21151
21382
|
})
|
|
@@ -21158,17 +21389,49 @@ var CameraSensorAttachmentSchema = discriminatedUnion("state", [
|
|
|
21158
21389
|
* say.
|
|
21159
21390
|
*/
|
|
21160
21391
|
var CameraSensorsNotForwardedSchema = _enum(["onboard-not-listed", "no-active-detection"]);
|
|
21392
|
+
/** Whether the camera's OWN motion counts on its own (D673 C2), from its READY sensors (C3). */
|
|
21393
|
+
var CameraOwnMotionSchema = _enum([
|
|
21394
|
+
"always",
|
|
21395
|
+
"when-confirmed",
|
|
21396
|
+
"never"
|
|
21397
|
+
]);
|
|
21398
|
+
/** Confirm / Replace cannot suppress this camera's motion: its provider still emits it directly (D673 C13). */
|
|
21399
|
+
var CameraSensorsNotEnforcedSchema = _enum(["provider-not-split"]);
|
|
21400
|
+
/**
|
|
21401
|
+
* The camera's OWN onboard motion (D696): the raw input the bridge combines,
|
|
21402
|
+
* never the effective value. The camera's `motion` slice is the effective one,
|
|
21403
|
+
* so a view of the camera's own row reads this.
|
|
21404
|
+
* - `atMs`: when the bridge received the camera's last own edge.
|
|
21405
|
+
* - `detected`: evaluated WHEN THE STATUS IS ASKED — the last edge said `true`
|
|
21406
|
+
* AND it is younger than the window the bridge counts the camera's own motion
|
|
21407
|
+
* for (`motionCooldownMs`, floored at two sustain ticks). A camera that never
|
|
21408
|
+
* sends a clear (heartbeats only) therefore reads `false` once no push came
|
|
21409
|
+
* within the window; a status read is a snapshot, so a live view re-asks.
|
|
21410
|
+
* Absent = this orchestrator has not received the camera's own motion since it
|
|
21411
|
+
* started (unknown, never "quiet"), or an orchestrator older than D696.
|
|
21412
|
+
*/
|
|
21413
|
+
var CameraRawLevelSchema = object({
|
|
21414
|
+
detected: boolean(),
|
|
21415
|
+
atMs: number()
|
|
21416
|
+
});
|
|
21161
21417
|
var CameraSensorsStatusSchema = discriminatedUnion("state", [
|
|
21162
|
-
object({
|
|
21418
|
+
object({
|
|
21419
|
+
state: literal("not-configured"),
|
|
21420
|
+
cameraLevel: CameraRawLevelSchema.optional()
|
|
21421
|
+
}),
|
|
21163
21422
|
object({
|
|
21164
21423
|
state: literal("unreadable"),
|
|
21165
|
-
reason: string()
|
|
21424
|
+
reason: string(),
|
|
21425
|
+
cameraLevel: CameraRawLevelSchema.optional()
|
|
21166
21426
|
}),
|
|
21167
21427
|
object({
|
|
21168
21428
|
state: literal("configured"),
|
|
21169
|
-
|
|
21429
|
+
cameraLevel: CameraRawLevelSchema.optional(),
|
|
21170
21430
|
sensors: array(CameraSensorAttachmentSchema).readonly(),
|
|
21171
|
-
|
|
21431
|
+
/** Absent = an orchestrator older than CS-2: it does not say (D315). */
|
|
21432
|
+
cameraMotion: CameraOwnMotionSchema.optional(),
|
|
21433
|
+
notForwarded: CameraSensorsNotForwardedSchema.optional(),
|
|
21434
|
+
notEnforced: CameraSensorsNotEnforcedSchema.optional()
|
|
21172
21435
|
})
|
|
21173
21436
|
]);
|
|
21174
21437
|
Object.freeze({
|
|
@@ -24399,8 +24662,10 @@ var RunnerCameraConfigSchema = object({
|
|
|
24399
24662
|
* - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
|
|
24400
24663
|
* analyzer providers) running on decoded frames in this runner.
|
|
24401
24664
|
* - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
|
|
24402
|
-
* analytics). The provider emits ProviderMotion
|
|
24403
|
-
*
|
|
24665
|
+
* analytics). The provider emits its raw push as `ProviderMotion`
|
|
24666
|
+
* (D673); the orchestrator's camera-sensors bridge re-emits the camera's
|
|
24667
|
+
* effective motion as `MotionOnMotionChanged`, which is what reaches
|
|
24668
|
+
* `reportMotion`.
|
|
24404
24669
|
*/
|
|
24405
24670
|
motionSources: MotionSourcesSchema.default(["analyzer"]),
|
|
24406
24671
|
/**
|
|
@@ -24577,7 +24842,15 @@ var RunnerLocalLoadSchema = object({
|
|
|
24577
24842
|
hasGpu: boolean(),
|
|
24578
24843
|
inferenceBackend: string().optional(),
|
|
24579
24844
|
cpuCores: number().optional()
|
|
24580
|
-
})
|
|
24845
|
+
}),
|
|
24846
|
+
/**
|
|
24847
|
+
* Who writes a camera's `motion` runtime slice (D696). `'orchestrator'`: this
|
|
24848
|
+
* runner never writes it. ABSENT = a runner older than D696, which still
|
|
24849
|
+
* writes the slice from its phase machine; the orchestrator does not write
|
|
24850
|
+
* while any runner node is absent-or-unanswered, so one slice never has two
|
|
24851
|
+
* writers.
|
|
24852
|
+
*/
|
|
24853
|
+
motionSliceWriter: literal("orchestrator").optional()
|
|
24581
24854
|
});
|
|
24582
24855
|
/**
|
|
24583
24856
|
* Aggregate runtime metrics for the runner's whole local pool. Mirrors the
|
|
@@ -27631,219 +27904,6 @@ DeviceType.Camera, method(object({
|
|
|
27631
27904
|
auth: "protected"
|
|
27632
27905
|
});
|
|
27633
27906
|
/**
|
|
27634
|
-
* Doorbell button cap. Two kinds of providers coexist behind this cap
|
|
27635
|
-
* name (same pattern as `snapshot`):
|
|
27636
|
-
*
|
|
27637
|
-
* - **Native** providers: registered per-device by device-driver
|
|
27638
|
-
* addons via `ctx.registerNativeCap` — either on a
|
|
27639
|
-
* `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
|
|
27640
|
-
* or directly on the camera (Reolink registers at camera level).
|
|
27641
|
-
* Emits an `onPressed` event every time the firmware pushes a
|
|
27642
|
-
* ring; status tracks the last press and a pressCount since start
|
|
27643
|
-
* (diagnostic).
|
|
27644
|
-
*
|
|
27645
|
-
* - **Wrapper** provider: the `virtual-doorbell` system builtin
|
|
27646
|
-
* (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
|
|
27647
|
-
* device (contact / switch / event-emitter …) into a doorbell for
|
|
27648
|
-
* a camera. `defaultActive: false` — the operator explicitly binds
|
|
27649
|
-
* it per camera in the device-bindings UI, then picks the source
|
|
27650
|
-
* device + trigger in the per-device settings.
|
|
27651
|
-
*
|
|
27652
|
-
* The DeviceEventPropagator re-emits `onPressed` on the camera parent
|
|
27653
|
-
* — subscribers listening at the camera level receive ring events
|
|
27654
|
-
* with `via[]` populated. No code on the parent needed.
|
|
27655
|
-
*/
|
|
27656
|
-
var DoorbellStatusSchema = object({
|
|
27657
|
-
/** Ms epoch of the last press. null = never observed since this provider started. */
|
|
27658
|
-
lastPressedAt: number().nullable(),
|
|
27659
|
-
/** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
|
|
27660
|
-
pressCountSinceStart: number()
|
|
27661
|
-
});
|
|
27662
|
-
var DoorbellPressEventSchema = object({
|
|
27663
|
-
deviceId: number(),
|
|
27664
|
-
timestamp: number()
|
|
27665
|
-
});
|
|
27666
|
-
/**
|
|
27667
|
-
* The `doorbell-source` extension slot's editable value (D648): the camera's
|
|
27668
|
-
* virtual-doorbell trigger devices, exactly what the wrapper's
|
|
27669
|
-
* `doorbellSources` persists (as `{ deviceId }` records).
|
|
27670
|
-
*/
|
|
27671
|
-
var DoorbellSourceSlotValueSchema = object({ deviceIds: array(number().int().positive()) });
|
|
27672
|
-
/**
|
|
27673
|
-
* The `doorbell-source` slot — which devices ring this camera's VIRTUAL
|
|
27674
|
-
* doorbell, owned by the `virtual-doorbell` wrapper over its
|
|
27675
|
-
* `doorbellSources` store (D648). A source rings when one of its
|
|
27676
|
-
* `SOURCE_CAPS` rises. Whether the wrapper is bound to the camera at all is a
|
|
27677
|
-
* different authority (`deviceManager.setWrapperActive`, D62) — the slot
|
|
27678
|
-
* reports it, it never writes it.
|
|
27679
|
-
*/
|
|
27680
|
-
var DOORBELL_SOURCE_SLOT = {
|
|
27681
|
-
id: "doorbell-source",
|
|
27682
|
-
label: "Doorbell trigger devices",
|
|
27683
|
-
description: "Any of these becoming active rings this camera's virtual doorbell: a binary sensor when it goes active, a switch when it turns on.",
|
|
27684
|
-
shape: "association",
|
|
27685
|
-
hostDeviceTypes: [DeviceType.Camera],
|
|
27686
|
-
sourceCaps: SOURCE_CAPS,
|
|
27687
|
-
cardinality: "many",
|
|
27688
|
-
value: DoorbellSourceSlotValueSchema
|
|
27689
|
-
};
|
|
27690
|
-
var doorbellCapability = {
|
|
27691
|
-
name: "doorbell",
|
|
27692
|
-
scope: "device",
|
|
27693
|
-
deviceNative: true,
|
|
27694
|
-
mode: "singleton",
|
|
27695
|
-
kind: "wrapper",
|
|
27696
|
-
defaultActive: false,
|
|
27697
|
-
deviceTypes: [DeviceType.Button, DeviceType.Camera],
|
|
27698
|
-
extensionSlots: [DOORBELL_SOURCE_SLOT],
|
|
27699
|
-
methods: {},
|
|
27700
|
-
events: {
|
|
27701
|
-
/**
|
|
27702
|
-
* Fires once per physical press. Reolink delivers via Baichuan
|
|
27703
|
-
* push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
|
|
27704
|
-
* release/duration — it's a pulse.
|
|
27705
|
-
*/
|
|
27706
|
-
onPressed: {
|
|
27707
|
-
data: DoorbellPressEventSchema,
|
|
27708
|
-
fromState: {
|
|
27709
|
-
field: "lastPressedAt",
|
|
27710
|
-
on: "advance"
|
|
27711
|
-
}
|
|
27712
|
-
} },
|
|
27713
|
-
status: {
|
|
27714
|
-
schema: DoorbellStatusSchema,
|
|
27715
|
-
kind: "push"
|
|
27716
|
-
},
|
|
27717
|
-
/**
|
|
27718
|
-
* Runtime-state slice — last press timestamp + lifetime press count.
|
|
27719
|
-
* Mirrored by the kernel and readable via
|
|
27720
|
-
* `device.state.doorbell.value`. UIs can show "last ring 5m ago"
|
|
27721
|
-
* without subscribing.
|
|
27722
|
-
*/
|
|
27723
|
-
runtimeState: DoorbellStatusSchema,
|
|
27724
|
-
/**
|
|
27725
|
-
* Runtime-state durability: **restored** — a monotonic accumulator: the slice IS the record. `lastPressedAt` is content here, not a clock, so it is deliberately NOT volatile.
|
|
27726
|
-
*
|
|
27727
|
-
* See `RuntimeStateDurability`. Enforced by
|
|
27728
|
-
* `scripts/check-runtime-state-durability.ts`.
|
|
27729
|
-
*/
|
|
27730
|
-
durability: "restored"
|
|
27731
|
-
};
|
|
27732
|
-
var ExtensionSlotIdSchema = _enum(["doorbell-source", "linked-devices"]);
|
|
27733
|
-
DeviceType.Camera, DeviceType.Camera;
|
|
27734
|
-
/** A slot's editable value, discriminated on `slot`. */
|
|
27735
|
-
var ExtensionSlotValueSchema = discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
|
|
27736
|
-
DeviceType.Camera;
|
|
27737
|
-
var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
|
|
27738
|
-
state: literal("unreachable"),
|
|
27739
|
-
reason: string()
|
|
27740
|
-
})]);
|
|
27741
|
-
/** One provider of slots — the D554 source-listing row. */
|
|
27742
|
-
var ExtensionSourceSchema = object({
|
|
27743
|
-
/** The routing prefix of every `slotRef` this provider serves. */
|
|
27744
|
-
source: string(),
|
|
27745
|
-
label: string(),
|
|
27746
|
-
/** Stamped by the dispatcher from the registry (D557). */
|
|
27747
|
-
addonId: string().optional(),
|
|
27748
|
-
availability: ExtensionSourceAvailabilitySchema
|
|
27749
|
-
});
|
|
27750
|
-
/**
|
|
27751
|
-
* How one picked source stands. `missing` — no such device (deleted, or an id
|
|
27752
|
-
* that never existed); `foreign` — a device the slot's owner cannot read from
|
|
27753
|
-
* (a source owned by another addon); `unavailable` — it exists but is not a
|
|
27754
|
-
* valid source now (a container, which is never a pick). A source in any of
|
|
27755
|
-
* these states is SHOWN, never silently dropped or re-pointed.
|
|
27756
|
-
*/
|
|
27757
|
-
var ExtensionSourceHealthSchema = _enum([
|
|
27758
|
-
"ok",
|
|
27759
|
-
"missing",
|
|
27760
|
-
"foreign",
|
|
27761
|
-
"unavailable"
|
|
27762
|
-
]);
|
|
27763
|
-
var ExtensionSlotSourceSchema = object({
|
|
27764
|
-
deviceId: number().int(),
|
|
27765
|
-
/** The device's name, or null when it could not be resolved (`missing`). */
|
|
27766
|
-
name: string().nullable(),
|
|
27767
|
-
health: ExtensionSourceHealthSchema,
|
|
27768
|
-
detail: string().optional()
|
|
27769
|
-
});
|
|
27770
|
-
/**
|
|
27771
|
-
* A DIFFERENT authority that gates whether the slot's sources do anything —
|
|
27772
|
-
* reported read-only, named, never written through this contract (D62). The
|
|
27773
|
-
* virtual doorbell's sources ring only while the wrapper is bound to the
|
|
27774
|
-
* camera, and that binding belongs to `deviceManager.setWrapperActive`.
|
|
27775
|
-
* `unknown` means the gate could not be read; it is not "inactive" (D315).
|
|
27776
|
-
*/
|
|
27777
|
-
var ExtensionSlotActivationSchema = object({
|
|
27778
|
-
state: _enum([
|
|
27779
|
-
"active",
|
|
27780
|
-
"inactive",
|
|
27781
|
-
"unknown"
|
|
27782
|
-
]),
|
|
27783
|
-
authority: string(),
|
|
27784
|
-
detail: string().optional()
|
|
27785
|
-
});
|
|
27786
|
-
var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
|
|
27787
|
-
state: literal("ok"),
|
|
27788
|
-
/** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
|
|
27789
|
-
slotRef: string(),
|
|
27790
|
-
slot: ExtensionSlotIdSchema,
|
|
27791
|
-
/** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
|
|
27792
|
-
authority: string(),
|
|
27793
|
-
activation: ExtensionSlotActivationSchema.nullable(),
|
|
27794
|
-
value: ExtensionSlotValueSchema,
|
|
27795
|
-
sources: array(ExtensionSlotSourceSchema),
|
|
27796
|
-
/**
|
|
27797
|
-
* Devices the owner links to the host ON ITS OWN, by structure, and that
|
|
27798
|
-
* are therefore not in `value` (D655): a camera's device-tree children, and
|
|
27799
|
-
* the child a picked container stands for (D356 — a container is never a
|
|
27800
|
-
* pick, its children are). Read-only; the editor shows them and may offer
|
|
27801
|
-
* per-device options on them (the linked-devices tracked-event opt-in).
|
|
27802
|
-
* Absent when the owner links nothing beyond the picks, and from an owner
|
|
27803
|
-
* older than D655.
|
|
27804
|
-
*/
|
|
27805
|
-
impliedSources: array(ExtensionSlotSourceSchema).optional()
|
|
27806
|
-
}), object({
|
|
27807
|
-
state: literal("unreachable"),
|
|
27808
|
-
addonId: string(),
|
|
27809
|
-
reason: string()
|
|
27810
|
-
})]);
|
|
27811
|
-
var ExtensionCandidatesSchema = object({ candidates: array(object({
|
|
27812
|
-
deviceId: number().int(),
|
|
27813
|
-
name: string(),
|
|
27814
|
-
type: string(),
|
|
27815
|
-
location: string().nullable(),
|
|
27816
|
-
/** The container a child belongs to — "Spotlight 2" alone does not say which. */
|
|
27817
|
-
parentName: string().nullable(),
|
|
27818
|
-
/** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
|
|
27819
|
-
suggested: boolean(),
|
|
27820
|
-
/** Why it is suggested ("same location"), null when it is not. */
|
|
27821
|
-
reason: string().nullable()
|
|
27822
|
-
})) });
|
|
27823
|
-
/**
|
|
27824
|
-
* What a write did. `none` — applied in place. `host` / `parent` — the owner
|
|
27825
|
-
* reloaded the host (or, for an accessory child, its parent) because the
|
|
27826
|
-
* write changed what the host REGISTERS. A slot never adds a capability to its
|
|
27827
|
-
* host — that is a composition (D663) — so today's owners answer `none`.
|
|
27828
|
-
*/
|
|
27829
|
-
var ExtensionSetResultSchema = object({
|
|
27830
|
-
applied: literal(true),
|
|
27831
|
-
reload: _enum([
|
|
27832
|
-
"none",
|
|
27833
|
-
"host",
|
|
27834
|
-
"parent"
|
|
27835
|
-
])
|
|
27836
|
-
});
|
|
27837
|
-
var ExtensionSlotRefInputSchema = object({
|
|
27838
|
-
deviceId: number().int(),
|
|
27839
|
-
slotRef: string().min(1)
|
|
27840
|
-
});
|
|
27841
|
-
var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
|
|
27842
|
-
method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)), method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)), method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema), method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
|
|
27843
|
-
kind: "mutation",
|
|
27844
|
-
auth: "admin"
|
|
27845
|
-
});
|
|
27846
|
-
/**
|
|
27847
27907
|
* Optional client-side hints sent at session creation to help the provider
|
|
27848
27908
|
* pick the best native source. All fields optional — a viewer that knows
|
|
27849
27909
|
* nothing still gets a sane default. (Relocated from the retired `webrtc`
|
|
@@ -30400,6 +30460,70 @@ onStatusChanged: { data: object({
|
|
|
30400
30460
|
* whether persisting is worth a SQLite commit. */
|
|
30401
30461
|
volatileStateFields: ["lastChangedAt"]
|
|
30402
30462
|
};
|
|
30463
|
+
var DoorbellStatusSchema = object({
|
|
30464
|
+
/** Ms epoch of the last press. null = never observed since this provider started. */
|
|
30465
|
+
lastPressedAt: number().nullable(),
|
|
30466
|
+
/** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
|
|
30467
|
+
pressCountSinceStart: number()
|
|
30468
|
+
});
|
|
30469
|
+
var DoorbellPressEventSchema = object({
|
|
30470
|
+
deviceId: number(),
|
|
30471
|
+
timestamp: number()
|
|
30472
|
+
});
|
|
30473
|
+
/**
|
|
30474
|
+
* Doorbell button cap. Two kinds of provider serve it, and to every consumer
|
|
30475
|
+
* they are the same cap:
|
|
30476
|
+
*
|
|
30477
|
+
* - **Native** providers, registered per device by a driver addon through
|
|
30478
|
+
* `ctx.registerNativeCap` — a `DeviceType.Button` accessory with
|
|
30479
|
+
* `role: DeviceRole.Doorbell`, or the camera itself (Reolink registers at
|
|
30480
|
+
* camera level). They emit `onPressed` on every firmware ring.
|
|
30481
|
+
* - **A composed doorbell** (D670, D671): a camera's customization gives it
|
|
30482
|
+
* the cap, its `lastPressedAt` rising from the sources the operator
|
|
30483
|
+
* assigned in Customize → Doorbell, and the composer emits `onPressed`
|
|
30484
|
+
* from that field's advance (`fromState`).
|
|
30485
|
+
*
|
|
30486
|
+
* The DeviceEventPropagator re-emits `onPressed` on the camera parent.
|
|
30487
|
+
*/
|
|
30488
|
+
var doorbellCapability = {
|
|
30489
|
+
name: "doorbell",
|
|
30490
|
+
scope: "device",
|
|
30491
|
+
deviceNative: true,
|
|
30492
|
+
mode: "singleton",
|
|
30493
|
+
deviceTypes: [DeviceType.Button, DeviceType.Camera],
|
|
30494
|
+
methods: {},
|
|
30495
|
+
events: {
|
|
30496
|
+
/**
|
|
30497
|
+
* Fires once per physical press. Reolink delivers via Baichuan
|
|
30498
|
+
* push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
|
|
30499
|
+
* release/duration — it's a pulse.
|
|
30500
|
+
*/
|
|
30501
|
+
onPressed: {
|
|
30502
|
+
data: DoorbellPressEventSchema,
|
|
30503
|
+
fromState: {
|
|
30504
|
+
field: "lastPressedAt",
|
|
30505
|
+
on: "advance"
|
|
30506
|
+
}
|
|
30507
|
+
} },
|
|
30508
|
+
status: {
|
|
30509
|
+
schema: DoorbellStatusSchema,
|
|
30510
|
+
kind: "push"
|
|
30511
|
+
},
|
|
30512
|
+
/**
|
|
30513
|
+
* Runtime-state slice — last press timestamp + lifetime press count.
|
|
30514
|
+
* Mirrored by the kernel and readable via
|
|
30515
|
+
* `device.state.doorbell.value`. UIs can show "last ring 5m ago"
|
|
30516
|
+
* without subscribing.
|
|
30517
|
+
*/
|
|
30518
|
+
runtimeState: DoorbellStatusSchema,
|
|
30519
|
+
/**
|
|
30520
|
+
* Runtime-state durability: **restored** — a monotonic accumulator: the slice IS the record. `lastPressedAt` is content here, not a clock, so it is deliberately NOT volatile.
|
|
30521
|
+
*
|
|
30522
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
30523
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
30524
|
+
*/
|
|
30525
|
+
durability: "restored"
|
|
30526
|
+
};
|
|
30403
30527
|
/**
|
|
30404
30528
|
* Enum-state sensor — a string value picked from a finite option set.
|
|
30405
30529
|
* Drives HA `sensor` entries with `state_class: enum` (HVAC action
|
|
@@ -32544,9 +32668,9 @@ var MotionStatusSchema = object({
|
|
|
32544
32668
|
/** Ms epoch of the last detected-true observation. Null if never detected. */
|
|
32545
32669
|
lastDetectedAt: number().nullable(),
|
|
32546
32670
|
/**
|
|
32547
|
-
* `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device
|
|
32548
|
-
* `null` while false and on every `Sensor`
|
|
32549
|
-
* constant's doc for the one-authority rule.
|
|
32671
|
+
* `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device (the
|
|
32672
|
+
* orchestrator writes it, D696), `null` while false and on every `Sensor`
|
|
32673
|
+
* device (D475) — see that constant's doc for the one-authority rule.
|
|
32550
32674
|
*
|
|
32551
32675
|
* ## Reading this field still arms nothing
|
|
32552
32676
|
*
|
|
@@ -32564,34 +32688,31 @@ var MotionStatusSchema = object({
|
|
|
32564
32688
|
* `addon-export-alexa/src/motion-clear-hold.ts` and
|
|
32565
32689
|
* `addon-export-hap`'s `RESET_DEBOUNCE_MS` both do.
|
|
32566
32690
|
*
|
|
32567
|
-
* ## Who writes it
|
|
32568
|
-
*
|
|
32569
|
-
* - **Cameras** — the
|
|
32570
|
-
*
|
|
32571
|
-
* `
|
|
32572
|
-
* `
|
|
32573
|
-
*
|
|
32574
|
-
*
|
|
32575
|
-
* a
|
|
32576
|
-
*
|
|
32577
|
-
*
|
|
32578
|
-
*
|
|
32579
|
-
*
|
|
32580
|
-
*
|
|
32581
|
-
*
|
|
32582
|
-
*
|
|
32583
|
-
*
|
|
32584
|
-
*
|
|
32585
|
-
* `
|
|
32586
|
-
*
|
|
32587
|
-
*
|
|
32588
|
-
*
|
|
32589
|
-
*
|
|
32590
|
-
*
|
|
32591
|
-
*
|
|
32592
|
-
* This predates D475 and is not fixed there: the fix touches every
|
|
32593
|
-
* camera provider. Recorded in D475's Consequences. Do not restore the
|
|
32594
|
-
* "sole writer" wording without also removing the other writers.
|
|
32691
|
+
* ## Who writes it (D696)
|
|
32692
|
+
*
|
|
32693
|
+
* - **Cameras** — the orchestrator, and nothing else. It writes the camera's
|
|
32694
|
+
* EFFECTIVE motion (`addon-pipeline-orchestrator`
|
|
32695
|
+
* `camera-sensors/motion-slice.ts`), alongside the effective
|
|
32696
|
+
* `MotionOnMotionChanged` it emits or receives: the camera-sensors bridge
|
|
32697
|
+
* for a split camera, an unsplit emitter's direct event, the analyzer and
|
|
32698
|
+
* device activity, as the camera's `motionSources` counts them. A source
|
|
32699
|
+
* that never sends a clear falls one window after its last `true`.
|
|
32700
|
+
* `lastDetectedAt` moves only on an effective rise. No camera provider
|
|
32701
|
+
* writes this slice (not even a boot seed), and neither does the runner's
|
|
32702
|
+
* phase machine: its phase is "a session is attached" for every on-motion
|
|
32703
|
+
* session, not motion, and it now has its own `DetectionPhaseTransition`.
|
|
32704
|
+
* A provider's `isDetected` answers from the hub's slice.
|
|
32705
|
+
* - **Sensors** (Home Assistant binary sensors, Homematic, Matter, Alexa
|
|
32706
|
+
* imports) — the provider pushes both edges itself, from the upstream
|
|
32707
|
+
* system's own state change. That is the sensor's own fact.
|
|
32708
|
+
*
|
|
32709
|
+
* `scripts/check-onboard-motion-emitters.ts` refuses any other writer of a
|
|
32710
|
+
* `motion` slice; each sensor writer is a named exemption.
|
|
32711
|
+
*
|
|
32712
|
+
* This replaces the D475 §4 rule ("the phase machine is the sole writer").
|
|
32713
|
+
* That rule was never true: Hikvision and Amcrest wrote the slice raw beside
|
|
32714
|
+
* it, every provider seeded it at boot, and every session left it
|
|
32715
|
+
* `detected: true` after its detach.
|
|
32595
32716
|
*/
|
|
32596
32717
|
autoClearAfterMs: number().nullable()
|
|
32597
32718
|
});
|
|
@@ -32663,11 +32784,12 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
|
|
|
32663
32784
|
*/
|
|
32664
32785
|
runtimeState: MotionStatusSchema,
|
|
32665
32786
|
/**
|
|
32666
|
-
* Runtime-state durability: **session** —
|
|
32787
|
+
* Runtime-state durability: **session** — the writer of this slice
|
|
32667
32788
|
* writes only on an EDGE, so a restored `detected: true` would stay
|
|
32668
32789
|
* frozen until the next one instead of being corrected. The next edge
|
|
32669
|
-
* re-publishes the real state
|
|
32670
|
-
*
|
|
32790
|
+
* re-publishes the real state, and the orchestrator re-publishes every
|
|
32791
|
+
* camera when it starts writing (D696; on who writes it, see
|
|
32792
|
+
* `autoClearAfterMs` above).
|
|
32671
32793
|
*
|
|
32672
32794
|
* See `RuntimeStateDurability`. Enforced by
|
|
32673
32795
|
* `scripts/check-runtime-state-durability.ts`.
|
|
@@ -35050,8 +35172,7 @@ var ptzAutotrackCapability = {
|
|
|
35050
35172
|
deviceNative: true,
|
|
35051
35173
|
mode: "singleton",
|
|
35052
35174
|
/**
|
|
35053
|
-
* Two kinds of provider behind one name, the same shape `snapshot`
|
|
35054
|
-
* `doorbell` use:
|
|
35175
|
+
* Two kinds of provider behind one name, the same shape `snapshot` uses:
|
|
35055
35176
|
*
|
|
35056
35177
|
* - **Native**: the camera's own firmware autotrack, registered per device by
|
|
35057
35178
|
* the driver when the probe says it exists (Reolink: yes; Hikvision:
|
|
@@ -35059,7 +35180,7 @@ var ptzAutotrackCapability = {
|
|
|
35059
35180
|
* - **Wrapper**: the emulated implementation (`@camstack/system`'s `autotrack` builtin),
|
|
35060
35181
|
* which follows a subject with `ptz.move` pulses driven by the detection
|
|
35061
35182
|
* pipeline. `defaultActive: false` — the operator binds it per camera in
|
|
35062
|
-
* the bindings UI
|
|
35183
|
+
* the bindings UI.
|
|
35063
35184
|
*
|
|
35064
35185
|
* The binding chooses WHICH implementation answers; `setEnabled` stays the
|
|
35065
35186
|
* one switch for the function either way. A camera never has both driving its
|
|
@@ -43127,6 +43248,18 @@ Object.freeze({
|
|
|
43127
43248
|
addonId: null,
|
|
43128
43249
|
access: "view"
|
|
43129
43250
|
},
|
|
43251
|
+
"databaseSnapshot.listDatabases": {
|
|
43252
|
+
capName: "database-snapshot",
|
|
43253
|
+
capScope: "system",
|
|
43254
|
+
addonId: null,
|
|
43255
|
+
access: "view"
|
|
43256
|
+
},
|
|
43257
|
+
"databaseSnapshot.writeSnapshot": {
|
|
43258
|
+
capName: "database-snapshot",
|
|
43259
|
+
capScope: "system",
|
|
43260
|
+
addonId: null,
|
|
43261
|
+
access: "create"
|
|
43262
|
+
},
|
|
43130
43263
|
"dataStoreProvider.aggregate": {
|
|
43131
43264
|
capName: "data-store-provider",
|
|
43132
43265
|
capScope: "system",
|
|
@@ -51862,6 +51995,18 @@ var STATE_SUMMARY_VARS = [
|
|
|
51862
51995
|
systemEventKinds: [...SUMMARISABLE],
|
|
51863
51996
|
systemEventDeliveries: ["summary"]
|
|
51864
51997
|
},
|
|
51998
|
+
{
|
|
51999
|
+
name: "summarySection",
|
|
52000
|
+
label: "Summary: this section",
|
|
52001
|
+
description: "The section a per-section summary row is about (D698); on a summary sent as one message, every section it reports, comma-separated.",
|
|
52002
|
+
example: "Batterie scariche",
|
|
52003
|
+
group: "system",
|
|
52004
|
+
families: ["rule"],
|
|
52005
|
+
fields: [...RULE_TEXT],
|
|
52006
|
+
kinds: ["system"],
|
|
52007
|
+
systemEventKinds: [...SUMMARISABLE],
|
|
52008
|
+
systemEventDeliveries: ["summary"]
|
|
52009
|
+
},
|
|
51865
52010
|
...STATE_SUMMARY_SECTION_VARS.map((v) => ({
|
|
51866
52011
|
name: v.name,
|
|
51867
52012
|
label: v.label,
|
|
@@ -52200,6 +52345,7 @@ TimelapseRuleInputSchema.extend({
|
|
|
52200
52345
|
createdAt: number(),
|
|
52201
52346
|
updatedAt: number()
|
|
52202
52347
|
});
|
|
52348
|
+
MotionOnMotionChangedDataSchema.omit({ triggeredBy: true });
|
|
52203
52349
|
object({
|
|
52204
52350
|
/**
|
|
52205
52351
|
* Fraction of the box's own size added on EACH side before cutting.
|