@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.js
CHANGED
|
@@ -32,7 +32,7 @@ let node_os = require("node:os");
|
|
|
32
32
|
node_os = require_chunk.__toESM(node_os);
|
|
33
33
|
let node_fs = require("node:fs");
|
|
34
34
|
node_fs = require_chunk.__toESM(node_fs, 1);
|
|
35
|
-
//#region ../types/dist/event-category-
|
|
35
|
+
//#region ../types/dist/event-category-BGmz_oxW.mjs
|
|
36
36
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
37
37
|
EventCategory["SystemBoot"] = "system.boot";
|
|
38
38
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -565,6 +565,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
565
565
|
*/
|
|
566
566
|
EventCategory["PipelineAudioInferenceResult"] = "pipeline.audio-inference-result";
|
|
567
567
|
EventCategory["DetectionPhaseTransition"] = "detection.phase-transition";
|
|
568
|
+
/**
|
|
569
|
+
* A camera provider's RAW onboard motion push (D673): the `MotionOnMotionChanged`
|
|
570
|
+
* data shape without `triggeredBy`, built by `providerMotionEvent`. Its one
|
|
571
|
+
* consumer is the orchestrator's camera-sensors bridge, which re-emits the
|
|
572
|
+
* camera's EFFECTIVE onboard motion as `MotionOnMotionChanged` (a pass-through
|
|
573
|
+
* for a camera with no attached sensor). Providers must not emit
|
|
574
|
+
* `MotionOnMotionChanged` themselves; `scripts/check-onboard-motion-emitters.ts`
|
|
575
|
+
* keeps it so (camera-grid is a named, deferred exception).
|
|
576
|
+
*/
|
|
568
577
|
EventCategory["ProviderMotion"] = "provider.motion";
|
|
569
578
|
EventCategory["ProviderDetection"] = "provider.detection";
|
|
570
579
|
EventCategory["EnrichmentEmbeddingStored"] = "enrichment.embedding.stored";
|
|
@@ -5403,7 +5412,7 @@ var ZodIssueCode = {
|
|
|
5403
5412
|
var ZodFirstPartyTypeKind;
|
|
5404
5413
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5405
5414
|
//#endregion
|
|
5406
|
-
//#region ../types/dist/sleep-
|
|
5415
|
+
//#region ../types/dist/sleep-CDCONfkt.mjs
|
|
5407
5416
|
/**
|
|
5408
5417
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5409
5418
|
* window to float samples (D455).
|
|
@@ -7494,7 +7503,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
7494
7503
|
return DeviceRole;
|
|
7495
7504
|
}({});
|
|
7496
7505
|
//#endregion
|
|
7497
|
-
//#region ../types/dist/composition-
|
|
7506
|
+
//#region ../types/dist/composition-43aqsZQj.mjs
|
|
7498
7507
|
/**
|
|
7499
7508
|
* The ffmpeg build every CamStack node downloads, per platform and arch.
|
|
7500
7509
|
*
|
|
@@ -7551,13 +7560,12 @@ portable("linux64"), portable("linuxarm64"), portable("macarm64"), portable("mac
|
|
|
7551
7560
|
* LA tabella "quale booleano di questo tipo di device conta come ALTO", e il
|
|
7552
7561
|
* valutatore puro del suo FRONTE.
|
|
7553
7562
|
*
|
|
7554
|
-
*
|
|
7555
|
-
*
|
|
7556
|
-
*
|
|
7557
|
-
*
|
|
7558
|
-
*
|
|
7559
|
-
* fa suonare il campanello ma non registra" — è esattamente D62.
|
|
7560
|
-
* SPOSTA qui e il doorbell la ri-esporta.
|
|
7563
|
+
* UNA tabella per tutti quelli che chiedono "questo device è ALTO?": il
|
|
7564
|
+
* trigger `RecordingTriggers.sensorDeviceIds` del recorder, i marker dei
|
|
7565
|
+
* sensori della post-analysis, il bridge camera-sensors dell'orchestratore e
|
|
7566
|
+
* le sorgenti di un campanello composto (`doorbellFeatureSources`, D671).
|
|
7567
|
+
* Una seconda copia divergerebbe alla prima cap aggiunta, e il sintomo — "il
|
|
7568
|
+
* sensore fa suonare il campanello ma non registra" — è esattamente D62.
|
|
7561
7569
|
*
|
|
7562
7570
|
* ⚠ NON è `DEVICE_STATE_READERS` (`catalogs/device-state-vocabulary.ts`), e le
|
|
7563
7571
|
* due non vanno unificate: quella risponde a "qual è la PAROLA di stato per una
|
|
@@ -7583,8 +7591,6 @@ var SOURCE_CAP_ACTIVE_FIELD = {
|
|
|
7583
7591
|
vibration: "detected",
|
|
7584
7592
|
tamper: "tampered"
|
|
7585
7593
|
};
|
|
7586
|
-
/** Cap names whose presence in a device's bindings qualify it as a source. */
|
|
7587
|
-
var SOURCE_CAPS = Object.keys(SOURCE_CAP_ACTIVE_FIELD);
|
|
7588
7594
|
/**
|
|
7589
7595
|
* Error types for the safe expression engine. Two distinct classes so callers
|
|
7590
7596
|
* can tell a compile-time (grammar) failure from a runtime (evaluation)
|
|
@@ -9040,6 +9046,82 @@ var ArchivedDebugNoteQueryInputSchema = object({
|
|
|
9040
9046
|
/** Max rows returned, newest-first. */
|
|
9041
9047
|
limit: number().int().min(1).max(1e3).optional()
|
|
9042
9048
|
});
|
|
9049
|
+
var TrackRelationKindSchema = _enum(["same-subject", "different-subjects"]);
|
|
9050
|
+
var TrackSideSchema = _enum(["before", "after"]);
|
|
9051
|
+
var TrackPurityValueSchema = _enum(["mixed", "not-a-subject"]);
|
|
9052
|
+
var TrackRelationSchema = object({
|
|
9053
|
+
id: string(),
|
|
9054
|
+
deviceId: number().int(),
|
|
9055
|
+
leftTrackId: string(),
|
|
9056
|
+
rightTrackId: string(),
|
|
9057
|
+
leftSide: TrackSideSchema.nullable(),
|
|
9058
|
+
rightSide: TrackSideSchema.nullable(),
|
|
9059
|
+
relation: TrackRelationKindSchema,
|
|
9060
|
+
presence: literal("continuous").nullable(),
|
|
9061
|
+
leftStartedAt: number().int().nullable(),
|
|
9062
|
+
rightStartedAt: number().int().nullable(),
|
|
9063
|
+
createdAt: number().int(),
|
|
9064
|
+
updatedAt: number().int(),
|
|
9065
|
+
author: string().nullable()
|
|
9066
|
+
});
|
|
9067
|
+
var TrackPuritySchema = object({
|
|
9068
|
+
id: string(),
|
|
9069
|
+
deviceId: number().int(),
|
|
9070
|
+
sourceTrackId: string(),
|
|
9071
|
+
purity: TrackPurityValueSchema,
|
|
9072
|
+
switchAtMs: number().int().nullable(),
|
|
9073
|
+
startedAt: number().int().nullable(),
|
|
9074
|
+
createdAt: number().int(),
|
|
9075
|
+
updatedAt: number().int(),
|
|
9076
|
+
author: string().nullable()
|
|
9077
|
+
});
|
|
9078
|
+
var SetTrackRelationInputSchema = object({
|
|
9079
|
+
deviceId: number().int(),
|
|
9080
|
+
trackId: string().min(1),
|
|
9081
|
+
otherTrackId: string().min(1),
|
|
9082
|
+
relation: TrackRelationKindSchema,
|
|
9083
|
+
presence: literal("continuous").optional(),
|
|
9084
|
+
trackSide: TrackSideSchema.optional(),
|
|
9085
|
+
otherSide: TrackSideSchema.optional()
|
|
9086
|
+
});
|
|
9087
|
+
var ClearTrackRelationInputSchema = object({
|
|
9088
|
+
deviceId: number().int(),
|
|
9089
|
+
trackId: string().min(1),
|
|
9090
|
+
otherTrackId: string().min(1)
|
|
9091
|
+
});
|
|
9092
|
+
var ClearTrackRelationResultSchema = object({ cleared: boolean() });
|
|
9093
|
+
var SetTrackPurityInputSchema = object({
|
|
9094
|
+
deviceId: number().int(),
|
|
9095
|
+
trackId: string().min(1),
|
|
9096
|
+
purity: _enum([
|
|
9097
|
+
"pure",
|
|
9098
|
+
"mixed",
|
|
9099
|
+
"not-a-subject"
|
|
9100
|
+
]),
|
|
9101
|
+
switchAtMs: number().int().optional()
|
|
9102
|
+
});
|
|
9103
|
+
/** `null` when `pure` cleared the row. */
|
|
9104
|
+
var SetTrackPurityResultSchema = object({ purity: TrackPuritySchema.nullable() });
|
|
9105
|
+
var ListTrackRelationsInputSchema = object({
|
|
9106
|
+
deviceId: number().int(),
|
|
9107
|
+
trackId: string().optional(),
|
|
9108
|
+
since: number().int().optional(),
|
|
9109
|
+
until: number().int().optional(),
|
|
9110
|
+
limit: number().int().min(1).max(5e3).optional()
|
|
9111
|
+
});
|
|
9112
|
+
var ListTrackRelationsResultSchema = object({
|
|
9113
|
+
relations: array(TrackRelationSchema).readonly(),
|
|
9114
|
+
purities: array(TrackPuritySchema).readonly(),
|
|
9115
|
+
truncated: boolean()
|
|
9116
|
+
});
|
|
9117
|
+
_enum([
|
|
9118
|
+
"unknown-track",
|
|
9119
|
+
"cross-device",
|
|
9120
|
+
"self-relation",
|
|
9121
|
+
"contradiction",
|
|
9122
|
+
"switch-outside-track",
|
|
9123
|
+
"switch-needs-mixed"
|
|
9124
|
+
]);
|
|
9043
9125
|
/**
|
|
9044
9126
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
9045
9127
|
* recordings and events management surfaces.
|
|
@@ -9238,7 +9320,7 @@ var RecordingTriggersSchema = object({
|
|
|
9238
9320
|
*
|
|
9239
9321
|
* Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
|
|
9240
9322
|
* `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
|
|
9241
|
-
* la stessa
|
|
9323
|
+
* la stessa del campanello composto (D671). Ed è il FRONTE, non
|
|
9242
9324
|
* il livello: un contatto trovato già aperto al riavvio del runner non fa
|
|
9243
9325
|
* registrare.
|
|
9244
9326
|
*/
|
|
@@ -12125,6 +12207,68 @@ method(object({
|
|
|
12125
12207
|
password: string()
|
|
12126
12208
|
}), AuthResultSchema.nullable(), { kind: "mutation" }), method(object({ state: string() }), string()), method(record(string(), string()), AuthResultSchema, { kind: "mutation" }), method(object({ token: string() }), AuthResultSchema.nullable());
|
|
12127
12209
|
/**
|
|
12210
|
+
* How long one snapshot may take end to end: the pinned copy of the whole
|
|
12211
|
+
* database plus `PRAGMA integrity_check` over the copy, on the hub's slowest
|
|
12212
|
+
* disk. ~800 MB at a pessimistic 10 MB/s is under 3 minutes; the bound is
|
|
12213
|
+
* generous because a timeout fails the whole backup run.
|
|
12214
|
+
*/
|
|
12215
|
+
var DATABASE_SNAPSHOT_TIMEOUT_MS = 30 * 6e4;
|
|
12216
|
+
/**
|
|
12217
|
+
* The databases an owner snapshots — declared by the OWNER, so a caller never
|
|
12218
|
+
* guesses which file is live from what sits beside it (a cleanly closed
|
|
12219
|
+
* database has no sidecars and is just as owned). Paths are absolute on the
|
|
12220
|
+
* owner's host.
|
|
12221
|
+
*/
|
|
12222
|
+
var DatabaseSnapshotTargetsSchema = object({ databases: array(object({ livePath: string() })) });
|
|
12223
|
+
/** One b-tree table of the snapshot and the rows it holds. */
|
|
12224
|
+
var DatabaseSnapshotTableSchema = object({
|
|
12225
|
+
name: string(),
|
|
12226
|
+
rows: number().int().nonnegative()
|
|
12227
|
+
});
|
|
12228
|
+
/**
|
|
12229
|
+
* What the owner wrote. Every path is ABSOLUTE on the owner's host — the
|
|
12230
|
+
* caller pins the call to its own node, so it can read the file; a caller
|
|
12231
|
+
* that finds the path outside its own data root refuses it rather than
|
|
12232
|
+
* archiving something it cannot place.
|
|
12233
|
+
*/
|
|
12234
|
+
var DatabaseSnapshotResultSchema = object({
|
|
12235
|
+
/** The live database the snapshot copies. Never to be copied as a file. */
|
|
12236
|
+
livePath: string(),
|
|
12237
|
+
/** The verified copy: `<livePath>` + {@link DATABASE_SNAPSHOT_SUFFIX}. */
|
|
12238
|
+
snapshotPath: string(),
|
|
12239
|
+
sizeBytes: number().int().nonnegative(),
|
|
12240
|
+
pageCount: number().int().nonnegative(),
|
|
12241
|
+
pageSize: number().int().positive(),
|
|
12242
|
+
/**
|
|
12243
|
+
* Every b-tree table with its row count. Read inside the SAME read
|
|
12244
|
+
* transaction the copy was taken from, and found EQUAL on the copy — so
|
|
12245
|
+
* this is the content of the snapshot, not an estimate of the source.
|
|
12246
|
+
*/
|
|
12247
|
+
tables: array(DatabaseSnapshotTableSchema),
|
|
12248
|
+
/** Wall time of the pinned copy (row counts included). */
|
|
12249
|
+
copyMs: number().nonnegative(),
|
|
12250
|
+
/** Wall time of the checks on the copy (`integrity_check`, row counts). */
|
|
12251
|
+
verifyMs: number().nonnegative(),
|
|
12252
|
+
/** When the pinned read transaction began (ms epoch) — the snapshot's instant. */
|
|
12253
|
+
takenAt: number()
|
|
12254
|
+
});
|
|
12255
|
+
/**
|
|
12256
|
+
* A snapshot as an ARCHIVE records it (`ArchiveManifest.sqliteSnapshots`):
|
|
12257
|
+
* the same facts, with both paths relative to the archive root (the node's
|
|
12258
|
+
* data dir), because an archive outlives the host that made it.
|
|
12259
|
+
*/
|
|
12260
|
+
var ArchiveSqliteSnapshotSchema = DatabaseSnapshotResultSchema.extend({
|
|
12261
|
+
/** Archive-relative path of the live database the archive does NOT carry. */
|
|
12262
|
+
livePath: string(),
|
|
12263
|
+
/** Archive-relative path of the verified copy it carries in its place. */
|
|
12264
|
+
snapshotPath: string()
|
|
12265
|
+
});
|
|
12266
|
+
method(object({}), DatabaseSnapshotTargetsSchema, { auth: "admin" }), method(object({}), DatabaseSnapshotResultSchema, {
|
|
12267
|
+
kind: "mutation",
|
|
12268
|
+
auth: "admin",
|
|
12269
|
+
timeoutMs: DATABASE_SNAPSHOT_TIMEOUT_MS
|
|
12270
|
+
});
|
|
12271
|
+
/**
|
|
12128
12272
|
* Orchestrator-side destination metadata. The orchestrator computes
|
|
12129
12273
|
* `id = <addonId>:<subId>` from its provider lookup so consumers
|
|
12130
12274
|
* (admin UI, restore flow) see one canonical key.
|
|
@@ -12235,7 +12379,12 @@ var ArchiveManifestSchema = object({
|
|
|
12235
12379
|
locations: array(string()),
|
|
12236
12380
|
entries: array(ArchiveEntrySchema),
|
|
12237
12381
|
totalBytes: number(),
|
|
12238
|
-
totalFiles: number()
|
|
12382
|
+
totalFiles: number(),
|
|
12383
|
+
/**
|
|
12384
|
+
* Live SQLite databases this archive carries as their OWNER's verified
|
|
12385
|
+
* snapshot instead of as files (D693). Absent on archives made before.
|
|
12386
|
+
*/
|
|
12387
|
+
sqliteSnapshots: array(ArchiveSqliteSnapshotSchema).optional()
|
|
12239
12388
|
});
|
|
12240
12389
|
var LocationStatSchema = object({
|
|
12241
12390
|
name: string(),
|
|
@@ -13761,6 +13910,116 @@ var CompositionBlockStateSchema = object({
|
|
|
13761
13910
|
reason: string().optional(),
|
|
13762
13911
|
fields: array(CompositionFieldStateSchema)
|
|
13763
13912
|
});
|
|
13913
|
+
var ComposerBlockSchema = object({
|
|
13914
|
+
id: string().min(1),
|
|
13915
|
+
name: string().min(1).max(120),
|
|
13916
|
+
enabled: boolean(),
|
|
13917
|
+
updatedAt: number(),
|
|
13918
|
+
composition: CompositionSchema
|
|
13919
|
+
});
|
|
13920
|
+
/**
|
|
13921
|
+
* A stored composition row that no longer PARSES — a schema a release
|
|
13922
|
+
* tightened, a row written by a newer build. Sent by id so the composer keeps
|
|
13923
|
+
* its device as a placeholder and reports the block `failed` naming the parse
|
|
13924
|
+
* error. Leaving it out would read, twice, exactly like a delete (D49).
|
|
13925
|
+
*/
|
|
13926
|
+
var ComposerUnreadableBlockSchema = object({
|
|
13927
|
+
id: string().min(1),
|
|
13928
|
+
/** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
|
|
13929
|
+
name: string().nullable(),
|
|
13930
|
+
/** The parse error, in the operator's words. */
|
|
13931
|
+
error: string()
|
|
13932
|
+
});
|
|
13933
|
+
method(object({
|
|
13934
|
+
/** The shared Blocks integration; null until `core-blocks` has reconciled it. */
|
|
13935
|
+
integrationId: string().nullable(),
|
|
13936
|
+
/** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
|
|
13937
|
+
storeLoaded: boolean(),
|
|
13938
|
+
blocks: array(ComposerBlockSchema),
|
|
13939
|
+
/** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
|
|
13940
|
+
restartBlockIds: array(string()),
|
|
13941
|
+
/** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
|
|
13942
|
+
unreadableBlocks: array(ComposerUnreadableBlockSchema)
|
|
13943
|
+
}), object({
|
|
13944
|
+
blocks: array(object({
|
|
13945
|
+
blockId: string(),
|
|
13946
|
+
status: CompositionRunStatusSchema,
|
|
13947
|
+
reason: string().optional()
|
|
13948
|
+
})),
|
|
13949
|
+
/**
|
|
13950
|
+
* False when the composer declared and withdrew NOTHING (store not loaded,
|
|
13951
|
+
* integration unknown, its own rows unread or read empty once). An empty
|
|
13952
|
+
* apply the caller owes is paid off only by one the composer acted on (D49).
|
|
13953
|
+
*/
|
|
13954
|
+
acted: boolean()
|
|
13955
|
+
}), {
|
|
13956
|
+
kind: "mutation",
|
|
13957
|
+
auth: "admin"
|
|
13958
|
+
}), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
|
|
13959
|
+
var NUMBER = {
|
|
13960
|
+
kind: "fixed",
|
|
13961
|
+
result: ["number"]
|
|
13962
|
+
};
|
|
13963
|
+
var BOOLEAN = {
|
|
13964
|
+
kind: "fixed",
|
|
13965
|
+
result: ["boolean"]
|
|
13966
|
+
};
|
|
13967
|
+
Object.freeze({
|
|
13968
|
+
min: NUMBER,
|
|
13969
|
+
max: NUMBER,
|
|
13970
|
+
abs: NUMBER,
|
|
13971
|
+
floor: NUMBER,
|
|
13972
|
+
ceil: NUMBER,
|
|
13973
|
+
sqrt: NUMBER,
|
|
13974
|
+
round: NUMBER,
|
|
13975
|
+
pow: NUMBER,
|
|
13976
|
+
clamp: NUMBER,
|
|
13977
|
+
avg: NUMBER,
|
|
13978
|
+
sum: NUMBER,
|
|
13979
|
+
age: NUMBER,
|
|
13980
|
+
convert: NUMBER,
|
|
13981
|
+
coalesce: { kind: "coalesce" },
|
|
13982
|
+
any: BOOLEAN,
|
|
13983
|
+
all: BOOLEAN,
|
|
13984
|
+
within: BOOLEAN,
|
|
13985
|
+
latest: {
|
|
13986
|
+
kind: "fixed",
|
|
13987
|
+
result: ["number", "null"]
|
|
13988
|
+
},
|
|
13989
|
+
number: {
|
|
13990
|
+
kind: "fixed",
|
|
13991
|
+
result: ["number", "null"]
|
|
13992
|
+
},
|
|
13993
|
+
rose: {
|
|
13994
|
+
kind: "fixed",
|
|
13995
|
+
result: ["number", "null"]
|
|
13996
|
+
},
|
|
13997
|
+
count: NUMBER
|
|
13998
|
+
});
|
|
13999
|
+
`${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
|
|
14000
|
+
/**
|
|
14001
|
+
* What a composition may BUILD on a device type (G2, D676): the caps a new
|
|
14002
|
+
* device of that type, or an existing one that lacks them, can be given. The
|
|
14003
|
+
* blockers are the validator's own refusal codes, and a spec compares this
|
|
14004
|
+
* listing with `planComposition` for every capability — the editor can never
|
|
14005
|
+
* offer a feature the save would refuse for the same reason.
|
|
14006
|
+
*/
|
|
14007
|
+
var ComposableFieldSchema = object({
|
|
14008
|
+
path: string(),
|
|
14009
|
+
kind: CompositionFieldKindSchema,
|
|
14010
|
+
nullable: boolean(),
|
|
14011
|
+
required: boolean(),
|
|
14012
|
+
enumValues: array(string()).optional()
|
|
14013
|
+
});
|
|
14014
|
+
var ComposableCapabilitiesSchema = object({ caps: array(object({
|
|
14015
|
+
cap: string(),
|
|
14016
|
+
fields: array(ComposableFieldSchema),
|
|
14017
|
+
/** Present for an item-array cap (`consumables.items`). */
|
|
14018
|
+
itemArray: object({
|
|
14019
|
+
path: string(),
|
|
14020
|
+
keyField: string()
|
|
14021
|
+
}).optional()
|
|
14022
|
+
})) });
|
|
13764
14023
|
/** Where a block runs. The operator chooses — a block driving a device on an
|
|
13765
14024
|
* agent is the reason placement is not fixed to the hub. */
|
|
13766
14025
|
var CoreBlockPlacementSchema = union([literal("hub"), string().min(1)]);
|
|
@@ -13925,7 +14184,7 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
|
|
|
13925
14184
|
}), method(object({ blockId: string() }), CompositionGetReadSchema, { auth: "admin" }), method(object({}), CompositionListReadSchema, { auth: "admin" }), method(object({
|
|
13926
14185
|
addonId: string().min(1),
|
|
13927
14186
|
stableId: string().min(1)
|
|
13928
|
-
}), CompositionCustomizationReadSchema, { auth: "admin" }), method(object({
|
|
14187
|
+
}), CompositionCustomizationReadSchema, { auth: "admin" }), method(object({ deviceType: _enum(DeviceType) }), ComposableCapabilitiesSchema, { auth: "admin" }), method(object({
|
|
13929
14188
|
composition: CompositionSchema,
|
|
13930
14189
|
blockId: string().optional()
|
|
13931
14190
|
}), CompositionValidationSchema, {
|
|
@@ -13933,52 +14192,6 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
|
|
|
13933
14192
|
auth: "admin",
|
|
13934
14193
|
access: "view"
|
|
13935
14194
|
});
|
|
13936
|
-
var ComposerBlockSchema = object({
|
|
13937
|
-
id: string().min(1),
|
|
13938
|
-
name: string().min(1).max(120),
|
|
13939
|
-
enabled: boolean(),
|
|
13940
|
-
updatedAt: number(),
|
|
13941
|
-
composition: CompositionSchema
|
|
13942
|
-
});
|
|
13943
|
-
/**
|
|
13944
|
-
* A stored composition row that no longer PARSES — a schema a release
|
|
13945
|
-
* tightened, a row written by a newer build. Sent by id so the composer keeps
|
|
13946
|
-
* its device as a placeholder and reports the block `failed` naming the parse
|
|
13947
|
-
* error. Leaving it out would read, twice, exactly like a delete (D49).
|
|
13948
|
-
*/
|
|
13949
|
-
var ComposerUnreadableBlockSchema = object({
|
|
13950
|
-
id: string().min(1),
|
|
13951
|
-
/** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
|
|
13952
|
-
name: string().nullable(),
|
|
13953
|
-
/** The parse error, in the operator's words. */
|
|
13954
|
-
error: string()
|
|
13955
|
-
});
|
|
13956
|
-
method(object({
|
|
13957
|
-
/** The shared Blocks integration; null until `core-blocks` has reconciled it. */
|
|
13958
|
-
integrationId: string().nullable(),
|
|
13959
|
-
/** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
|
|
13960
|
-
storeLoaded: boolean(),
|
|
13961
|
-
blocks: array(ComposerBlockSchema),
|
|
13962
|
-
/** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
|
|
13963
|
-
restartBlockIds: array(string()),
|
|
13964
|
-
/** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
|
|
13965
|
-
unreadableBlocks: array(ComposerUnreadableBlockSchema)
|
|
13966
|
-
}), object({
|
|
13967
|
-
blocks: array(object({
|
|
13968
|
-
blockId: string(),
|
|
13969
|
-
status: CompositionRunStatusSchema,
|
|
13970
|
-
reason: string().optional()
|
|
13971
|
-
})),
|
|
13972
|
-
/**
|
|
13973
|
-
* False when the composer declared and withdrew NOTHING (store not loaded,
|
|
13974
|
-
* integration unknown, its own rows unread or read empty once). An empty
|
|
13975
|
-
* apply the caller owes is paid off only by one the composer acted on (D49).
|
|
13976
|
-
*/
|
|
13977
|
-
acted: boolean()
|
|
13978
|
-
}), {
|
|
13979
|
-
kind: "mutation",
|
|
13980
|
-
auth: "admin"
|
|
13981
|
-
}), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
|
|
13982
14195
|
/**
|
|
13983
14196
|
* `custom-model-registry` — collection cap exposing operator-registered
|
|
13984
14197
|
* custom detection models. Each provider (today: `addon-model-studio`)
|
|
@@ -16128,6 +16341,121 @@ method(object({
|
|
|
16128
16341
|
deviceIds: array(number()).readonly(),
|
|
16129
16342
|
caps: array(string()).readonly().optional()
|
|
16130
16343
|
}), record(string(), record(string(), unknown().nullable())));
|
|
16344
|
+
var ExtensionSlotIdSchema = _enum(["linked-devices"]);
|
|
16345
|
+
DeviceType.Camera;
|
|
16346
|
+
/** A slot's editable value, discriminated on `slot`. */
|
|
16347
|
+
var ExtensionSlotValueSchema = discriminatedUnion("slot", [LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
|
|
16348
|
+
DeviceType.Camera;
|
|
16349
|
+
var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
|
|
16350
|
+
state: literal("unreachable"),
|
|
16351
|
+
reason: string()
|
|
16352
|
+
})]);
|
|
16353
|
+
/** One provider of slots — the D554 source-listing row. */
|
|
16354
|
+
var ExtensionSourceSchema = object({
|
|
16355
|
+
/** The routing prefix of every `slotRef` this provider serves. */
|
|
16356
|
+
source: string(),
|
|
16357
|
+
label: string(),
|
|
16358
|
+
/** Stamped by the dispatcher from the registry (D557). */
|
|
16359
|
+
addonId: string().optional(),
|
|
16360
|
+
availability: ExtensionSourceAvailabilitySchema
|
|
16361
|
+
});
|
|
16362
|
+
/**
|
|
16363
|
+
* How one picked source stands. `missing` — no such device (deleted, or an id
|
|
16364
|
+
* that never existed); `foreign` — a device the slot's owner cannot read from
|
|
16365
|
+
* (a source owned by another addon); `unavailable` — it exists but is not a
|
|
16366
|
+
* valid source now (a container, which is never a pick). A source in any of
|
|
16367
|
+
* these states is SHOWN, never silently dropped or re-pointed.
|
|
16368
|
+
*/
|
|
16369
|
+
var ExtensionSourceHealthSchema = _enum([
|
|
16370
|
+
"ok",
|
|
16371
|
+
"missing",
|
|
16372
|
+
"foreign",
|
|
16373
|
+
"unavailable"
|
|
16374
|
+
]);
|
|
16375
|
+
var ExtensionSlotSourceSchema = object({
|
|
16376
|
+
deviceId: number().int(),
|
|
16377
|
+
/** The device's name, or null when it could not be resolved (`missing`). */
|
|
16378
|
+
name: string().nullable(),
|
|
16379
|
+
health: ExtensionSourceHealthSchema,
|
|
16380
|
+
detail: string().optional()
|
|
16381
|
+
});
|
|
16382
|
+
/**
|
|
16383
|
+
* A DIFFERENT authority that gates whether the slot's sources do anything —
|
|
16384
|
+
* reported read-only, named, never written through this contract (D62) — e.g.
|
|
16385
|
+
* a slot whose sources act only while a wrapper is bound to the host, a
|
|
16386
|
+
* binding that belongs to `deviceManager.setWrapperActive`. No slot reports
|
|
16387
|
+
* one today (`linked-devices` answers `null`). `unknown` means the gate could
|
|
16388
|
+
* not be read; it is not "inactive" (D315).
|
|
16389
|
+
*/
|
|
16390
|
+
var ExtensionSlotActivationSchema = object({
|
|
16391
|
+
state: _enum([
|
|
16392
|
+
"active",
|
|
16393
|
+
"inactive",
|
|
16394
|
+
"unknown"
|
|
16395
|
+
]),
|
|
16396
|
+
authority: string(),
|
|
16397
|
+
detail: string().optional()
|
|
16398
|
+
});
|
|
16399
|
+
var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
|
|
16400
|
+
state: literal("ok"),
|
|
16401
|
+
/** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
|
|
16402
|
+
slotRef: string(),
|
|
16403
|
+
slot: ExtensionSlotIdSchema,
|
|
16404
|
+
/** Names the store written (D62), e.g. `device-manager:_linkedDeviceIds`. */
|
|
16405
|
+
authority: string(),
|
|
16406
|
+
activation: ExtensionSlotActivationSchema.nullable(),
|
|
16407
|
+
value: ExtensionSlotValueSchema,
|
|
16408
|
+
sources: array(ExtensionSlotSourceSchema),
|
|
16409
|
+
/**
|
|
16410
|
+
* Devices the owner links to the host ON ITS OWN, by structure, and that
|
|
16411
|
+
* are therefore not in `value` (D655): a camera's device-tree children, and
|
|
16412
|
+
* the child a picked container stands for (D356 — a container is never a
|
|
16413
|
+
* pick, its children are). Read-only; the editor shows them and may offer
|
|
16414
|
+
* per-device options on them (the linked-devices tracked-event opt-in).
|
|
16415
|
+
* Absent when the owner links nothing beyond the picks, and from an owner
|
|
16416
|
+
* older than D655.
|
|
16417
|
+
*/
|
|
16418
|
+
impliedSources: array(ExtensionSlotSourceSchema).optional()
|
|
16419
|
+
}), object({
|
|
16420
|
+
state: literal("unreachable"),
|
|
16421
|
+
addonId: string(),
|
|
16422
|
+
reason: string()
|
|
16423
|
+
})]);
|
|
16424
|
+
var ExtensionCandidatesSchema = object({ candidates: array(object({
|
|
16425
|
+
deviceId: number().int(),
|
|
16426
|
+
name: string(),
|
|
16427
|
+
type: string(),
|
|
16428
|
+
location: string().nullable(),
|
|
16429
|
+
/** The container a child belongs to — "Spotlight 2" alone does not say which. */
|
|
16430
|
+
parentName: string().nullable(),
|
|
16431
|
+
/** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
|
|
16432
|
+
suggested: boolean(),
|
|
16433
|
+
/** Why it is suggested ("same location"), null when it is not. */
|
|
16434
|
+
reason: string().nullable()
|
|
16435
|
+
})) });
|
|
16436
|
+
/**
|
|
16437
|
+
* What a write did. `none` — applied in place. `host` / `parent` — the owner
|
|
16438
|
+
* reloaded the host (or, for an accessory child, its parent) because the
|
|
16439
|
+
* write changed what the host REGISTERS. A slot never adds a capability to its
|
|
16440
|
+
* host — that is a composition (D663) — so today's owners answer `none`.
|
|
16441
|
+
*/
|
|
16442
|
+
var ExtensionSetResultSchema = object({
|
|
16443
|
+
applied: literal(true),
|
|
16444
|
+
reload: _enum([
|
|
16445
|
+
"none",
|
|
16446
|
+
"host",
|
|
16447
|
+
"parent"
|
|
16448
|
+
])
|
|
16449
|
+
});
|
|
16450
|
+
var ExtensionSlotRefInputSchema = object({
|
|
16451
|
+
deviceId: number().int(),
|
|
16452
|
+
slotRef: string().min(1)
|
|
16453
|
+
});
|
|
16454
|
+
var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
|
|
16455
|
+
method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)), method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)), method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema), method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
|
|
16456
|
+
kind: "mutation",
|
|
16457
|
+
auth: "admin"
|
|
16458
|
+
});
|
|
16131
16459
|
/**
|
|
16132
16460
|
* Per-field ownership (D663). A composition may CLAIM fields of a native
|
|
16133
16461
|
* cap's runtime-state slice on an existing device: `replace` overlays the
|
|
@@ -19178,17 +19506,25 @@ var NcScheduleSchema = object({
|
|
|
19178
19506
|
*/
|
|
19179
19507
|
var NcSystemEventDeliveryModeSchema = _enum(["instant", "summary"]);
|
|
19180
19508
|
/**
|
|
19509
|
+
* How a summary window is SENT (D698): `rule` (absent) = ONE notification with
|
|
19510
|
+
* every section; `section` = one notification per section with something to
|
|
19511
|
+
* say (an unavailable section included), each titled by its section.
|
|
19512
|
+
*/
|
|
19513
|
+
var NcStateSummarySplitSchema = _enum(["rule", "section"]);
|
|
19514
|
+
/**
|
|
19181
19515
|
* `summary`: the rule sends NOTHING per event. When a window of `schedule`
|
|
19182
19516
|
* CLOSES, it sends one notification with the current state of its kinds
|
|
19183
19517
|
* (low batteries, consumables to replace, devices offline, updates
|
|
19184
|
-
* available, ...), after its own filters
|
|
19518
|
+
* available, ...), after its own filters — or, with `split: 'section'`
|
|
19519
|
+
* (D698), one notification per section. Nothing to report sends nothing.
|
|
19185
19520
|
* The schedule is the ordinary `NcSchedule` (weekly windows, IANA timezone,
|
|
19186
19521
|
* midnight crossing); the send time is each window's END. Refused on the
|
|
19187
19522
|
* `alarm` family, which stays instant (`systemEventDeliveryProblems`).
|
|
19188
19523
|
*/
|
|
19189
19524
|
var NcSystemEventDeliverySchema = discriminatedUnion("mode", [object({ mode: literal("instant") }), object({
|
|
19190
19525
|
mode: literal("summary"),
|
|
19191
|
-
schedule: NcScheduleSchema
|
|
19526
|
+
schedule: NcScheduleSchema,
|
|
19527
|
+
split: NcStateSummarySplitSchema.optional()
|
|
19192
19528
|
})]);
|
|
19193
19529
|
/** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
|
|
19194
19530
|
var NcPlateMatcherSchema = object({
|
|
@@ -19328,8 +19664,14 @@ var NcSensorTransitionSchema = _enum(["raised", "cleared"]);
|
|
|
19328
19664
|
/** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
|
|
19329
19665
|
var NcZoneConditionSchema = object({
|
|
19330
19666
|
ids: array(string().min(1)).min(1),
|
|
19331
|
-
/**
|
|
19332
|
-
|
|
19667
|
+
/**
|
|
19668
|
+
* LEGACY quantifier over `ids`. Absent = `any` (at least one visited), which
|
|
19669
|
+
* is what both editors mean and all they write since D690: "all of" was
|
|
19670
|
+
* removed from the editors because on an immediate rule it asked one
|
|
19671
|
+
* detection to stand in every zone at once. Still ACCEPTED, and `all` still
|
|
19672
|
+
* evaluated, so a stored rule keeps parsing and meaning what it meant.
|
|
19673
|
+
*/
|
|
19674
|
+
match: _enum(["any", "all"]).optional()
|
|
19333
19675
|
});
|
|
19334
19676
|
/**
|
|
19335
19677
|
* The P1 condition set — a flat AND of groups; absent group = pass;
|
|
@@ -19833,10 +20175,12 @@ var NcMediaPolicySchema = object({
|
|
|
19833
20175
|
/**
|
|
19834
20176
|
* Cooldown GRANULARITY over the subject's class — how much a fired
|
|
19835
20177
|
* notification suppresses.
|
|
19836
|
-
* - `
|
|
19837
|
-
*
|
|
19838
|
-
*
|
|
19839
|
-
*
|
|
20178
|
+
* - `per-class` (default, and the absent value since 2026-10-01 — D36) — an
|
|
20179
|
+
* independent window per detected class: cat→dog fires at once, cat→cat
|
|
20180
|
+
* still waits.
|
|
20181
|
+
* - `shared` — one window for the whole rule/scope: a cat silences the next
|
|
20182
|
+
* dog for `cooldownSec`. Only written when an operator picks it; it is no
|
|
20183
|
+
* longer what an unset rule means.
|
|
19840
20184
|
*
|
|
19841
20185
|
* AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
|
|
19842
20186
|
* must not be swallowed by a bark's window (the precedent this generalizes —
|
|
@@ -19851,8 +20195,11 @@ var NcThrottleSchema = object({
|
|
|
19851
20195
|
/**
|
|
19852
20196
|
* Class granularity of the cooldown key. Optional rather than defaulted:
|
|
19853
20197
|
* a Zod default does NOT run on the addon→addon cap path, so a persisted
|
|
19854
|
-
* rule authored before this field simply carries none
|
|
19855
|
-
*
|
|
20198
|
+
* rule authored before this field simply carries none. The engine used to
|
|
20199
|
+
* read absent as `shared` (D36); since 2026-10-01 it reads absent as
|
|
20200
|
+
* `per-class` — the operator's default — and only an explicit `shared`
|
|
20201
|
+
* still means `shared`. See `cooldownKey` / `keysPerClass` in the rule
|
|
20202
|
+
* engine, and D36's dated note.
|
|
19856
20203
|
*/
|
|
19857
20204
|
granularity: NcThrottleGranularitySchema.optional()
|
|
19858
20205
|
});
|
|
@@ -20176,11 +20523,23 @@ var NcStateSummaryPreviewSectionSchema = object({
|
|
|
20176
20523
|
reason: string().optional()
|
|
20177
20524
|
});
|
|
20178
20525
|
/**
|
|
20526
|
+
* One notification a previewed summary would send (D698): the whole summary on
|
|
20527
|
+
* a `rule` split (no `section`), one section's on a `section` split.
|
|
20528
|
+
*/
|
|
20529
|
+
var NcStateSummaryPreviewRowSchema = object({
|
|
20530
|
+
section: string().optional(),
|
|
20531
|
+
/** The section's name on a per-section row; every reported section's, joined, on a combined one. */
|
|
20532
|
+
title: string(),
|
|
20533
|
+
text: string(),
|
|
20534
|
+
count: number().int().nonnegative()
|
|
20535
|
+
});
|
|
20536
|
+
/**
|
|
20179
20537
|
* The summary a rule would send now. `empty` = nothing to report and every
|
|
20180
20538
|
* section read: such a summary is NOT sent. `dropped` counts the open states
|
|
20181
20539
|
* the rule's own filters (or a camera mute) left out, by reason.
|
|
20182
20540
|
* `excludedGroups` names the kind groups selected that have no state to report
|
|
20183
|
-
* (backups & exports).
|
|
20541
|
+
* (backups & exports). `split` and `rows` (D698) say how it would be sent —
|
|
20542
|
+
* optional, so an older hub's answer still parses.
|
|
20184
20543
|
*/
|
|
20185
20544
|
var NcStateSummaryPreviewSchema = object({
|
|
20186
20545
|
empty: boolean(),
|
|
@@ -20188,7 +20547,9 @@ var NcStateSummaryPreviewSchema = object({
|
|
|
20188
20547
|
text: string(),
|
|
20189
20548
|
sections: array(NcStateSummaryPreviewSectionSchema),
|
|
20190
20549
|
dropped: record(string(), number().int().nonnegative()),
|
|
20191
|
-
excludedGroups: array(string())
|
|
20550
|
+
excludedGroups: array(string()),
|
|
20551
|
+
split: NcStateSummarySplitSchema.optional(),
|
|
20552
|
+
rows: array(NcStateSummaryPreviewRowSchema).optional()
|
|
20192
20553
|
});
|
|
20193
20554
|
var NcTestResultSchema = object({
|
|
20194
20555
|
recordId: string(),
|
|
@@ -21202,12 +21563,26 @@ var CameraSensorRefSchema = object({
|
|
|
21202
21563
|
function cameraSensorRefKey(ref) {
|
|
21203
21564
|
return `${ref.addonId}/${ref.stableId}`;
|
|
21204
21565
|
}
|
|
21205
|
-
/**
|
|
21206
|
-
|
|
21207
|
-
|
|
21208
|
-
|
|
21209
|
-
|
|
21210
|
-
|
|
21566
|
+
/**
|
|
21567
|
+
* A sensor's mode (D673). `in-addition`: its motion is the camera's motion too.
|
|
21568
|
+
* `replace`: its motion is the camera's, and while one is READY the camera's
|
|
21569
|
+
* own motion no longer counts on its own. `confirm`: while one is READY the
|
|
21570
|
+
* camera's own motion counts only while a confirm sensor is active — with or
|
|
21571
|
+
* without a replace sensor (spec C2, the controller's ruling on Q1).
|
|
21572
|
+
*/
|
|
21573
|
+
var CameraSensorModeSchema = _enum([
|
|
21574
|
+
"in-addition",
|
|
21575
|
+
"confirm",
|
|
21576
|
+
"replace"
|
|
21577
|
+
]);
|
|
21578
|
+
/** A stored sensor with no mode — every CS-1 row — is in addition. */
|
|
21579
|
+
var DEFAULT_CAMERA_SENSOR_MODE = "in-addition";
|
|
21580
|
+
/**
|
|
21581
|
+
* A camera's attached sensors. A CS-1 row carried an envelope
|
|
21582
|
+
* `mode: 'in-addition'`: `z.object` drops it on parse, and the PARSED value is
|
|
21583
|
+
* what the write stores (D672 rule 3), so it is never written again.
|
|
21584
|
+
*/
|
|
21585
|
+
var CameraSensorsConfigSchema = object({ sensors: array(CameraSensorRefSchema.extend({ mode: CameraSensorModeSchema.default(DEFAULT_CAMERA_SENSOR_MODE) })).min(1).max(8) }).superRefine((value, ctx) => {
|
|
21211
21586
|
const seen = /* @__PURE__ */ new Set();
|
|
21212
21587
|
value.sensors.forEach((ref, index) => {
|
|
21213
21588
|
const key = cameraSensorRefKey(ref);
|
|
@@ -21219,39 +21594,41 @@ object({
|
|
|
21219
21594
|
seen.add(key);
|
|
21220
21595
|
});
|
|
21221
21596
|
});
|
|
21222
|
-
|
|
21597
|
+
/** Every attachment names its mode; an older orchestrator that does not is in addition. */
|
|
21598
|
+
var AttachmentFields = {
|
|
21223
21599
|
addonId: string(),
|
|
21224
|
-
stableId: string()
|
|
21600
|
+
stableId: string(),
|
|
21601
|
+
mode: CameraSensorModeSchema.default(DEFAULT_CAMERA_SENSOR_MODE)
|
|
21225
21602
|
};
|
|
21226
21603
|
var CameraSensorAttachmentSchema = discriminatedUnion("state", [
|
|
21227
21604
|
object({
|
|
21228
|
-
...
|
|
21605
|
+
...AttachmentFields,
|
|
21229
21606
|
state: literal("ready"),
|
|
21230
21607
|
deviceId: number(),
|
|
21231
21608
|
name: string(),
|
|
21232
21609
|
caps: array(string()).readonly()
|
|
21233
21610
|
}),
|
|
21234
21611
|
object({
|
|
21235
|
-
...
|
|
21612
|
+
...AttachmentFields,
|
|
21236
21613
|
state: literal("offline"),
|
|
21237
21614
|
deviceId: number(),
|
|
21238
21615
|
name: string(),
|
|
21239
21616
|
reason: _enum(["offline", "disabled"])
|
|
21240
21617
|
}),
|
|
21241
21618
|
object({
|
|
21242
|
-
...
|
|
21619
|
+
...AttachmentFields,
|
|
21243
21620
|
state: literal("missing"),
|
|
21244
21621
|
reason: string()
|
|
21245
21622
|
}),
|
|
21246
21623
|
object({
|
|
21247
|
-
...
|
|
21624
|
+
...AttachmentFields,
|
|
21248
21625
|
state: literal("unsupported"),
|
|
21249
21626
|
deviceId: number(),
|
|
21250
21627
|
name: string(),
|
|
21251
21628
|
reason: string()
|
|
21252
21629
|
}),
|
|
21253
21630
|
object({
|
|
21254
|
-
...
|
|
21631
|
+
...AttachmentFields,
|
|
21255
21632
|
state: literal("unreadable"),
|
|
21256
21633
|
reason: string()
|
|
21257
21634
|
})
|
|
@@ -21264,17 +21641,49 @@ var CameraSensorAttachmentSchema = discriminatedUnion("state", [
|
|
|
21264
21641
|
* say.
|
|
21265
21642
|
*/
|
|
21266
21643
|
var CameraSensorsNotForwardedSchema = _enum(["onboard-not-listed", "no-active-detection"]);
|
|
21644
|
+
/** Whether the camera's OWN motion counts on its own (D673 C2), from its READY sensors (C3). */
|
|
21645
|
+
var CameraOwnMotionSchema = _enum([
|
|
21646
|
+
"always",
|
|
21647
|
+
"when-confirmed",
|
|
21648
|
+
"never"
|
|
21649
|
+
]);
|
|
21650
|
+
/** Confirm / Replace cannot suppress this camera's motion: its provider still emits it directly (D673 C13). */
|
|
21651
|
+
var CameraSensorsNotEnforcedSchema = _enum(["provider-not-split"]);
|
|
21652
|
+
/**
|
|
21653
|
+
* The camera's OWN onboard motion (D696): the raw input the bridge combines,
|
|
21654
|
+
* never the effective value. The camera's `motion` slice is the effective one,
|
|
21655
|
+
* so a view of the camera's own row reads this.
|
|
21656
|
+
* - `atMs`: when the bridge received the camera's last own edge.
|
|
21657
|
+
* - `detected`: evaluated WHEN THE STATUS IS ASKED — the last edge said `true`
|
|
21658
|
+
* AND it is younger than the window the bridge counts the camera's own motion
|
|
21659
|
+
* for (`motionCooldownMs`, floored at two sustain ticks). A camera that never
|
|
21660
|
+
* sends a clear (heartbeats only) therefore reads `false` once no push came
|
|
21661
|
+
* within the window; a status read is a snapshot, so a live view re-asks.
|
|
21662
|
+
* Absent = this orchestrator has not received the camera's own motion since it
|
|
21663
|
+
* started (unknown, never "quiet"), or an orchestrator older than D696.
|
|
21664
|
+
*/
|
|
21665
|
+
var CameraRawLevelSchema = object({
|
|
21666
|
+
detected: boolean(),
|
|
21667
|
+
atMs: number()
|
|
21668
|
+
});
|
|
21267
21669
|
var CameraSensorsStatusSchema = discriminatedUnion("state", [
|
|
21268
|
-
object({
|
|
21670
|
+
object({
|
|
21671
|
+
state: literal("not-configured"),
|
|
21672
|
+
cameraLevel: CameraRawLevelSchema.optional()
|
|
21673
|
+
}),
|
|
21269
21674
|
object({
|
|
21270
21675
|
state: literal("unreadable"),
|
|
21271
|
-
reason: string()
|
|
21676
|
+
reason: string(),
|
|
21677
|
+
cameraLevel: CameraRawLevelSchema.optional()
|
|
21272
21678
|
}),
|
|
21273
21679
|
object({
|
|
21274
21680
|
state: literal("configured"),
|
|
21275
|
-
|
|
21681
|
+
cameraLevel: CameraRawLevelSchema.optional(),
|
|
21276
21682
|
sensors: array(CameraSensorAttachmentSchema).readonly(),
|
|
21277
|
-
|
|
21683
|
+
/** Absent = an orchestrator older than CS-2: it does not say (D315). */
|
|
21684
|
+
cameraMotion: CameraOwnMotionSchema.optional(),
|
|
21685
|
+
notForwarded: CameraSensorsNotForwardedSchema.optional(),
|
|
21686
|
+
notEnforced: CameraSensorsNotEnforcedSchema.optional()
|
|
21278
21687
|
})
|
|
21279
21688
|
]);
|
|
21280
21689
|
Object.freeze({
|
|
@@ -23109,7 +23518,8 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
23109
23518
|
trackIds: array(string()).min(1)
|
|
23110
23519
|
}), object({
|
|
23111
23520
|
deleted: number().int(),
|
|
23112
|
-
failed: array(string()).readonly()
|
|
23521
|
+
failed: array(string()).readonly(),
|
|
23522
|
+
sparedMediaIds: array(number().int()).readonly().optional()
|
|
23113
23523
|
}), {
|
|
23114
23524
|
kind: "mutation",
|
|
23115
23525
|
auth: "admin"
|
|
@@ -23118,7 +23528,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
23118
23528
|
deviceId: number(),
|
|
23119
23529
|
trackId: string(),
|
|
23120
23530
|
flags: TrackFlagsPatchSchema
|
|
23121
|
-
}), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
|
|
23531
|
+
}), 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, {
|
|
23122
23532
|
kind: "query",
|
|
23123
23533
|
auth: "admin"
|
|
23124
23534
|
}), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
|
|
@@ -24504,8 +24914,10 @@ var RunnerCameraConfigSchema = object({
|
|
|
24504
24914
|
* - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
|
|
24505
24915
|
* analyzer providers) running on decoded frames in this runner.
|
|
24506
24916
|
* - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
|
|
24507
|
-
* analytics). The provider emits ProviderMotion
|
|
24508
|
-
*
|
|
24917
|
+
* analytics). The provider emits its raw push as `ProviderMotion`
|
|
24918
|
+
* (D673); the orchestrator's camera-sensors bridge re-emits the camera's
|
|
24919
|
+
* effective motion as `MotionOnMotionChanged`, which is what reaches
|
|
24920
|
+
* `reportMotion`.
|
|
24509
24921
|
*/
|
|
24510
24922
|
motionSources: MotionSourcesSchema.default(["analyzer"]),
|
|
24511
24923
|
/**
|
|
@@ -24682,7 +25094,15 @@ var RunnerLocalLoadSchema = object({
|
|
|
24682
25094
|
hasGpu: boolean(),
|
|
24683
25095
|
inferenceBackend: string().optional(),
|
|
24684
25096
|
cpuCores: number().optional()
|
|
24685
|
-
})
|
|
25097
|
+
}),
|
|
25098
|
+
/**
|
|
25099
|
+
* Who writes a camera's `motion` runtime slice (D696). `'orchestrator'`: this
|
|
25100
|
+
* runner never writes it. ABSENT = a runner older than D696, which still
|
|
25101
|
+
* writes the slice from its phase machine; the orchestrator does not write
|
|
25102
|
+
* while any runner node is absent-or-unanswered, so one slice never has two
|
|
25103
|
+
* writers.
|
|
25104
|
+
*/
|
|
25105
|
+
motionSliceWriter: literal("orchestrator").optional()
|
|
24686
25106
|
});
|
|
24687
25107
|
/**
|
|
24688
25108
|
* Aggregate runtime metrics for the runner's whole local pool. Mirrors the
|
|
@@ -25316,7 +25736,64 @@ var NodeInferenceDevicesSchema = object({
|
|
|
25316
25736
|
reachable: boolean(),
|
|
25317
25737
|
devices: array(NodeInferenceDeviceSchema).readonly()
|
|
25318
25738
|
});
|
|
25319
|
-
|
|
25739
|
+
/**
|
|
25740
|
+
* Pipeline Orchestrator capability — global load balancer + camera dispatcher.
|
|
25741
|
+
*
|
|
25742
|
+
* Lives on the hub. Tracks the camera-to-agent assignment map, listens to
|
|
25743
|
+
* device lifecycle events, queries each runner's capacity + hardware
|
|
25744
|
+
* profile, and dispatches `attachCamera` / `detachCamera` cap calls to the
|
|
25745
|
+
* appropriate runner instances. Persists assignments via the multi-level
|
|
25746
|
+
* settings store so they survive hub restarts.
|
|
25747
|
+
*
|
|
25748
|
+
* Strictly the control plane: never sees a frame, never calls inference,
|
|
25749
|
+
* never drains queues. The runner does that work locally on each agent.
|
|
25750
|
+
*/
|
|
25751
|
+
/**
|
|
25752
|
+
* The input of `setCameraSensors` (G5, D676): the ONE typed write path of a
|
|
25753
|
+
* camera's attached sensors (D672). `config: null` removes the attachment —
|
|
25754
|
+
* the camera reads `not-configured` again, never `unreadable`.
|
|
25755
|
+
*/
|
|
25756
|
+
var SetCameraSensorsInputSchema = object({
|
|
25757
|
+
deviceId: number().int().nonnegative(),
|
|
25758
|
+
/** `null` removes the attachment: the camera goes back to `not-configured`. */
|
|
25759
|
+
config: CameraSensorsConfigSchema.nullable()
|
|
25760
|
+
});
|
|
25761
|
+
/**
|
|
25762
|
+
* Why an early occupancy look (D691) was not scheduled.
|
|
25763
|
+
*
|
|
25764
|
+
* - `unknown-camera` — no session was ever dispatched for it, so there is no
|
|
25765
|
+
* node and no config to attach a burst with.
|
|
25766
|
+
* - `out-of-range` — the ask is negative or further out than the orchestrator
|
|
25767
|
+
* will hold a timer for; the parked-object cadence is the answer there.
|
|
25768
|
+
* - `no-burst-producer` — this build has no burst producer at all.
|
|
25769
|
+
* - `already-looked` — this camera's ONE early look since its last session has
|
|
25770
|
+
* been spent. A look's own burst can re-arm a flickering flip, and a look
|
|
25771
|
+
* per arm would chain a burst every ~30 s forever (review H2); the next
|
|
25772
|
+
* real session re-arms the budget.
|
|
25773
|
+
*/
|
|
25774
|
+
var OccupancyLookRefusalSchema = _enum([
|
|
25775
|
+
"unknown-camera",
|
|
25776
|
+
"out-of-range",
|
|
25777
|
+
"no-burst-producer",
|
|
25778
|
+
"already-looked"
|
|
25779
|
+
]);
|
|
25780
|
+
method(object({
|
|
25781
|
+
deviceId: number().int().nonnegative(),
|
|
25782
|
+
/** How long from NOW until the pending flip's sustain window ends. RELATIVE,
|
|
25783
|
+
* so the caller's clock and the orchestrator's never have to agree. */
|
|
25784
|
+
afterMs: number().finite(),
|
|
25785
|
+
/** Why, for the log. */
|
|
25786
|
+
reason: string()
|
|
25787
|
+
}), object({
|
|
25788
|
+
scheduled: boolean(),
|
|
25789
|
+
/** When `scheduled`: how long until the burst is dialled. */
|
|
25790
|
+
dueInMs: number().optional(),
|
|
25791
|
+
/** When not `scheduled`: why. */
|
|
25792
|
+
refusedBecause: OccupancyLookRefusalSchema.optional()
|
|
25793
|
+
}), {
|
|
25794
|
+
kind: "mutation",
|
|
25795
|
+
auth: "admin"
|
|
25796
|
+
}), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
|
|
25320
25797
|
kind: "mutation",
|
|
25321
25798
|
auth: "admin"
|
|
25322
25799
|
}), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
|
|
@@ -25470,7 +25947,10 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
|
|
|
25470
25947
|
}), CameraSwitchGroupSchema, {
|
|
25471
25948
|
kind: "mutation",
|
|
25472
25949
|
auth: "admin"
|
|
25473
|
-
}), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(
|
|
25950
|
+
}), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(SetCameraSensorsInputSchema, object({ success: literal(true) }), {
|
|
25951
|
+
kind: "mutation",
|
|
25952
|
+
auth: "admin"
|
|
25953
|
+
}), method(_void(), DiskReconcileJobSchema, {
|
|
25474
25954
|
kind: "mutation",
|
|
25475
25955
|
auth: "admin"
|
|
25476
25956
|
}), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
|
|
@@ -28198,219 +28678,6 @@ var CLIP_PLAYBACK_OPTIONS = {
|
|
|
28198
28678
|
}
|
|
28199
28679
|
};
|
|
28200
28680
|
/**
|
|
28201
|
-
* Doorbell button cap. Two kinds of providers coexist behind this cap
|
|
28202
|
-
* name (same pattern as `snapshot`):
|
|
28203
|
-
*
|
|
28204
|
-
* - **Native** providers: registered per-device by device-driver
|
|
28205
|
-
* addons via `ctx.registerNativeCap` — either on a
|
|
28206
|
-
* `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
|
|
28207
|
-
* or directly on the camera (Reolink registers at camera level).
|
|
28208
|
-
* Emits an `onPressed` event every time the firmware pushes a
|
|
28209
|
-
* ring; status tracks the last press and a pressCount since start
|
|
28210
|
-
* (diagnostic).
|
|
28211
|
-
*
|
|
28212
|
-
* - **Wrapper** provider: the `virtual-doorbell` system builtin
|
|
28213
|
-
* (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
|
|
28214
|
-
* device (contact / switch / event-emitter …) into a doorbell for
|
|
28215
|
-
* a camera. `defaultActive: false` — the operator explicitly binds
|
|
28216
|
-
* it per camera in the device-bindings UI, then picks the source
|
|
28217
|
-
* device + trigger in the per-device settings.
|
|
28218
|
-
*
|
|
28219
|
-
* The DeviceEventPropagator re-emits `onPressed` on the camera parent
|
|
28220
|
-
* — subscribers listening at the camera level receive ring events
|
|
28221
|
-
* with `via[]` populated. No code on the parent needed.
|
|
28222
|
-
*/
|
|
28223
|
-
var DoorbellStatusSchema = object({
|
|
28224
|
-
/** Ms epoch of the last press. null = never observed since this provider started. */
|
|
28225
|
-
lastPressedAt: number().nullable(),
|
|
28226
|
-
/** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
|
|
28227
|
-
pressCountSinceStart: number()
|
|
28228
|
-
});
|
|
28229
|
-
var DoorbellPressEventSchema = object({
|
|
28230
|
-
deviceId: number(),
|
|
28231
|
-
timestamp: number()
|
|
28232
|
-
});
|
|
28233
|
-
/**
|
|
28234
|
-
* The `doorbell-source` extension slot's editable value (D648): the camera's
|
|
28235
|
-
* virtual-doorbell trigger devices, exactly what the wrapper's
|
|
28236
|
-
* `doorbellSources` persists (as `{ deviceId }` records).
|
|
28237
|
-
*/
|
|
28238
|
-
var DoorbellSourceSlotValueSchema = object({ deviceIds: array(number().int().positive()) });
|
|
28239
|
-
/**
|
|
28240
|
-
* The `doorbell-source` slot — which devices ring this camera's VIRTUAL
|
|
28241
|
-
* doorbell, owned by the `virtual-doorbell` wrapper over its
|
|
28242
|
-
* `doorbellSources` store (D648). A source rings when one of its
|
|
28243
|
-
* `SOURCE_CAPS` rises. Whether the wrapper is bound to the camera at all is a
|
|
28244
|
-
* different authority (`deviceManager.setWrapperActive`, D62) — the slot
|
|
28245
|
-
* reports it, it never writes it.
|
|
28246
|
-
*/
|
|
28247
|
-
var DOORBELL_SOURCE_SLOT = {
|
|
28248
|
-
id: "doorbell-source",
|
|
28249
|
-
label: "Doorbell trigger devices",
|
|
28250
|
-
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.",
|
|
28251
|
-
shape: "association",
|
|
28252
|
-
hostDeviceTypes: [DeviceType.Camera],
|
|
28253
|
-
sourceCaps: SOURCE_CAPS,
|
|
28254
|
-
cardinality: "many",
|
|
28255
|
-
value: DoorbellSourceSlotValueSchema
|
|
28256
|
-
};
|
|
28257
|
-
var doorbellCapability = {
|
|
28258
|
-
name: "doorbell",
|
|
28259
|
-
scope: "device",
|
|
28260
|
-
deviceNative: true,
|
|
28261
|
-
mode: "singleton",
|
|
28262
|
-
kind: "wrapper",
|
|
28263
|
-
defaultActive: false,
|
|
28264
|
-
deviceTypes: [DeviceType.Button, DeviceType.Camera],
|
|
28265
|
-
extensionSlots: [DOORBELL_SOURCE_SLOT],
|
|
28266
|
-
methods: {},
|
|
28267
|
-
events: {
|
|
28268
|
-
/**
|
|
28269
|
-
* Fires once per physical press. Reolink delivers via Baichuan
|
|
28270
|
-
* push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
|
|
28271
|
-
* release/duration — it's a pulse.
|
|
28272
|
-
*/
|
|
28273
|
-
onPressed: {
|
|
28274
|
-
data: DoorbellPressEventSchema,
|
|
28275
|
-
fromState: {
|
|
28276
|
-
field: "lastPressedAt",
|
|
28277
|
-
on: "advance"
|
|
28278
|
-
}
|
|
28279
|
-
} },
|
|
28280
|
-
status: {
|
|
28281
|
-
schema: DoorbellStatusSchema,
|
|
28282
|
-
kind: "push"
|
|
28283
|
-
},
|
|
28284
|
-
/**
|
|
28285
|
-
* Runtime-state slice — last press timestamp + lifetime press count.
|
|
28286
|
-
* Mirrored by the kernel and readable via
|
|
28287
|
-
* `device.state.doorbell.value`. UIs can show "last ring 5m ago"
|
|
28288
|
-
* without subscribing.
|
|
28289
|
-
*/
|
|
28290
|
-
runtimeState: DoorbellStatusSchema,
|
|
28291
|
-
/**
|
|
28292
|
-
* 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.
|
|
28293
|
-
*
|
|
28294
|
-
* See `RuntimeStateDurability`. Enforced by
|
|
28295
|
-
* `scripts/check-runtime-state-durability.ts`.
|
|
28296
|
-
*/
|
|
28297
|
-
durability: "restored"
|
|
28298
|
-
};
|
|
28299
|
-
var ExtensionSlotIdSchema = _enum(["doorbell-source", "linked-devices"]);
|
|
28300
|
-
DeviceType.Camera, DeviceType.Camera;
|
|
28301
|
-
/** A slot's editable value, discriminated on `slot`. */
|
|
28302
|
-
var ExtensionSlotValueSchema = discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
|
|
28303
|
-
DeviceType.Camera;
|
|
28304
|
-
var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
|
|
28305
|
-
state: literal("unreachable"),
|
|
28306
|
-
reason: string()
|
|
28307
|
-
})]);
|
|
28308
|
-
/** One provider of slots — the D554 source-listing row. */
|
|
28309
|
-
var ExtensionSourceSchema = object({
|
|
28310
|
-
/** The routing prefix of every `slotRef` this provider serves. */
|
|
28311
|
-
source: string(),
|
|
28312
|
-
label: string(),
|
|
28313
|
-
/** Stamped by the dispatcher from the registry (D557). */
|
|
28314
|
-
addonId: string().optional(),
|
|
28315
|
-
availability: ExtensionSourceAvailabilitySchema
|
|
28316
|
-
});
|
|
28317
|
-
/**
|
|
28318
|
-
* How one picked source stands. `missing` — no such device (deleted, or an id
|
|
28319
|
-
* that never existed); `foreign` — a device the slot's owner cannot read from
|
|
28320
|
-
* (a source owned by another addon); `unavailable` — it exists but is not a
|
|
28321
|
-
* valid source now (a container, which is never a pick). A source in any of
|
|
28322
|
-
* these states is SHOWN, never silently dropped or re-pointed.
|
|
28323
|
-
*/
|
|
28324
|
-
var ExtensionSourceHealthSchema = _enum([
|
|
28325
|
-
"ok",
|
|
28326
|
-
"missing",
|
|
28327
|
-
"foreign",
|
|
28328
|
-
"unavailable"
|
|
28329
|
-
]);
|
|
28330
|
-
var ExtensionSlotSourceSchema = object({
|
|
28331
|
-
deviceId: number().int(),
|
|
28332
|
-
/** The device's name, or null when it could not be resolved (`missing`). */
|
|
28333
|
-
name: string().nullable(),
|
|
28334
|
-
health: ExtensionSourceHealthSchema,
|
|
28335
|
-
detail: string().optional()
|
|
28336
|
-
});
|
|
28337
|
-
/**
|
|
28338
|
-
* A DIFFERENT authority that gates whether the slot's sources do anything —
|
|
28339
|
-
* reported read-only, named, never written through this contract (D62). The
|
|
28340
|
-
* virtual doorbell's sources ring only while the wrapper is bound to the
|
|
28341
|
-
* camera, and that binding belongs to `deviceManager.setWrapperActive`.
|
|
28342
|
-
* `unknown` means the gate could not be read; it is not "inactive" (D315).
|
|
28343
|
-
*/
|
|
28344
|
-
var ExtensionSlotActivationSchema = object({
|
|
28345
|
-
state: _enum([
|
|
28346
|
-
"active",
|
|
28347
|
-
"inactive",
|
|
28348
|
-
"unknown"
|
|
28349
|
-
]),
|
|
28350
|
-
authority: string(),
|
|
28351
|
-
detail: string().optional()
|
|
28352
|
-
});
|
|
28353
|
-
var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
|
|
28354
|
-
state: literal("ok"),
|
|
28355
|
-
/** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
|
|
28356
|
-
slotRef: string(),
|
|
28357
|
-
slot: ExtensionSlotIdSchema,
|
|
28358
|
-
/** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
|
|
28359
|
-
authority: string(),
|
|
28360
|
-
activation: ExtensionSlotActivationSchema.nullable(),
|
|
28361
|
-
value: ExtensionSlotValueSchema,
|
|
28362
|
-
sources: array(ExtensionSlotSourceSchema),
|
|
28363
|
-
/**
|
|
28364
|
-
* Devices the owner links to the host ON ITS OWN, by structure, and that
|
|
28365
|
-
* are therefore not in `value` (D655): a camera's device-tree children, and
|
|
28366
|
-
* the child a picked container stands for (D356 — a container is never a
|
|
28367
|
-
* pick, its children are). Read-only; the editor shows them and may offer
|
|
28368
|
-
* per-device options on them (the linked-devices tracked-event opt-in).
|
|
28369
|
-
* Absent when the owner links nothing beyond the picks, and from an owner
|
|
28370
|
-
* older than D655.
|
|
28371
|
-
*/
|
|
28372
|
-
impliedSources: array(ExtensionSlotSourceSchema).optional()
|
|
28373
|
-
}), object({
|
|
28374
|
-
state: literal("unreachable"),
|
|
28375
|
-
addonId: string(),
|
|
28376
|
-
reason: string()
|
|
28377
|
-
})]);
|
|
28378
|
-
var ExtensionCandidatesSchema = object({ candidates: array(object({
|
|
28379
|
-
deviceId: number().int(),
|
|
28380
|
-
name: string(),
|
|
28381
|
-
type: string(),
|
|
28382
|
-
location: string().nullable(),
|
|
28383
|
-
/** The container a child belongs to — "Spotlight 2" alone does not say which. */
|
|
28384
|
-
parentName: string().nullable(),
|
|
28385
|
-
/** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
|
|
28386
|
-
suggested: boolean(),
|
|
28387
|
-
/** Why it is suggested ("same location"), null when it is not. */
|
|
28388
|
-
reason: string().nullable()
|
|
28389
|
-
})) });
|
|
28390
|
-
/**
|
|
28391
|
-
* What a write did. `none` — applied in place. `host` / `parent` — the owner
|
|
28392
|
-
* reloaded the host (or, for an accessory child, its parent) because the
|
|
28393
|
-
* write changed what the host REGISTERS. A slot never adds a capability to its
|
|
28394
|
-
* host — that is a composition (D663) — so today's owners answer `none`.
|
|
28395
|
-
*/
|
|
28396
|
-
var ExtensionSetResultSchema = object({
|
|
28397
|
-
applied: literal(true),
|
|
28398
|
-
reload: _enum([
|
|
28399
|
-
"none",
|
|
28400
|
-
"host",
|
|
28401
|
-
"parent"
|
|
28402
|
-
])
|
|
28403
|
-
});
|
|
28404
|
-
var ExtensionSlotRefInputSchema = object({
|
|
28405
|
-
deviceId: number().int(),
|
|
28406
|
-
slotRef: string().min(1)
|
|
28407
|
-
});
|
|
28408
|
-
var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
|
|
28409
|
-
method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)), method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)), method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema), method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
|
|
28410
|
-
kind: "mutation",
|
|
28411
|
-
auth: "admin"
|
|
28412
|
-
});
|
|
28413
|
-
/**
|
|
28414
28681
|
* Optional client-side hints sent at session creation to help the provider
|
|
28415
28682
|
* pick the best native source. All fields optional — a viewer that knows
|
|
28416
28683
|
* nothing still gets a sane default. (Relocated from the retired `webrtc`
|
|
@@ -30878,6 +31145,70 @@ onStatusChanged: { data: object({
|
|
|
30878
31145
|
* whether persisting is worth a SQLite commit. */
|
|
30879
31146
|
volatileStateFields: ["lastChangedAt"]
|
|
30880
31147
|
};
|
|
31148
|
+
var DoorbellStatusSchema = object({
|
|
31149
|
+
/** Ms epoch of the last press. null = never observed since this provider started. */
|
|
31150
|
+
lastPressedAt: number().nullable(),
|
|
31151
|
+
/** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
|
|
31152
|
+
pressCountSinceStart: number()
|
|
31153
|
+
});
|
|
31154
|
+
var DoorbellPressEventSchema = object({
|
|
31155
|
+
deviceId: number(),
|
|
31156
|
+
timestamp: number()
|
|
31157
|
+
});
|
|
31158
|
+
/**
|
|
31159
|
+
* Doorbell button cap. Two kinds of provider serve it, and to every consumer
|
|
31160
|
+
* they are the same cap:
|
|
31161
|
+
*
|
|
31162
|
+
* - **Native** providers, registered per device by a driver addon through
|
|
31163
|
+
* `ctx.registerNativeCap` — a `DeviceType.Button` accessory with
|
|
31164
|
+
* `role: DeviceRole.Doorbell`, or the camera itself (Reolink registers at
|
|
31165
|
+
* camera level). They emit `onPressed` on every firmware ring.
|
|
31166
|
+
* - **A composed doorbell** (D670, D671): a camera's customization gives it
|
|
31167
|
+
* the cap, its `lastPressedAt` rising from the sources the operator
|
|
31168
|
+
* assigned in Customize → Doorbell, and the composer emits `onPressed`
|
|
31169
|
+
* from that field's advance (`fromState`).
|
|
31170
|
+
*
|
|
31171
|
+
* The DeviceEventPropagator re-emits `onPressed` on the camera parent.
|
|
31172
|
+
*/
|
|
31173
|
+
var doorbellCapability = {
|
|
31174
|
+
name: "doorbell",
|
|
31175
|
+
scope: "device",
|
|
31176
|
+
deviceNative: true,
|
|
31177
|
+
mode: "singleton",
|
|
31178
|
+
deviceTypes: [DeviceType.Button, DeviceType.Camera],
|
|
31179
|
+
methods: {},
|
|
31180
|
+
events: {
|
|
31181
|
+
/**
|
|
31182
|
+
* Fires once per physical press. Reolink delivers via Baichuan
|
|
31183
|
+
* push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
|
|
31184
|
+
* release/duration — it's a pulse.
|
|
31185
|
+
*/
|
|
31186
|
+
onPressed: {
|
|
31187
|
+
data: DoorbellPressEventSchema,
|
|
31188
|
+
fromState: {
|
|
31189
|
+
field: "lastPressedAt",
|
|
31190
|
+
on: "advance"
|
|
31191
|
+
}
|
|
31192
|
+
} },
|
|
31193
|
+
status: {
|
|
31194
|
+
schema: DoorbellStatusSchema,
|
|
31195
|
+
kind: "push"
|
|
31196
|
+
},
|
|
31197
|
+
/**
|
|
31198
|
+
* Runtime-state slice — last press timestamp + lifetime press count.
|
|
31199
|
+
* Mirrored by the kernel and readable via
|
|
31200
|
+
* `device.state.doorbell.value`. UIs can show "last ring 5m ago"
|
|
31201
|
+
* without subscribing.
|
|
31202
|
+
*/
|
|
31203
|
+
runtimeState: DoorbellStatusSchema,
|
|
31204
|
+
/**
|
|
31205
|
+
* 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.
|
|
31206
|
+
*
|
|
31207
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
31208
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
31209
|
+
*/
|
|
31210
|
+
durability: "restored"
|
|
31211
|
+
};
|
|
30881
31212
|
/**
|
|
30882
31213
|
* Enum-state sensor — a string value picked from a finite option set.
|
|
30883
31214
|
* Drives HA `sensor` entries with `state_class: enum` (HVAC action
|
|
@@ -33022,9 +33353,9 @@ var MotionStatusSchema = object({
|
|
|
33022
33353
|
/** Ms epoch of the last detected-true observation. Null if never detected. */
|
|
33023
33354
|
lastDetectedAt: number().nullable(),
|
|
33024
33355
|
/**
|
|
33025
|
-
* `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device
|
|
33026
|
-
* `null` while false and on every `Sensor`
|
|
33027
|
-
* constant's doc for the one-authority rule.
|
|
33356
|
+
* `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device (the
|
|
33357
|
+
* orchestrator writes it, D696), `null` while false and on every `Sensor`
|
|
33358
|
+
* device (D475) — see that constant's doc for the one-authority rule.
|
|
33028
33359
|
*
|
|
33029
33360
|
* ## Reading this field still arms nothing
|
|
33030
33361
|
*
|
|
@@ -33042,34 +33373,31 @@ var MotionStatusSchema = object({
|
|
|
33042
33373
|
* `addon-export-alexa/src/motion-clear-hold.ts` and
|
|
33043
33374
|
* `addon-export-hap`'s `RESET_DEBOUNCE_MS` both do.
|
|
33044
33375
|
*
|
|
33045
|
-
* ## Who writes it
|
|
33046
|
-
*
|
|
33047
|
-
* - **Cameras** — the
|
|
33048
|
-
*
|
|
33049
|
-
* `
|
|
33050
|
-
* `
|
|
33051
|
-
*
|
|
33052
|
-
*
|
|
33053
|
-
* a
|
|
33054
|
-
*
|
|
33055
|
-
*
|
|
33056
|
-
*
|
|
33057
|
-
*
|
|
33058
|
-
*
|
|
33059
|
-
*
|
|
33060
|
-
*
|
|
33061
|
-
*
|
|
33062
|
-
*
|
|
33063
|
-
* `
|
|
33064
|
-
*
|
|
33065
|
-
*
|
|
33066
|
-
*
|
|
33067
|
-
*
|
|
33068
|
-
*
|
|
33069
|
-
*
|
|
33070
|
-
* This predates D475 and is not fixed there: the fix touches every
|
|
33071
|
-
* camera provider. Recorded in D475's Consequences. Do not restore the
|
|
33072
|
-
* "sole writer" wording without also removing the other writers.
|
|
33376
|
+
* ## Who writes it (D696)
|
|
33377
|
+
*
|
|
33378
|
+
* - **Cameras** — the orchestrator, and nothing else. It writes the camera's
|
|
33379
|
+
* EFFECTIVE motion (`addon-pipeline-orchestrator`
|
|
33380
|
+
* `camera-sensors/motion-slice.ts`), alongside the effective
|
|
33381
|
+
* `MotionOnMotionChanged` it emits or receives: the camera-sensors bridge
|
|
33382
|
+
* for a split camera, an unsplit emitter's direct event, the analyzer and
|
|
33383
|
+
* device activity, as the camera's `motionSources` counts them. A source
|
|
33384
|
+
* that never sends a clear falls one window after its last `true`.
|
|
33385
|
+
* `lastDetectedAt` moves only on an effective rise. No camera provider
|
|
33386
|
+
* writes this slice (not even a boot seed), and neither does the runner's
|
|
33387
|
+
* phase machine: its phase is "a session is attached" for every on-motion
|
|
33388
|
+
* session, not motion, and it now has its own `DetectionPhaseTransition`.
|
|
33389
|
+
* A provider's `isDetected` answers from the hub's slice.
|
|
33390
|
+
* - **Sensors** (Home Assistant binary sensors, Homematic, Matter, Alexa
|
|
33391
|
+
* imports) — the provider pushes both edges itself, from the upstream
|
|
33392
|
+
* system's own state change. That is the sensor's own fact.
|
|
33393
|
+
*
|
|
33394
|
+
* `scripts/check-onboard-motion-emitters.ts` refuses any other writer of a
|
|
33395
|
+
* `motion` slice; each sensor writer is a named exemption.
|
|
33396
|
+
*
|
|
33397
|
+
* This replaces the D475 §4 rule ("the phase machine is the sole writer").
|
|
33398
|
+
* That rule was never true: Hikvision and Amcrest wrote the slice raw beside
|
|
33399
|
+
* it, every provider seeded it at boot, and every session left it
|
|
33400
|
+
* `detected: true` after its detach.
|
|
33073
33401
|
*/
|
|
33074
33402
|
autoClearAfterMs: number().nullable()
|
|
33075
33403
|
});
|
|
@@ -33141,11 +33469,12 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
|
|
|
33141
33469
|
*/
|
|
33142
33470
|
runtimeState: MotionStatusSchema,
|
|
33143
33471
|
/**
|
|
33144
|
-
* Runtime-state durability: **session** —
|
|
33472
|
+
* Runtime-state durability: **session** — the writer of this slice
|
|
33145
33473
|
* writes only on an EDGE, so a restored `detected: true` would stay
|
|
33146
33474
|
* frozen until the next one instead of being corrected. The next edge
|
|
33147
|
-
* re-publishes the real state
|
|
33148
|
-
*
|
|
33475
|
+
* re-publishes the real state, and the orchestrator re-publishes every
|
|
33476
|
+
* camera when it starts writing (D696; on who writes it, see
|
|
33477
|
+
* `autoClearAfterMs` above).
|
|
33149
33478
|
*
|
|
33150
33479
|
* See `RuntimeStateDurability`. Enforced by
|
|
33151
33480
|
* `scripts/check-runtime-state-durability.ts`.
|
|
@@ -35660,8 +35989,7 @@ var ptzAutotrackCapability = {
|
|
|
35660
35989
|
deviceNative: true,
|
|
35661
35990
|
mode: "singleton",
|
|
35662
35991
|
/**
|
|
35663
|
-
* Two kinds of provider behind one name, the same shape `snapshot`
|
|
35664
|
-
* `doorbell` use:
|
|
35992
|
+
* Two kinds of provider behind one name, the same shape `snapshot` uses:
|
|
35665
35993
|
*
|
|
35666
35994
|
* - **Native**: the camera's own firmware autotrack, registered per device by
|
|
35667
35995
|
* the driver when the probe says it exists (Reolink: yes; Hikvision:
|
|
@@ -35669,7 +35997,7 @@ var ptzAutotrackCapability = {
|
|
|
35669
35997
|
* - **Wrapper**: the emulated implementation (`@camstack/system`'s `autotrack` builtin),
|
|
35670
35998
|
* which follows a subject with `ptz.move` pulses driven by the detection
|
|
35671
35999
|
* pipeline. `defaultActive: false` — the operator binds it per camera in
|
|
35672
|
-
* the bindings UI
|
|
36000
|
+
* the bindings UI.
|
|
35673
36001
|
*
|
|
35674
36002
|
* The binding chooses WHICH implementation answers; `setEnabled` stays the
|
|
35675
36003
|
* one switch for the function either way. A camera never has both driving its
|
|
@@ -40100,47 +40428,6 @@ var zoneRulesCapability = {
|
|
|
40100
40428
|
*/
|
|
40101
40429
|
durability: "restored"
|
|
40102
40430
|
};
|
|
40103
|
-
var NUMBER = {
|
|
40104
|
-
kind: "fixed",
|
|
40105
|
-
result: ["number"]
|
|
40106
|
-
};
|
|
40107
|
-
var BOOLEAN = {
|
|
40108
|
-
kind: "fixed",
|
|
40109
|
-
result: ["boolean"]
|
|
40110
|
-
};
|
|
40111
|
-
Object.freeze({
|
|
40112
|
-
min: NUMBER,
|
|
40113
|
-
max: NUMBER,
|
|
40114
|
-
abs: NUMBER,
|
|
40115
|
-
floor: NUMBER,
|
|
40116
|
-
ceil: NUMBER,
|
|
40117
|
-
sqrt: NUMBER,
|
|
40118
|
-
round: NUMBER,
|
|
40119
|
-
pow: NUMBER,
|
|
40120
|
-
clamp: NUMBER,
|
|
40121
|
-
avg: NUMBER,
|
|
40122
|
-
sum: NUMBER,
|
|
40123
|
-
age: NUMBER,
|
|
40124
|
-
convert: NUMBER,
|
|
40125
|
-
coalesce: { kind: "coalesce" },
|
|
40126
|
-
any: BOOLEAN,
|
|
40127
|
-
all: BOOLEAN,
|
|
40128
|
-
within: BOOLEAN,
|
|
40129
|
-
latest: {
|
|
40130
|
-
kind: "fixed",
|
|
40131
|
-
result: ["number", "null"]
|
|
40132
|
-
},
|
|
40133
|
-
number: {
|
|
40134
|
-
kind: "fixed",
|
|
40135
|
-
result: ["number", "null"]
|
|
40136
|
-
},
|
|
40137
|
-
rose: {
|
|
40138
|
-
kind: "fixed",
|
|
40139
|
-
result: ["number", "null"]
|
|
40140
|
-
},
|
|
40141
|
-
count: NUMBER
|
|
40142
|
-
});
|
|
40143
|
-
`${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
|
|
40144
40431
|
/**
|
|
40145
40432
|
* Accessory device helpers — shared across drivers.
|
|
40146
40433
|
*
|
|
@@ -44264,6 +44551,12 @@ Object.freeze({
|
|
|
44264
44551
|
addonId: null,
|
|
44265
44552
|
access: "view"
|
|
44266
44553
|
},
|
|
44554
|
+
"coreBlocks.listComposableCaps": {
|
|
44555
|
+
capName: "core-blocks",
|
|
44556
|
+
capScope: "system",
|
|
44557
|
+
addonId: null,
|
|
44558
|
+
access: "view"
|
|
44559
|
+
},
|
|
44267
44560
|
"coreBlocks.listCompositions": {
|
|
44268
44561
|
capName: "core-blocks",
|
|
44269
44562
|
capScope: "system",
|
|
@@ -44342,6 +44635,18 @@ Object.freeze({
|
|
|
44342
44635
|
addonId: null,
|
|
44343
44636
|
access: "view"
|
|
44344
44637
|
},
|
|
44638
|
+
"databaseSnapshot.listDatabases": {
|
|
44639
|
+
capName: "database-snapshot",
|
|
44640
|
+
capScope: "system",
|
|
44641
|
+
addonId: null,
|
|
44642
|
+
access: "view"
|
|
44643
|
+
},
|
|
44644
|
+
"databaseSnapshot.writeSnapshot": {
|
|
44645
|
+
capName: "database-snapshot",
|
|
44646
|
+
capScope: "system",
|
|
44647
|
+
addonId: null,
|
|
44648
|
+
access: "create"
|
|
44649
|
+
},
|
|
44345
44650
|
"dataStoreProvider.aggregate": {
|
|
44346
44651
|
capName: "data-store-provider",
|
|
44347
44652
|
capScope: "system",
|
|
@@ -47078,6 +47383,12 @@ Object.freeze({
|
|
|
47078
47383
|
addonId: null,
|
|
47079
47384
|
access: "create"
|
|
47080
47385
|
},
|
|
47386
|
+
"pipelineAnalytics.clearTrackRelation": {
|
|
47387
|
+
capName: "pipeline-analytics",
|
|
47388
|
+
capScope: "device",
|
|
47389
|
+
addonId: null,
|
|
47390
|
+
access: "delete"
|
|
47391
|
+
},
|
|
47081
47392
|
"pipelineAnalytics.clearTracks": {
|
|
47082
47393
|
capName: "pipeline-analytics",
|
|
47083
47394
|
capScope: "device",
|
|
@@ -47330,6 +47641,12 @@ Object.freeze({
|
|
|
47330
47641
|
addonId: null,
|
|
47331
47642
|
access: "view"
|
|
47332
47643
|
},
|
|
47644
|
+
"pipelineAnalytics.listTrackRelations": {
|
|
47645
|
+
capName: "pipeline-analytics",
|
|
47646
|
+
capScope: "device",
|
|
47647
|
+
addonId: null,
|
|
47648
|
+
access: "view"
|
|
47649
|
+
},
|
|
47333
47650
|
"pipelineAnalytics.listTracks": {
|
|
47334
47651
|
capName: "pipeline-analytics",
|
|
47335
47652
|
capScope: "device",
|
|
@@ -47444,6 +47761,18 @@ Object.freeze({
|
|
|
47444
47761
|
addonId: null,
|
|
47445
47762
|
access: "create"
|
|
47446
47763
|
},
|
|
47764
|
+
"pipelineAnalytics.setTrackPurity": {
|
|
47765
|
+
capName: "pipeline-analytics",
|
|
47766
|
+
capScope: "device",
|
|
47767
|
+
addonId: null,
|
|
47768
|
+
access: "create"
|
|
47769
|
+
},
|
|
47770
|
+
"pipelineAnalytics.setTrackRelation": {
|
|
47771
|
+
capName: "pipeline-analytics",
|
|
47772
|
+
capScope: "device",
|
|
47773
|
+
addonId: null,
|
|
47774
|
+
access: "create"
|
|
47775
|
+
},
|
|
47447
47776
|
"pipelineAnalytics.startStorageMigrationMove": {
|
|
47448
47777
|
capName: "pipeline-analytics",
|
|
47449
47778
|
capScope: "device",
|
|
@@ -47882,6 +48211,12 @@ Object.freeze({
|
|
|
47882
48211
|
addonId: null,
|
|
47883
48212
|
access: "delete"
|
|
47884
48213
|
},
|
|
48214
|
+
"pipelineOrchestrator.requestOccupancyLook": {
|
|
48215
|
+
capName: "pipeline-orchestrator",
|
|
48216
|
+
capScope: "system",
|
|
48217
|
+
addonId: null,
|
|
48218
|
+
access: "create"
|
|
48219
|
+
},
|
|
47885
48220
|
"pipelineOrchestrator.resetNodePipelineDefaults": {
|
|
47886
48221
|
capName: "pipeline-orchestrator",
|
|
47887
48222
|
capScope: "system",
|
|
@@ -47948,6 +48283,12 @@ Object.freeze({
|
|
|
47948
48283
|
addonId: null,
|
|
47949
48284
|
access: "create"
|
|
47950
48285
|
},
|
|
48286
|
+
"pipelineOrchestrator.setCameraSensors": {
|
|
48287
|
+
capName: "pipeline-orchestrator",
|
|
48288
|
+
capScope: "system",
|
|
48289
|
+
addonId: null,
|
|
48290
|
+
access: "create"
|
|
48291
|
+
},
|
|
47951
48292
|
"pipelineOrchestrator.setCameraStepOverride": {
|
|
47952
48293
|
capName: "pipeline-orchestrator",
|
|
47953
48294
|
capScope: "system",
|
|
@@ -51358,6 +51699,11 @@ Object.freeze({
|
|
|
51358
51699
|
form: "single",
|
|
51359
51700
|
optional: false
|
|
51360
51701
|
}],
|
|
51702
|
+
"pipelineAnalytics.clearTrackRelation": [{
|
|
51703
|
+
name: "deviceId",
|
|
51704
|
+
form: "single",
|
|
51705
|
+
optional: false
|
|
51706
|
+
}],
|
|
51361
51707
|
"pipelineAnalytics.clearTracks": [{
|
|
51362
51708
|
name: "deviceId",
|
|
51363
51709
|
form: "single",
|
|
@@ -51508,6 +51854,11 @@ Object.freeze({
|
|
|
51508
51854
|
form: "single",
|
|
51509
51855
|
optional: false
|
|
51510
51856
|
}],
|
|
51857
|
+
"pipelineAnalytics.listTrackRelations": [{
|
|
51858
|
+
name: "deviceId",
|
|
51859
|
+
form: "single",
|
|
51860
|
+
optional: false
|
|
51861
|
+
}],
|
|
51511
51862
|
"pipelineAnalytics.listTracks": [{
|
|
51512
51863
|
name: "deviceId",
|
|
51513
51864
|
form: "single",
|
|
@@ -51578,6 +51929,16 @@ Object.freeze({
|
|
|
51578
51929
|
form: "single",
|
|
51579
51930
|
optional: false
|
|
51580
51931
|
}],
|
|
51932
|
+
"pipelineAnalytics.setTrackPurity": [{
|
|
51933
|
+
name: "deviceId",
|
|
51934
|
+
form: "single",
|
|
51935
|
+
optional: false
|
|
51936
|
+
}],
|
|
51937
|
+
"pipelineAnalytics.setTrackRelation": [{
|
|
51938
|
+
name: "deviceId",
|
|
51939
|
+
form: "single",
|
|
51940
|
+
optional: false
|
|
51941
|
+
}],
|
|
51581
51942
|
"pipelineAnalytics.wipeAllAnalytics": [{
|
|
51582
51943
|
name: "deviceId",
|
|
51583
51944
|
form: "single",
|
|
@@ -51648,6 +52009,11 @@ Object.freeze({
|
|
|
51648
52009
|
form: "single",
|
|
51649
52010
|
optional: false
|
|
51650
52011
|
}],
|
|
52012
|
+
"pipelineOrchestrator.requestOccupancyLook": [{
|
|
52013
|
+
name: "deviceId",
|
|
52014
|
+
form: "single",
|
|
52015
|
+
optional: false
|
|
52016
|
+
}],
|
|
51651
52017
|
"pipelineOrchestrator.resolvePipeline": [{
|
|
51652
52018
|
name: "deviceId",
|
|
51653
52019
|
form: "single",
|
|
@@ -51658,6 +52024,11 @@ Object.freeze({
|
|
|
51658
52024
|
form: "single",
|
|
51659
52025
|
optional: false
|
|
51660
52026
|
}],
|
|
52027
|
+
"pipelineOrchestrator.setCameraSensors": [{
|
|
52028
|
+
name: "deviceId",
|
|
52029
|
+
form: "single",
|
|
52030
|
+
optional: false
|
|
52031
|
+
}],
|
|
51661
52032
|
"pipelineOrchestrator.setCameraStepOverride": [{
|
|
51662
52033
|
name: "deviceId",
|
|
51663
52034
|
form: "single",
|
|
@@ -52804,6 +53175,18 @@ var STATE_SUMMARY_VARS = [
|
|
|
52804
53175
|
systemEventKinds: [...SUMMARISABLE],
|
|
52805
53176
|
systemEventDeliveries: ["summary"]
|
|
52806
53177
|
},
|
|
53178
|
+
{
|
|
53179
|
+
name: "summarySection",
|
|
53180
|
+
label: "Summary: this section",
|
|
53181
|
+
description: "The section a per-section summary row is about (D698); on a summary sent as one message, every section it reports, comma-separated.",
|
|
53182
|
+
example: "Batterie scariche",
|
|
53183
|
+
group: "system",
|
|
53184
|
+
families: ["rule"],
|
|
53185
|
+
fields: [...RULE_TEXT],
|
|
53186
|
+
kinds: ["system"],
|
|
53187
|
+
systemEventKinds: [...SUMMARISABLE],
|
|
53188
|
+
systemEventDeliveries: ["summary"]
|
|
53189
|
+
},
|
|
52807
53190
|
...STATE_SUMMARY_SECTION_VARS.map((v) => ({
|
|
52808
53191
|
name: v.name,
|
|
52809
53192
|
label: v.label,
|
|
@@ -52880,6 +53263,37 @@ var STATE_SUMMARY_VARS = [
|
|
|
52880
53263
|
[...RULE_TEXT],
|
|
52881
53264
|
...STATE_SUMMARY_VARS
|
|
52882
53265
|
];
|
|
53266
|
+
new Set([
|
|
53267
|
+
"disarmed",
|
|
53268
|
+
"armed_home",
|
|
53269
|
+
"armed_away",
|
|
53270
|
+
"armed_night",
|
|
53271
|
+
"armed_vacation",
|
|
53272
|
+
"armed_custom_bypass",
|
|
53273
|
+
"arming",
|
|
53274
|
+
"disarming",
|
|
53275
|
+
"pending",
|
|
53276
|
+
"triggered",
|
|
53277
|
+
"open",
|
|
53278
|
+
"opening",
|
|
53279
|
+
"closing",
|
|
53280
|
+
"closed",
|
|
53281
|
+
"stopped",
|
|
53282
|
+
"locked",
|
|
53283
|
+
"unlocked",
|
|
53284
|
+
"locking",
|
|
53285
|
+
"unlocking",
|
|
53286
|
+
"jammed",
|
|
53287
|
+
"on",
|
|
53288
|
+
"off",
|
|
53289
|
+
"home",
|
|
53290
|
+
"not_home",
|
|
53291
|
+
"matched",
|
|
53292
|
+
"diverged",
|
|
53293
|
+
"unknown",
|
|
53294
|
+
"latched",
|
|
53295
|
+
"live"
|
|
53296
|
+
]);
|
|
52883
53297
|
/**
|
|
52884
53298
|
* TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
|
|
52885
53299
|
*
|
|
@@ -53111,6 +53525,25 @@ TimelapseRuleInputSchema.extend({
|
|
|
53111
53525
|
createdAt: number(),
|
|
53112
53526
|
updatedAt: number()
|
|
53113
53527
|
});
|
|
53528
|
+
async function readHubMotionDetected(deviceState, deviceId) {
|
|
53529
|
+
let slice;
|
|
53530
|
+
try {
|
|
53531
|
+
slice = await deviceState.getCapSlice.query({
|
|
53532
|
+
deviceId,
|
|
53533
|
+
capName: "motion"
|
|
53534
|
+
});
|
|
53535
|
+
} catch (err) {
|
|
53536
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
53537
|
+
throw new Error(`motion state of device ${deviceId} is unreadable: ${reason}`, { cause: err });
|
|
53538
|
+
}
|
|
53539
|
+
const detected = slice?.["detected"];
|
|
53540
|
+
if (typeof detected !== "boolean") throw new Error(`motion state of device ${deviceId} is not published yet (unknown)`);
|
|
53541
|
+
return detected;
|
|
53542
|
+
}
|
|
53543
|
+
MotionOnMotionChangedDataSchema.omit({ triggeredBy: true });
|
|
53544
|
+
function providerMotionEvent(source, data) {
|
|
53545
|
+
return createEvent(EventCategory.ProviderMotion, source, data);
|
|
53546
|
+
}
|
|
53114
53547
|
object({
|
|
53115
53548
|
/**
|
|
53116
53549
|
* Fraction of the box's own size added on EACH side before cutting.
|
|
@@ -164666,6 +165099,22 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
164666
165099
|
* writers are {@link refreshNetworkLinkFromApi}. Seeded unknown so the
|
|
164667
165100
|
* restored slice (if any) stays valid and a fresh device draws no link.
|
|
164668
165101
|
*/
|
|
165102
|
+
/**
|
|
165103
|
+
* The native `motion` cap. This provider writes NO `motion` slice (D696):
|
|
165104
|
+
* `handleSimpleEvent` emits its raw push as `ProviderMotion` (`source:
|
|
165105
|
+
* 'onboard'`, D673), the orchestrator's camera-sensors bridge turns it into
|
|
165106
|
+
* the effective `MotionOnMotionChanged`, and the orchestrator is the slice's
|
|
165107
|
+
* only writer, with that effective value, on the hub. `isDetected`
|
|
165108
|
+
* therefore answers from the HUB's slice; an unreadable hub, or a slice
|
|
165109
|
+
* nobody has published since the hub started, fails the call. It never
|
|
165110
|
+
* answers `false` for "unknown" (D49, D393).
|
|
165111
|
+
*/
|
|
165112
|
+
registerMotionCap() {
|
|
165113
|
+
this.ctx.registerNativeCap(motionCapability, { isDetected: async ({ deviceId }) => {
|
|
165114
|
+
if (deviceId !== this.id) throw new Error(`ReolinkCamera: deviceId mismatch, expected ${this.id}, got ${deviceId}`);
|
|
165115
|
+
return readHubMotionDetected(this.ctx.api.deviceState, this.id);
|
|
165116
|
+
} });
|
|
165117
|
+
}
|
|
164669
165118
|
registerNetworkLink() {
|
|
164670
165119
|
this.ctx.registerNativeCap(networkLinkCapability, { getStatus: async ({ deviceId }) => {
|
|
164671
165120
|
if (deviceId !== this.id) throw new Error(`ReolinkCamera: deviceId mismatch, expected ${this.id}, got ${deviceId}`);
|
|
@@ -165394,15 +165843,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
165394
165843
|
};
|
|
165395
165844
|
} });
|
|
165396
165845
|
this.registerNetworkLink();
|
|
165397
|
-
this.
|
|
165398
|
-
if (deviceId !== this.id) throw new Error(`ReolinkCamera: deviceId mismatch, expected ${this.id}, got ${deviceId}`);
|
|
165399
|
-
return this.state.motion.detected ?? false;
|
|
165400
|
-
} });
|
|
165401
|
-
this.setCapSlice(motionCapability, {
|
|
165402
|
-
detected: false,
|
|
165403
|
-
lastDetectedAt: null,
|
|
165404
|
-
autoClearAfterMs: null
|
|
165405
|
-
});
|
|
165846
|
+
this.registerMotionCap();
|
|
165406
165847
|
this.registerDoorbellIfSupported();
|
|
165407
165848
|
this.registerPtzIfSupported();
|
|
165408
165849
|
this.registerPtzAutotrackIfSupported();
|
|
@@ -171401,11 +171842,11 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
171401
171842
|
* axes, each driven exclusively by their own firmware push events.
|
|
171402
171843
|
*
|
|
171403
171844
|
* - 'motion' + AI types (people, vehicle, animal, face, package):
|
|
171404
|
-
* emit `EventCategory.
|
|
171405
|
-
*
|
|
171406
|
-
*
|
|
171407
|
-
*
|
|
171408
|
-
*
|
|
171845
|
+
* emit the RAW push as `EventCategory.ProviderMotion`
|
|
171846
|
+
* (`source: 'onboard'`, D673). The orchestrator's camera-sensors bridge
|
|
171847
|
+
* re-emits it as the effective `MotionOnMotionChanged`, and the
|
|
171848
|
+
* orchestrator is the only writer of the camera's `motion` runtime-state
|
|
171849
|
+
* slice (D696; no slice write here). AI subtype also lands on
|
|
171409
171850
|
* `EventCategory.DetectionCameraNative`.
|
|
171410
171851
|
* - 'awake' / 'sleeping': emit DeviceAwake / DeviceSleeping. Battery
|
|
171411
171852
|
* power-state only — does NOT touch online state.
|
|
@@ -171458,7 +171899,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
171458
171899
|
} });
|
|
171459
171900
|
if (event.type === "motion") {
|
|
171460
171901
|
const now = Date.now();
|
|
171461
|
-
this.ctx.eventBus.emit(
|
|
171902
|
+
this.ctx.eventBus.emit(providerMotionEvent(eventSource, {
|
|
171462
171903
|
deviceId: this.id,
|
|
171463
171904
|
detected: true,
|
|
171464
171905
|
timestamp: now,
|
|
@@ -171486,7 +171927,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
171486
171927
|
}]
|
|
171487
171928
|
}));
|
|
171488
171929
|
} else this.noteNativeDetectionSuppressed(aiClass);
|
|
171489
|
-
this.ctx.eventBus.emit(
|
|
171930
|
+
this.ctx.eventBus.emit(providerMotionEvent(eventSource, {
|
|
171490
171931
|
deviceId: this.id,
|
|
171491
171932
|
detected: true,
|
|
171492
171933
|
timestamp: now,
|
|
@@ -173335,7 +173776,7 @@ var AutodetectCache = class {
|
|
|
173335
173776
|
* silently dropped.
|
|
173336
173777
|
*
|
|
173337
173778
|
* Returns a LIST rather than a single type because of `doorbell`. The
|
|
173338
|
-
* camera's `handleSimpleEvent` emits `
|
|
173779
|
+
* camera's `handleSimpleEvent` emits `ProviderMotion` for `motion`
|
|
173339
173780
|
* and for every AI class, but the `doorbell` branch emits ONLY
|
|
173340
173781
|
* `DoorbellOnPressed` and returns. An email is the sole signal a sleeping
|
|
173341
173782
|
* battery camera can send, so a doorbell-classified email mapped to
|