@camstack/addon-provider-reolink 1.2.165 → 1.2.167
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 +846 -405
- package/dist/addon.mjs +846 -405
- package/package.json +3 -2
package/dist/addon.mjs
CHANGED
|
@@ -25,7 +25,7 @@ import { mkdir as mkdir$1 } from "fs/promises";
|
|
|
25
25
|
import { spawn as spawn$1 } from "node:child_process";
|
|
26
26
|
import os, { tmpdir } from "node:os";
|
|
27
27
|
import { createReadStream } from "node:fs";
|
|
28
|
-
//#region ../types/dist/event-category-
|
|
28
|
+
//#region ../types/dist/event-category-BGmz_oxW.mjs
|
|
29
29
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
30
30
|
EventCategory["SystemBoot"] = "system.boot";
|
|
31
31
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -558,6 +558,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
558
558
|
*/
|
|
559
559
|
EventCategory["PipelineAudioInferenceResult"] = "pipeline.audio-inference-result";
|
|
560
560
|
EventCategory["DetectionPhaseTransition"] = "detection.phase-transition";
|
|
561
|
+
/**
|
|
562
|
+
* A camera provider's RAW onboard motion push (D673): the `MotionOnMotionChanged`
|
|
563
|
+
* data shape without `triggeredBy`, built by `providerMotionEvent`. Its one
|
|
564
|
+
* consumer is the orchestrator's camera-sensors bridge, which re-emits the
|
|
565
|
+
* camera's EFFECTIVE onboard motion as `MotionOnMotionChanged` (a pass-through
|
|
566
|
+
* for a camera with no attached sensor). Providers must not emit
|
|
567
|
+
* `MotionOnMotionChanged` themselves; `scripts/check-onboard-motion-emitters.ts`
|
|
568
|
+
* keeps it so (camera-grid is a named, deferred exception).
|
|
569
|
+
*/
|
|
561
570
|
EventCategory["ProviderMotion"] = "provider.motion";
|
|
562
571
|
EventCategory["ProviderDetection"] = "provider.detection";
|
|
563
572
|
EventCategory["EnrichmentEmbeddingStored"] = "enrichment.embedding.stored";
|
|
@@ -5396,7 +5405,7 @@ var ZodIssueCode = {
|
|
|
5396
5405
|
var ZodFirstPartyTypeKind;
|
|
5397
5406
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5398
5407
|
//#endregion
|
|
5399
|
-
//#region ../types/dist/sleep-
|
|
5408
|
+
//#region ../types/dist/sleep-CDCONfkt.mjs
|
|
5400
5409
|
/**
|
|
5401
5410
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5402
5411
|
* window to float samples (D455).
|
|
@@ -7487,7 +7496,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
7487
7496
|
return DeviceRole;
|
|
7488
7497
|
}({});
|
|
7489
7498
|
//#endregion
|
|
7490
|
-
//#region ../types/dist/composition-
|
|
7499
|
+
//#region ../types/dist/composition-43aqsZQj.mjs
|
|
7491
7500
|
/**
|
|
7492
7501
|
* The ffmpeg build every CamStack node downloads, per platform and arch.
|
|
7493
7502
|
*
|
|
@@ -7544,13 +7553,12 @@ portable("linux64"), portable("linuxarm64"), portable("macarm64"), portable("mac
|
|
|
7544
7553
|
* LA tabella "quale booleano di questo tipo di device conta come ALTO", e il
|
|
7545
7554
|
* valutatore puro del suo FRONTE.
|
|
7546
7555
|
*
|
|
7547
|
-
*
|
|
7548
|
-
*
|
|
7549
|
-
*
|
|
7550
|
-
*
|
|
7551
|
-
*
|
|
7552
|
-
* fa suonare il campanello ma non registra" — è esattamente D62.
|
|
7553
|
-
* SPOSTA qui e il doorbell la ri-esporta.
|
|
7556
|
+
* UNA tabella per tutti quelli che chiedono "questo device è ALTO?": il
|
|
7557
|
+
* trigger `RecordingTriggers.sensorDeviceIds` del recorder, i marker dei
|
|
7558
|
+
* sensori della post-analysis, il bridge camera-sensors dell'orchestratore e
|
|
7559
|
+
* le sorgenti di un campanello composto (`doorbellFeatureSources`, D671).
|
|
7560
|
+
* Una seconda copia divergerebbe alla prima cap aggiunta, e il sintomo — "il
|
|
7561
|
+
* sensore fa suonare il campanello ma non registra" — è esattamente D62.
|
|
7554
7562
|
*
|
|
7555
7563
|
* ⚠ NON è `DEVICE_STATE_READERS` (`catalogs/device-state-vocabulary.ts`), e le
|
|
7556
7564
|
* due non vanno unificate: quella risponde a "qual è la PAROLA di stato per una
|
|
@@ -7576,8 +7584,6 @@ var SOURCE_CAP_ACTIVE_FIELD = {
|
|
|
7576
7584
|
vibration: "detected",
|
|
7577
7585
|
tamper: "tampered"
|
|
7578
7586
|
};
|
|
7579
|
-
/** Cap names whose presence in a device's bindings qualify it as a source. */
|
|
7580
|
-
var SOURCE_CAPS = Object.keys(SOURCE_CAP_ACTIVE_FIELD);
|
|
7581
7587
|
/**
|
|
7582
7588
|
* Error types for the safe expression engine. Two distinct classes so callers
|
|
7583
7589
|
* can tell a compile-time (grammar) failure from a runtime (evaluation)
|
|
@@ -9033,6 +9039,82 @@ var ArchivedDebugNoteQueryInputSchema = object({
|
|
|
9033
9039
|
/** Max rows returned, newest-first. */
|
|
9034
9040
|
limit: number().int().min(1).max(1e3).optional()
|
|
9035
9041
|
});
|
|
9042
|
+
var TrackRelationKindSchema = _enum(["same-subject", "different-subjects"]);
|
|
9043
|
+
var TrackSideSchema = _enum(["before", "after"]);
|
|
9044
|
+
var TrackPurityValueSchema = _enum(["mixed", "not-a-subject"]);
|
|
9045
|
+
var TrackRelationSchema = object({
|
|
9046
|
+
id: string(),
|
|
9047
|
+
deviceId: number().int(),
|
|
9048
|
+
leftTrackId: string(),
|
|
9049
|
+
rightTrackId: string(),
|
|
9050
|
+
leftSide: TrackSideSchema.nullable(),
|
|
9051
|
+
rightSide: TrackSideSchema.nullable(),
|
|
9052
|
+
relation: TrackRelationKindSchema,
|
|
9053
|
+
presence: literal("continuous").nullable(),
|
|
9054
|
+
leftStartedAt: number().int().nullable(),
|
|
9055
|
+
rightStartedAt: number().int().nullable(),
|
|
9056
|
+
createdAt: number().int(),
|
|
9057
|
+
updatedAt: number().int(),
|
|
9058
|
+
author: string().nullable()
|
|
9059
|
+
});
|
|
9060
|
+
var TrackPuritySchema = object({
|
|
9061
|
+
id: string(),
|
|
9062
|
+
deviceId: number().int(),
|
|
9063
|
+
sourceTrackId: string(),
|
|
9064
|
+
purity: TrackPurityValueSchema,
|
|
9065
|
+
switchAtMs: number().int().nullable(),
|
|
9066
|
+
startedAt: number().int().nullable(),
|
|
9067
|
+
createdAt: number().int(),
|
|
9068
|
+
updatedAt: number().int(),
|
|
9069
|
+
author: string().nullable()
|
|
9070
|
+
});
|
|
9071
|
+
var SetTrackRelationInputSchema = object({
|
|
9072
|
+
deviceId: number().int(),
|
|
9073
|
+
trackId: string().min(1),
|
|
9074
|
+
otherTrackId: string().min(1),
|
|
9075
|
+
relation: TrackRelationKindSchema,
|
|
9076
|
+
presence: literal("continuous").optional(),
|
|
9077
|
+
trackSide: TrackSideSchema.optional(),
|
|
9078
|
+
otherSide: TrackSideSchema.optional()
|
|
9079
|
+
});
|
|
9080
|
+
var ClearTrackRelationInputSchema = object({
|
|
9081
|
+
deviceId: number().int(),
|
|
9082
|
+
trackId: string().min(1),
|
|
9083
|
+
otherTrackId: string().min(1)
|
|
9084
|
+
});
|
|
9085
|
+
var ClearTrackRelationResultSchema = object({ cleared: boolean() });
|
|
9086
|
+
var SetTrackPurityInputSchema = object({
|
|
9087
|
+
deviceId: number().int(),
|
|
9088
|
+
trackId: string().min(1),
|
|
9089
|
+
purity: _enum([
|
|
9090
|
+
"pure",
|
|
9091
|
+
"mixed",
|
|
9092
|
+
"not-a-subject"
|
|
9093
|
+
]),
|
|
9094
|
+
switchAtMs: number().int().optional()
|
|
9095
|
+
});
|
|
9096
|
+
/** `null` when `pure` cleared the row. */
|
|
9097
|
+
var SetTrackPurityResultSchema = object({ purity: TrackPuritySchema.nullable() });
|
|
9098
|
+
var ListTrackRelationsInputSchema = object({
|
|
9099
|
+
deviceId: number().int(),
|
|
9100
|
+
trackId: string().optional(),
|
|
9101
|
+
since: number().int().optional(),
|
|
9102
|
+
until: number().int().optional(),
|
|
9103
|
+
limit: number().int().min(1).max(5e3).optional()
|
|
9104
|
+
});
|
|
9105
|
+
var ListTrackRelationsResultSchema = object({
|
|
9106
|
+
relations: array(TrackRelationSchema).readonly(),
|
|
9107
|
+
purities: array(TrackPuritySchema).readonly(),
|
|
9108
|
+
truncated: boolean()
|
|
9109
|
+
});
|
|
9110
|
+
_enum([
|
|
9111
|
+
"unknown-track",
|
|
9112
|
+
"cross-device",
|
|
9113
|
+
"self-relation",
|
|
9114
|
+
"contradiction",
|
|
9115
|
+
"switch-outside-track",
|
|
9116
|
+
"switch-needs-mixed"
|
|
9117
|
+
]);
|
|
9036
9118
|
/**
|
|
9037
9119
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
9038
9120
|
* recordings and events management surfaces.
|
|
@@ -9231,7 +9313,7 @@ var RecordingTriggersSchema = object({
|
|
|
9231
9313
|
*
|
|
9232
9314
|
* Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
|
|
9233
9315
|
* `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
|
|
9234
|
-
* la stessa
|
|
9316
|
+
* la stessa del campanello composto (D671). Ed è il FRONTE, non
|
|
9235
9317
|
* il livello: un contatto trovato già aperto al riavvio del runner non fa
|
|
9236
9318
|
* registrare.
|
|
9237
9319
|
*/
|
|
@@ -12118,6 +12200,68 @@ method(object({
|
|
|
12118
12200
|
password: string()
|
|
12119
12201
|
}), AuthResultSchema.nullable(), { kind: "mutation" }), method(object({ state: string() }), string()), method(record(string(), string()), AuthResultSchema, { kind: "mutation" }), method(object({ token: string() }), AuthResultSchema.nullable());
|
|
12120
12202
|
/**
|
|
12203
|
+
* How long one snapshot may take end to end: the pinned copy of the whole
|
|
12204
|
+
* database plus `PRAGMA integrity_check` over the copy, on the hub's slowest
|
|
12205
|
+
* disk. ~800 MB at a pessimistic 10 MB/s is under 3 minutes; the bound is
|
|
12206
|
+
* generous because a timeout fails the whole backup run.
|
|
12207
|
+
*/
|
|
12208
|
+
var DATABASE_SNAPSHOT_TIMEOUT_MS = 30 * 6e4;
|
|
12209
|
+
/**
|
|
12210
|
+
* The databases an owner snapshots — declared by the OWNER, so a caller never
|
|
12211
|
+
* guesses which file is live from what sits beside it (a cleanly closed
|
|
12212
|
+
* database has no sidecars and is just as owned). Paths are absolute on the
|
|
12213
|
+
* owner's host.
|
|
12214
|
+
*/
|
|
12215
|
+
var DatabaseSnapshotTargetsSchema = object({ databases: array(object({ livePath: string() })) });
|
|
12216
|
+
/** One b-tree table of the snapshot and the rows it holds. */
|
|
12217
|
+
var DatabaseSnapshotTableSchema = object({
|
|
12218
|
+
name: string(),
|
|
12219
|
+
rows: number().int().nonnegative()
|
|
12220
|
+
});
|
|
12221
|
+
/**
|
|
12222
|
+
* What the owner wrote. Every path is ABSOLUTE on the owner's host — the
|
|
12223
|
+
* caller pins the call to its own node, so it can read the file; a caller
|
|
12224
|
+
* that finds the path outside its own data root refuses it rather than
|
|
12225
|
+
* archiving something it cannot place.
|
|
12226
|
+
*/
|
|
12227
|
+
var DatabaseSnapshotResultSchema = object({
|
|
12228
|
+
/** The live database the snapshot copies. Never to be copied as a file. */
|
|
12229
|
+
livePath: string(),
|
|
12230
|
+
/** The verified copy: `<livePath>` + {@link DATABASE_SNAPSHOT_SUFFIX}. */
|
|
12231
|
+
snapshotPath: string(),
|
|
12232
|
+
sizeBytes: number().int().nonnegative(),
|
|
12233
|
+
pageCount: number().int().nonnegative(),
|
|
12234
|
+
pageSize: number().int().positive(),
|
|
12235
|
+
/**
|
|
12236
|
+
* Every b-tree table with its row count. Read inside the SAME read
|
|
12237
|
+
* transaction the copy was taken from, and found EQUAL on the copy — so
|
|
12238
|
+
* this is the content of the snapshot, not an estimate of the source.
|
|
12239
|
+
*/
|
|
12240
|
+
tables: array(DatabaseSnapshotTableSchema),
|
|
12241
|
+
/** Wall time of the pinned copy (row counts included). */
|
|
12242
|
+
copyMs: number().nonnegative(),
|
|
12243
|
+
/** Wall time of the checks on the copy (`integrity_check`, row counts). */
|
|
12244
|
+
verifyMs: number().nonnegative(),
|
|
12245
|
+
/** When the pinned read transaction began (ms epoch) — the snapshot's instant. */
|
|
12246
|
+
takenAt: number()
|
|
12247
|
+
});
|
|
12248
|
+
/**
|
|
12249
|
+
* A snapshot as an ARCHIVE records it (`ArchiveManifest.sqliteSnapshots`):
|
|
12250
|
+
* the same facts, with both paths relative to the archive root (the node's
|
|
12251
|
+
* data dir), because an archive outlives the host that made it.
|
|
12252
|
+
*/
|
|
12253
|
+
var ArchiveSqliteSnapshotSchema = DatabaseSnapshotResultSchema.extend({
|
|
12254
|
+
/** Archive-relative path of the live database the archive does NOT carry. */
|
|
12255
|
+
livePath: string(),
|
|
12256
|
+
/** Archive-relative path of the verified copy it carries in its place. */
|
|
12257
|
+
snapshotPath: string()
|
|
12258
|
+
});
|
|
12259
|
+
method(object({}), DatabaseSnapshotTargetsSchema, { auth: "admin" }), method(object({}), DatabaseSnapshotResultSchema, {
|
|
12260
|
+
kind: "mutation",
|
|
12261
|
+
auth: "admin",
|
|
12262
|
+
timeoutMs: DATABASE_SNAPSHOT_TIMEOUT_MS
|
|
12263
|
+
});
|
|
12264
|
+
/**
|
|
12121
12265
|
* Orchestrator-side destination metadata. The orchestrator computes
|
|
12122
12266
|
* `id = <addonId>:<subId>` from its provider lookup so consumers
|
|
12123
12267
|
* (admin UI, restore flow) see one canonical key.
|
|
@@ -12228,7 +12372,12 @@ var ArchiveManifestSchema = object({
|
|
|
12228
12372
|
locations: array(string()),
|
|
12229
12373
|
entries: array(ArchiveEntrySchema),
|
|
12230
12374
|
totalBytes: number(),
|
|
12231
|
-
totalFiles: number()
|
|
12375
|
+
totalFiles: number(),
|
|
12376
|
+
/**
|
|
12377
|
+
* Live SQLite databases this archive carries as their OWNER's verified
|
|
12378
|
+
* snapshot instead of as files (D693). Absent on archives made before.
|
|
12379
|
+
*/
|
|
12380
|
+
sqliteSnapshots: array(ArchiveSqliteSnapshotSchema).optional()
|
|
12232
12381
|
});
|
|
12233
12382
|
var LocationStatSchema = object({
|
|
12234
12383
|
name: string(),
|
|
@@ -13754,6 +13903,116 @@ var CompositionBlockStateSchema = object({
|
|
|
13754
13903
|
reason: string().optional(),
|
|
13755
13904
|
fields: array(CompositionFieldStateSchema)
|
|
13756
13905
|
});
|
|
13906
|
+
var ComposerBlockSchema = object({
|
|
13907
|
+
id: string().min(1),
|
|
13908
|
+
name: string().min(1).max(120),
|
|
13909
|
+
enabled: boolean(),
|
|
13910
|
+
updatedAt: number(),
|
|
13911
|
+
composition: CompositionSchema
|
|
13912
|
+
});
|
|
13913
|
+
/**
|
|
13914
|
+
* A stored composition row that no longer PARSES — a schema a release
|
|
13915
|
+
* tightened, a row written by a newer build. Sent by id so the composer keeps
|
|
13916
|
+
* its device as a placeholder and reports the block `failed` naming the parse
|
|
13917
|
+
* error. Leaving it out would read, twice, exactly like a delete (D49).
|
|
13918
|
+
*/
|
|
13919
|
+
var ComposerUnreadableBlockSchema = object({
|
|
13920
|
+
id: string().min(1),
|
|
13921
|
+
/** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
|
|
13922
|
+
name: string().nullable(),
|
|
13923
|
+
/** The parse error, in the operator's words. */
|
|
13924
|
+
error: string()
|
|
13925
|
+
});
|
|
13926
|
+
method(object({
|
|
13927
|
+
/** The shared Blocks integration; null until `core-blocks` has reconciled it. */
|
|
13928
|
+
integrationId: string().nullable(),
|
|
13929
|
+
/** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
|
|
13930
|
+
storeLoaded: boolean(),
|
|
13931
|
+
blocks: array(ComposerBlockSchema),
|
|
13932
|
+
/** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
|
|
13933
|
+
restartBlockIds: array(string()),
|
|
13934
|
+
/** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
|
|
13935
|
+
unreadableBlocks: array(ComposerUnreadableBlockSchema)
|
|
13936
|
+
}), object({
|
|
13937
|
+
blocks: array(object({
|
|
13938
|
+
blockId: string(),
|
|
13939
|
+
status: CompositionRunStatusSchema,
|
|
13940
|
+
reason: string().optional()
|
|
13941
|
+
})),
|
|
13942
|
+
/**
|
|
13943
|
+
* False when the composer declared and withdrew NOTHING (store not loaded,
|
|
13944
|
+
* integration unknown, its own rows unread or read empty once). An empty
|
|
13945
|
+
* apply the caller owes is paid off only by one the composer acted on (D49).
|
|
13946
|
+
*/
|
|
13947
|
+
acted: boolean()
|
|
13948
|
+
}), {
|
|
13949
|
+
kind: "mutation",
|
|
13950
|
+
auth: "admin"
|
|
13951
|
+
}), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
|
|
13952
|
+
var NUMBER = {
|
|
13953
|
+
kind: "fixed",
|
|
13954
|
+
result: ["number"]
|
|
13955
|
+
};
|
|
13956
|
+
var BOOLEAN = {
|
|
13957
|
+
kind: "fixed",
|
|
13958
|
+
result: ["boolean"]
|
|
13959
|
+
};
|
|
13960
|
+
Object.freeze({
|
|
13961
|
+
min: NUMBER,
|
|
13962
|
+
max: NUMBER,
|
|
13963
|
+
abs: NUMBER,
|
|
13964
|
+
floor: NUMBER,
|
|
13965
|
+
ceil: NUMBER,
|
|
13966
|
+
sqrt: NUMBER,
|
|
13967
|
+
round: NUMBER,
|
|
13968
|
+
pow: NUMBER,
|
|
13969
|
+
clamp: NUMBER,
|
|
13970
|
+
avg: NUMBER,
|
|
13971
|
+
sum: NUMBER,
|
|
13972
|
+
age: NUMBER,
|
|
13973
|
+
convert: NUMBER,
|
|
13974
|
+
coalesce: { kind: "coalesce" },
|
|
13975
|
+
any: BOOLEAN,
|
|
13976
|
+
all: BOOLEAN,
|
|
13977
|
+
within: BOOLEAN,
|
|
13978
|
+
latest: {
|
|
13979
|
+
kind: "fixed",
|
|
13980
|
+
result: ["number", "null"]
|
|
13981
|
+
},
|
|
13982
|
+
number: {
|
|
13983
|
+
kind: "fixed",
|
|
13984
|
+
result: ["number", "null"]
|
|
13985
|
+
},
|
|
13986
|
+
rose: {
|
|
13987
|
+
kind: "fixed",
|
|
13988
|
+
result: ["number", "null"]
|
|
13989
|
+
},
|
|
13990
|
+
count: NUMBER
|
|
13991
|
+
});
|
|
13992
|
+
`${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
|
|
13993
|
+
/**
|
|
13994
|
+
* What a composition may BUILD on a device type (G2, D676): the caps a new
|
|
13995
|
+
* device of that type, or an existing one that lacks them, can be given. The
|
|
13996
|
+
* blockers are the validator's own refusal codes, and a spec compares this
|
|
13997
|
+
* listing with `planComposition` for every capability — the editor can never
|
|
13998
|
+
* offer a feature the save would refuse for the same reason.
|
|
13999
|
+
*/
|
|
14000
|
+
var ComposableFieldSchema = object({
|
|
14001
|
+
path: string(),
|
|
14002
|
+
kind: CompositionFieldKindSchema,
|
|
14003
|
+
nullable: boolean(),
|
|
14004
|
+
required: boolean(),
|
|
14005
|
+
enumValues: array(string()).optional()
|
|
14006
|
+
});
|
|
14007
|
+
var ComposableCapabilitiesSchema = object({ caps: array(object({
|
|
14008
|
+
cap: string(),
|
|
14009
|
+
fields: array(ComposableFieldSchema),
|
|
14010
|
+
/** Present for an item-array cap (`consumables.items`). */
|
|
14011
|
+
itemArray: object({
|
|
14012
|
+
path: string(),
|
|
14013
|
+
keyField: string()
|
|
14014
|
+
}).optional()
|
|
14015
|
+
})) });
|
|
13757
14016
|
/** Where a block runs. The operator chooses — a block driving a device on an
|
|
13758
14017
|
* agent is the reason placement is not fixed to the hub. */
|
|
13759
14018
|
var CoreBlockPlacementSchema = union([literal("hub"), string().min(1)]);
|
|
@@ -13918,7 +14177,7 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
|
|
|
13918
14177
|
}), method(object({ blockId: string() }), CompositionGetReadSchema, { auth: "admin" }), method(object({}), CompositionListReadSchema, { auth: "admin" }), method(object({
|
|
13919
14178
|
addonId: string().min(1),
|
|
13920
14179
|
stableId: string().min(1)
|
|
13921
|
-
}), CompositionCustomizationReadSchema, { auth: "admin" }), method(object({
|
|
14180
|
+
}), CompositionCustomizationReadSchema, { auth: "admin" }), method(object({ deviceType: _enum(DeviceType) }), ComposableCapabilitiesSchema, { auth: "admin" }), method(object({
|
|
13922
14181
|
composition: CompositionSchema,
|
|
13923
14182
|
blockId: string().optional()
|
|
13924
14183
|
}), CompositionValidationSchema, {
|
|
@@ -13926,52 +14185,6 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
|
|
|
13926
14185
|
auth: "admin",
|
|
13927
14186
|
access: "view"
|
|
13928
14187
|
});
|
|
13929
|
-
var ComposerBlockSchema = object({
|
|
13930
|
-
id: string().min(1),
|
|
13931
|
-
name: string().min(1).max(120),
|
|
13932
|
-
enabled: boolean(),
|
|
13933
|
-
updatedAt: number(),
|
|
13934
|
-
composition: CompositionSchema
|
|
13935
|
-
});
|
|
13936
|
-
/**
|
|
13937
|
-
* A stored composition row that no longer PARSES — a schema a release
|
|
13938
|
-
* tightened, a row written by a newer build. Sent by id so the composer keeps
|
|
13939
|
-
* its device as a placeholder and reports the block `failed` naming the parse
|
|
13940
|
-
* error. Leaving it out would read, twice, exactly like a delete (D49).
|
|
13941
|
-
*/
|
|
13942
|
-
var ComposerUnreadableBlockSchema = object({
|
|
13943
|
-
id: string().min(1),
|
|
13944
|
-
/** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
|
|
13945
|
-
name: string().nullable(),
|
|
13946
|
-
/** The parse error, in the operator's words. */
|
|
13947
|
-
error: string()
|
|
13948
|
-
});
|
|
13949
|
-
method(object({
|
|
13950
|
-
/** The shared Blocks integration; null until `core-blocks` has reconciled it. */
|
|
13951
|
-
integrationId: string().nullable(),
|
|
13952
|
-
/** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
|
|
13953
|
-
storeLoaded: boolean(),
|
|
13954
|
-
blocks: array(ComposerBlockSchema),
|
|
13955
|
-
/** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
|
|
13956
|
-
restartBlockIds: array(string()),
|
|
13957
|
-
/** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
|
|
13958
|
-
unreadableBlocks: array(ComposerUnreadableBlockSchema)
|
|
13959
|
-
}), object({
|
|
13960
|
-
blocks: array(object({
|
|
13961
|
-
blockId: string(),
|
|
13962
|
-
status: CompositionRunStatusSchema,
|
|
13963
|
-
reason: string().optional()
|
|
13964
|
-
})),
|
|
13965
|
-
/**
|
|
13966
|
-
* False when the composer declared and withdrew NOTHING (store not loaded,
|
|
13967
|
-
* integration unknown, its own rows unread or read empty once). An empty
|
|
13968
|
-
* apply the caller owes is paid off only by one the composer acted on (D49).
|
|
13969
|
-
*/
|
|
13970
|
-
acted: boolean()
|
|
13971
|
-
}), {
|
|
13972
|
-
kind: "mutation",
|
|
13973
|
-
auth: "admin"
|
|
13974
|
-
}), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
|
|
13975
14188
|
/**
|
|
13976
14189
|
* `custom-model-registry` — collection cap exposing operator-registered
|
|
13977
14190
|
* custom detection models. Each provider (today: `addon-model-studio`)
|
|
@@ -16121,6 +16334,121 @@ method(object({
|
|
|
16121
16334
|
deviceIds: array(number()).readonly(),
|
|
16122
16335
|
caps: array(string()).readonly().optional()
|
|
16123
16336
|
}), record(string(), record(string(), unknown().nullable())));
|
|
16337
|
+
var ExtensionSlotIdSchema = _enum(["linked-devices"]);
|
|
16338
|
+
DeviceType.Camera;
|
|
16339
|
+
/** A slot's editable value, discriminated on `slot`. */
|
|
16340
|
+
var ExtensionSlotValueSchema = discriminatedUnion("slot", [LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
|
|
16341
|
+
DeviceType.Camera;
|
|
16342
|
+
var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
|
|
16343
|
+
state: literal("unreachable"),
|
|
16344
|
+
reason: string()
|
|
16345
|
+
})]);
|
|
16346
|
+
/** One provider of slots — the D554 source-listing row. */
|
|
16347
|
+
var ExtensionSourceSchema = object({
|
|
16348
|
+
/** The routing prefix of every `slotRef` this provider serves. */
|
|
16349
|
+
source: string(),
|
|
16350
|
+
label: string(),
|
|
16351
|
+
/** Stamped by the dispatcher from the registry (D557). */
|
|
16352
|
+
addonId: string().optional(),
|
|
16353
|
+
availability: ExtensionSourceAvailabilitySchema
|
|
16354
|
+
});
|
|
16355
|
+
/**
|
|
16356
|
+
* How one picked source stands. `missing` — no such device (deleted, or an id
|
|
16357
|
+
* that never existed); `foreign` — a device the slot's owner cannot read from
|
|
16358
|
+
* (a source owned by another addon); `unavailable` — it exists but is not a
|
|
16359
|
+
* valid source now (a container, which is never a pick). A source in any of
|
|
16360
|
+
* these states is SHOWN, never silently dropped or re-pointed.
|
|
16361
|
+
*/
|
|
16362
|
+
var ExtensionSourceHealthSchema = _enum([
|
|
16363
|
+
"ok",
|
|
16364
|
+
"missing",
|
|
16365
|
+
"foreign",
|
|
16366
|
+
"unavailable"
|
|
16367
|
+
]);
|
|
16368
|
+
var ExtensionSlotSourceSchema = object({
|
|
16369
|
+
deviceId: number().int(),
|
|
16370
|
+
/** The device's name, or null when it could not be resolved (`missing`). */
|
|
16371
|
+
name: string().nullable(),
|
|
16372
|
+
health: ExtensionSourceHealthSchema,
|
|
16373
|
+
detail: string().optional()
|
|
16374
|
+
});
|
|
16375
|
+
/**
|
|
16376
|
+
* A DIFFERENT authority that gates whether the slot's sources do anything —
|
|
16377
|
+
* reported read-only, named, never written through this contract (D62) — e.g.
|
|
16378
|
+
* a slot whose sources act only while a wrapper is bound to the host, a
|
|
16379
|
+
* binding that belongs to `deviceManager.setWrapperActive`. No slot reports
|
|
16380
|
+
* one today (`linked-devices` answers `null`). `unknown` means the gate could
|
|
16381
|
+
* not be read; it is not "inactive" (D315).
|
|
16382
|
+
*/
|
|
16383
|
+
var ExtensionSlotActivationSchema = object({
|
|
16384
|
+
state: _enum([
|
|
16385
|
+
"active",
|
|
16386
|
+
"inactive",
|
|
16387
|
+
"unknown"
|
|
16388
|
+
]),
|
|
16389
|
+
authority: string(),
|
|
16390
|
+
detail: string().optional()
|
|
16391
|
+
});
|
|
16392
|
+
var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
|
|
16393
|
+
state: literal("ok"),
|
|
16394
|
+
/** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
|
|
16395
|
+
slotRef: string(),
|
|
16396
|
+
slot: ExtensionSlotIdSchema,
|
|
16397
|
+
/** Names the store written (D62), e.g. `device-manager:_linkedDeviceIds`. */
|
|
16398
|
+
authority: string(),
|
|
16399
|
+
activation: ExtensionSlotActivationSchema.nullable(),
|
|
16400
|
+
value: ExtensionSlotValueSchema,
|
|
16401
|
+
sources: array(ExtensionSlotSourceSchema),
|
|
16402
|
+
/**
|
|
16403
|
+
* Devices the owner links to the host ON ITS OWN, by structure, and that
|
|
16404
|
+
* are therefore not in `value` (D655): a camera's device-tree children, and
|
|
16405
|
+
* the child a picked container stands for (D356 — a container is never a
|
|
16406
|
+
* pick, its children are). Read-only; the editor shows them and may offer
|
|
16407
|
+
* per-device options on them (the linked-devices tracked-event opt-in).
|
|
16408
|
+
* Absent when the owner links nothing beyond the picks, and from an owner
|
|
16409
|
+
* older than D655.
|
|
16410
|
+
*/
|
|
16411
|
+
impliedSources: array(ExtensionSlotSourceSchema).optional()
|
|
16412
|
+
}), object({
|
|
16413
|
+
state: literal("unreachable"),
|
|
16414
|
+
addonId: string(),
|
|
16415
|
+
reason: string()
|
|
16416
|
+
})]);
|
|
16417
|
+
var ExtensionCandidatesSchema = object({ candidates: array(object({
|
|
16418
|
+
deviceId: number().int(),
|
|
16419
|
+
name: string(),
|
|
16420
|
+
type: string(),
|
|
16421
|
+
location: string().nullable(),
|
|
16422
|
+
/** The container a child belongs to — "Spotlight 2" alone does not say which. */
|
|
16423
|
+
parentName: string().nullable(),
|
|
16424
|
+
/** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
|
|
16425
|
+
suggested: boolean(),
|
|
16426
|
+
/** Why it is suggested ("same location"), null when it is not. */
|
|
16427
|
+
reason: string().nullable()
|
|
16428
|
+
})) });
|
|
16429
|
+
/**
|
|
16430
|
+
* What a write did. `none` — applied in place. `host` / `parent` — the owner
|
|
16431
|
+
* reloaded the host (or, for an accessory child, its parent) because the
|
|
16432
|
+
* write changed what the host REGISTERS. A slot never adds a capability to its
|
|
16433
|
+
* host — that is a composition (D663) — so today's owners answer `none`.
|
|
16434
|
+
*/
|
|
16435
|
+
var ExtensionSetResultSchema = object({
|
|
16436
|
+
applied: literal(true),
|
|
16437
|
+
reload: _enum([
|
|
16438
|
+
"none",
|
|
16439
|
+
"host",
|
|
16440
|
+
"parent"
|
|
16441
|
+
])
|
|
16442
|
+
});
|
|
16443
|
+
var ExtensionSlotRefInputSchema = object({
|
|
16444
|
+
deviceId: number().int(),
|
|
16445
|
+
slotRef: string().min(1)
|
|
16446
|
+
});
|
|
16447
|
+
var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
|
|
16448
|
+
method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)), method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)), method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema), method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
|
|
16449
|
+
kind: "mutation",
|
|
16450
|
+
auth: "admin"
|
|
16451
|
+
});
|
|
16124
16452
|
/**
|
|
16125
16453
|
* Per-field ownership (D663). A composition may CLAIM fields of a native
|
|
16126
16454
|
* cap's runtime-state slice on an existing device: `replace` overlays the
|
|
@@ -19171,17 +19499,25 @@ var NcScheduleSchema = object({
|
|
|
19171
19499
|
*/
|
|
19172
19500
|
var NcSystemEventDeliveryModeSchema = _enum(["instant", "summary"]);
|
|
19173
19501
|
/**
|
|
19502
|
+
* How a summary window is SENT (D698): `rule` (absent) = ONE notification with
|
|
19503
|
+
* every section; `section` = one notification per section with something to
|
|
19504
|
+
* say (an unavailable section included), each titled by its section.
|
|
19505
|
+
*/
|
|
19506
|
+
var NcStateSummarySplitSchema = _enum(["rule", "section"]);
|
|
19507
|
+
/**
|
|
19174
19508
|
* `summary`: the rule sends NOTHING per event. When a window of `schedule`
|
|
19175
19509
|
* CLOSES, it sends one notification with the current state of its kinds
|
|
19176
19510
|
* (low batteries, consumables to replace, devices offline, updates
|
|
19177
|
-
* available, ...), after its own filters
|
|
19511
|
+
* available, ...), after its own filters — or, with `split: 'section'`
|
|
19512
|
+
* (D698), one notification per section. Nothing to report sends nothing.
|
|
19178
19513
|
* The schedule is the ordinary `NcSchedule` (weekly windows, IANA timezone,
|
|
19179
19514
|
* midnight crossing); the send time is each window's END. Refused on the
|
|
19180
19515
|
* `alarm` family, which stays instant (`systemEventDeliveryProblems`).
|
|
19181
19516
|
*/
|
|
19182
19517
|
var NcSystemEventDeliverySchema = discriminatedUnion("mode", [object({ mode: literal("instant") }), object({
|
|
19183
19518
|
mode: literal("summary"),
|
|
19184
|
-
schedule: NcScheduleSchema
|
|
19519
|
+
schedule: NcScheduleSchema,
|
|
19520
|
+
split: NcStateSummarySplitSchema.optional()
|
|
19185
19521
|
})]);
|
|
19186
19522
|
/** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
|
|
19187
19523
|
var NcPlateMatcherSchema = object({
|
|
@@ -19321,8 +19657,14 @@ var NcSensorTransitionSchema = _enum(["raised", "cleared"]);
|
|
|
19321
19657
|
/** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
|
|
19322
19658
|
var NcZoneConditionSchema = object({
|
|
19323
19659
|
ids: array(string().min(1)).min(1),
|
|
19324
|
-
/**
|
|
19325
|
-
|
|
19660
|
+
/**
|
|
19661
|
+
* LEGACY quantifier over `ids`. Absent = `any` (at least one visited), which
|
|
19662
|
+
* is what both editors mean and all they write since D690: "all of" was
|
|
19663
|
+
* removed from the editors because on an immediate rule it asked one
|
|
19664
|
+
* detection to stand in every zone at once. Still ACCEPTED, and `all` still
|
|
19665
|
+
* evaluated, so a stored rule keeps parsing and meaning what it meant.
|
|
19666
|
+
*/
|
|
19667
|
+
match: _enum(["any", "all"]).optional()
|
|
19326
19668
|
});
|
|
19327
19669
|
/**
|
|
19328
19670
|
* The P1 condition set — a flat AND of groups; absent group = pass;
|
|
@@ -19826,10 +20168,12 @@ var NcMediaPolicySchema = object({
|
|
|
19826
20168
|
/**
|
|
19827
20169
|
* Cooldown GRANULARITY over the subject's class — how much a fired
|
|
19828
20170
|
* notification suppresses.
|
|
19829
|
-
* - `
|
|
19830
|
-
*
|
|
19831
|
-
*
|
|
19832
|
-
*
|
|
20171
|
+
* - `per-class` (default, and the absent value since 2026-10-01 — D36) — an
|
|
20172
|
+
* independent window per detected class: cat→dog fires at once, cat→cat
|
|
20173
|
+
* still waits.
|
|
20174
|
+
* - `shared` — one window for the whole rule/scope: a cat silences the next
|
|
20175
|
+
* dog for `cooldownSec`. Only written when an operator picks it; it is no
|
|
20176
|
+
* longer what an unset rule means.
|
|
19833
20177
|
*
|
|
19834
20178
|
* AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
|
|
19835
20179
|
* must not be swallowed by a bark's window (the precedent this generalizes —
|
|
@@ -19844,8 +20188,11 @@ var NcThrottleSchema = object({
|
|
|
19844
20188
|
/**
|
|
19845
20189
|
* Class granularity of the cooldown key. Optional rather than defaulted:
|
|
19846
20190
|
* a Zod default does NOT run on the addon→addon cap path, so a persisted
|
|
19847
|
-
* rule authored before this field simply carries none
|
|
19848
|
-
*
|
|
20191
|
+
* rule authored before this field simply carries none. The engine used to
|
|
20192
|
+
* read absent as `shared` (D36); since 2026-10-01 it reads absent as
|
|
20193
|
+
* `per-class` — the operator's default — and only an explicit `shared`
|
|
20194
|
+
* still means `shared`. See `cooldownKey` / `keysPerClass` in the rule
|
|
20195
|
+
* engine, and D36's dated note.
|
|
19849
20196
|
*/
|
|
19850
20197
|
granularity: NcThrottleGranularitySchema.optional()
|
|
19851
20198
|
});
|
|
@@ -20169,11 +20516,23 @@ var NcStateSummaryPreviewSectionSchema = object({
|
|
|
20169
20516
|
reason: string().optional()
|
|
20170
20517
|
});
|
|
20171
20518
|
/**
|
|
20519
|
+
* One notification a previewed summary would send (D698): the whole summary on
|
|
20520
|
+
* a `rule` split (no `section`), one section's on a `section` split.
|
|
20521
|
+
*/
|
|
20522
|
+
var NcStateSummaryPreviewRowSchema = object({
|
|
20523
|
+
section: string().optional(),
|
|
20524
|
+
/** The section's name on a per-section row; every reported section's, joined, on a combined one. */
|
|
20525
|
+
title: string(),
|
|
20526
|
+
text: string(),
|
|
20527
|
+
count: number().int().nonnegative()
|
|
20528
|
+
});
|
|
20529
|
+
/**
|
|
20172
20530
|
* The summary a rule would send now. `empty` = nothing to report and every
|
|
20173
20531
|
* section read: such a summary is NOT sent. `dropped` counts the open states
|
|
20174
20532
|
* the rule's own filters (or a camera mute) left out, by reason.
|
|
20175
20533
|
* `excludedGroups` names the kind groups selected that have no state to report
|
|
20176
|
-
* (backups & exports).
|
|
20534
|
+
* (backups & exports). `split` and `rows` (D698) say how it would be sent —
|
|
20535
|
+
* optional, so an older hub's answer still parses.
|
|
20177
20536
|
*/
|
|
20178
20537
|
var NcStateSummaryPreviewSchema = object({
|
|
20179
20538
|
empty: boolean(),
|
|
@@ -20181,7 +20540,9 @@ var NcStateSummaryPreviewSchema = object({
|
|
|
20181
20540
|
text: string(),
|
|
20182
20541
|
sections: array(NcStateSummaryPreviewSectionSchema),
|
|
20183
20542
|
dropped: record(string(), number().int().nonnegative()),
|
|
20184
|
-
excludedGroups: array(string())
|
|
20543
|
+
excludedGroups: array(string()),
|
|
20544
|
+
split: NcStateSummarySplitSchema.optional(),
|
|
20545
|
+
rows: array(NcStateSummaryPreviewRowSchema).optional()
|
|
20185
20546
|
});
|
|
20186
20547
|
var NcTestResultSchema = object({
|
|
20187
20548
|
recordId: string(),
|
|
@@ -21195,12 +21556,26 @@ var CameraSensorRefSchema = object({
|
|
|
21195
21556
|
function cameraSensorRefKey(ref) {
|
|
21196
21557
|
return `${ref.addonId}/${ref.stableId}`;
|
|
21197
21558
|
}
|
|
21198
|
-
/**
|
|
21199
|
-
|
|
21200
|
-
|
|
21201
|
-
|
|
21202
|
-
|
|
21203
|
-
|
|
21559
|
+
/**
|
|
21560
|
+
* A sensor's mode (D673). `in-addition`: its motion is the camera's motion too.
|
|
21561
|
+
* `replace`: its motion is the camera's, and while one is READY the camera's
|
|
21562
|
+
* own motion no longer counts on its own. `confirm`: while one is READY the
|
|
21563
|
+
* camera's own motion counts only while a confirm sensor is active — with or
|
|
21564
|
+
* without a replace sensor (spec C2, the controller's ruling on Q1).
|
|
21565
|
+
*/
|
|
21566
|
+
var CameraSensorModeSchema = _enum([
|
|
21567
|
+
"in-addition",
|
|
21568
|
+
"confirm",
|
|
21569
|
+
"replace"
|
|
21570
|
+
]);
|
|
21571
|
+
/** A stored sensor with no mode — every CS-1 row — is in addition. */
|
|
21572
|
+
var DEFAULT_CAMERA_SENSOR_MODE = "in-addition";
|
|
21573
|
+
/**
|
|
21574
|
+
* A camera's attached sensors. A CS-1 row carried an envelope
|
|
21575
|
+
* `mode: 'in-addition'`: `z.object` drops it on parse, and the PARSED value is
|
|
21576
|
+
* what the write stores (D672 rule 3), so it is never written again.
|
|
21577
|
+
*/
|
|
21578
|
+
var CameraSensorsConfigSchema = object({ sensors: array(CameraSensorRefSchema.extend({ mode: CameraSensorModeSchema.default(DEFAULT_CAMERA_SENSOR_MODE) })).min(1).max(8) }).superRefine((value, ctx) => {
|
|
21204
21579
|
const seen = /* @__PURE__ */ new Set();
|
|
21205
21580
|
value.sensors.forEach((ref, index) => {
|
|
21206
21581
|
const key = cameraSensorRefKey(ref);
|
|
@@ -21212,39 +21587,41 @@ object({
|
|
|
21212
21587
|
seen.add(key);
|
|
21213
21588
|
});
|
|
21214
21589
|
});
|
|
21215
|
-
|
|
21590
|
+
/** Every attachment names its mode; an older orchestrator that does not is in addition. */
|
|
21591
|
+
var AttachmentFields = {
|
|
21216
21592
|
addonId: string(),
|
|
21217
|
-
stableId: string()
|
|
21593
|
+
stableId: string(),
|
|
21594
|
+
mode: CameraSensorModeSchema.default(DEFAULT_CAMERA_SENSOR_MODE)
|
|
21218
21595
|
};
|
|
21219
21596
|
var CameraSensorAttachmentSchema = discriminatedUnion("state", [
|
|
21220
21597
|
object({
|
|
21221
|
-
...
|
|
21598
|
+
...AttachmentFields,
|
|
21222
21599
|
state: literal("ready"),
|
|
21223
21600
|
deviceId: number(),
|
|
21224
21601
|
name: string(),
|
|
21225
21602
|
caps: array(string()).readonly()
|
|
21226
21603
|
}),
|
|
21227
21604
|
object({
|
|
21228
|
-
...
|
|
21605
|
+
...AttachmentFields,
|
|
21229
21606
|
state: literal("offline"),
|
|
21230
21607
|
deviceId: number(),
|
|
21231
21608
|
name: string(),
|
|
21232
21609
|
reason: _enum(["offline", "disabled"])
|
|
21233
21610
|
}),
|
|
21234
21611
|
object({
|
|
21235
|
-
...
|
|
21612
|
+
...AttachmentFields,
|
|
21236
21613
|
state: literal("missing"),
|
|
21237
21614
|
reason: string()
|
|
21238
21615
|
}),
|
|
21239
21616
|
object({
|
|
21240
|
-
...
|
|
21617
|
+
...AttachmentFields,
|
|
21241
21618
|
state: literal("unsupported"),
|
|
21242
21619
|
deviceId: number(),
|
|
21243
21620
|
name: string(),
|
|
21244
21621
|
reason: string()
|
|
21245
21622
|
}),
|
|
21246
21623
|
object({
|
|
21247
|
-
...
|
|
21624
|
+
...AttachmentFields,
|
|
21248
21625
|
state: literal("unreadable"),
|
|
21249
21626
|
reason: string()
|
|
21250
21627
|
})
|
|
@@ -21257,17 +21634,49 @@ var CameraSensorAttachmentSchema = discriminatedUnion("state", [
|
|
|
21257
21634
|
* say.
|
|
21258
21635
|
*/
|
|
21259
21636
|
var CameraSensorsNotForwardedSchema = _enum(["onboard-not-listed", "no-active-detection"]);
|
|
21637
|
+
/** Whether the camera's OWN motion counts on its own (D673 C2), from its READY sensors (C3). */
|
|
21638
|
+
var CameraOwnMotionSchema = _enum([
|
|
21639
|
+
"always",
|
|
21640
|
+
"when-confirmed",
|
|
21641
|
+
"never"
|
|
21642
|
+
]);
|
|
21643
|
+
/** Confirm / Replace cannot suppress this camera's motion: its provider still emits it directly (D673 C13). */
|
|
21644
|
+
var CameraSensorsNotEnforcedSchema = _enum(["provider-not-split"]);
|
|
21645
|
+
/**
|
|
21646
|
+
* The camera's OWN onboard motion (D696): the raw input the bridge combines,
|
|
21647
|
+
* never the effective value. The camera's `motion` slice is the effective one,
|
|
21648
|
+
* so a view of the camera's own row reads this.
|
|
21649
|
+
* - `atMs`: when the bridge received the camera's last own edge.
|
|
21650
|
+
* - `detected`: evaluated WHEN THE STATUS IS ASKED — the last edge said `true`
|
|
21651
|
+
* AND it is younger than the window the bridge counts the camera's own motion
|
|
21652
|
+
* for (`motionCooldownMs`, floored at two sustain ticks). A camera that never
|
|
21653
|
+
* sends a clear (heartbeats only) therefore reads `false` once no push came
|
|
21654
|
+
* within the window; a status read is a snapshot, so a live view re-asks.
|
|
21655
|
+
* Absent = this orchestrator has not received the camera's own motion since it
|
|
21656
|
+
* started (unknown, never "quiet"), or an orchestrator older than D696.
|
|
21657
|
+
*/
|
|
21658
|
+
var CameraRawLevelSchema = object({
|
|
21659
|
+
detected: boolean(),
|
|
21660
|
+
atMs: number()
|
|
21661
|
+
});
|
|
21260
21662
|
var CameraSensorsStatusSchema = discriminatedUnion("state", [
|
|
21261
|
-
object({
|
|
21663
|
+
object({
|
|
21664
|
+
state: literal("not-configured"),
|
|
21665
|
+
cameraLevel: CameraRawLevelSchema.optional()
|
|
21666
|
+
}),
|
|
21262
21667
|
object({
|
|
21263
21668
|
state: literal("unreadable"),
|
|
21264
|
-
reason: string()
|
|
21669
|
+
reason: string(),
|
|
21670
|
+
cameraLevel: CameraRawLevelSchema.optional()
|
|
21265
21671
|
}),
|
|
21266
21672
|
object({
|
|
21267
21673
|
state: literal("configured"),
|
|
21268
|
-
|
|
21674
|
+
cameraLevel: CameraRawLevelSchema.optional(),
|
|
21269
21675
|
sensors: array(CameraSensorAttachmentSchema).readonly(),
|
|
21270
|
-
|
|
21676
|
+
/** Absent = an orchestrator older than CS-2: it does not say (D315). */
|
|
21677
|
+
cameraMotion: CameraOwnMotionSchema.optional(),
|
|
21678
|
+
notForwarded: CameraSensorsNotForwardedSchema.optional(),
|
|
21679
|
+
notEnforced: CameraSensorsNotEnforcedSchema.optional()
|
|
21271
21680
|
})
|
|
21272
21681
|
]);
|
|
21273
21682
|
Object.freeze({
|
|
@@ -23102,7 +23511,8 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
23102
23511
|
trackIds: array(string()).min(1)
|
|
23103
23512
|
}), object({
|
|
23104
23513
|
deleted: number().int(),
|
|
23105
|
-
failed: array(string()).readonly()
|
|
23514
|
+
failed: array(string()).readonly(),
|
|
23515
|
+
sparedMediaIds: array(number().int()).readonly().optional()
|
|
23106
23516
|
}), {
|
|
23107
23517
|
kind: "mutation",
|
|
23108
23518
|
auth: "admin"
|
|
@@ -23111,7 +23521,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
23111
23521
|
deviceId: number(),
|
|
23112
23522
|
trackId: string(),
|
|
23113
23523
|
flags: TrackFlagsPatchSchema
|
|
23114
|
-
}), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
|
|
23524
|
+
}), 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, {
|
|
23115
23525
|
kind: "query",
|
|
23116
23526
|
auth: "admin"
|
|
23117
23527
|
}), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
|
|
@@ -24497,8 +24907,10 @@ var RunnerCameraConfigSchema = object({
|
|
|
24497
24907
|
* - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
|
|
24498
24908
|
* analyzer providers) running on decoded frames in this runner.
|
|
24499
24909
|
* - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
|
|
24500
|
-
* analytics). The provider emits ProviderMotion
|
|
24501
|
-
*
|
|
24910
|
+
* analytics). The provider emits its raw push as `ProviderMotion`
|
|
24911
|
+
* (D673); the orchestrator's camera-sensors bridge re-emits the camera's
|
|
24912
|
+
* effective motion as `MotionOnMotionChanged`, which is what reaches
|
|
24913
|
+
* `reportMotion`.
|
|
24502
24914
|
*/
|
|
24503
24915
|
motionSources: MotionSourcesSchema.default(["analyzer"]),
|
|
24504
24916
|
/**
|
|
@@ -24675,7 +25087,15 @@ var RunnerLocalLoadSchema = object({
|
|
|
24675
25087
|
hasGpu: boolean(),
|
|
24676
25088
|
inferenceBackend: string().optional(),
|
|
24677
25089
|
cpuCores: number().optional()
|
|
24678
|
-
})
|
|
25090
|
+
}),
|
|
25091
|
+
/**
|
|
25092
|
+
* Who writes a camera's `motion` runtime slice (D696). `'orchestrator'`: this
|
|
25093
|
+
* runner never writes it. ABSENT = a runner older than D696, which still
|
|
25094
|
+
* writes the slice from its phase machine; the orchestrator does not write
|
|
25095
|
+
* while any runner node is absent-or-unanswered, so one slice never has two
|
|
25096
|
+
* writers.
|
|
25097
|
+
*/
|
|
25098
|
+
motionSliceWriter: literal("orchestrator").optional()
|
|
24679
25099
|
});
|
|
24680
25100
|
/**
|
|
24681
25101
|
* Aggregate runtime metrics for the runner's whole local pool. Mirrors the
|
|
@@ -25309,7 +25729,64 @@ var NodeInferenceDevicesSchema = object({
|
|
|
25309
25729
|
reachable: boolean(),
|
|
25310
25730
|
devices: array(NodeInferenceDeviceSchema).readonly()
|
|
25311
25731
|
});
|
|
25312
|
-
|
|
25732
|
+
/**
|
|
25733
|
+
* Pipeline Orchestrator capability — global load balancer + camera dispatcher.
|
|
25734
|
+
*
|
|
25735
|
+
* Lives on the hub. Tracks the camera-to-agent assignment map, listens to
|
|
25736
|
+
* device lifecycle events, queries each runner's capacity + hardware
|
|
25737
|
+
* profile, and dispatches `attachCamera` / `detachCamera` cap calls to the
|
|
25738
|
+
* appropriate runner instances. Persists assignments via the multi-level
|
|
25739
|
+
* settings store so they survive hub restarts.
|
|
25740
|
+
*
|
|
25741
|
+
* Strictly the control plane: never sees a frame, never calls inference,
|
|
25742
|
+
* never drains queues. The runner does that work locally on each agent.
|
|
25743
|
+
*/
|
|
25744
|
+
/**
|
|
25745
|
+
* The input of `setCameraSensors` (G5, D676): the ONE typed write path of a
|
|
25746
|
+
* camera's attached sensors (D672). `config: null` removes the attachment —
|
|
25747
|
+
* the camera reads `not-configured` again, never `unreadable`.
|
|
25748
|
+
*/
|
|
25749
|
+
var SetCameraSensorsInputSchema = object({
|
|
25750
|
+
deviceId: number().int().nonnegative(),
|
|
25751
|
+
/** `null` removes the attachment: the camera goes back to `not-configured`. */
|
|
25752
|
+
config: CameraSensorsConfigSchema.nullable()
|
|
25753
|
+
});
|
|
25754
|
+
/**
|
|
25755
|
+
* Why an early occupancy look (D691) was not scheduled.
|
|
25756
|
+
*
|
|
25757
|
+
* - `unknown-camera` — no session was ever dispatched for it, so there is no
|
|
25758
|
+
* node and no config to attach a burst with.
|
|
25759
|
+
* - `out-of-range` — the ask is negative or further out than the orchestrator
|
|
25760
|
+
* will hold a timer for; the parked-object cadence is the answer there.
|
|
25761
|
+
* - `no-burst-producer` — this build has no burst producer at all.
|
|
25762
|
+
* - `already-looked` — this camera's ONE early look since its last session has
|
|
25763
|
+
* been spent. A look's own burst can re-arm a flickering flip, and a look
|
|
25764
|
+
* per arm would chain a burst every ~30 s forever (review H2); the next
|
|
25765
|
+
* real session re-arms the budget.
|
|
25766
|
+
*/
|
|
25767
|
+
var OccupancyLookRefusalSchema = _enum([
|
|
25768
|
+
"unknown-camera",
|
|
25769
|
+
"out-of-range",
|
|
25770
|
+
"no-burst-producer",
|
|
25771
|
+
"already-looked"
|
|
25772
|
+
]);
|
|
25773
|
+
method(object({
|
|
25774
|
+
deviceId: number().int().nonnegative(),
|
|
25775
|
+
/** How long from NOW until the pending flip's sustain window ends. RELATIVE,
|
|
25776
|
+
* so the caller's clock and the orchestrator's never have to agree. */
|
|
25777
|
+
afterMs: number().finite(),
|
|
25778
|
+
/** Why, for the log. */
|
|
25779
|
+
reason: string()
|
|
25780
|
+
}), object({
|
|
25781
|
+
scheduled: boolean(),
|
|
25782
|
+
/** When `scheduled`: how long until the burst is dialled. */
|
|
25783
|
+
dueInMs: number().optional(),
|
|
25784
|
+
/** When not `scheduled`: why. */
|
|
25785
|
+
refusedBecause: OccupancyLookRefusalSchema.optional()
|
|
25786
|
+
}), {
|
|
25787
|
+
kind: "mutation",
|
|
25788
|
+
auth: "admin"
|
|
25789
|
+
}), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
|
|
25313
25790
|
kind: "mutation",
|
|
25314
25791
|
auth: "admin"
|
|
25315
25792
|
}), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
|
|
@@ -25463,7 +25940,10 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
|
|
|
25463
25940
|
}), CameraSwitchGroupSchema, {
|
|
25464
25941
|
kind: "mutation",
|
|
25465
25942
|
auth: "admin"
|
|
25466
|
-
}), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(
|
|
25943
|
+
}), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(SetCameraSensorsInputSchema, object({ success: literal(true) }), {
|
|
25944
|
+
kind: "mutation",
|
|
25945
|
+
auth: "admin"
|
|
25946
|
+
}), method(_void(), DiskReconcileJobSchema, {
|
|
25467
25947
|
kind: "mutation",
|
|
25468
25948
|
auth: "admin"
|
|
25469
25949
|
}), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
|
|
@@ -28191,219 +28671,6 @@ var CLIP_PLAYBACK_OPTIONS = {
|
|
|
28191
28671
|
}
|
|
28192
28672
|
};
|
|
28193
28673
|
/**
|
|
28194
|
-
* Doorbell button cap. Two kinds of providers coexist behind this cap
|
|
28195
|
-
* name (same pattern as `snapshot`):
|
|
28196
|
-
*
|
|
28197
|
-
* - **Native** providers: registered per-device by device-driver
|
|
28198
|
-
* addons via `ctx.registerNativeCap` — either on a
|
|
28199
|
-
* `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
|
|
28200
|
-
* or directly on the camera (Reolink registers at camera level).
|
|
28201
|
-
* Emits an `onPressed` event every time the firmware pushes a
|
|
28202
|
-
* ring; status tracks the last press and a pressCount since start
|
|
28203
|
-
* (diagnostic).
|
|
28204
|
-
*
|
|
28205
|
-
* - **Wrapper** provider: the `virtual-doorbell` system builtin
|
|
28206
|
-
* (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
|
|
28207
|
-
* device (contact / switch / event-emitter …) into a doorbell for
|
|
28208
|
-
* a camera. `defaultActive: false` — the operator explicitly binds
|
|
28209
|
-
* it per camera in the device-bindings UI, then picks the source
|
|
28210
|
-
* device + trigger in the per-device settings.
|
|
28211
|
-
*
|
|
28212
|
-
* The DeviceEventPropagator re-emits `onPressed` on the camera parent
|
|
28213
|
-
* — subscribers listening at the camera level receive ring events
|
|
28214
|
-
* with `via[]` populated. No code on the parent needed.
|
|
28215
|
-
*/
|
|
28216
|
-
var DoorbellStatusSchema = object({
|
|
28217
|
-
/** Ms epoch of the last press. null = never observed since this provider started. */
|
|
28218
|
-
lastPressedAt: number().nullable(),
|
|
28219
|
-
/** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
|
|
28220
|
-
pressCountSinceStart: number()
|
|
28221
|
-
});
|
|
28222
|
-
var DoorbellPressEventSchema = object({
|
|
28223
|
-
deviceId: number(),
|
|
28224
|
-
timestamp: number()
|
|
28225
|
-
});
|
|
28226
|
-
/**
|
|
28227
|
-
* The `doorbell-source` extension slot's editable value (D648): the camera's
|
|
28228
|
-
* virtual-doorbell trigger devices, exactly what the wrapper's
|
|
28229
|
-
* `doorbellSources` persists (as `{ deviceId }` records).
|
|
28230
|
-
*/
|
|
28231
|
-
var DoorbellSourceSlotValueSchema = object({ deviceIds: array(number().int().positive()) });
|
|
28232
|
-
/**
|
|
28233
|
-
* The `doorbell-source` slot — which devices ring this camera's VIRTUAL
|
|
28234
|
-
* doorbell, owned by the `virtual-doorbell` wrapper over its
|
|
28235
|
-
* `doorbellSources` store (D648). A source rings when one of its
|
|
28236
|
-
* `SOURCE_CAPS` rises. Whether the wrapper is bound to the camera at all is a
|
|
28237
|
-
* different authority (`deviceManager.setWrapperActive`, D62) — the slot
|
|
28238
|
-
* reports it, it never writes it.
|
|
28239
|
-
*/
|
|
28240
|
-
var DOORBELL_SOURCE_SLOT = {
|
|
28241
|
-
id: "doorbell-source",
|
|
28242
|
-
label: "Doorbell trigger devices",
|
|
28243
|
-
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.",
|
|
28244
|
-
shape: "association",
|
|
28245
|
-
hostDeviceTypes: [DeviceType.Camera],
|
|
28246
|
-
sourceCaps: SOURCE_CAPS,
|
|
28247
|
-
cardinality: "many",
|
|
28248
|
-
value: DoorbellSourceSlotValueSchema
|
|
28249
|
-
};
|
|
28250
|
-
var doorbellCapability = {
|
|
28251
|
-
name: "doorbell",
|
|
28252
|
-
scope: "device",
|
|
28253
|
-
deviceNative: true,
|
|
28254
|
-
mode: "singleton",
|
|
28255
|
-
kind: "wrapper",
|
|
28256
|
-
defaultActive: false,
|
|
28257
|
-
deviceTypes: [DeviceType.Button, DeviceType.Camera],
|
|
28258
|
-
extensionSlots: [DOORBELL_SOURCE_SLOT],
|
|
28259
|
-
methods: {},
|
|
28260
|
-
events: {
|
|
28261
|
-
/**
|
|
28262
|
-
* Fires once per physical press. Reolink delivers via Baichuan
|
|
28263
|
-
* push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
|
|
28264
|
-
* release/duration — it's a pulse.
|
|
28265
|
-
*/
|
|
28266
|
-
onPressed: {
|
|
28267
|
-
data: DoorbellPressEventSchema,
|
|
28268
|
-
fromState: {
|
|
28269
|
-
field: "lastPressedAt",
|
|
28270
|
-
on: "advance"
|
|
28271
|
-
}
|
|
28272
|
-
} },
|
|
28273
|
-
status: {
|
|
28274
|
-
schema: DoorbellStatusSchema,
|
|
28275
|
-
kind: "push"
|
|
28276
|
-
},
|
|
28277
|
-
/**
|
|
28278
|
-
* Runtime-state slice — last press timestamp + lifetime press count.
|
|
28279
|
-
* Mirrored by the kernel and readable via
|
|
28280
|
-
* `device.state.doorbell.value`. UIs can show "last ring 5m ago"
|
|
28281
|
-
* without subscribing.
|
|
28282
|
-
*/
|
|
28283
|
-
runtimeState: DoorbellStatusSchema,
|
|
28284
|
-
/**
|
|
28285
|
-
* 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.
|
|
28286
|
-
*
|
|
28287
|
-
* See `RuntimeStateDurability`. Enforced by
|
|
28288
|
-
* `scripts/check-runtime-state-durability.ts`.
|
|
28289
|
-
*/
|
|
28290
|
-
durability: "restored"
|
|
28291
|
-
};
|
|
28292
|
-
var ExtensionSlotIdSchema = _enum(["doorbell-source", "linked-devices"]);
|
|
28293
|
-
DeviceType.Camera, DeviceType.Camera;
|
|
28294
|
-
/** A slot's editable value, discriminated on `slot`. */
|
|
28295
|
-
var ExtensionSlotValueSchema = discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
|
|
28296
|
-
DeviceType.Camera;
|
|
28297
|
-
var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
|
|
28298
|
-
state: literal("unreachable"),
|
|
28299
|
-
reason: string()
|
|
28300
|
-
})]);
|
|
28301
|
-
/** One provider of slots — the D554 source-listing row. */
|
|
28302
|
-
var ExtensionSourceSchema = object({
|
|
28303
|
-
/** The routing prefix of every `slotRef` this provider serves. */
|
|
28304
|
-
source: string(),
|
|
28305
|
-
label: string(),
|
|
28306
|
-
/** Stamped by the dispatcher from the registry (D557). */
|
|
28307
|
-
addonId: string().optional(),
|
|
28308
|
-
availability: ExtensionSourceAvailabilitySchema
|
|
28309
|
-
});
|
|
28310
|
-
/**
|
|
28311
|
-
* How one picked source stands. `missing` — no such device (deleted, or an id
|
|
28312
|
-
* that never existed); `foreign` — a device the slot's owner cannot read from
|
|
28313
|
-
* (a source owned by another addon); `unavailable` — it exists but is not a
|
|
28314
|
-
* valid source now (a container, which is never a pick). A source in any of
|
|
28315
|
-
* these states is SHOWN, never silently dropped or re-pointed.
|
|
28316
|
-
*/
|
|
28317
|
-
var ExtensionSourceHealthSchema = _enum([
|
|
28318
|
-
"ok",
|
|
28319
|
-
"missing",
|
|
28320
|
-
"foreign",
|
|
28321
|
-
"unavailable"
|
|
28322
|
-
]);
|
|
28323
|
-
var ExtensionSlotSourceSchema = object({
|
|
28324
|
-
deviceId: number().int(),
|
|
28325
|
-
/** The device's name, or null when it could not be resolved (`missing`). */
|
|
28326
|
-
name: string().nullable(),
|
|
28327
|
-
health: ExtensionSourceHealthSchema,
|
|
28328
|
-
detail: string().optional()
|
|
28329
|
-
});
|
|
28330
|
-
/**
|
|
28331
|
-
* A DIFFERENT authority that gates whether the slot's sources do anything —
|
|
28332
|
-
* reported read-only, named, never written through this contract (D62). The
|
|
28333
|
-
* virtual doorbell's sources ring only while the wrapper is bound to the
|
|
28334
|
-
* camera, and that binding belongs to `deviceManager.setWrapperActive`.
|
|
28335
|
-
* `unknown` means the gate could not be read; it is not "inactive" (D315).
|
|
28336
|
-
*/
|
|
28337
|
-
var ExtensionSlotActivationSchema = object({
|
|
28338
|
-
state: _enum([
|
|
28339
|
-
"active",
|
|
28340
|
-
"inactive",
|
|
28341
|
-
"unknown"
|
|
28342
|
-
]),
|
|
28343
|
-
authority: string(),
|
|
28344
|
-
detail: string().optional()
|
|
28345
|
-
});
|
|
28346
|
-
var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
|
|
28347
|
-
state: literal("ok"),
|
|
28348
|
-
/** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
|
|
28349
|
-
slotRef: string(),
|
|
28350
|
-
slot: ExtensionSlotIdSchema,
|
|
28351
|
-
/** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
|
|
28352
|
-
authority: string(),
|
|
28353
|
-
activation: ExtensionSlotActivationSchema.nullable(),
|
|
28354
|
-
value: ExtensionSlotValueSchema,
|
|
28355
|
-
sources: array(ExtensionSlotSourceSchema),
|
|
28356
|
-
/**
|
|
28357
|
-
* Devices the owner links to the host ON ITS OWN, by structure, and that
|
|
28358
|
-
* are therefore not in `value` (D655): a camera's device-tree children, and
|
|
28359
|
-
* the child a picked container stands for (D356 — a container is never a
|
|
28360
|
-
* pick, its children are). Read-only; the editor shows them and may offer
|
|
28361
|
-
* per-device options on them (the linked-devices tracked-event opt-in).
|
|
28362
|
-
* Absent when the owner links nothing beyond the picks, and from an owner
|
|
28363
|
-
* older than D655.
|
|
28364
|
-
*/
|
|
28365
|
-
impliedSources: array(ExtensionSlotSourceSchema).optional()
|
|
28366
|
-
}), object({
|
|
28367
|
-
state: literal("unreachable"),
|
|
28368
|
-
addonId: string(),
|
|
28369
|
-
reason: string()
|
|
28370
|
-
})]);
|
|
28371
|
-
var ExtensionCandidatesSchema = object({ candidates: array(object({
|
|
28372
|
-
deviceId: number().int(),
|
|
28373
|
-
name: string(),
|
|
28374
|
-
type: string(),
|
|
28375
|
-
location: string().nullable(),
|
|
28376
|
-
/** The container a child belongs to — "Spotlight 2" alone does not say which. */
|
|
28377
|
-
parentName: string().nullable(),
|
|
28378
|
-
/** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
|
|
28379
|
-
suggested: boolean(),
|
|
28380
|
-
/** Why it is suggested ("same location"), null when it is not. */
|
|
28381
|
-
reason: string().nullable()
|
|
28382
|
-
})) });
|
|
28383
|
-
/**
|
|
28384
|
-
* What a write did. `none` — applied in place. `host` / `parent` — the owner
|
|
28385
|
-
* reloaded the host (or, for an accessory child, its parent) because the
|
|
28386
|
-
* write changed what the host REGISTERS. A slot never adds a capability to its
|
|
28387
|
-
* host — that is a composition (D663) — so today's owners answer `none`.
|
|
28388
|
-
*/
|
|
28389
|
-
var ExtensionSetResultSchema = object({
|
|
28390
|
-
applied: literal(true),
|
|
28391
|
-
reload: _enum([
|
|
28392
|
-
"none",
|
|
28393
|
-
"host",
|
|
28394
|
-
"parent"
|
|
28395
|
-
])
|
|
28396
|
-
});
|
|
28397
|
-
var ExtensionSlotRefInputSchema = object({
|
|
28398
|
-
deviceId: number().int(),
|
|
28399
|
-
slotRef: string().min(1)
|
|
28400
|
-
});
|
|
28401
|
-
var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
|
|
28402
|
-
method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)), method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)), method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema), method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
|
|
28403
|
-
kind: "mutation",
|
|
28404
|
-
auth: "admin"
|
|
28405
|
-
});
|
|
28406
|
-
/**
|
|
28407
28674
|
* Optional client-side hints sent at session creation to help the provider
|
|
28408
28675
|
* pick the best native source. All fields optional — a viewer that knows
|
|
28409
28676
|
* nothing still gets a sane default. (Relocated from the retired `webrtc`
|
|
@@ -30871,6 +31138,70 @@ onStatusChanged: { data: object({
|
|
|
30871
31138
|
* whether persisting is worth a SQLite commit. */
|
|
30872
31139
|
volatileStateFields: ["lastChangedAt"]
|
|
30873
31140
|
};
|
|
31141
|
+
var DoorbellStatusSchema = object({
|
|
31142
|
+
/** Ms epoch of the last press. null = never observed since this provider started. */
|
|
31143
|
+
lastPressedAt: number().nullable(),
|
|
31144
|
+
/** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
|
|
31145
|
+
pressCountSinceStart: number()
|
|
31146
|
+
});
|
|
31147
|
+
var DoorbellPressEventSchema = object({
|
|
31148
|
+
deviceId: number(),
|
|
31149
|
+
timestamp: number()
|
|
31150
|
+
});
|
|
31151
|
+
/**
|
|
31152
|
+
* Doorbell button cap. Two kinds of provider serve it, and to every consumer
|
|
31153
|
+
* they are the same cap:
|
|
31154
|
+
*
|
|
31155
|
+
* - **Native** providers, registered per device by a driver addon through
|
|
31156
|
+
* `ctx.registerNativeCap` — a `DeviceType.Button` accessory with
|
|
31157
|
+
* `role: DeviceRole.Doorbell`, or the camera itself (Reolink registers at
|
|
31158
|
+
* camera level). They emit `onPressed` on every firmware ring.
|
|
31159
|
+
* - **A composed doorbell** (D670, D671): a camera's customization gives it
|
|
31160
|
+
* the cap, its `lastPressedAt` rising from the sources the operator
|
|
31161
|
+
* assigned in Customize → Doorbell, and the composer emits `onPressed`
|
|
31162
|
+
* from that field's advance (`fromState`).
|
|
31163
|
+
*
|
|
31164
|
+
* The DeviceEventPropagator re-emits `onPressed` on the camera parent.
|
|
31165
|
+
*/
|
|
31166
|
+
var doorbellCapability = {
|
|
31167
|
+
name: "doorbell",
|
|
31168
|
+
scope: "device",
|
|
31169
|
+
deviceNative: true,
|
|
31170
|
+
mode: "singleton",
|
|
31171
|
+
deviceTypes: [DeviceType.Button, DeviceType.Camera],
|
|
31172
|
+
methods: {},
|
|
31173
|
+
events: {
|
|
31174
|
+
/**
|
|
31175
|
+
* Fires once per physical press. Reolink delivers via Baichuan
|
|
31176
|
+
* push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
|
|
31177
|
+
* release/duration — it's a pulse.
|
|
31178
|
+
*/
|
|
31179
|
+
onPressed: {
|
|
31180
|
+
data: DoorbellPressEventSchema,
|
|
31181
|
+
fromState: {
|
|
31182
|
+
field: "lastPressedAt",
|
|
31183
|
+
on: "advance"
|
|
31184
|
+
}
|
|
31185
|
+
} },
|
|
31186
|
+
status: {
|
|
31187
|
+
schema: DoorbellStatusSchema,
|
|
31188
|
+
kind: "push"
|
|
31189
|
+
},
|
|
31190
|
+
/**
|
|
31191
|
+
* Runtime-state slice — last press timestamp + lifetime press count.
|
|
31192
|
+
* Mirrored by the kernel and readable via
|
|
31193
|
+
* `device.state.doorbell.value`. UIs can show "last ring 5m ago"
|
|
31194
|
+
* without subscribing.
|
|
31195
|
+
*/
|
|
31196
|
+
runtimeState: DoorbellStatusSchema,
|
|
31197
|
+
/**
|
|
31198
|
+
* 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.
|
|
31199
|
+
*
|
|
31200
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
31201
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
31202
|
+
*/
|
|
31203
|
+
durability: "restored"
|
|
31204
|
+
};
|
|
30874
31205
|
/**
|
|
30875
31206
|
* Enum-state sensor — a string value picked from a finite option set.
|
|
30876
31207
|
* Drives HA `sensor` entries with `state_class: enum` (HVAC action
|
|
@@ -33015,9 +33346,9 @@ var MotionStatusSchema = object({
|
|
|
33015
33346
|
/** Ms epoch of the last detected-true observation. Null if never detected. */
|
|
33016
33347
|
lastDetectedAt: number().nullable(),
|
|
33017
33348
|
/**
|
|
33018
|
-
* `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device
|
|
33019
|
-
* `null` while false and on every `Sensor`
|
|
33020
|
-
* constant's doc for the one-authority rule.
|
|
33349
|
+
* `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device (the
|
|
33350
|
+
* orchestrator writes it, D696), `null` while false and on every `Sensor`
|
|
33351
|
+
* device (D475) — see that constant's doc for the one-authority rule.
|
|
33021
33352
|
*
|
|
33022
33353
|
* ## Reading this field still arms nothing
|
|
33023
33354
|
*
|
|
@@ -33035,34 +33366,31 @@ var MotionStatusSchema = object({
|
|
|
33035
33366
|
* `addon-export-alexa/src/motion-clear-hold.ts` and
|
|
33036
33367
|
* `addon-export-hap`'s `RESET_DEBOUNCE_MS` both do.
|
|
33037
33368
|
*
|
|
33038
|
-
* ## Who writes it
|
|
33039
|
-
*
|
|
33040
|
-
* - **Cameras** — the
|
|
33041
|
-
*
|
|
33042
|
-
* `
|
|
33043
|
-
* `
|
|
33044
|
-
*
|
|
33045
|
-
*
|
|
33046
|
-
* a
|
|
33047
|
-
*
|
|
33048
|
-
*
|
|
33049
|
-
*
|
|
33050
|
-
*
|
|
33051
|
-
*
|
|
33052
|
-
*
|
|
33053
|
-
*
|
|
33054
|
-
*
|
|
33055
|
-
*
|
|
33056
|
-
* `
|
|
33057
|
-
*
|
|
33058
|
-
*
|
|
33059
|
-
*
|
|
33060
|
-
*
|
|
33061
|
-
*
|
|
33062
|
-
*
|
|
33063
|
-
* This predates D475 and is not fixed there: the fix touches every
|
|
33064
|
-
* camera provider. Recorded in D475's Consequences. Do not restore the
|
|
33065
|
-
* "sole writer" wording without also removing the other writers.
|
|
33369
|
+
* ## Who writes it (D696)
|
|
33370
|
+
*
|
|
33371
|
+
* - **Cameras** — the orchestrator, and nothing else. It writes the camera's
|
|
33372
|
+
* EFFECTIVE motion (`addon-pipeline-orchestrator`
|
|
33373
|
+
* `camera-sensors/motion-slice.ts`), alongside the effective
|
|
33374
|
+
* `MotionOnMotionChanged` it emits or receives: the camera-sensors bridge
|
|
33375
|
+
* for a split camera, an unsplit emitter's direct event, the analyzer and
|
|
33376
|
+
* device activity, as the camera's `motionSources` counts them. A source
|
|
33377
|
+
* that never sends a clear falls one window after its last `true`.
|
|
33378
|
+
* `lastDetectedAt` moves only on an effective rise. No camera provider
|
|
33379
|
+
* writes this slice (not even a boot seed), and neither does the runner's
|
|
33380
|
+
* phase machine: its phase is "a session is attached" for every on-motion
|
|
33381
|
+
* session, not motion, and it now has its own `DetectionPhaseTransition`.
|
|
33382
|
+
* A provider's `isDetected` answers from the hub's slice.
|
|
33383
|
+
* - **Sensors** (Home Assistant binary sensors, Homematic, Matter, Alexa
|
|
33384
|
+
* imports) — the provider pushes both edges itself, from the upstream
|
|
33385
|
+
* system's own state change. That is the sensor's own fact.
|
|
33386
|
+
*
|
|
33387
|
+
* `scripts/check-onboard-motion-emitters.ts` refuses any other writer of a
|
|
33388
|
+
* `motion` slice; each sensor writer is a named exemption.
|
|
33389
|
+
*
|
|
33390
|
+
* This replaces the D475 §4 rule ("the phase machine is the sole writer").
|
|
33391
|
+
* That rule was never true: Hikvision and Amcrest wrote the slice raw beside
|
|
33392
|
+
* it, every provider seeded it at boot, and every session left it
|
|
33393
|
+
* `detected: true` after its detach.
|
|
33066
33394
|
*/
|
|
33067
33395
|
autoClearAfterMs: number().nullable()
|
|
33068
33396
|
});
|
|
@@ -33134,11 +33462,12 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
|
|
|
33134
33462
|
*/
|
|
33135
33463
|
runtimeState: MotionStatusSchema,
|
|
33136
33464
|
/**
|
|
33137
|
-
* Runtime-state durability: **session** —
|
|
33465
|
+
* Runtime-state durability: **session** — the writer of this slice
|
|
33138
33466
|
* writes only on an EDGE, so a restored `detected: true` would stay
|
|
33139
33467
|
* frozen until the next one instead of being corrected. The next edge
|
|
33140
|
-
* re-publishes the real state
|
|
33141
|
-
*
|
|
33468
|
+
* re-publishes the real state, and the orchestrator re-publishes every
|
|
33469
|
+
* camera when it starts writing (D696; on who writes it, see
|
|
33470
|
+
* `autoClearAfterMs` above).
|
|
33142
33471
|
*
|
|
33143
33472
|
* See `RuntimeStateDurability`. Enforced by
|
|
33144
33473
|
* `scripts/check-runtime-state-durability.ts`.
|
|
@@ -35653,8 +35982,7 @@ var ptzAutotrackCapability = {
|
|
|
35653
35982
|
deviceNative: true,
|
|
35654
35983
|
mode: "singleton",
|
|
35655
35984
|
/**
|
|
35656
|
-
* Two kinds of provider behind one name, the same shape `snapshot`
|
|
35657
|
-
* `doorbell` use:
|
|
35985
|
+
* Two kinds of provider behind one name, the same shape `snapshot` uses:
|
|
35658
35986
|
*
|
|
35659
35987
|
* - **Native**: the camera's own firmware autotrack, registered per device by
|
|
35660
35988
|
* the driver when the probe says it exists (Reolink: yes; Hikvision:
|
|
@@ -35662,7 +35990,7 @@ var ptzAutotrackCapability = {
|
|
|
35662
35990
|
* - **Wrapper**: the emulated implementation (`@camstack/system`'s `autotrack` builtin),
|
|
35663
35991
|
* which follows a subject with `ptz.move` pulses driven by the detection
|
|
35664
35992
|
* pipeline. `defaultActive: false` — the operator binds it per camera in
|
|
35665
|
-
* the bindings UI
|
|
35993
|
+
* the bindings UI.
|
|
35666
35994
|
*
|
|
35667
35995
|
* The binding chooses WHICH implementation answers; `setEnabled` stays the
|
|
35668
35996
|
* one switch for the function either way. A camera never has both driving its
|
|
@@ -40093,47 +40421,6 @@ var zoneRulesCapability = {
|
|
|
40093
40421
|
*/
|
|
40094
40422
|
durability: "restored"
|
|
40095
40423
|
};
|
|
40096
|
-
var NUMBER = {
|
|
40097
|
-
kind: "fixed",
|
|
40098
|
-
result: ["number"]
|
|
40099
|
-
};
|
|
40100
|
-
var BOOLEAN = {
|
|
40101
|
-
kind: "fixed",
|
|
40102
|
-
result: ["boolean"]
|
|
40103
|
-
};
|
|
40104
|
-
Object.freeze({
|
|
40105
|
-
min: NUMBER,
|
|
40106
|
-
max: NUMBER,
|
|
40107
|
-
abs: NUMBER,
|
|
40108
|
-
floor: NUMBER,
|
|
40109
|
-
ceil: NUMBER,
|
|
40110
|
-
sqrt: NUMBER,
|
|
40111
|
-
round: NUMBER,
|
|
40112
|
-
pow: NUMBER,
|
|
40113
|
-
clamp: NUMBER,
|
|
40114
|
-
avg: NUMBER,
|
|
40115
|
-
sum: NUMBER,
|
|
40116
|
-
age: NUMBER,
|
|
40117
|
-
convert: NUMBER,
|
|
40118
|
-
coalesce: { kind: "coalesce" },
|
|
40119
|
-
any: BOOLEAN,
|
|
40120
|
-
all: BOOLEAN,
|
|
40121
|
-
within: BOOLEAN,
|
|
40122
|
-
latest: {
|
|
40123
|
-
kind: "fixed",
|
|
40124
|
-
result: ["number", "null"]
|
|
40125
|
-
},
|
|
40126
|
-
number: {
|
|
40127
|
-
kind: "fixed",
|
|
40128
|
-
result: ["number", "null"]
|
|
40129
|
-
},
|
|
40130
|
-
rose: {
|
|
40131
|
-
kind: "fixed",
|
|
40132
|
-
result: ["number", "null"]
|
|
40133
|
-
},
|
|
40134
|
-
count: NUMBER
|
|
40135
|
-
});
|
|
40136
|
-
`${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
|
|
40137
40424
|
/**
|
|
40138
40425
|
* Accessory device helpers — shared across drivers.
|
|
40139
40426
|
*
|
|
@@ -44257,6 +44544,12 @@ Object.freeze({
|
|
|
44257
44544
|
addonId: null,
|
|
44258
44545
|
access: "view"
|
|
44259
44546
|
},
|
|
44547
|
+
"coreBlocks.listComposableCaps": {
|
|
44548
|
+
capName: "core-blocks",
|
|
44549
|
+
capScope: "system",
|
|
44550
|
+
addonId: null,
|
|
44551
|
+
access: "view"
|
|
44552
|
+
},
|
|
44260
44553
|
"coreBlocks.listCompositions": {
|
|
44261
44554
|
capName: "core-blocks",
|
|
44262
44555
|
capScope: "system",
|
|
@@ -44335,6 +44628,18 @@ Object.freeze({
|
|
|
44335
44628
|
addonId: null,
|
|
44336
44629
|
access: "view"
|
|
44337
44630
|
},
|
|
44631
|
+
"databaseSnapshot.listDatabases": {
|
|
44632
|
+
capName: "database-snapshot",
|
|
44633
|
+
capScope: "system",
|
|
44634
|
+
addonId: null,
|
|
44635
|
+
access: "view"
|
|
44636
|
+
},
|
|
44637
|
+
"databaseSnapshot.writeSnapshot": {
|
|
44638
|
+
capName: "database-snapshot",
|
|
44639
|
+
capScope: "system",
|
|
44640
|
+
addonId: null,
|
|
44641
|
+
access: "create"
|
|
44642
|
+
},
|
|
44338
44643
|
"dataStoreProvider.aggregate": {
|
|
44339
44644
|
capName: "data-store-provider",
|
|
44340
44645
|
capScope: "system",
|
|
@@ -47071,6 +47376,12 @@ Object.freeze({
|
|
|
47071
47376
|
addonId: null,
|
|
47072
47377
|
access: "create"
|
|
47073
47378
|
},
|
|
47379
|
+
"pipelineAnalytics.clearTrackRelation": {
|
|
47380
|
+
capName: "pipeline-analytics",
|
|
47381
|
+
capScope: "device",
|
|
47382
|
+
addonId: null,
|
|
47383
|
+
access: "delete"
|
|
47384
|
+
},
|
|
47074
47385
|
"pipelineAnalytics.clearTracks": {
|
|
47075
47386
|
capName: "pipeline-analytics",
|
|
47076
47387
|
capScope: "device",
|
|
@@ -47323,6 +47634,12 @@ Object.freeze({
|
|
|
47323
47634
|
addonId: null,
|
|
47324
47635
|
access: "view"
|
|
47325
47636
|
},
|
|
47637
|
+
"pipelineAnalytics.listTrackRelations": {
|
|
47638
|
+
capName: "pipeline-analytics",
|
|
47639
|
+
capScope: "device",
|
|
47640
|
+
addonId: null,
|
|
47641
|
+
access: "view"
|
|
47642
|
+
},
|
|
47326
47643
|
"pipelineAnalytics.listTracks": {
|
|
47327
47644
|
capName: "pipeline-analytics",
|
|
47328
47645
|
capScope: "device",
|
|
@@ -47437,6 +47754,18 @@ Object.freeze({
|
|
|
47437
47754
|
addonId: null,
|
|
47438
47755
|
access: "create"
|
|
47439
47756
|
},
|
|
47757
|
+
"pipelineAnalytics.setTrackPurity": {
|
|
47758
|
+
capName: "pipeline-analytics",
|
|
47759
|
+
capScope: "device",
|
|
47760
|
+
addonId: null,
|
|
47761
|
+
access: "create"
|
|
47762
|
+
},
|
|
47763
|
+
"pipelineAnalytics.setTrackRelation": {
|
|
47764
|
+
capName: "pipeline-analytics",
|
|
47765
|
+
capScope: "device",
|
|
47766
|
+
addonId: null,
|
|
47767
|
+
access: "create"
|
|
47768
|
+
},
|
|
47440
47769
|
"pipelineAnalytics.startStorageMigrationMove": {
|
|
47441
47770
|
capName: "pipeline-analytics",
|
|
47442
47771
|
capScope: "device",
|
|
@@ -47875,6 +48204,12 @@ Object.freeze({
|
|
|
47875
48204
|
addonId: null,
|
|
47876
48205
|
access: "delete"
|
|
47877
48206
|
},
|
|
48207
|
+
"pipelineOrchestrator.requestOccupancyLook": {
|
|
48208
|
+
capName: "pipeline-orchestrator",
|
|
48209
|
+
capScope: "system",
|
|
48210
|
+
addonId: null,
|
|
48211
|
+
access: "create"
|
|
48212
|
+
},
|
|
47878
48213
|
"pipelineOrchestrator.resetNodePipelineDefaults": {
|
|
47879
48214
|
capName: "pipeline-orchestrator",
|
|
47880
48215
|
capScope: "system",
|
|
@@ -47941,6 +48276,12 @@ Object.freeze({
|
|
|
47941
48276
|
addonId: null,
|
|
47942
48277
|
access: "create"
|
|
47943
48278
|
},
|
|
48279
|
+
"pipelineOrchestrator.setCameraSensors": {
|
|
48280
|
+
capName: "pipeline-orchestrator",
|
|
48281
|
+
capScope: "system",
|
|
48282
|
+
addonId: null,
|
|
48283
|
+
access: "create"
|
|
48284
|
+
},
|
|
47944
48285
|
"pipelineOrchestrator.setCameraStepOverride": {
|
|
47945
48286
|
capName: "pipeline-orchestrator",
|
|
47946
48287
|
capScope: "system",
|
|
@@ -51351,6 +51692,11 @@ Object.freeze({
|
|
|
51351
51692
|
form: "single",
|
|
51352
51693
|
optional: false
|
|
51353
51694
|
}],
|
|
51695
|
+
"pipelineAnalytics.clearTrackRelation": [{
|
|
51696
|
+
name: "deviceId",
|
|
51697
|
+
form: "single",
|
|
51698
|
+
optional: false
|
|
51699
|
+
}],
|
|
51354
51700
|
"pipelineAnalytics.clearTracks": [{
|
|
51355
51701
|
name: "deviceId",
|
|
51356
51702
|
form: "single",
|
|
@@ -51501,6 +51847,11 @@ Object.freeze({
|
|
|
51501
51847
|
form: "single",
|
|
51502
51848
|
optional: false
|
|
51503
51849
|
}],
|
|
51850
|
+
"pipelineAnalytics.listTrackRelations": [{
|
|
51851
|
+
name: "deviceId",
|
|
51852
|
+
form: "single",
|
|
51853
|
+
optional: false
|
|
51854
|
+
}],
|
|
51504
51855
|
"pipelineAnalytics.listTracks": [{
|
|
51505
51856
|
name: "deviceId",
|
|
51506
51857
|
form: "single",
|
|
@@ -51571,6 +51922,16 @@ Object.freeze({
|
|
|
51571
51922
|
form: "single",
|
|
51572
51923
|
optional: false
|
|
51573
51924
|
}],
|
|
51925
|
+
"pipelineAnalytics.setTrackPurity": [{
|
|
51926
|
+
name: "deviceId",
|
|
51927
|
+
form: "single",
|
|
51928
|
+
optional: false
|
|
51929
|
+
}],
|
|
51930
|
+
"pipelineAnalytics.setTrackRelation": [{
|
|
51931
|
+
name: "deviceId",
|
|
51932
|
+
form: "single",
|
|
51933
|
+
optional: false
|
|
51934
|
+
}],
|
|
51574
51935
|
"pipelineAnalytics.wipeAllAnalytics": [{
|
|
51575
51936
|
name: "deviceId",
|
|
51576
51937
|
form: "single",
|
|
@@ -51641,6 +52002,11 @@ Object.freeze({
|
|
|
51641
52002
|
form: "single",
|
|
51642
52003
|
optional: false
|
|
51643
52004
|
}],
|
|
52005
|
+
"pipelineOrchestrator.requestOccupancyLook": [{
|
|
52006
|
+
name: "deviceId",
|
|
52007
|
+
form: "single",
|
|
52008
|
+
optional: false
|
|
52009
|
+
}],
|
|
51644
52010
|
"pipelineOrchestrator.resolvePipeline": [{
|
|
51645
52011
|
name: "deviceId",
|
|
51646
52012
|
form: "single",
|
|
@@ -51651,6 +52017,11 @@ Object.freeze({
|
|
|
51651
52017
|
form: "single",
|
|
51652
52018
|
optional: false
|
|
51653
52019
|
}],
|
|
52020
|
+
"pipelineOrchestrator.setCameraSensors": [{
|
|
52021
|
+
name: "deviceId",
|
|
52022
|
+
form: "single",
|
|
52023
|
+
optional: false
|
|
52024
|
+
}],
|
|
51654
52025
|
"pipelineOrchestrator.setCameraStepOverride": [{
|
|
51655
52026
|
name: "deviceId",
|
|
51656
52027
|
form: "single",
|
|
@@ -52797,6 +53168,18 @@ var STATE_SUMMARY_VARS = [
|
|
|
52797
53168
|
systemEventKinds: [...SUMMARISABLE],
|
|
52798
53169
|
systemEventDeliveries: ["summary"]
|
|
52799
53170
|
},
|
|
53171
|
+
{
|
|
53172
|
+
name: "summarySection",
|
|
53173
|
+
label: "Summary: this section",
|
|
53174
|
+
description: "The section a per-section summary row is about (D698); on a summary sent as one message, every section it reports, comma-separated.",
|
|
53175
|
+
example: "Batterie scariche",
|
|
53176
|
+
group: "system",
|
|
53177
|
+
families: ["rule"],
|
|
53178
|
+
fields: [...RULE_TEXT],
|
|
53179
|
+
kinds: ["system"],
|
|
53180
|
+
systemEventKinds: [...SUMMARISABLE],
|
|
53181
|
+
systemEventDeliveries: ["summary"]
|
|
53182
|
+
},
|
|
52800
53183
|
...STATE_SUMMARY_SECTION_VARS.map((v) => ({
|
|
52801
53184
|
name: v.name,
|
|
52802
53185
|
label: v.label,
|
|
@@ -52873,6 +53256,37 @@ var STATE_SUMMARY_VARS = [
|
|
|
52873
53256
|
[...RULE_TEXT],
|
|
52874
53257
|
...STATE_SUMMARY_VARS
|
|
52875
53258
|
];
|
|
53259
|
+
new Set([
|
|
53260
|
+
"disarmed",
|
|
53261
|
+
"armed_home",
|
|
53262
|
+
"armed_away",
|
|
53263
|
+
"armed_night",
|
|
53264
|
+
"armed_vacation",
|
|
53265
|
+
"armed_custom_bypass",
|
|
53266
|
+
"arming",
|
|
53267
|
+
"disarming",
|
|
53268
|
+
"pending",
|
|
53269
|
+
"triggered",
|
|
53270
|
+
"open",
|
|
53271
|
+
"opening",
|
|
53272
|
+
"closing",
|
|
53273
|
+
"closed",
|
|
53274
|
+
"stopped",
|
|
53275
|
+
"locked",
|
|
53276
|
+
"unlocked",
|
|
53277
|
+
"locking",
|
|
53278
|
+
"unlocking",
|
|
53279
|
+
"jammed",
|
|
53280
|
+
"on",
|
|
53281
|
+
"off",
|
|
53282
|
+
"home",
|
|
53283
|
+
"not_home",
|
|
53284
|
+
"matched",
|
|
53285
|
+
"diverged",
|
|
53286
|
+
"unknown",
|
|
53287
|
+
"latched",
|
|
53288
|
+
"live"
|
|
53289
|
+
]);
|
|
52876
53290
|
/**
|
|
52877
53291
|
* TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
|
|
52878
53292
|
*
|
|
@@ -53104,6 +53518,25 @@ TimelapseRuleInputSchema.extend({
|
|
|
53104
53518
|
createdAt: number(),
|
|
53105
53519
|
updatedAt: number()
|
|
53106
53520
|
});
|
|
53521
|
+
async function readHubMotionDetected(deviceState, deviceId) {
|
|
53522
|
+
let slice;
|
|
53523
|
+
try {
|
|
53524
|
+
slice = await deviceState.getCapSlice.query({
|
|
53525
|
+
deviceId,
|
|
53526
|
+
capName: "motion"
|
|
53527
|
+
});
|
|
53528
|
+
} catch (err) {
|
|
53529
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
53530
|
+
throw new Error(`motion state of device ${deviceId} is unreadable: ${reason}`, { cause: err });
|
|
53531
|
+
}
|
|
53532
|
+
const detected = slice?.["detected"];
|
|
53533
|
+
if (typeof detected !== "boolean") throw new Error(`motion state of device ${deviceId} is not published yet (unknown)`);
|
|
53534
|
+
return detected;
|
|
53535
|
+
}
|
|
53536
|
+
MotionOnMotionChangedDataSchema.omit({ triggeredBy: true });
|
|
53537
|
+
function providerMotionEvent(source, data) {
|
|
53538
|
+
return createEvent(EventCategory.ProviderMotion, source, data);
|
|
53539
|
+
}
|
|
53107
53540
|
object({
|
|
53108
53541
|
/**
|
|
53109
53542
|
* Fraction of the box's own size added on EACH side before cutting.
|
|
@@ -164659,6 +165092,22 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
164659
165092
|
* writers are {@link refreshNetworkLinkFromApi}. Seeded unknown so the
|
|
164660
165093
|
* restored slice (if any) stays valid and a fresh device draws no link.
|
|
164661
165094
|
*/
|
|
165095
|
+
/**
|
|
165096
|
+
* The native `motion` cap. This provider writes NO `motion` slice (D696):
|
|
165097
|
+
* `handleSimpleEvent` emits its raw push as `ProviderMotion` (`source:
|
|
165098
|
+
* 'onboard'`, D673), the orchestrator's camera-sensors bridge turns it into
|
|
165099
|
+
* the effective `MotionOnMotionChanged`, and the orchestrator is the slice's
|
|
165100
|
+
* only writer, with that effective value, on the hub. `isDetected`
|
|
165101
|
+
* therefore answers from the HUB's slice; an unreadable hub, or a slice
|
|
165102
|
+
* nobody has published since the hub started, fails the call. It never
|
|
165103
|
+
* answers `false` for "unknown" (D49, D393).
|
|
165104
|
+
*/
|
|
165105
|
+
registerMotionCap() {
|
|
165106
|
+
this.ctx.registerNativeCap(motionCapability, { isDetected: async ({ deviceId }) => {
|
|
165107
|
+
if (deviceId !== this.id) throw new Error(`ReolinkCamera: deviceId mismatch, expected ${this.id}, got ${deviceId}`);
|
|
165108
|
+
return readHubMotionDetected(this.ctx.api.deviceState, this.id);
|
|
165109
|
+
} });
|
|
165110
|
+
}
|
|
164662
165111
|
registerNetworkLink() {
|
|
164663
165112
|
this.ctx.registerNativeCap(networkLinkCapability, { getStatus: async ({ deviceId }) => {
|
|
164664
165113
|
if (deviceId !== this.id) throw new Error(`ReolinkCamera: deviceId mismatch, expected ${this.id}, got ${deviceId}`);
|
|
@@ -165387,15 +165836,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
165387
165836
|
};
|
|
165388
165837
|
} });
|
|
165389
165838
|
this.registerNetworkLink();
|
|
165390
|
-
this.
|
|
165391
|
-
if (deviceId !== this.id) throw new Error(`ReolinkCamera: deviceId mismatch, expected ${this.id}, got ${deviceId}`);
|
|
165392
|
-
return this.state.motion.detected ?? false;
|
|
165393
|
-
} });
|
|
165394
|
-
this.setCapSlice(motionCapability, {
|
|
165395
|
-
detected: false,
|
|
165396
|
-
lastDetectedAt: null,
|
|
165397
|
-
autoClearAfterMs: null
|
|
165398
|
-
});
|
|
165839
|
+
this.registerMotionCap();
|
|
165399
165840
|
this.registerDoorbellIfSupported();
|
|
165400
165841
|
this.registerPtzIfSupported();
|
|
165401
165842
|
this.registerPtzAutotrackIfSupported();
|
|
@@ -171394,11 +171835,11 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
171394
171835
|
* axes, each driven exclusively by their own firmware push events.
|
|
171395
171836
|
*
|
|
171396
171837
|
* - 'motion' + AI types (people, vehicle, animal, face, package):
|
|
171397
|
-
* emit `EventCategory.
|
|
171398
|
-
*
|
|
171399
|
-
*
|
|
171400
|
-
*
|
|
171401
|
-
*
|
|
171838
|
+
* emit the RAW push as `EventCategory.ProviderMotion`
|
|
171839
|
+
* (`source: 'onboard'`, D673). The orchestrator's camera-sensors bridge
|
|
171840
|
+
* re-emits it as the effective `MotionOnMotionChanged`, and the
|
|
171841
|
+
* orchestrator is the only writer of the camera's `motion` runtime-state
|
|
171842
|
+
* slice (D696; no slice write here). AI subtype also lands on
|
|
171402
171843
|
* `EventCategory.DetectionCameraNative`.
|
|
171403
171844
|
* - 'awake' / 'sleeping': emit DeviceAwake / DeviceSleeping. Battery
|
|
171404
171845
|
* power-state only — does NOT touch online state.
|
|
@@ -171451,7 +171892,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
171451
171892
|
} });
|
|
171452
171893
|
if (event.type === "motion") {
|
|
171453
171894
|
const now = Date.now();
|
|
171454
|
-
this.ctx.eventBus.emit(
|
|
171895
|
+
this.ctx.eventBus.emit(providerMotionEvent(eventSource, {
|
|
171455
171896
|
deviceId: this.id,
|
|
171456
171897
|
detected: true,
|
|
171457
171898
|
timestamp: now,
|
|
@@ -171479,7 +171920,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
171479
171920
|
}]
|
|
171480
171921
|
}));
|
|
171481
171922
|
} else this.noteNativeDetectionSuppressed(aiClass);
|
|
171482
|
-
this.ctx.eventBus.emit(
|
|
171923
|
+
this.ctx.eventBus.emit(providerMotionEvent(eventSource, {
|
|
171483
171924
|
deviceId: this.id,
|
|
171484
171925
|
detected: true,
|
|
171485
171926
|
timestamp: now,
|
|
@@ -173328,7 +173769,7 @@ var AutodetectCache = class {
|
|
|
173328
173769
|
* silently dropped.
|
|
173329
173770
|
*
|
|
173330
173771
|
* Returns a LIST rather than a single type because of `doorbell`. The
|
|
173331
|
-
* camera's `handleSimpleEvent` emits `
|
|
173772
|
+
* camera's `handleSimpleEvent` emits `ProviderMotion` for `motion`
|
|
173332
173773
|
* and for every AI class, but the `doorbell` branch emits ONLY
|
|
173333
173774
|
* `DoorbellOnPressed` and returns. An email is the sole signal a sleeping
|
|
173334
173775
|
* battery camera can send, so a doorbell-classified email mapped to
|