@camstack/addon-provider-homematic 1.2.14 → 1.2.16
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 +686 -42
- package/dist/addon.mjs +686 -42
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -7228,8 +7228,31 @@ var AdoptionJobSchema = object({
|
|
|
7228
7228
|
error: string().nullable()
|
|
7229
7229
|
});
|
|
7230
7230
|
/**
|
|
7231
|
-
* Per-camera FUNCTION SWITCHES
|
|
7232
|
-
*
|
|
7231
|
+
* Per-camera FUNCTION SWITCHES.
|
|
7232
|
+
*
|
|
7233
|
+
* ## The aggregate group is being withdrawn — the BADGE is not (D113)
|
|
7234
|
+
*
|
|
7235
|
+
* This file shipped as "the one coherent on/off surface over the pipeline
|
|
7236
|
+
* functions an operator thinks in terms of". The operator's verdict on
|
|
7237
|
+
* 2026-08-12 was that the coherent surface bought complexity and no clarity:
|
|
7238
|
+
* every function already had a settings page of its own, and a second place to
|
|
7239
|
+
* turn it off is a second place to look. Each switch is going back to its own
|
|
7240
|
+
* component's original options — detection to the detection-pipeline wrapper
|
|
7241
|
+
* binding, audio analysis to its own, recording to `RecordingConfig.enabled`
|
|
7242
|
+
* (which was always first-class; the switch was a veneer over
|
|
7243
|
+
* `recording.setDeviceConfig`), notifications to a notification-center
|
|
7244
|
+
* per-device setting, the two camera planes to their own components.
|
|
7245
|
+
*
|
|
7246
|
+
* What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
|
|
7247
|
+
* thing that lets a status surface say DISABLED instead of BROKEN, recomposed
|
|
7248
|
+
* straight from the authorities with no group in the middle. That rule was
|
|
7249
|
+
* never about a control panel.
|
|
7250
|
+
*
|
|
7251
|
+
* Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
|
|
7252
|
+
* {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
|
|
7253
|
+
* `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
|
|
7254
|
+
* viewers (v1.0.305) and the admin UI still call it. It is deleted when they
|
|
7255
|
+
* stop; nothing new may be built on it.
|
|
7233
7256
|
*
|
|
7234
7257
|
* ## This file adds no state
|
|
7235
7258
|
*
|
|
@@ -7580,7 +7603,15 @@ var RecordingConfigSchema = object({
|
|
|
7580
7603
|
* Each completed/failed run also lands one durable ops-log row on its owning
|
|
7581
7604
|
* addon surface.
|
|
7582
7605
|
*/
|
|
7606
|
+
/**
|
|
7607
|
+
* `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
|
|
7608
|
+
* rebalance enqueues one job per (camera, profile). Refusing the second job —
|
|
7609
|
+
* what the engine did before — turned a fifteen-camera rebalance into fifteen
|
|
7610
|
+
* manual retries. Queued jobs run FIFO; a queued job that is cancelled never
|
|
7611
|
+
* runs at all.
|
|
7612
|
+
*/
|
|
7583
7613
|
var RelocateJobStateSchema = _enum([
|
|
7614
|
+
"queued",
|
|
7584
7615
|
"running",
|
|
7585
7616
|
"done",
|
|
7586
7617
|
"failed",
|
|
@@ -7615,6 +7646,15 @@ var RelocateFootageInputSchema = object({
|
|
|
7615
7646
|
/** Limits relocation to the logical profile class. Omit only for the
|
|
7616
7647
|
* pre-orchestration compatibility path. */
|
|
7617
7648
|
footageClass: RelocateFootageClassSchema.optional(),
|
|
7649
|
+
/** Scope the move to ONE camera. Absent = every camera on the source, which
|
|
7650
|
+
* is what a whole-disk drain means. The rebalance path always sets it: its
|
|
7651
|
+
* unit is a (camera, profile) pile, not a disk. */
|
|
7652
|
+
deviceId: number().int().optional(),
|
|
7653
|
+
/** Scope the move to specific segment profiles (`high` / `mid` / `low`).
|
|
7654
|
+
* Finer than `footageClass`, which cannot separate high from mid — and the
|
|
7655
|
+
* placement plan assigns those two independently, so a rebalance that could
|
|
7656
|
+
* only say "recordings" would move footage the plan never asked to move. */
|
|
7657
|
+
profiles: array(string()).optional(),
|
|
7618
7658
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
7619
7659
|
* never allowed to starve live writers. */
|
|
7620
7660
|
throttleMbps: number().min(1).max(1e3).optional()
|
|
@@ -7750,6 +7790,21 @@ var StorageLocationSchema = object({
|
|
|
7750
7790
|
nodeId: string().optional(),
|
|
7751
7791
|
isDefault: boolean().default(false),
|
|
7752
7792
|
isSystem: boolean().default(false),
|
|
7793
|
+
/**
|
|
7794
|
+
* Operator opt-in: whether consumers that BALANCE across several locations
|
|
7795
|
+
* of a type may write here. Recordings reads it today; event media and
|
|
7796
|
+
* backups are the next consumers, which is why the flag lives on the
|
|
7797
|
+
* location rather than in any one addon's store — nothing has to be
|
|
7798
|
+
* extended to add the next consumer.
|
|
7799
|
+
*
|
|
7800
|
+
* OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
|
|
7801
|
+
* flag existed reads back with no flag and keeps working exactly as before;
|
|
7802
|
+
* that is the whole compat story, and it is why no migration ships with it.
|
|
7803
|
+
* A newly CREATED sibling is stamped `false` by the orchestrator (creating a
|
|
7804
|
+
* disk must not silently start writing to it); the default of a type is
|
|
7805
|
+
* always stamped `true`.
|
|
7806
|
+
*/
|
|
7807
|
+
enabled: boolean().optional(),
|
|
7753
7808
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
7754
7809
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
7755
7810
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -12368,7 +12423,8 @@ method(object({
|
|
|
12368
12423
|
}), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
|
|
12369
12424
|
/**
|
|
12370
12425
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
12371
|
-
* filesystem
|
|
12426
|
+
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
12427
|
+
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
12372
12428
|
* admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
|
|
12373
12429
|
* (one provider per node); the hub calls it with `{nodeId}` so the codegen
|
|
12374
12430
|
* routes to that exact node (default `nodeIdMode:'routing'`).
|
|
@@ -14209,6 +14265,13 @@ var MaskGridDimsSchema = object({
|
|
|
14209
14265
|
* `package-event` are pure trigger kinds (no urgency dimension). Extending
|
|
14210
14266
|
* this one field keeps the schema additive — a rule still declares exactly
|
|
14211
14267
|
* one trigger.
|
|
14268
|
+
*
|
|
14269
|
+
* AUDIO rules add no member here, for the reason occupancy added none: the
|
|
14270
|
+
* enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
|
|
14271
|
+
* mirror.ts` fails the build on a member the app cannot render) and every
|
|
14272
|
+
* member costs a release train. A sustained-sound rule is therefore an
|
|
14273
|
+
* `immediate` rule carrying {@link NcConditions.audio} — the condition is the
|
|
14274
|
+
* trigger discriminator, exactly as `occupancy` is on `device-event`.
|
|
14212
14275
|
*/
|
|
14213
14276
|
var NcDeliverySchema = _enum([
|
|
14214
14277
|
"immediate",
|
|
@@ -14223,15 +14286,32 @@ var NcDeliverySchema = _enum([
|
|
|
14223
14286
|
* depend on a provider's raw event name or payload shape.
|
|
14224
14287
|
*/
|
|
14225
14288
|
var NcSystemEventKindSchema = _enum([
|
|
14226
|
-
"
|
|
14227
|
-
"
|
|
14289
|
+
"device-online",
|
|
14290
|
+
"device-offline",
|
|
14291
|
+
"device-disabled",
|
|
14292
|
+
"device-enabled",
|
|
14228
14293
|
"stream-online",
|
|
14229
14294
|
"stream-offline",
|
|
14230
14295
|
"node-online",
|
|
14231
14296
|
"node-offline",
|
|
14232
14297
|
"addon-update-available",
|
|
14233
|
-
"server-update-available"
|
|
14298
|
+
"server-update-available",
|
|
14299
|
+
"alarm-triggered",
|
|
14300
|
+
"alarm-armed",
|
|
14301
|
+
"alarm-disarmed",
|
|
14302
|
+
"camera-online",
|
|
14303
|
+
"camera-offline",
|
|
14304
|
+
"camera-disabled",
|
|
14305
|
+
"camera-enabled"
|
|
14234
14306
|
]);
|
|
14307
|
+
/** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
|
|
14308
|
+
var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
|
|
14309
|
+
"camera-online",
|
|
14310
|
+
"camera-offline",
|
|
14311
|
+
"camera-disabled",
|
|
14312
|
+
"camera-enabled"
|
|
14313
|
+
]);
|
|
14314
|
+
NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
|
|
14235
14315
|
/**
|
|
14236
14316
|
* One coherent system-event condition. `kinds` is the required opt-in safety
|
|
14237
14317
|
* gate; the remaining lists are optional narrowing filters relevant to the
|
|
@@ -14240,6 +14320,18 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14240
14320
|
var NcSystemEventConditionSchema = object({
|
|
14241
14321
|
kinds: array(NcSystemEventKindSchema).min(1),
|
|
14242
14322
|
deviceIds: array(number().int()).min(1).optional(),
|
|
14323
|
+
/**
|
|
14324
|
+
* Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
|
|
14325
|
+
* `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
|
|
14326
|
+
* is what a liveness rule means when nobody said otherwise.
|
|
14327
|
+
*
|
|
14328
|
+
* This is where "only my cameras" is expressed, and it lives on the rule for
|
|
14329
|
+
* one reason: the intake cannot know which devices this household cares
|
|
14330
|
+
* about, and a producer-side filter is one no operator can change. Fails
|
|
14331
|
+
* CLOSED — a subject whose device type is unknown (an id the device mirror
|
|
14332
|
+
* does not carry) matches no `deviceTypes` list.
|
|
14333
|
+
*/
|
|
14334
|
+
deviceTypes: array(string().min(1)).min(1).optional(),
|
|
14243
14335
|
nodeIds: array(string().min(1)).min(1).optional(),
|
|
14244
14336
|
packageNames: array(string().min(1)).min(1).optional()
|
|
14245
14337
|
});
|
|
@@ -14290,6 +14382,47 @@ var NcOccupancyConditionSchema = object({
|
|
|
14290
14382
|
sustainSeconds: number().int().min(0).max(3600).default(15)
|
|
14291
14383
|
});
|
|
14292
14384
|
/**
|
|
14385
|
+
* Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
|
|
14386
|
+
*
|
|
14387
|
+
* Operator-approved vocabulary (2026-08-12, option A — the same one the
|
|
14388
|
+
* reference notifier uses, so an operator moving between them re-uses what
|
|
14389
|
+
* they already know): a rule matches when, over a sampling window of
|
|
14390
|
+
* `samplingSeconds`, at least `hitPercent`% of the audio samples in that
|
|
14391
|
+
* window are HITS. A sample is a hit when it satisfies BOTH present filters:
|
|
14392
|
+
*
|
|
14393
|
+
* - `dbThreshold` — its level is at or above this many dBFS (see
|
|
14394
|
+
* {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
|
|
14395
|
+
* - `labels` — the classifier put at least one of these labels on it.
|
|
14396
|
+
*
|
|
14397
|
+
* Both are OPTIONAL and independent, which is the point of the shape: a
|
|
14398
|
+
* loudness rule ("something loud at 3am") needs no model to be right, and a
|
|
14399
|
+
* label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
|
|
14400
|
+
* is given** — a window in which every sample is trivially a hit would fire on
|
|
14401
|
+
* silence, so the engine refuses such a condition rather than notifying on
|
|
14402
|
+
* nothing (the schema cannot express "at least one of" without becoming a
|
|
14403
|
+
* ZodEffects the cap path would have to special-case).
|
|
14404
|
+
*
|
|
14405
|
+
* `hitPercent` is over the samples the window actually HOLDS, and the window
|
|
14406
|
+
* must be FULL before it can match — a window that has been open for two
|
|
14407
|
+
* seconds of its ten is 100% of nothing, and firing on it would make
|
|
14408
|
+
* `samplingSeconds` decorative.
|
|
14409
|
+
*
|
|
14410
|
+
* Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
|
|
14411
|
+
* `audio-*` ids). Both spellings are accepted — the matcher normalizes the
|
|
14412
|
+
* `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
|
|
14413
|
+
* an operator who typed `dog` mean the same thing.
|
|
14414
|
+
*/
|
|
14415
|
+
var NcAudioConditionSchema = object({
|
|
14416
|
+
/** Audio macro labels; absent = any sound (level-only rule). */
|
|
14417
|
+
labels: array(string().min(1)).min(1).optional(),
|
|
14418
|
+
/** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
|
|
14419
|
+
dbThreshold: number().min(-96).max(0).optional(),
|
|
14420
|
+
/** Percentage of the window's samples that must be hits (1–100). */
|
|
14421
|
+
hitPercent: number().int().min(1).max(100).default(60),
|
|
14422
|
+
/** Length of the sampling window in seconds. */
|
|
14423
|
+
samplingSeconds: number().int().min(1).max(300).default(10)
|
|
14424
|
+
});
|
|
14425
|
+
/**
|
|
14293
14426
|
* Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
|
|
14294
14427
|
*
|
|
14295
14428
|
* The values are not symmetric, and deliberately so — the absent value has to
|
|
@@ -14562,7 +14695,33 @@ var NcConditionsSchema = object({
|
|
|
14562
14695
|
* threshold and holds for `sustainSeconds`. Fail-closed on missing
|
|
14563
14696
|
* substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
|
|
14564
14697
|
*/
|
|
14565
|
-
occupancy: NcOccupancyConditionSchema.optional()
|
|
14698
|
+
occupancy: NcOccupancyConditionSchema.optional(),
|
|
14699
|
+
/**
|
|
14700
|
+
* IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
|
|
14701
|
+
* `samplingSeconds` window clear the optional `dbThreshold` and carry one of
|
|
14702
|
+
* the optional `labels`. Fail-closed on missing substrate (no audio samples,
|
|
14703
|
+
* a window that is not full yet, neither filter given). See
|
|
14704
|
+
* {@link NcAudioCondition}.
|
|
14705
|
+
*
|
|
14706
|
+
* Presence of this key is what makes a rule an AUDIO rule: the engine fires
|
|
14707
|
+
* it ONLY on a confirmed audio window, and a rule carrying it never fires on
|
|
14708
|
+
* a detection, a track or a device event (the same fail-closed pairing
|
|
14709
|
+
* `occupancy` has with the `device-event` trigger). That is how audio labels
|
|
14710
|
+
* leave `classes`: an audio rule names its sounds HERE, and the legacy path
|
|
14711
|
+
* (an `immediate` rule naming an `audio-*` class, one notification per
|
|
14712
|
+
* classified sample) stays exactly as it was for rules that already use it.
|
|
14713
|
+
*
|
|
14714
|
+
* NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
|
|
14715
|
+
* rather than an oversight: the viewer mirrors the descriptor enums BY HAND
|
|
14716
|
+
* (`camstack/src/data/notification-center.ts`, guarded by
|
|
14717
|
+
* `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
|
|
14718
|
+
* condition fields it does not know when a rule is saved from the phone.
|
|
14719
|
+
* Publishing an editor for a condition the app cannot round-trip is how an
|
|
14720
|
+
* operator loses a rule's conditions by opening it — so the descriptor, the
|
|
14721
|
+
* admin widget and the viewer mirror land together (P2 + P3), and only then
|
|
14722
|
+
* does an audio rule become authorable.
|
|
14723
|
+
*/
|
|
14724
|
+
audio: NcAudioConditionSchema.optional()
|
|
14566
14725
|
});
|
|
14567
14726
|
/** One delivery target: a `notification-output` Target ref + passthrough params. */
|
|
14568
14727
|
var NcRuleTargetSchema = object({
|
|
@@ -14676,6 +14835,73 @@ var NcThrottleSchema = object({
|
|
|
14676
14835
|
*/
|
|
14677
14836
|
granularity: NcThrottleGranularitySchema.optional()
|
|
14678
14837
|
});
|
|
14838
|
+
/**
|
|
14839
|
+
* How long the confirm gate may hold ONE notification, and how big the picture
|
|
14840
|
+
* it judges may be.
|
|
14841
|
+
*
|
|
14842
|
+
* The clamp is the product decision, not a coincidence of the model: p50 was
|
|
14843
|
+
* 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
|
|
14844
|
+
* arrives after the visitor has gone is not a notification. 448 px was enough
|
|
14845
|
+
* to score 16/16 on the operator's parking scenario — bigger costs latency and
|
|
14846
|
+
* tokens for pixels the model pools away.
|
|
14847
|
+
*/
|
|
14848
|
+
var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
|
|
14849
|
+
var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
|
|
14850
|
+
var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
|
|
14851
|
+
/** Comparison the model's COUNT must satisfy for the notification to fire. */
|
|
14852
|
+
var NcConfirmExpectSchema = object({
|
|
14853
|
+
op: _enum([
|
|
14854
|
+
">=",
|
|
14855
|
+
">",
|
|
14856
|
+
"<=",
|
|
14857
|
+
"<",
|
|
14858
|
+
"=="
|
|
14859
|
+
]),
|
|
14860
|
+
count: number().int().min(0).max(1e3)
|
|
14861
|
+
});
|
|
14862
|
+
/**
|
|
14863
|
+
* AI CONFIRM — a vision model looks at the picture this notification is about
|
|
14864
|
+
* to ship and says whether it agrees with the rule.
|
|
14865
|
+
*
|
|
14866
|
+
* It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
|
|
14867
|
+
* crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
|
|
14868
|
+
* on the operator's phone is not a verdict about this notification.
|
|
14869
|
+
*
|
|
14870
|
+
* FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
|
|
14871
|
+
* whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
|
|
14872
|
+
* the default and every fail-open is COUNTED, because a gate that always fails
|
|
14873
|
+
* open looks in the log exactly like a gate that works.
|
|
14874
|
+
*
|
|
14875
|
+
* Every field is `.optional()` rather than relied on as a Zod default at the
|
|
14876
|
+
* runtime seam: a Zod default does NOT run on the addon→addon cap path (three
|
|
14877
|
+
* production failures in one day), so the gate reads absent as the constant
|
|
14878
|
+
* above rather than trusting a parse it may never have seen.
|
|
14879
|
+
*/
|
|
14880
|
+
var NcConfirmSchema = object({
|
|
14881
|
+
/** Off unless asked for. An absent `confirm` and `enabled:false` are the
|
|
14882
|
+
* same thing, and both mean "deliver exactly as before". */
|
|
14883
|
+
enabled: boolean().default(false),
|
|
14884
|
+
/** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
|
|
14885
|
+
profileId: string().optional(),
|
|
14886
|
+
/**
|
|
14887
|
+
* The operator's question, in his own words. Absent = a question derived
|
|
14888
|
+
* from the rule (its class and its expectation).
|
|
14889
|
+
*
|
|
14890
|
+
* NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
|
|
14891
|
+
* banners, signage and plates as instructions if you let them reach the
|
|
14892
|
+
* prompt — proven live — so the authoritative contract stays in the system
|
|
14893
|
+
* turn and only rule-authored words land here.
|
|
14894
|
+
*/
|
|
14895
|
+
prompt: string().max(1e3).optional(),
|
|
14896
|
+
/** Fire only when the model's count satisfies this. Absent = the model's
|
|
14897
|
+
* own boolean verdict decides. */
|
|
14898
|
+
expect: NcConfirmExpectSchema.optional(),
|
|
14899
|
+
timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
|
|
14900
|
+
/** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
|
|
14901
|
+
onTimeout: _enum(["fire", "suppress"]).default("fire"),
|
|
14902
|
+
/** Longest edge the judged image is downscaled to before it is sent. */
|
|
14903
|
+
maxImagePx: number().int().min(64).max(2048).default(448)
|
|
14904
|
+
});
|
|
14679
14905
|
/** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
|
|
14680
14906
|
var NcRuleInputSchema = object({
|
|
14681
14907
|
name: string().min(1).max(200),
|
|
@@ -14736,7 +14962,13 @@ var NcRuleInputSchema = object({
|
|
|
14736
14962
|
* `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
|
|
14737
14963
|
* shape as every other actuation.
|
|
14738
14964
|
*/
|
|
14739
|
-
actions: NcRuleActionsSchema.optional()
|
|
14965
|
+
actions: NcRuleActionsSchema.optional(),
|
|
14966
|
+
/**
|
|
14967
|
+
* AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
|
|
14968
|
+
* a rule that predates the gate must keep delivering byte-for-byte as it
|
|
14969
|
+
* did, and absent is the only way to say that without a migration.
|
|
14970
|
+
*/
|
|
14971
|
+
confirm: NcConfirmSchema.optional()
|
|
14740
14972
|
});
|
|
14741
14973
|
/**
|
|
14742
14974
|
* Partial patch for `updateRule` — any subset of the input fields, plus the
|
|
@@ -14747,7 +14979,37 @@ var NcRuleInputSchema = object({
|
|
|
14747
14979
|
* still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
|
|
14748
14980
|
* `updateRule` patch.
|
|
14749
14981
|
*/
|
|
14750
|
-
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
14982
|
+
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
14983
|
+
disabledTargetIds: array(string()).optional(),
|
|
14984
|
+
/**
|
|
14985
|
+
* `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
|
|
14986
|
+
*
|
|
14987
|
+
* It makes the key optional to SUPPLY; the parse still materialises the
|
|
14988
|
+
* default when the key is absent. And `NcRuleStore.update` merges with
|
|
14989
|
+
* `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
|
|
14990
|
+
* one — which made every partial edit destructive:
|
|
14991
|
+
*
|
|
14992
|
+
* nc.updateRule({ throttle }) → conditions reset to `{}`
|
|
14993
|
+
* nc.setRuleTargetEnabled(...) → conditions reset to `{}`
|
|
14994
|
+
* setEnabled(ruleId, false) → conditions reset to `{}`
|
|
14995
|
+
*
|
|
14996
|
+
* A rule scoped to one camera and one zone silently became a rule that
|
|
14997
|
+
* matches EVERY event on EVERY camera, and lost its `media` policy
|
|
14998
|
+
* (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
|
|
14999
|
+
* live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
|
|
15000
|
+
* within a minute of a two-field patch.
|
|
15001
|
+
*
|
|
15002
|
+
* So every defaulted field is re-declared here WITHOUT its default. The
|
|
15003
|
+
* inner defaults still apply when the caller DOES send the key — `{}` for
|
|
15004
|
+
* conditions remains a real instruction ("clear them") — and only the
|
|
15005
|
+
* absent key is now genuinely absent.
|
|
15006
|
+
*/
|
|
15007
|
+
enabled: boolean().optional(),
|
|
15008
|
+
conditions: NcConditionsSchema.optional(),
|
|
15009
|
+
media: NcMediaPolicySchema.optional(),
|
|
15010
|
+
throttle: NcThrottleSchema.optional(),
|
|
15011
|
+
priority: number().int().min(1).max(5).optional()
|
|
15012
|
+
});
|
|
14751
15013
|
/** A persisted rule. */
|
|
14752
15014
|
var NcRuleSchema = NcRuleInputSchema.extend({
|
|
14753
15015
|
id: string(),
|
|
@@ -15048,6 +15310,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
|
|
|
15048
15310
|
* Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
|
|
15049
15311
|
* copy would lie the first time a rule is disabled.
|
|
15050
15312
|
*/
|
|
15313
|
+
/**
|
|
15314
|
+
* Why a device a mode NAMES is nonetheless not armed by it.
|
|
15315
|
+
*
|
|
15316
|
+
* Each value is an existing authority, never a new flag (D62): `muted` is the
|
|
15317
|
+
* per-camera notification switch the Notification Center already owns,
|
|
15318
|
+
* `detection-off` is the device's own detection binding being inactive, and
|
|
15319
|
+
* `offline` is the device manager's liveness. A fourth reason would mean a
|
|
15320
|
+
* fourth authority, and inventing one here is how a panel starts disagreeing
|
|
15321
|
+
* with the switches the operator actually used.
|
|
15322
|
+
*/
|
|
15323
|
+
var NcAlarmSkipReasonSchema = _enum([
|
|
15324
|
+
"muted",
|
|
15325
|
+
"detection-off",
|
|
15326
|
+
"offline"
|
|
15327
|
+
]);
|
|
15328
|
+
var NcAlarmSkippedDeviceSchema = object({
|
|
15329
|
+
deviceId: number().int(),
|
|
15330
|
+
reason: NcAlarmSkipReasonSchema
|
|
15331
|
+
});
|
|
15051
15332
|
var NcAlarmModeCoverageSchema = object({
|
|
15052
15333
|
mode: AlarmArmModeSchema,
|
|
15053
15334
|
/** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
|
|
@@ -15055,7 +15336,18 @@ var NcAlarmModeCoverageSchema = object({
|
|
|
15055
15336
|
/** At least one covering rule has no device scope, so the mode covers all. */
|
|
15056
15337
|
allDevices: boolean(),
|
|
15057
15338
|
/** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
|
|
15058
|
-
deviceIds: array(number().int())
|
|
15339
|
+
deviceIds: array(number().int()),
|
|
15340
|
+
/**
|
|
15341
|
+
* Devices this mode NAMES but cannot actually arm, each with the switch that
|
|
15342
|
+
* excludes it.
|
|
15343
|
+
*
|
|
15344
|
+
* "Away armed — 12 cameras" is a promise, and a muted camera among those
|
|
15345
|
+
* twelve makes it false in exactly the way nobody notices until an incident.
|
|
15346
|
+
* Defaulted to `[]` so a coverage answer computed before this field existed
|
|
15347
|
+
* still parses as "nothing known to be skipped" rather than failing the whole
|
|
15348
|
+
* alarm tab.
|
|
15349
|
+
*/
|
|
15350
|
+
skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
|
|
15059
15351
|
});
|
|
15060
15352
|
var NcAlarmConfigSchema = object({
|
|
15061
15353
|
/**
|
|
@@ -17887,9 +18179,16 @@ var CameraStatusSchema = object({
|
|
|
17887
18179
|
audio: CameraAudioStatusSchema.nullable(),
|
|
17888
18180
|
recording: CameraRecordingStatusSchema.nullable(),
|
|
17889
18181
|
/**
|
|
17890
|
-
* Per-camera
|
|
18182
|
+
* Per-camera functions an OPERATOR has turned off
|
|
17891
18183
|
* ([D61](../../../../docs/decisions/adr-0067.md)).
|
|
17892
18184
|
*
|
|
18185
|
+
* Composed from the AUTHORITIES themselves — the wrapper bindings,
|
|
18186
|
+
* `RecordingConfig.enabled`, the notification mute, the broker's audio
|
|
18187
|
+
* policy, the camera's own microphone — via `composeSwitchedOff`, not from
|
|
18188
|
+
* the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
|
|
18189
|
+
* The badge outlives the control panel: the panel was a convenience, this is
|
|
18190
|
+
* the difference between a camera being off and a camera being dead.
|
|
18191
|
+
*
|
|
17893
18192
|
* This is the difference between DISABLED and BROKEN. A camera whose
|
|
17894
18193
|
* `detection` block reports zero fps and whose `switchedOff` contains
|
|
17895
18194
|
* `'object-detection'` was switched off by a person; the same camera with an
|
|
@@ -24631,7 +24930,19 @@ var RecordingManifestSchema = object({
|
|
|
24631
24930
|
* profiles/subtrees/locations on this node). */
|
|
24632
24931
|
var RecordingDeviceUsageSchema = object({
|
|
24633
24932
|
deviceId: number(),
|
|
24634
|
-
usedBytes: number()
|
|
24933
|
+
usedBytes: number(),
|
|
24934
|
+
/**
|
|
24935
|
+
* Start of this camera's OLDEST indexed segment, across every profile and
|
|
24936
|
+
* location — the "Oldest footage" column in Recordings → Storage, and the
|
|
24937
|
+
* only honest answer to "is retention actually holding?" per camera.
|
|
24938
|
+
*
|
|
24939
|
+
* `null` = the camera has no footage. OPTIONAL because a recorder that
|
|
24940
|
+
* predates this field omits it entirely, and a hub whose types carry the
|
|
24941
|
+
* field must keep validating that older provider's payload: the framework
|
|
24942
|
+
* (types) and the addon ship on different trains, and the addon is usually
|
|
24943
|
+
* the later of the two.
|
|
24944
|
+
*/
|
|
24945
|
+
oldestMs: number().nullable().optional()
|
|
24635
24946
|
});
|
|
24636
24947
|
/** Recording storage usage + capacity for one storage location. */
|
|
24637
24948
|
var RecordingLocationUsageSchema = object({
|
|
@@ -24659,6 +24970,57 @@ var RecordingStorageUsageSchema = object({
|
|
|
24659
24970
|
locations: array(RecordingLocationUsageSchema)
|
|
24660
24971
|
});
|
|
24661
24972
|
/**
|
|
24973
|
+
* The OPERATOR-ARMED half of multi-location recordings (D116).
|
|
24974
|
+
*
|
|
24975
|
+
* The placement plan decides where NEW writes go and moves nothing. A rebalance
|
|
24976
|
+
* is the operator asking for the EXISTING archive to be brought into line with
|
|
24977
|
+
* that plan: one relocate job per (camera, profile) pile that sits on the wrong
|
|
24978
|
+
* location, run FIFO behind the single-flight mover.
|
|
24979
|
+
*
|
|
24980
|
+
* `plan…` and `start…` return the SAME shape deliberately — what the operator
|
|
24981
|
+
* confirms is exactly what gets enqueued, and `jobIds` is the only difference
|
|
24982
|
+
* (empty on the plan).
|
|
24983
|
+
*/
|
|
24984
|
+
var RecordingRebalanceMoveSchema = object({
|
|
24985
|
+
deviceId: number(),
|
|
24986
|
+
profile: string(),
|
|
24987
|
+
fromLocationId: string(),
|
|
24988
|
+
toLocationId: string(),
|
|
24989
|
+
bytes: number(),
|
|
24990
|
+
files: number().int()
|
|
24991
|
+
});
|
|
24992
|
+
/** Why a pile that is out of place is staying there. Every refusal is
|
|
24993
|
+
* reported: a rebalance that silently drops a camera reads exactly like one
|
|
24994
|
+
* that had nothing to do. */
|
|
24995
|
+
var RecordingRebalanceSkipReasonSchema = _enum([
|
|
24996
|
+
"unassigned",
|
|
24997
|
+
"target-not-writable",
|
|
24998
|
+
"below-threshold",
|
|
24999
|
+
"no-headroom"
|
|
25000
|
+
]);
|
|
25001
|
+
var RecordingRebalanceSkipSchema = object({
|
|
25002
|
+
deviceId: number(),
|
|
25003
|
+
profile: string(),
|
|
25004
|
+
fromLocationId: string(),
|
|
25005
|
+
/** The location the plan wants; null when the camera has no assignment. */
|
|
25006
|
+
toLocationId: string().nullable(),
|
|
25007
|
+
bytes: number(),
|
|
25008
|
+
reason: RecordingRebalanceSkipReasonSchema
|
|
25009
|
+
});
|
|
25010
|
+
var RecordingRebalancePlanSchema = object({
|
|
25011
|
+
moves: array(RecordingRebalanceMoveSchema),
|
|
25012
|
+
skipped: array(RecordingRebalanceSkipSchema),
|
|
25013
|
+
bytesToMove: number(),
|
|
25014
|
+
/** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
|
|
25015
|
+
jobIds: array(string())
|
|
25016
|
+
});
|
|
25017
|
+
var RecordingRebalanceInputSchema = object({
|
|
25018
|
+
/** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
|
|
25019
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
25020
|
+
/** Ignore piles smaller than this (default 1 GB). */
|
|
25021
|
+
minMoveGb: number().min(0).optional()
|
|
25022
|
+
});
|
|
25023
|
+
/**
|
|
24662
25024
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
24663
25025
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
24664
25026
|
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
@@ -24821,9 +25183,24 @@ method(object({
|
|
|
24821
25183
|
}), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
24822
25184
|
kind: "mutation",
|
|
24823
25185
|
auth: "admin"
|
|
25186
|
+
}), method(RelocateFootageInputSchema, object({ jobId: string() }), {
|
|
25187
|
+
kind: "mutation",
|
|
25188
|
+
auth: "admin"
|
|
25189
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
25190
|
+
kind: "query",
|
|
25191
|
+
auth: "admin"
|
|
25192
|
+
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
25193
|
+
kind: "mutation",
|
|
25194
|
+
auth: "admin"
|
|
25195
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
25196
|
+
kind: "query",
|
|
25197
|
+
auth: "admin"
|
|
25198
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
25199
|
+
kind: "mutation",
|
|
25200
|
+
auth: "admin"
|
|
24824
25201
|
});
|
|
24825
25202
|
/**
|
|
24826
|
-
* `
|
|
25203
|
+
* `recording-export` cap — render a footage time range into a single downloadable
|
|
24827
25204
|
* MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
|
|
24828
25205
|
* bounded lifetime with a durable history, auto-expiry, and optional
|
|
24829
25206
|
* delete-after-download.
|
|
@@ -24838,10 +25215,53 @@ method(object({
|
|
|
24838
25215
|
*/
|
|
24839
25216
|
/** Playback-speed multiplier for the render (1 = realtime). */
|
|
24840
25217
|
var ExportSpeedSchema = number().min(.25).max(32);
|
|
25218
|
+
/**
|
|
25219
|
+
* One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
|
|
25220
|
+
*
|
|
25221
|
+
* **Wall clock, not ffmpeg's `t`** — and the recorder translates. A caller
|
|
25222
|
+
* derives these bounds from things that happened at a TIME (a track's
|
|
25223
|
+
* `firstSeen`), while `t` runs over the source playlist: the concatenation of
|
|
25224
|
+
* every segment present for the range, with each recording GAP removed. The
|
|
25225
|
+
* two agree only on a window that recorded without one interruption, and only
|
|
25226
|
+
* the render side knows the segments, so the translation lives there
|
|
25227
|
+
* (`export-dense-map.ts`, addon-pipeline).
|
|
25228
|
+
*
|
|
25229
|
+
* It was not always so. These seconds were fed to `between(t,…)` verbatim, and
|
|
25230
|
+
* on a 10 h window holding 29,393 s of footage every range landed late by the
|
|
25231
|
+
* gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
|
|
25232
|
+
* the video was a uniform timelapse, and the log line reported the five ranges
|
|
25233
|
+
* that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
|
|
25234
|
+
*
|
|
25235
|
+
* Relative and not absolute epoch, because an absolute epoch would make every
|
|
25236
|
+
* call site responsible for the same subtraction.
|
|
25237
|
+
*/
|
|
25238
|
+
var ExportDenseRangeSchema = object({
|
|
25239
|
+
fromSec: number().nonnegative(),
|
|
25240
|
+
toSec: number().nonnegative()
|
|
25241
|
+
}).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
|
|
25242
|
+
/**
|
|
25243
|
+
* Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
|
|
25244
|
+
* listed ranges and at the base `everyMs` everywhere else.
|
|
25245
|
+
*
|
|
25246
|
+
* `everyMs` must be strictly smaller than the base cadence — a dense rate that
|
|
25247
|
+
* is not denser renders a uniform timelapse the operator believes is two-rate.
|
|
25248
|
+
*/
|
|
25249
|
+
var ExportDenseSchema = object({
|
|
25250
|
+
everyMs: number().int().positive(),
|
|
25251
|
+
ranges: array(ExportDenseRangeSchema).min(1).max(200)
|
|
25252
|
+
});
|
|
24841
25253
|
/** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
|
|
24842
25254
|
var ExportTimelapseSchema = object({
|
|
24843
25255
|
everyMs: number().int().positive(),
|
|
24844
|
-
outputFps: number().int().min(1).max(60).optional()
|
|
25256
|
+
outputFps: number().int().min(1).max(60).optional(),
|
|
25257
|
+
/** Optional second, FASTER rate over the intervals that matter. */
|
|
25258
|
+
dense: ExportDenseSchema.optional()
|
|
25259
|
+
}).superRefine((v, ctx) => {
|
|
25260
|
+
if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
|
|
25261
|
+
code: ZodIssueCode.custom,
|
|
25262
|
+
message: "dense.everyMs must be strictly smaller than the base everyMs",
|
|
25263
|
+
path: ["dense", "everyMs"]
|
|
25264
|
+
});
|
|
24845
25265
|
});
|
|
24846
25266
|
/**
|
|
24847
25267
|
* Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
|
|
@@ -24899,6 +25319,19 @@ var ExportDownloadSchema = object({
|
|
|
24899
25319
|
url: string(),
|
|
24900
25320
|
endpoints: array(string())
|
|
24901
25321
|
});
|
|
25322
|
+
/**
|
|
25323
|
+
* A finished export's bytes, inline.
|
|
25324
|
+
*
|
|
25325
|
+
* `bytes` is the DECODED length — the number the caller bounds and logs
|
|
25326
|
+
* against, so nobody has to infer it from the base64 length.
|
|
25327
|
+
*/
|
|
25328
|
+
var ExportBytesSchema = object({
|
|
25329
|
+
base64: string(),
|
|
25330
|
+
contentType: string(),
|
|
25331
|
+
/** Suggested filename, extension included. */
|
|
25332
|
+
name: string(),
|
|
25333
|
+
bytes: number().int().nonnegative()
|
|
25334
|
+
});
|
|
24902
25335
|
method(object({
|
|
24903
25336
|
deviceId: number(),
|
|
24904
25337
|
profile: string(),
|
|
@@ -24923,6 +25356,9 @@ method(object({
|
|
|
24923
25356
|
}), method(object({ exportId: string() }), ExportDownloadSchema, {
|
|
24924
25357
|
kind: "query",
|
|
24925
25358
|
auth: "protected"
|
|
25359
|
+
}), method(object({ exportId: string() }), ExportBytesSchema, {
|
|
25360
|
+
kind: "query",
|
|
25361
|
+
auth: "protected"
|
|
24926
25362
|
});
|
|
24927
25363
|
/**
|
|
24928
25364
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
@@ -31600,6 +32036,12 @@ Object.freeze({
|
|
|
31600
32036
|
addonId: null,
|
|
31601
32037
|
access: "create"
|
|
31602
32038
|
},
|
|
32039
|
+
"recording.cancelRelocateJob": {
|
|
32040
|
+
capName: "recording",
|
|
32041
|
+
capScope: "system",
|
|
32042
|
+
addonId: null,
|
|
32043
|
+
access: "create"
|
|
32044
|
+
},
|
|
31603
32045
|
"recording.cancelStorageMigrationMove": {
|
|
31604
32046
|
capName: "recording",
|
|
31605
32047
|
capScope: "system",
|
|
@@ -31654,6 +32096,12 @@ Object.freeze({
|
|
|
31654
32096
|
addonId: null,
|
|
31655
32097
|
access: "view"
|
|
31656
32098
|
},
|
|
32099
|
+
"recording.listRelocateJobs": {
|
|
32100
|
+
capName: "recording",
|
|
32101
|
+
capScope: "system",
|
|
32102
|
+
addonId: null,
|
|
32103
|
+
access: "view"
|
|
32104
|
+
},
|
|
31657
32105
|
"recording.locateSegment": {
|
|
31658
32106
|
capName: "recording",
|
|
31659
32107
|
capScope: "system",
|
|
@@ -31666,6 +32114,12 @@ Object.freeze({
|
|
|
31666
32114
|
addonId: null,
|
|
31667
32115
|
access: "create"
|
|
31668
32116
|
},
|
|
32117
|
+
"recording.planStorageRebalance": {
|
|
32118
|
+
capName: "recording",
|
|
32119
|
+
capScope: "system",
|
|
32120
|
+
addonId: null,
|
|
32121
|
+
access: "view"
|
|
32122
|
+
},
|
|
31669
32123
|
"recording.pruneFootage": {
|
|
31670
32124
|
capName: "recording",
|
|
31671
32125
|
capScope: "system",
|
|
@@ -31690,6 +32144,12 @@ Object.freeze({
|
|
|
31690
32144
|
addonId: null,
|
|
31691
32145
|
access: "create"
|
|
31692
32146
|
},
|
|
32147
|
+
"recording.relocateFootage": {
|
|
32148
|
+
capName: "recording",
|
|
32149
|
+
capScope: "system",
|
|
32150
|
+
addonId: null,
|
|
32151
|
+
access: "create"
|
|
32152
|
+
},
|
|
31693
32153
|
"recording.renderClip": {
|
|
31694
32154
|
capName: "recording",
|
|
31695
32155
|
capScope: "system",
|
|
@@ -31726,38 +32186,50 @@ Object.freeze({
|
|
|
31726
32186
|
addonId: null,
|
|
31727
32187
|
access: "create"
|
|
31728
32188
|
},
|
|
32189
|
+
"recording.startStorageRebalance": {
|
|
32190
|
+
capName: "recording",
|
|
32191
|
+
capScope: "system",
|
|
32192
|
+
addonId: null,
|
|
32193
|
+
access: "create"
|
|
32194
|
+
},
|
|
31729
32195
|
"recordingExport.cancelExport": {
|
|
31730
|
-
capName: "
|
|
32196
|
+
capName: "recording-export",
|
|
31731
32197
|
capScope: "system",
|
|
31732
32198
|
addonId: null,
|
|
31733
32199
|
access: "create"
|
|
31734
32200
|
},
|
|
31735
32201
|
"recordingExport.createExport": {
|
|
31736
|
-
capName: "
|
|
32202
|
+
capName: "recording-export",
|
|
31737
32203
|
capScope: "system",
|
|
31738
32204
|
addonId: null,
|
|
31739
32205
|
access: "create"
|
|
31740
32206
|
},
|
|
31741
32207
|
"recordingExport.deleteExport": {
|
|
31742
|
-
capName: "
|
|
32208
|
+
capName: "recording-export",
|
|
31743
32209
|
capScope: "system",
|
|
31744
32210
|
addonId: null,
|
|
31745
32211
|
access: "delete"
|
|
31746
32212
|
},
|
|
31747
32213
|
"recordingExport.getDownloadUrl": {
|
|
31748
|
-
capName: "
|
|
32214
|
+
capName: "recording-export",
|
|
31749
32215
|
capScope: "system",
|
|
31750
32216
|
addonId: null,
|
|
31751
32217
|
access: "view"
|
|
31752
32218
|
},
|
|
31753
32219
|
"recordingExport.getExport": {
|
|
31754
|
-
capName: "
|
|
32220
|
+
capName: "recording-export",
|
|
31755
32221
|
capScope: "system",
|
|
31756
32222
|
addonId: null,
|
|
31757
32223
|
access: "view"
|
|
31758
32224
|
},
|
|
31759
32225
|
"recordingExport.listExports": {
|
|
31760
|
-
capName: "
|
|
32226
|
+
capName: "recording-export",
|
|
32227
|
+
capScope: "system",
|
|
32228
|
+
addonId: null,
|
|
32229
|
+
access: "view"
|
|
32230
|
+
},
|
|
32231
|
+
"recordingExport.readExportBytes": {
|
|
32232
|
+
capName: "recording-export",
|
|
31761
32233
|
capScope: "system",
|
|
31762
32234
|
addonId: null,
|
|
31763
32235
|
access: "view"
|
|
@@ -33134,6 +33606,104 @@ var FramerateField = number().int().min(1).max(60);
|
|
|
33134
33606
|
var TargetsField = array(NcRuleTargetSchema).min(1);
|
|
33135
33607
|
var PriorityField = number().int().min(1).max(5);
|
|
33136
33608
|
/**
|
|
33609
|
+
* Explicit override of the DENSE sampling cadence, seconds.
|
|
33610
|
+
*
|
|
33611
|
+
* Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
|
|
33612
|
+
* 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
|
|
33613
|
+
* made that same base 3 s and rendered a person pass as two frames.)
|
|
33614
|
+
*
|
|
33615
|
+
* THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
|
|
33616
|
+
* `denseCadenceSec` and played at `framerate` occupies
|
|
33617
|
+
*
|
|
33618
|
+
* outputSeconds = (rangeSec / denseCadenceSec) / framerate
|
|
33619
|
+
*
|
|
33620
|
+
* so a 7 s pass at 1 s / 12 fps is 0.58 s of video, and at 0.5 s it is 1.17 s.
|
|
33621
|
+
* Halving this field doubles the frames INSIDE ranges only — the base cadence,
|
|
33622
|
+
* and therefore the length of a quiet night, does not move.
|
|
33623
|
+
*
|
|
33624
|
+
* Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
|
|
33625
|
+
* the recording has them returns the same frames, requested twice. Must be
|
|
33626
|
+
* STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
|
|
33627
|
+
* a uniform video the operator believes is two-rate — and upsert refuses it
|
|
33628
|
+
* rather than letting the export cap reject the render hours after the window.
|
|
33629
|
+
*/
|
|
33630
|
+
var DenseCadenceSecField = number().min(.1).max(3600);
|
|
33631
|
+
/**
|
|
33632
|
+
* Minimum seconds of OUTPUT video each detection range must occupy.
|
|
33633
|
+
*
|
|
33634
|
+
* The operator-facing form of the arithmetic above: instead of solving for a
|
|
33635
|
+
* cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
|
|
33636
|
+
* 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
|
|
33637
|
+
* that range every ~583 ms.
|
|
33638
|
+
*
|
|
33639
|
+
* ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
|
|
33640
|
+
* ranges are terms of a single ffmpeg `select` expression that cannot vary rate
|
|
33641
|
+
* per term — so the MOST DEMANDING (shortest) range sets the rate and longer
|
|
33642
|
+
* ranges are sampled denser than they need. Per-range cadences require a cap
|
|
33643
|
+
* schema change and are the tracked follow-up.
|
|
33644
|
+
*
|
|
33645
|
+
* A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
|
|
33646
|
+
* is rendered with every frame that EXISTS and no more: the guarantee is capped
|
|
33647
|
+
* by real footage, never met by duplicating frames into motion that never
|
|
33648
|
+
* happened.
|
|
33649
|
+
*/
|
|
33650
|
+
var MinDwellSecField = number().min(0).max(60);
|
|
33651
|
+
/**
|
|
33652
|
+
* Caption burned into the notification's preview frame.
|
|
33653
|
+
*
|
|
33654
|
+
* Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
|
|
33655
|
+
* `rule`, `from`, `to`) and rendered by the SAME renderer — a second
|
|
33656
|
+
* templating dialect for one field would be a second thing to explain.
|
|
33657
|
+
*
|
|
33658
|
+
* Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
|
|
33659
|
+
* operator saying "the frame, no caption" — a distinct, reachable answer, and
|
|
33660
|
+
* the reason this is not `.min(1)`.
|
|
33661
|
+
*/
|
|
33662
|
+
var PreviewTextField = string().max(200);
|
|
33663
|
+
/**
|
|
33664
|
+
* Whether the notification's preview is a STILL or a short animation.
|
|
33665
|
+
*
|
|
33666
|
+
* The operator's ask, verbatim: *"inviato come gif o video (come per le altre
|
|
33667
|
+
* rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
|
|
33668
|
+
* night reads better as three seconds of motion than as one frame of it. Both
|
|
33669
|
+
* modes get the SAME treatment (blurred frame, large centred title); `'gif'`
|
|
33670
|
+
* simply applies it to a dozen frames sampled across the render and assembles
|
|
33671
|
+
* them.
|
|
33672
|
+
*
|
|
33673
|
+
* `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
|
|
33674
|
+
* seeks and a palette pass, and no rule that never asked for one should start
|
|
33675
|
+
* paying that on the deploy that shipped it.
|
|
33676
|
+
*
|
|
33677
|
+
* A GIF that cannot be assembled DEGRADES to the still — never to nothing.
|
|
33678
|
+
*/
|
|
33679
|
+
var PreviewModeField = _enum(["image", "gif"]);
|
|
33680
|
+
/**
|
|
33681
|
+
* Which detection classes the notification reports counts for.
|
|
33682
|
+
*
|
|
33683
|
+
* The counts come from the tracks the render ALREADY fetched for its dense-range
|
|
33684
|
+
* plan — no second query — aggregated per class. Absent or empty means "every
|
|
33685
|
+
* class the window actually contained", which is what an operator who never
|
|
33686
|
+
* opened the field wants; a list narrows it (`['person']` on a driveway that
|
|
33687
|
+
* counts cars all night).
|
|
33688
|
+
*
|
|
33689
|
+
* Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
|
|
33690
|
+
* …). An unknown name simply never matches and reports nothing — it is not an
|
|
33691
|
+
* error, because a rule may legitimately name a class this camera's model does
|
|
33692
|
+
* not emit.
|
|
33693
|
+
*
|
|
33694
|
+
* The counts are exposed to {@link TimelapseTemplateSchema} as:
|
|
33695
|
+
* - `{{detections}}` — total over the reported classes
|
|
33696
|
+
* - `{{detectionSummary}}` — `2 persone, 1 veicolo`
|
|
33697
|
+
* - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
|
|
33698
|
+
* one per class, `count_` + the class name
|
|
33699
|
+
*
|
|
33700
|
+
* With NO custom body template the summary is appended to the derived body, and
|
|
33701
|
+
* only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
|
|
33702
|
+
* reads. With a custom template the operator owns every word — nothing is
|
|
33703
|
+
* appended, so `{{detectionSummary}}` is how he asks for it.
|
|
33704
|
+
*/
|
|
33705
|
+
var ReportClassesField = array(string().min(1).max(40)).max(20);
|
|
33706
|
+
/**
|
|
33137
33707
|
* Client-supplied timelapse-rule fields. The server stamps id / createdBy /
|
|
33138
33708
|
* createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
|
|
33139
33709
|
* here (see the ownership note above).
|
|
@@ -33153,9 +33723,30 @@ var TimelapseRuleInputSchema = object({
|
|
|
33153
33723
|
cadenceSec: CadenceSecField.default(15),
|
|
33154
33724
|
/** Output frames per second of the assembled mp4 (predecessor parity). */
|
|
33155
33725
|
framerate: FramerateField.default(10),
|
|
33726
|
+
/**
|
|
33727
|
+
* Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
|
|
33728
|
+
* as `max(1s, cadenceSec / 30)`, which is what every rule written before this
|
|
33729
|
+
* field gets.
|
|
33730
|
+
*/
|
|
33731
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
33732
|
+
/** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
|
|
33733
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
33156
33734
|
/** `notification-output` targets the finished video/thumbnail is sent to. */
|
|
33157
33735
|
targets: TargetsField,
|
|
33158
33736
|
template: TimelapseTemplateSchema.optional(),
|
|
33737
|
+
/**
|
|
33738
|
+
* Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
|
|
33739
|
+
* and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
|
|
33740
|
+
*
|
|
33741
|
+
* Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
|
|
33742
|
+
* the notification's title/body, and clearing it (`template: null`) must not
|
|
33743
|
+
* silently clear the caption too.
|
|
33744
|
+
*/
|
|
33745
|
+
previewText: PreviewTextField.optional(),
|
|
33746
|
+
/** Still or animation — see {@link PreviewModeField}. */
|
|
33747
|
+
previewMode: PreviewModeField.default("image"),
|
|
33748
|
+
/** Classes the notification counts — see {@link ReportClassesField}. */
|
|
33749
|
+
reportClasses: ReportClassesField.optional(),
|
|
33159
33750
|
/** Canonical notification priority ordinal (1..5); per-target overridable. */
|
|
33160
33751
|
priority: PriorityField.default(3)
|
|
33161
33752
|
});
|
|
@@ -33166,8 +33757,13 @@ object({
|
|
|
33166
33757
|
schedule: NcScheduleSchema.optional(),
|
|
33167
33758
|
cadenceSec: CadenceSecField.optional(),
|
|
33168
33759
|
framerate: FramerateField.optional(),
|
|
33760
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
33761
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
33169
33762
|
targets: TargetsField.optional(),
|
|
33170
33763
|
template: TimelapseTemplateSchema.nullable().optional(),
|
|
33764
|
+
previewText: PreviewTextField.optional(),
|
|
33765
|
+
previewMode: PreviewModeField.optional(),
|
|
33766
|
+
reportClasses: ReportClassesField.optional(),
|
|
33171
33767
|
priority: PriorityField.optional()
|
|
33172
33768
|
});
|
|
33173
33769
|
TimelapseRuleInputSchema.extend({
|
|
@@ -33179,10 +33775,28 @@ TimelapseRuleInputSchema.extend({
|
|
|
33179
33775
|
*/
|
|
33180
33776
|
ownerUserId: string().optional(),
|
|
33181
33777
|
/**
|
|
33182
|
-
* Epoch-ms of the
|
|
33183
|
-
*
|
|
33778
|
+
* Epoch-ms of the NEWEST successful generation across every camera of this
|
|
33779
|
+
* rule. What a UI shows, and the compatibility floor for
|
|
33780
|
+
* {@link readTimelapseGeneratedAt}. Absent = never generated.
|
|
33184
33781
|
*/
|
|
33185
33782
|
lastGeneratedAt: number().optional(),
|
|
33783
|
+
/**
|
|
33784
|
+
* PER-CAMERA generation state, keyed by `String(deviceId)` — the
|
|
33785
|
+
* re-generation guard's real durable state.
|
|
33786
|
+
*
|
|
33787
|
+
* One rule covers several cameras and each renders its own video, so a rule
|
|
33788
|
+
* -wide stamp is wrong in the direction that DESTROYS work: camera A
|
|
33789
|
+
* succeeding at 06:05 tells camera B, whose render failed, that it is
|
|
33790
|
+
* already done — and B's night is gone for good, because the window will not
|
|
33791
|
+
* come back.
|
|
33792
|
+
*
|
|
33793
|
+
* ADDITIVE, so the migration is free: a row written before this field simply
|
|
33794
|
+
* has no map, and {@link readTimelapseGeneratedAt} falls back to
|
|
33795
|
+
* {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
|
|
33796
|
+
* "never generated" would re-render and re-notify every camera of every rule
|
|
33797
|
+
* once, on the deploy that shipped the map.
|
|
33798
|
+
*/
|
|
33799
|
+
generatedByDevice: record(string(), number()).optional(),
|
|
33186
33800
|
/** userId of the caller who created the rule (server-stamped). */
|
|
33187
33801
|
createdBy: string(),
|
|
33188
33802
|
createdAt: number(),
|
|
@@ -33233,25 +33847,32 @@ object({
|
|
|
33233
33847
|
var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
|
|
33234
33848
|
object({
|
|
33235
33849
|
/**
|
|
33236
|
-
* How
|
|
33850
|
+
* How many delivered frames the worker HOLDS at once, waiting for each one's
|
|
33851
|
+
* detection result.
|
|
33237
33852
|
*
|
|
33238
|
-
*
|
|
33239
|
-
*
|
|
33240
|
-
*
|
|
33241
|
-
*
|
|
33242
|
-
*
|
|
33853
|
+
* This replaced a TTL on 2026-08-13, and the replacement is the whole point:
|
|
33854
|
+
* a time window was never related to the event the pixels were waiting for.
|
|
33855
|
+
* A held frame now lives from delivery until the runner has its `FrameResult`
|
|
33856
|
+
* — at which moment the runner cuts the subject tiles it actually wanted and
|
|
33857
|
+
* releases the frame. The bound exists only so a runner that stops answering
|
|
33858
|
+
* cannot pin RAM: above it the OLDEST held frame is dropped and counted.
|
|
33859
|
+
*
|
|
33860
|
+
* Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
|
|
33861
|
+
* 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
|
|
33862
|
+
* without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
|
|
33863
|
+
* Raising it does not buy hit rate — it buys tolerance for a slow runner, and
|
|
33864
|
+
* `holdOverflow` on the metrics line is what says you need it.
|
|
33243
33865
|
*/
|
|
33244
|
-
|
|
33866
|
+
holdFrames: number().int().min(1).max(64),
|
|
33245
33867
|
/**
|
|
33246
33868
|
* Hard per-decode-worker RAM ceiling for retained native frames, in MB.
|
|
33247
33869
|
*
|
|
33248
|
-
*
|
|
33249
|
-
*
|
|
33250
|
-
*
|
|
33251
|
-
*
|
|
33252
|
-
*
|
|
33253
|
-
*
|
|
33254
|
-
* rather than giving RAM back — lower this knob if RAM is what you wanted.
|
|
33870
|
+
* Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
|
|
33871
|
+
* is what decides how much is held, and the ceiling is the number above which
|
|
33872
|
+
* something is wrong. Before that it was the effective cap — at 1024 MB with
|
|
33873
|
+
* a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
|
|
33874
|
+
* with the TTL expiring nothing, which is exactly the confusion the hold
|
|
33875
|
+
* removes. `leaseMb` / `leaseFrames` still say what is resident.
|
|
33255
33876
|
* `0` DISABLES the lease entirely and falls the worker back to the tiny
|
|
33256
33877
|
* leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
|
|
33257
33878
|
* to replace).
|
|
@@ -33277,22 +33898,45 @@ object({
|
|
|
33277
33898
|
* there is the signal that some caller names frames outside the inference set
|
|
33278
33899
|
* and that this must go back to `all`.
|
|
33279
33900
|
*/
|
|
33280
|
-
admission: NativeLeaseAdmissionSchema
|
|
33901
|
+
admission: NativeLeaseAdmissionSchema,
|
|
33902
|
+
/**
|
|
33903
|
+
* RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
|
|
33904
|
+
* compressed native crops the worker cuts at the moment a frame's detection
|
|
33905
|
+
* result arrives, and keeps long after the frame itself is freed.
|
|
33906
|
+
*
|
|
33907
|
+
* This is the knob that replaced the old retention window, and it buys about
|
|
33908
|
+
* three orders of magnitude more of it: a tile is one subject at native
|
|
33909
|
+
* resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
|
|
33910
|
+
* the frame it was cut from. A frame on which nothing was detected costs
|
|
33911
|
+
* nothing at all, which is the real change — the old lease paid per FRAME and
|
|
33912
|
+
* was interrogated per SUBJECT.
|
|
33913
|
+
*
|
|
33914
|
+
* `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
|
|
33915
|
+
* fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
|
|
33916
|
+
* reproduce that.
|
|
33917
|
+
*/
|
|
33918
|
+
tileBudgetMb: number().int().min(0).max(1024)
|
|
33281
33919
|
});
|
|
33282
33920
|
/**
|
|
33283
|
-
* The values in force when the operator has set nothing
|
|
33284
|
-
*
|
|
33285
|
-
*
|
|
33921
|
+
* The values in force when the operator has set nothing.
|
|
33922
|
+
*
|
|
33923
|
+
* `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
|
|
33924
|
+
* being the retention window and became the OOM ceiling, and lowering a ceiling
|
|
33925
|
+
* in the same change that redefines it would make a regression and a retune
|
|
33926
|
+
* indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
|
|
33927
|
+
* live traffic.
|
|
33286
33928
|
*/
|
|
33287
33929
|
var DEFAULT_NATIVE_LEASE_SETTINGS = {
|
|
33288
|
-
|
|
33930
|
+
holdFrames: 8,
|
|
33289
33931
|
budgetMb: 1024,
|
|
33290
33932
|
activityMs: 15e3,
|
|
33933
|
+
tileBudgetMb: 64,
|
|
33291
33934
|
admission: "inferred"
|
|
33292
33935
|
};
|
|
33293
|
-
DEFAULT_NATIVE_LEASE_SETTINGS.
|
|
33936
|
+
DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
|
|
33294
33937
|
DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
|
|
33295
33938
|
DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
|
|
33939
|
+
DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
|
|
33296
33940
|
DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
33297
33941
|
/**
|
|
33298
33942
|
* Pure fuzzy matcher for adoption location import. Normalized
|