@camstack/addon-notifiers 1.2.17 → 1.2.18
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 +625 -22
- package/dist/addon.mjs +625 -22
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -7338,8 +7338,31 @@ var AdoptionJobSchema = object({
|
|
|
7338
7338
|
error: string().nullable()
|
|
7339
7339
|
});
|
|
7340
7340
|
/**
|
|
7341
|
-
* Per-camera FUNCTION SWITCHES
|
|
7342
|
-
*
|
|
7341
|
+
* Per-camera FUNCTION SWITCHES.
|
|
7342
|
+
*
|
|
7343
|
+
* ## The aggregate group is being withdrawn — the BADGE is not (D113)
|
|
7344
|
+
*
|
|
7345
|
+
* This file shipped as "the one coherent on/off surface over the pipeline
|
|
7346
|
+
* functions an operator thinks in terms of". The operator's verdict on
|
|
7347
|
+
* 2026-08-12 was that the coherent surface bought complexity and no clarity:
|
|
7348
|
+
* every function already had a settings page of its own, and a second place to
|
|
7349
|
+
* turn it off is a second place to look. Each switch is going back to its own
|
|
7350
|
+
* component's original options — detection to the detection-pipeline wrapper
|
|
7351
|
+
* binding, audio analysis to its own, recording to `RecordingConfig.enabled`
|
|
7352
|
+
* (which was always first-class; the switch was a veneer over
|
|
7353
|
+
* `recording.setDeviceConfig`), notifications to a notification-center
|
|
7354
|
+
* per-device setting, the two camera planes to their own components.
|
|
7355
|
+
*
|
|
7356
|
+
* What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
|
|
7357
|
+
* thing that lets a status surface say DISABLED instead of BROKEN, recomposed
|
|
7358
|
+
* straight from the authorities with no group in the middle. That rule was
|
|
7359
|
+
* never about a control panel.
|
|
7360
|
+
*
|
|
7361
|
+
* Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
|
|
7362
|
+
* {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
|
|
7363
|
+
* `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
|
|
7364
|
+
* viewers (v1.0.305) and the admin UI still call it. It is deleted when they
|
|
7365
|
+
* stop; nothing new may be built on it.
|
|
7343
7366
|
*
|
|
7344
7367
|
* ## This file adds no state
|
|
7345
7368
|
*
|
|
@@ -7690,7 +7713,15 @@ var RecordingConfigSchema = object({
|
|
|
7690
7713
|
* Each completed/failed run also lands one durable ops-log row on its owning
|
|
7691
7714
|
* addon surface.
|
|
7692
7715
|
*/
|
|
7716
|
+
/**
|
|
7717
|
+
* `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
|
|
7718
|
+
* rebalance enqueues one job per (camera, profile). Refusing the second job —
|
|
7719
|
+
* what the engine did before — turned a fifteen-camera rebalance into fifteen
|
|
7720
|
+
* manual retries. Queued jobs run FIFO; a queued job that is cancelled never
|
|
7721
|
+
* runs at all.
|
|
7722
|
+
*/
|
|
7693
7723
|
var RelocateJobStateSchema = _enum([
|
|
7724
|
+
"queued",
|
|
7694
7725
|
"running",
|
|
7695
7726
|
"done",
|
|
7696
7727
|
"failed",
|
|
@@ -7725,6 +7756,15 @@ var RelocateFootageInputSchema = object({
|
|
|
7725
7756
|
/** Limits relocation to the logical profile class. Omit only for the
|
|
7726
7757
|
* pre-orchestration compatibility path. */
|
|
7727
7758
|
footageClass: RelocateFootageClassSchema.optional(),
|
|
7759
|
+
/** Scope the move to ONE camera. Absent = every camera on the source, which
|
|
7760
|
+
* is what a whole-disk drain means. The rebalance path always sets it: its
|
|
7761
|
+
* unit is a (camera, profile) pile, not a disk. */
|
|
7762
|
+
deviceId: number().int().optional(),
|
|
7763
|
+
/** Scope the move to specific segment profiles (`high` / `mid` / `low`).
|
|
7764
|
+
* Finer than `footageClass`, which cannot separate high from mid — and the
|
|
7765
|
+
* placement plan assigns those two independently, so a rebalance that could
|
|
7766
|
+
* only say "recordings" would move footage the plan never asked to move. */
|
|
7767
|
+
profiles: array(string()).optional(),
|
|
7728
7768
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
7729
7769
|
* never allowed to starve live writers. */
|
|
7730
7770
|
throttleMbps: number().min(1).max(1e3).optional()
|
|
@@ -7860,6 +7900,21 @@ var StorageLocationSchema = object({
|
|
|
7860
7900
|
nodeId: string().optional(),
|
|
7861
7901
|
isDefault: boolean().default(false),
|
|
7862
7902
|
isSystem: boolean().default(false),
|
|
7903
|
+
/**
|
|
7904
|
+
* Operator opt-in: whether consumers that BALANCE across several locations
|
|
7905
|
+
* of a type may write here. Recordings reads it today; event media and
|
|
7906
|
+
* backups are the next consumers, which is why the flag lives on the
|
|
7907
|
+
* location rather than in any one addon's store — nothing has to be
|
|
7908
|
+
* extended to add the next consumer.
|
|
7909
|
+
*
|
|
7910
|
+
* OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
|
|
7911
|
+
* flag existed reads back with no flag and keeps working exactly as before;
|
|
7912
|
+
* that is the whole compat story, and it is why no migration ships with it.
|
|
7913
|
+
* A newly CREATED sibling is stamped `false` by the orchestrator (creating a
|
|
7914
|
+
* disk must not silently start writing to it); the default of a type is
|
|
7915
|
+
* always stamped `true`.
|
|
7916
|
+
*/
|
|
7917
|
+
enabled: boolean().optional(),
|
|
7863
7918
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
7864
7919
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
7865
7920
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -12203,7 +12258,8 @@ method(object({
|
|
|
12203
12258
|
}), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
|
|
12204
12259
|
/**
|
|
12205
12260
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
12206
|
-
* filesystem
|
|
12261
|
+
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
12262
|
+
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
12207
12263
|
* admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
|
|
12208
12264
|
* (one provider per node); the hub calls it with `{nodeId}` so the codegen
|
|
12209
12265
|
* routes to that exact node (default `nodeIdMode:'routing'`).
|
|
@@ -14030,6 +14086,13 @@ var MaskGridDimsSchema = object({
|
|
|
14030
14086
|
* `package-event` are pure trigger kinds (no urgency dimension). Extending
|
|
14031
14087
|
* this one field keeps the schema additive — a rule still declares exactly
|
|
14032
14088
|
* one trigger.
|
|
14089
|
+
*
|
|
14090
|
+
* AUDIO rules add no member here, for the reason occupancy added none: the
|
|
14091
|
+
* enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
|
|
14092
|
+
* mirror.ts` fails the build on a member the app cannot render) and every
|
|
14093
|
+
* member costs a release train. A sustained-sound rule is therefore an
|
|
14094
|
+
* `immediate` rule carrying {@link NcConditions.audio} — the condition is the
|
|
14095
|
+
* trigger discriminator, exactly as `occupancy` is on `device-event`.
|
|
14033
14096
|
*/
|
|
14034
14097
|
var NcDeliverySchema = _enum([
|
|
14035
14098
|
"immediate",
|
|
@@ -14044,15 +14107,32 @@ var NcDeliverySchema = _enum([
|
|
|
14044
14107
|
* depend on a provider's raw event name or payload shape.
|
|
14045
14108
|
*/
|
|
14046
14109
|
var NcSystemEventKindSchema = _enum([
|
|
14047
|
-
"
|
|
14048
|
-
"
|
|
14110
|
+
"device-online",
|
|
14111
|
+
"device-offline",
|
|
14112
|
+
"device-disabled",
|
|
14113
|
+
"device-enabled",
|
|
14049
14114
|
"stream-online",
|
|
14050
14115
|
"stream-offline",
|
|
14051
14116
|
"node-online",
|
|
14052
14117
|
"node-offline",
|
|
14053
14118
|
"addon-update-available",
|
|
14054
|
-
"server-update-available"
|
|
14119
|
+
"server-update-available",
|
|
14120
|
+
"alarm-triggered",
|
|
14121
|
+
"alarm-armed",
|
|
14122
|
+
"alarm-disarmed",
|
|
14123
|
+
"camera-online",
|
|
14124
|
+
"camera-offline",
|
|
14125
|
+
"camera-disabled",
|
|
14126
|
+
"camera-enabled"
|
|
14127
|
+
]);
|
|
14128
|
+
/** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
|
|
14129
|
+
var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
|
|
14130
|
+
"camera-online",
|
|
14131
|
+
"camera-offline",
|
|
14132
|
+
"camera-disabled",
|
|
14133
|
+
"camera-enabled"
|
|
14055
14134
|
]);
|
|
14135
|
+
NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
|
|
14056
14136
|
/**
|
|
14057
14137
|
* One coherent system-event condition. `kinds` is the required opt-in safety
|
|
14058
14138
|
* gate; the remaining lists are optional narrowing filters relevant to the
|
|
@@ -14061,6 +14141,18 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14061
14141
|
var NcSystemEventConditionSchema = object({
|
|
14062
14142
|
kinds: array(NcSystemEventKindSchema).min(1),
|
|
14063
14143
|
deviceIds: array(number().int()).min(1).optional(),
|
|
14144
|
+
/**
|
|
14145
|
+
* Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
|
|
14146
|
+
* `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
|
|
14147
|
+
* is what a liveness rule means when nobody said otherwise.
|
|
14148
|
+
*
|
|
14149
|
+
* This is where "only my cameras" is expressed, and it lives on the rule for
|
|
14150
|
+
* one reason: the intake cannot know which devices this household cares
|
|
14151
|
+
* about, and a producer-side filter is one no operator can change. Fails
|
|
14152
|
+
* CLOSED — a subject whose device type is unknown (an id the device mirror
|
|
14153
|
+
* does not carry) matches no `deviceTypes` list.
|
|
14154
|
+
*/
|
|
14155
|
+
deviceTypes: array(string().min(1)).min(1).optional(),
|
|
14064
14156
|
nodeIds: array(string().min(1)).min(1).optional(),
|
|
14065
14157
|
packageNames: array(string().min(1)).min(1).optional()
|
|
14066
14158
|
});
|
|
@@ -14111,6 +14203,47 @@ var NcOccupancyConditionSchema = object({
|
|
|
14111
14203
|
sustainSeconds: number().int().min(0).max(3600).default(15)
|
|
14112
14204
|
});
|
|
14113
14205
|
/**
|
|
14206
|
+
* Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
|
|
14207
|
+
*
|
|
14208
|
+
* Operator-approved vocabulary (2026-08-12, option A — the same one the
|
|
14209
|
+
* reference notifier uses, so an operator moving between them re-uses what
|
|
14210
|
+
* they already know): a rule matches when, over a sampling window of
|
|
14211
|
+
* `samplingSeconds`, at least `hitPercent`% of the audio samples in that
|
|
14212
|
+
* window are HITS. A sample is a hit when it satisfies BOTH present filters:
|
|
14213
|
+
*
|
|
14214
|
+
* - `dbThreshold` — its level is at or above this many dBFS (see
|
|
14215
|
+
* {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
|
|
14216
|
+
* - `labels` — the classifier put at least one of these labels on it.
|
|
14217
|
+
*
|
|
14218
|
+
* Both are OPTIONAL and independent, which is the point of the shape: a
|
|
14219
|
+
* loudness rule ("something loud at 3am") needs no model to be right, and a
|
|
14220
|
+
* label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
|
|
14221
|
+
* is given** — a window in which every sample is trivially a hit would fire on
|
|
14222
|
+
* silence, so the engine refuses such a condition rather than notifying on
|
|
14223
|
+
* nothing (the schema cannot express "at least one of" without becoming a
|
|
14224
|
+
* ZodEffects the cap path would have to special-case).
|
|
14225
|
+
*
|
|
14226
|
+
* `hitPercent` is over the samples the window actually HOLDS, and the window
|
|
14227
|
+
* must be FULL before it can match — a window that has been open for two
|
|
14228
|
+
* seconds of its ten is 100% of nothing, and firing on it would make
|
|
14229
|
+
* `samplingSeconds` decorative.
|
|
14230
|
+
*
|
|
14231
|
+
* Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
|
|
14232
|
+
* `audio-*` ids). Both spellings are accepted — the matcher normalizes the
|
|
14233
|
+
* `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
|
|
14234
|
+
* an operator who typed `dog` mean the same thing.
|
|
14235
|
+
*/
|
|
14236
|
+
var NcAudioConditionSchema = object({
|
|
14237
|
+
/** Audio macro labels; absent = any sound (level-only rule). */
|
|
14238
|
+
labels: array(string().min(1)).min(1).optional(),
|
|
14239
|
+
/** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
|
|
14240
|
+
dbThreshold: number().min(-96).max(0).optional(),
|
|
14241
|
+
/** Percentage of the window's samples that must be hits (1–100). */
|
|
14242
|
+
hitPercent: number().int().min(1).max(100).default(60),
|
|
14243
|
+
/** Length of the sampling window in seconds. */
|
|
14244
|
+
samplingSeconds: number().int().min(1).max(300).default(10)
|
|
14245
|
+
});
|
|
14246
|
+
/**
|
|
14114
14247
|
* Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
|
|
14115
14248
|
*
|
|
14116
14249
|
* The values are not symmetric, and deliberately so — the absent value has to
|
|
@@ -14383,7 +14516,33 @@ var NcConditionsSchema = object({
|
|
|
14383
14516
|
* threshold and holds for `sustainSeconds`. Fail-closed on missing
|
|
14384
14517
|
* substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
|
|
14385
14518
|
*/
|
|
14386
|
-
occupancy: NcOccupancyConditionSchema.optional()
|
|
14519
|
+
occupancy: NcOccupancyConditionSchema.optional(),
|
|
14520
|
+
/**
|
|
14521
|
+
* IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
|
|
14522
|
+
* `samplingSeconds` window clear the optional `dbThreshold` and carry one of
|
|
14523
|
+
* the optional `labels`. Fail-closed on missing substrate (no audio samples,
|
|
14524
|
+
* a window that is not full yet, neither filter given). See
|
|
14525
|
+
* {@link NcAudioCondition}.
|
|
14526
|
+
*
|
|
14527
|
+
* Presence of this key is what makes a rule an AUDIO rule: the engine fires
|
|
14528
|
+
* it ONLY on a confirmed audio window, and a rule carrying it never fires on
|
|
14529
|
+
* a detection, a track or a device event (the same fail-closed pairing
|
|
14530
|
+
* `occupancy` has with the `device-event` trigger). That is how audio labels
|
|
14531
|
+
* leave `classes`: an audio rule names its sounds HERE, and the legacy path
|
|
14532
|
+
* (an `immediate` rule naming an `audio-*` class, one notification per
|
|
14533
|
+
* classified sample) stays exactly as it was for rules that already use it.
|
|
14534
|
+
*
|
|
14535
|
+
* NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
|
|
14536
|
+
* rather than an oversight: the viewer mirrors the descriptor enums BY HAND
|
|
14537
|
+
* (`camstack/src/data/notification-center.ts`, guarded by
|
|
14538
|
+
* `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
|
|
14539
|
+
* condition fields it does not know when a rule is saved from the phone.
|
|
14540
|
+
* Publishing an editor for a condition the app cannot round-trip is how an
|
|
14541
|
+
* operator loses a rule's conditions by opening it — so the descriptor, the
|
|
14542
|
+
* admin widget and the viewer mirror land together (P2 + P3), and only then
|
|
14543
|
+
* does an audio rule become authorable.
|
|
14544
|
+
*/
|
|
14545
|
+
audio: NcAudioConditionSchema.optional()
|
|
14387
14546
|
});
|
|
14388
14547
|
/** One delivery target: a `notification-output` Target ref + passthrough params. */
|
|
14389
14548
|
var NcRuleTargetSchema = object({
|
|
@@ -14497,6 +14656,73 @@ var NcThrottleSchema = object({
|
|
|
14497
14656
|
*/
|
|
14498
14657
|
granularity: NcThrottleGranularitySchema.optional()
|
|
14499
14658
|
});
|
|
14659
|
+
/**
|
|
14660
|
+
* How long the confirm gate may hold ONE notification, and how big the picture
|
|
14661
|
+
* it judges may be.
|
|
14662
|
+
*
|
|
14663
|
+
* The clamp is the product decision, not a coincidence of the model: p50 was
|
|
14664
|
+
* 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
|
|
14665
|
+
* arrives after the visitor has gone is not a notification. 448 px was enough
|
|
14666
|
+
* to score 16/16 on the operator's parking scenario — bigger costs latency and
|
|
14667
|
+
* tokens for pixels the model pools away.
|
|
14668
|
+
*/
|
|
14669
|
+
var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
|
|
14670
|
+
var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
|
|
14671
|
+
var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
|
|
14672
|
+
/** Comparison the model's COUNT must satisfy for the notification to fire. */
|
|
14673
|
+
var NcConfirmExpectSchema = object({
|
|
14674
|
+
op: _enum([
|
|
14675
|
+
">=",
|
|
14676
|
+
">",
|
|
14677
|
+
"<=",
|
|
14678
|
+
"<",
|
|
14679
|
+
"=="
|
|
14680
|
+
]),
|
|
14681
|
+
count: number().int().min(0).max(1e3)
|
|
14682
|
+
});
|
|
14683
|
+
/**
|
|
14684
|
+
* AI CONFIRM — a vision model looks at the picture this notification is about
|
|
14685
|
+
* to ship and says whether it agrees with the rule.
|
|
14686
|
+
*
|
|
14687
|
+
* It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
|
|
14688
|
+
* crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
|
|
14689
|
+
* on the operator's phone is not a verdict about this notification.
|
|
14690
|
+
*
|
|
14691
|
+
* FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
|
|
14692
|
+
* whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
|
|
14693
|
+
* the default and every fail-open is COUNTED, because a gate that always fails
|
|
14694
|
+
* open looks in the log exactly like a gate that works.
|
|
14695
|
+
*
|
|
14696
|
+
* Every field is `.optional()` rather than relied on as a Zod default at the
|
|
14697
|
+
* runtime seam: a Zod default does NOT run on the addon→addon cap path (three
|
|
14698
|
+
* production failures in one day), so the gate reads absent as the constant
|
|
14699
|
+
* above rather than trusting a parse it may never have seen.
|
|
14700
|
+
*/
|
|
14701
|
+
var NcConfirmSchema = object({
|
|
14702
|
+
/** Off unless asked for. An absent `confirm` and `enabled:false` are the
|
|
14703
|
+
* same thing, and both mean "deliver exactly as before". */
|
|
14704
|
+
enabled: boolean().default(false),
|
|
14705
|
+
/** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
|
|
14706
|
+
profileId: string().optional(),
|
|
14707
|
+
/**
|
|
14708
|
+
* The operator's question, in his own words. Absent = a question derived
|
|
14709
|
+
* from the rule (its class and its expectation).
|
|
14710
|
+
*
|
|
14711
|
+
* NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
|
|
14712
|
+
* banners, signage and plates as instructions if you let them reach the
|
|
14713
|
+
* prompt — proven live — so the authoritative contract stays in the system
|
|
14714
|
+
* turn and only rule-authored words land here.
|
|
14715
|
+
*/
|
|
14716
|
+
prompt: string().max(1e3).optional(),
|
|
14717
|
+
/** Fire only when the model's count satisfies this. Absent = the model's
|
|
14718
|
+
* own boolean verdict decides. */
|
|
14719
|
+
expect: NcConfirmExpectSchema.optional(),
|
|
14720
|
+
timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
|
|
14721
|
+
/** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
|
|
14722
|
+
onTimeout: _enum(["fire", "suppress"]).default("fire"),
|
|
14723
|
+
/** Longest edge the judged image is downscaled to before it is sent. */
|
|
14724
|
+
maxImagePx: number().int().min(64).max(2048).default(448)
|
|
14725
|
+
});
|
|
14500
14726
|
/** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
|
|
14501
14727
|
var NcRuleInputSchema = object({
|
|
14502
14728
|
name: string().min(1).max(200),
|
|
@@ -14557,7 +14783,13 @@ var NcRuleInputSchema = object({
|
|
|
14557
14783
|
* `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
|
|
14558
14784
|
* shape as every other actuation.
|
|
14559
14785
|
*/
|
|
14560
|
-
actions: NcRuleActionsSchema.optional()
|
|
14786
|
+
actions: NcRuleActionsSchema.optional(),
|
|
14787
|
+
/**
|
|
14788
|
+
* AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
|
|
14789
|
+
* a rule that predates the gate must keep delivering byte-for-byte as it
|
|
14790
|
+
* did, and absent is the only way to say that without a migration.
|
|
14791
|
+
*/
|
|
14792
|
+
confirm: NcConfirmSchema.optional()
|
|
14561
14793
|
});
|
|
14562
14794
|
/**
|
|
14563
14795
|
* Partial patch for `updateRule` — any subset of the input fields, plus the
|
|
@@ -14568,7 +14800,37 @@ var NcRuleInputSchema = object({
|
|
|
14568
14800
|
* still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
|
|
14569
14801
|
* `updateRule` patch.
|
|
14570
14802
|
*/
|
|
14571
|
-
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
14803
|
+
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
14804
|
+
disabledTargetIds: array(string()).optional(),
|
|
14805
|
+
/**
|
|
14806
|
+
* `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
|
|
14807
|
+
*
|
|
14808
|
+
* It makes the key optional to SUPPLY; the parse still materialises the
|
|
14809
|
+
* default when the key is absent. And `NcRuleStore.update` merges with
|
|
14810
|
+
* `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
|
|
14811
|
+
* one — which made every partial edit destructive:
|
|
14812
|
+
*
|
|
14813
|
+
* nc.updateRule({ throttle }) → conditions reset to `{}`
|
|
14814
|
+
* nc.setRuleTargetEnabled(...) → conditions reset to `{}`
|
|
14815
|
+
* setEnabled(ruleId, false) → conditions reset to `{}`
|
|
14816
|
+
*
|
|
14817
|
+
* A rule scoped to one camera and one zone silently became a rule that
|
|
14818
|
+
* matches EVERY event on EVERY camera, and lost its `media` policy
|
|
14819
|
+
* (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
|
|
14820
|
+
* live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
|
|
14821
|
+
* within a minute of a two-field patch.
|
|
14822
|
+
*
|
|
14823
|
+
* So every defaulted field is re-declared here WITHOUT its default. The
|
|
14824
|
+
* inner defaults still apply when the caller DOES send the key — `{}` for
|
|
14825
|
+
* conditions remains a real instruction ("clear them") — and only the
|
|
14826
|
+
* absent key is now genuinely absent.
|
|
14827
|
+
*/
|
|
14828
|
+
enabled: boolean().optional(),
|
|
14829
|
+
conditions: NcConditionsSchema.optional(),
|
|
14830
|
+
media: NcMediaPolicySchema.optional(),
|
|
14831
|
+
throttle: NcThrottleSchema.optional(),
|
|
14832
|
+
priority: number().int().min(1).max(5).optional()
|
|
14833
|
+
});
|
|
14572
14834
|
/** A persisted rule. */
|
|
14573
14835
|
var NcRuleSchema = NcRuleInputSchema.extend({
|
|
14574
14836
|
id: string(),
|
|
@@ -14869,6 +15131,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
|
|
|
14869
15131
|
* Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
|
|
14870
15132
|
* copy would lie the first time a rule is disabled.
|
|
14871
15133
|
*/
|
|
15134
|
+
/**
|
|
15135
|
+
* Why a device a mode NAMES is nonetheless not armed by it.
|
|
15136
|
+
*
|
|
15137
|
+
* Each value is an existing authority, never a new flag (D62): `muted` is the
|
|
15138
|
+
* per-camera notification switch the Notification Center already owns,
|
|
15139
|
+
* `detection-off` is the device's own detection binding being inactive, and
|
|
15140
|
+
* `offline` is the device manager's liveness. A fourth reason would mean a
|
|
15141
|
+
* fourth authority, and inventing one here is how a panel starts disagreeing
|
|
15142
|
+
* with the switches the operator actually used.
|
|
15143
|
+
*/
|
|
15144
|
+
var NcAlarmSkipReasonSchema = _enum([
|
|
15145
|
+
"muted",
|
|
15146
|
+
"detection-off",
|
|
15147
|
+
"offline"
|
|
15148
|
+
]);
|
|
15149
|
+
var NcAlarmSkippedDeviceSchema = object({
|
|
15150
|
+
deviceId: number().int(),
|
|
15151
|
+
reason: NcAlarmSkipReasonSchema
|
|
15152
|
+
});
|
|
14872
15153
|
var NcAlarmModeCoverageSchema = object({
|
|
14873
15154
|
mode: AlarmArmModeSchema,
|
|
14874
15155
|
/** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
|
|
@@ -14876,7 +15157,18 @@ var NcAlarmModeCoverageSchema = object({
|
|
|
14876
15157
|
/** At least one covering rule has no device scope, so the mode covers all. */
|
|
14877
15158
|
allDevices: boolean(),
|
|
14878
15159
|
/** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
|
|
14879
|
-
deviceIds: array(number().int())
|
|
15160
|
+
deviceIds: array(number().int()),
|
|
15161
|
+
/**
|
|
15162
|
+
* Devices this mode NAMES but cannot actually arm, each with the switch that
|
|
15163
|
+
* excludes it.
|
|
15164
|
+
*
|
|
15165
|
+
* "Away armed — 12 cameras" is a promise, and a muted camera among those
|
|
15166
|
+
* twelve makes it false in exactly the way nobody notices until an incident.
|
|
15167
|
+
* Defaulted to `[]` so a coverage answer computed before this field existed
|
|
15168
|
+
* still parses as "nothing known to be skipped" rather than failing the whole
|
|
15169
|
+
* alarm tab.
|
|
15170
|
+
*/
|
|
15171
|
+
skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
|
|
14880
15172
|
});
|
|
14881
15173
|
var NcAlarmConfigSchema = object({
|
|
14882
15174
|
/**
|
|
@@ -17675,9 +17967,16 @@ var CameraStatusSchema = object({
|
|
|
17675
17967
|
audio: CameraAudioStatusSchema.nullable(),
|
|
17676
17968
|
recording: CameraRecordingStatusSchema.nullable(),
|
|
17677
17969
|
/**
|
|
17678
|
-
* Per-camera
|
|
17970
|
+
* Per-camera functions an OPERATOR has turned off
|
|
17679
17971
|
* ([D61](../../../../docs/decisions/adr-0067.md)).
|
|
17680
17972
|
*
|
|
17973
|
+
* Composed from the AUTHORITIES themselves — the wrapper bindings,
|
|
17974
|
+
* `RecordingConfig.enabled`, the notification mute, the broker's audio
|
|
17975
|
+
* policy, the camera's own microphone — via `composeSwitchedOff`, not from
|
|
17976
|
+
* the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
|
|
17977
|
+
* The badge outlives the control panel: the panel was a convenience, this is
|
|
17978
|
+
* the difference between a camera being off and a camera being dead.
|
|
17979
|
+
*
|
|
17681
17980
|
* This is the difference between DISABLED and BROKEN. A camera whose
|
|
17682
17981
|
* `detection` block reports zero fps and whose `switchedOff` contains
|
|
17683
17982
|
* `'object-detection'` was switched off by a person; the same camera with an
|
|
@@ -23186,7 +23485,19 @@ var RecordingManifestSchema = object({
|
|
|
23186
23485
|
* profiles/subtrees/locations on this node). */
|
|
23187
23486
|
var RecordingDeviceUsageSchema = object({
|
|
23188
23487
|
deviceId: number(),
|
|
23189
|
-
usedBytes: number()
|
|
23488
|
+
usedBytes: number(),
|
|
23489
|
+
/**
|
|
23490
|
+
* Start of this camera's OLDEST indexed segment, across every profile and
|
|
23491
|
+
* location — the "Oldest footage" column in Recordings → Storage, and the
|
|
23492
|
+
* only honest answer to "is retention actually holding?" per camera.
|
|
23493
|
+
*
|
|
23494
|
+
* `null` = the camera has no footage. OPTIONAL because a recorder that
|
|
23495
|
+
* predates this field omits it entirely, and a hub whose types carry the
|
|
23496
|
+
* field must keep validating that older provider's payload: the framework
|
|
23497
|
+
* (types) and the addon ship on different trains, and the addon is usually
|
|
23498
|
+
* the later of the two.
|
|
23499
|
+
*/
|
|
23500
|
+
oldestMs: number().nullable().optional()
|
|
23190
23501
|
});
|
|
23191
23502
|
/** Recording storage usage + capacity for one storage location. */
|
|
23192
23503
|
var RecordingLocationUsageSchema = object({
|
|
@@ -23214,6 +23525,57 @@ var RecordingStorageUsageSchema = object({
|
|
|
23214
23525
|
locations: array(RecordingLocationUsageSchema)
|
|
23215
23526
|
});
|
|
23216
23527
|
/**
|
|
23528
|
+
* The OPERATOR-ARMED half of multi-location recordings (D116).
|
|
23529
|
+
*
|
|
23530
|
+
* The placement plan decides where NEW writes go and moves nothing. A rebalance
|
|
23531
|
+
* is the operator asking for the EXISTING archive to be brought into line with
|
|
23532
|
+
* that plan: one relocate job per (camera, profile) pile that sits on the wrong
|
|
23533
|
+
* location, run FIFO behind the single-flight mover.
|
|
23534
|
+
*
|
|
23535
|
+
* `plan…` and `start…` return the SAME shape deliberately — what the operator
|
|
23536
|
+
* confirms is exactly what gets enqueued, and `jobIds` is the only difference
|
|
23537
|
+
* (empty on the plan).
|
|
23538
|
+
*/
|
|
23539
|
+
var RecordingRebalanceMoveSchema = object({
|
|
23540
|
+
deviceId: number(),
|
|
23541
|
+
profile: string(),
|
|
23542
|
+
fromLocationId: string(),
|
|
23543
|
+
toLocationId: string(),
|
|
23544
|
+
bytes: number(),
|
|
23545
|
+
files: number().int()
|
|
23546
|
+
});
|
|
23547
|
+
/** Why a pile that is out of place is staying there. Every refusal is
|
|
23548
|
+
* reported: a rebalance that silently drops a camera reads exactly like one
|
|
23549
|
+
* that had nothing to do. */
|
|
23550
|
+
var RecordingRebalanceSkipReasonSchema = _enum([
|
|
23551
|
+
"unassigned",
|
|
23552
|
+
"target-not-writable",
|
|
23553
|
+
"below-threshold",
|
|
23554
|
+
"no-headroom"
|
|
23555
|
+
]);
|
|
23556
|
+
var RecordingRebalanceSkipSchema = object({
|
|
23557
|
+
deviceId: number(),
|
|
23558
|
+
profile: string(),
|
|
23559
|
+
fromLocationId: string(),
|
|
23560
|
+
/** The location the plan wants; null when the camera has no assignment. */
|
|
23561
|
+
toLocationId: string().nullable(),
|
|
23562
|
+
bytes: number(),
|
|
23563
|
+
reason: RecordingRebalanceSkipReasonSchema
|
|
23564
|
+
});
|
|
23565
|
+
var RecordingRebalancePlanSchema = object({
|
|
23566
|
+
moves: array(RecordingRebalanceMoveSchema),
|
|
23567
|
+
skipped: array(RecordingRebalanceSkipSchema),
|
|
23568
|
+
bytesToMove: number(),
|
|
23569
|
+
/** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
|
|
23570
|
+
jobIds: array(string())
|
|
23571
|
+
});
|
|
23572
|
+
var RecordingRebalanceInputSchema = object({
|
|
23573
|
+
/** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
|
|
23574
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
23575
|
+
/** Ignore piles smaller than this (default 1 GB). */
|
|
23576
|
+
minMoveGb: number().min(0).optional()
|
|
23577
|
+
});
|
|
23578
|
+
/**
|
|
23217
23579
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
23218
23580
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
23219
23581
|
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
@@ -23376,9 +23738,24 @@ method(object({
|
|
|
23376
23738
|
}), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
23377
23739
|
kind: "mutation",
|
|
23378
23740
|
auth: "admin"
|
|
23741
|
+
}), method(RelocateFootageInputSchema, object({ jobId: string() }), {
|
|
23742
|
+
kind: "mutation",
|
|
23743
|
+
auth: "admin"
|
|
23744
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
23745
|
+
kind: "query",
|
|
23746
|
+
auth: "admin"
|
|
23747
|
+
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
23748
|
+
kind: "mutation",
|
|
23749
|
+
auth: "admin"
|
|
23750
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
23751
|
+
kind: "query",
|
|
23752
|
+
auth: "admin"
|
|
23753
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
23754
|
+
kind: "mutation",
|
|
23755
|
+
auth: "admin"
|
|
23379
23756
|
});
|
|
23380
23757
|
/**
|
|
23381
|
-
* `
|
|
23758
|
+
* `recording-export` cap — render a footage time range into a single downloadable
|
|
23382
23759
|
* MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
|
|
23383
23760
|
* bounded lifetime with a durable history, auto-expiry, and optional
|
|
23384
23761
|
* delete-after-download.
|
|
@@ -23393,10 +23770,42 @@ method(object({
|
|
|
23393
23770
|
*/
|
|
23394
23771
|
/** Playback-speed multiplier for the render (1 = realtime). */
|
|
23395
23772
|
var ExportSpeedSchema = number().min(.25).max(32);
|
|
23773
|
+
/**
|
|
23774
|
+
* One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
|
|
23775
|
+
*
|
|
23776
|
+
* Relative and not absolute epoch on purpose: the renderer's frame-select
|
|
23777
|
+
* expression sees ffmpeg's `t`, which starts at 0 for the export's source
|
|
23778
|
+
* playlist. Handing it absolute epochs would make every call site responsible
|
|
23779
|
+
* for the same subtraction, and the one that forgot would emit a filter that
|
|
23780
|
+
* selects nothing — silently, as a uniform timelapse.
|
|
23781
|
+
*/
|
|
23782
|
+
var ExportDenseRangeSchema = object({
|
|
23783
|
+
fromSec: number().nonnegative(),
|
|
23784
|
+
toSec: number().nonnegative()
|
|
23785
|
+
}).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
|
|
23786
|
+
/**
|
|
23787
|
+
* Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
|
|
23788
|
+
* listed ranges and at the base `everyMs` everywhere else.
|
|
23789
|
+
*
|
|
23790
|
+
* `everyMs` must be strictly smaller than the base cadence — a dense rate that
|
|
23791
|
+
* is not denser renders a uniform timelapse the operator believes is two-rate.
|
|
23792
|
+
*/
|
|
23793
|
+
var ExportDenseSchema = object({
|
|
23794
|
+
everyMs: number().int().positive(),
|
|
23795
|
+
ranges: array(ExportDenseRangeSchema).min(1).max(200)
|
|
23796
|
+
});
|
|
23396
23797
|
/** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
|
|
23397
23798
|
var ExportTimelapseSchema = object({
|
|
23398
23799
|
everyMs: number().int().positive(),
|
|
23399
|
-
outputFps: number().int().min(1).max(60).optional()
|
|
23800
|
+
outputFps: number().int().min(1).max(60).optional(),
|
|
23801
|
+
/** Optional second, FASTER rate over the intervals that matter. */
|
|
23802
|
+
dense: ExportDenseSchema.optional()
|
|
23803
|
+
}).superRefine((v, ctx) => {
|
|
23804
|
+
if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
|
|
23805
|
+
code: ZodIssueCode.custom,
|
|
23806
|
+
message: "dense.everyMs must be strictly smaller than the base everyMs",
|
|
23807
|
+
path: ["dense", "everyMs"]
|
|
23808
|
+
});
|
|
23400
23809
|
});
|
|
23401
23810
|
/**
|
|
23402
23811
|
* Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
|
|
@@ -23454,6 +23863,19 @@ var ExportDownloadSchema = object({
|
|
|
23454
23863
|
url: string(),
|
|
23455
23864
|
endpoints: array(string())
|
|
23456
23865
|
});
|
|
23866
|
+
/**
|
|
23867
|
+
* A finished export's bytes, inline.
|
|
23868
|
+
*
|
|
23869
|
+
* `bytes` is the DECODED length — the number the caller bounds and logs
|
|
23870
|
+
* against, so nobody has to infer it from the base64 length.
|
|
23871
|
+
*/
|
|
23872
|
+
var ExportBytesSchema = object({
|
|
23873
|
+
base64: string(),
|
|
23874
|
+
contentType: string(),
|
|
23875
|
+
/** Suggested filename, extension included. */
|
|
23876
|
+
name: string(),
|
|
23877
|
+
bytes: number().int().nonnegative()
|
|
23878
|
+
});
|
|
23457
23879
|
method(object({
|
|
23458
23880
|
deviceId: number(),
|
|
23459
23881
|
profile: string(),
|
|
@@ -23478,6 +23900,9 @@ method(object({
|
|
|
23478
23900
|
}), method(object({ exportId: string() }), ExportDownloadSchema, {
|
|
23479
23901
|
kind: "query",
|
|
23480
23902
|
auth: "protected"
|
|
23903
|
+
}), method(object({ exportId: string() }), ExportBytesSchema, {
|
|
23904
|
+
kind: "query",
|
|
23905
|
+
auth: "protected"
|
|
23481
23906
|
});
|
|
23482
23907
|
/**
|
|
23483
23908
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
@@ -28671,6 +29096,12 @@ Object.freeze({
|
|
|
28671
29096
|
addonId: null,
|
|
28672
29097
|
access: "create"
|
|
28673
29098
|
},
|
|
29099
|
+
"recording.cancelRelocateJob": {
|
|
29100
|
+
capName: "recording",
|
|
29101
|
+
capScope: "system",
|
|
29102
|
+
addonId: null,
|
|
29103
|
+
access: "create"
|
|
29104
|
+
},
|
|
28674
29105
|
"recording.cancelStorageMigrationMove": {
|
|
28675
29106
|
capName: "recording",
|
|
28676
29107
|
capScope: "system",
|
|
@@ -28725,6 +29156,12 @@ Object.freeze({
|
|
|
28725
29156
|
addonId: null,
|
|
28726
29157
|
access: "view"
|
|
28727
29158
|
},
|
|
29159
|
+
"recording.listRelocateJobs": {
|
|
29160
|
+
capName: "recording",
|
|
29161
|
+
capScope: "system",
|
|
29162
|
+
addonId: null,
|
|
29163
|
+
access: "view"
|
|
29164
|
+
},
|
|
28728
29165
|
"recording.locateSegment": {
|
|
28729
29166
|
capName: "recording",
|
|
28730
29167
|
capScope: "system",
|
|
@@ -28737,6 +29174,12 @@ Object.freeze({
|
|
|
28737
29174
|
addonId: null,
|
|
28738
29175
|
access: "create"
|
|
28739
29176
|
},
|
|
29177
|
+
"recording.planStorageRebalance": {
|
|
29178
|
+
capName: "recording",
|
|
29179
|
+
capScope: "system",
|
|
29180
|
+
addonId: null,
|
|
29181
|
+
access: "view"
|
|
29182
|
+
},
|
|
28740
29183
|
"recording.pruneFootage": {
|
|
28741
29184
|
capName: "recording",
|
|
28742
29185
|
capScope: "system",
|
|
@@ -28761,6 +29204,12 @@ Object.freeze({
|
|
|
28761
29204
|
addonId: null,
|
|
28762
29205
|
access: "create"
|
|
28763
29206
|
},
|
|
29207
|
+
"recording.relocateFootage": {
|
|
29208
|
+
capName: "recording",
|
|
29209
|
+
capScope: "system",
|
|
29210
|
+
addonId: null,
|
|
29211
|
+
access: "create"
|
|
29212
|
+
},
|
|
28764
29213
|
"recording.renderClip": {
|
|
28765
29214
|
capName: "recording",
|
|
28766
29215
|
capScope: "system",
|
|
@@ -28797,38 +29246,50 @@ Object.freeze({
|
|
|
28797
29246
|
addonId: null,
|
|
28798
29247
|
access: "create"
|
|
28799
29248
|
},
|
|
29249
|
+
"recording.startStorageRebalance": {
|
|
29250
|
+
capName: "recording",
|
|
29251
|
+
capScope: "system",
|
|
29252
|
+
addonId: null,
|
|
29253
|
+
access: "create"
|
|
29254
|
+
},
|
|
28800
29255
|
"recordingExport.cancelExport": {
|
|
28801
|
-
capName: "
|
|
29256
|
+
capName: "recording-export",
|
|
28802
29257
|
capScope: "system",
|
|
28803
29258
|
addonId: null,
|
|
28804
29259
|
access: "create"
|
|
28805
29260
|
},
|
|
28806
29261
|
"recordingExport.createExport": {
|
|
28807
|
-
capName: "
|
|
29262
|
+
capName: "recording-export",
|
|
28808
29263
|
capScope: "system",
|
|
28809
29264
|
addonId: null,
|
|
28810
29265
|
access: "create"
|
|
28811
29266
|
},
|
|
28812
29267
|
"recordingExport.deleteExport": {
|
|
28813
|
-
capName: "
|
|
29268
|
+
capName: "recording-export",
|
|
28814
29269
|
capScope: "system",
|
|
28815
29270
|
addonId: null,
|
|
28816
29271
|
access: "delete"
|
|
28817
29272
|
},
|
|
28818
29273
|
"recordingExport.getDownloadUrl": {
|
|
28819
|
-
capName: "
|
|
29274
|
+
capName: "recording-export",
|
|
28820
29275
|
capScope: "system",
|
|
28821
29276
|
addonId: null,
|
|
28822
29277
|
access: "view"
|
|
28823
29278
|
},
|
|
28824
29279
|
"recordingExport.getExport": {
|
|
28825
|
-
capName: "
|
|
29280
|
+
capName: "recording-export",
|
|
28826
29281
|
capScope: "system",
|
|
28827
29282
|
addonId: null,
|
|
28828
29283
|
access: "view"
|
|
28829
29284
|
},
|
|
28830
29285
|
"recordingExport.listExports": {
|
|
28831
|
-
capName: "
|
|
29286
|
+
capName: "recording-export",
|
|
29287
|
+
capScope: "system",
|
|
29288
|
+
addonId: null,
|
|
29289
|
+
access: "view"
|
|
29290
|
+
},
|
|
29291
|
+
"recordingExport.readExportBytes": {
|
|
29292
|
+
capName: "recording-export",
|
|
28832
29293
|
capScope: "system",
|
|
28833
29294
|
addonId: null,
|
|
28834
29295
|
access: "view"
|
|
@@ -30412,6 +30873,104 @@ var FramerateField = number().int().min(1).max(60);
|
|
|
30412
30873
|
var TargetsField = array(NcRuleTargetSchema).min(1);
|
|
30413
30874
|
var PriorityField = number().int().min(1).max(5);
|
|
30414
30875
|
/**
|
|
30876
|
+
* Explicit override of the DENSE sampling cadence, seconds.
|
|
30877
|
+
*
|
|
30878
|
+
* Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
|
|
30879
|
+
* 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
|
|
30880
|
+
* made that same base 3 s and rendered a person pass as two frames.)
|
|
30881
|
+
*
|
|
30882
|
+
* THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
|
|
30883
|
+
* `denseCadenceSec` and played at `framerate` occupies
|
|
30884
|
+
*
|
|
30885
|
+
* outputSeconds = (rangeSec / denseCadenceSec) / framerate
|
|
30886
|
+
*
|
|
30887
|
+
* 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.
|
|
30888
|
+
* Halving this field doubles the frames INSIDE ranges only — the base cadence,
|
|
30889
|
+
* and therefore the length of a quiet night, does not move.
|
|
30890
|
+
*
|
|
30891
|
+
* Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
|
|
30892
|
+
* the recording has them returns the same frames, requested twice. Must be
|
|
30893
|
+
* STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
|
|
30894
|
+
* a uniform video the operator believes is two-rate — and upsert refuses it
|
|
30895
|
+
* rather than letting the export cap reject the render hours after the window.
|
|
30896
|
+
*/
|
|
30897
|
+
var DenseCadenceSecField = number().min(.1).max(3600);
|
|
30898
|
+
/**
|
|
30899
|
+
* Minimum seconds of OUTPUT video each detection range must occupy.
|
|
30900
|
+
*
|
|
30901
|
+
* The operator-facing form of the arithmetic above: instead of solving for a
|
|
30902
|
+
* cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
|
|
30903
|
+
* 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
|
|
30904
|
+
* that range every ~583 ms.
|
|
30905
|
+
*
|
|
30906
|
+
* ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
|
|
30907
|
+
* ranges are terms of a single ffmpeg `select` expression that cannot vary rate
|
|
30908
|
+
* per term — so the MOST DEMANDING (shortest) range sets the rate and longer
|
|
30909
|
+
* ranges are sampled denser than they need. Per-range cadences require a cap
|
|
30910
|
+
* schema change and are the tracked follow-up.
|
|
30911
|
+
*
|
|
30912
|
+
* A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
|
|
30913
|
+
* is rendered with every frame that EXISTS and no more: the guarantee is capped
|
|
30914
|
+
* by real footage, never met by duplicating frames into motion that never
|
|
30915
|
+
* happened.
|
|
30916
|
+
*/
|
|
30917
|
+
var MinDwellSecField = number().min(0).max(60);
|
|
30918
|
+
/**
|
|
30919
|
+
* Caption burned into the notification's preview frame.
|
|
30920
|
+
*
|
|
30921
|
+
* Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
|
|
30922
|
+
* `rule`, `from`, `to`) and rendered by the SAME renderer — a second
|
|
30923
|
+
* templating dialect for one field would be a second thing to explain.
|
|
30924
|
+
*
|
|
30925
|
+
* Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
|
|
30926
|
+
* operator saying "the frame, no caption" — a distinct, reachable answer, and
|
|
30927
|
+
* the reason this is not `.min(1)`.
|
|
30928
|
+
*/
|
|
30929
|
+
var PreviewTextField = string().max(200);
|
|
30930
|
+
/**
|
|
30931
|
+
* Whether the notification's preview is a STILL or a short animation.
|
|
30932
|
+
*
|
|
30933
|
+
* The operator's ask, verbatim: *"inviato come gif o video (come per le altre
|
|
30934
|
+
* rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
|
|
30935
|
+
* night reads better as three seconds of motion than as one frame of it. Both
|
|
30936
|
+
* modes get the SAME treatment (blurred frame, large centred title); `'gif'`
|
|
30937
|
+
* simply applies it to a dozen frames sampled across the render and assembles
|
|
30938
|
+
* them.
|
|
30939
|
+
*
|
|
30940
|
+
* `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
|
|
30941
|
+
* seeks and a palette pass, and no rule that never asked for one should start
|
|
30942
|
+
* paying that on the deploy that shipped it.
|
|
30943
|
+
*
|
|
30944
|
+
* A GIF that cannot be assembled DEGRADES to the still — never to nothing.
|
|
30945
|
+
*/
|
|
30946
|
+
var PreviewModeField = _enum(["image", "gif"]);
|
|
30947
|
+
/**
|
|
30948
|
+
* Which detection classes the notification reports counts for.
|
|
30949
|
+
*
|
|
30950
|
+
* The counts come from the tracks the render ALREADY fetched for its dense-range
|
|
30951
|
+
* plan — no second query — aggregated per class. Absent or empty means "every
|
|
30952
|
+
* class the window actually contained", which is what an operator who never
|
|
30953
|
+
* opened the field wants; a list narrows it (`['person']` on a driveway that
|
|
30954
|
+
* counts cars all night).
|
|
30955
|
+
*
|
|
30956
|
+
* Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
|
|
30957
|
+
* …). An unknown name simply never matches and reports nothing — it is not an
|
|
30958
|
+
* error, because a rule may legitimately name a class this camera's model does
|
|
30959
|
+
* not emit.
|
|
30960
|
+
*
|
|
30961
|
+
* The counts are exposed to {@link TimelapseTemplateSchema} as:
|
|
30962
|
+
* - `{{detections}}` — total over the reported classes
|
|
30963
|
+
* - `{{detectionSummary}}` — `2 persone, 1 veicolo`
|
|
30964
|
+
* - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
|
|
30965
|
+
* one per class, `count_` + the class name
|
|
30966
|
+
*
|
|
30967
|
+
* With NO custom body template the summary is appended to the derived body, and
|
|
30968
|
+
* only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
|
|
30969
|
+
* reads. With a custom template the operator owns every word — nothing is
|
|
30970
|
+
* appended, so `{{detectionSummary}}` is how he asks for it.
|
|
30971
|
+
*/
|
|
30972
|
+
var ReportClassesField = array(string().min(1).max(40)).max(20);
|
|
30973
|
+
/**
|
|
30415
30974
|
* Client-supplied timelapse-rule fields. The server stamps id / createdBy /
|
|
30416
30975
|
* createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
|
|
30417
30976
|
* here (see the ownership note above).
|
|
@@ -30431,9 +30990,30 @@ var TimelapseRuleInputSchema = object({
|
|
|
30431
30990
|
cadenceSec: CadenceSecField.default(15),
|
|
30432
30991
|
/** Output frames per second of the assembled mp4 (predecessor parity). */
|
|
30433
30992
|
framerate: FramerateField.default(10),
|
|
30993
|
+
/**
|
|
30994
|
+
* Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
|
|
30995
|
+
* as `max(1s, cadenceSec / 30)`, which is what every rule written before this
|
|
30996
|
+
* field gets.
|
|
30997
|
+
*/
|
|
30998
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
30999
|
+
/** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
|
|
31000
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
30434
31001
|
/** `notification-output` targets the finished video/thumbnail is sent to. */
|
|
30435
31002
|
targets: TargetsField,
|
|
30436
31003
|
template: TimelapseTemplateSchema.optional(),
|
|
31004
|
+
/**
|
|
31005
|
+
* Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
|
|
31006
|
+
* and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
|
|
31007
|
+
*
|
|
31008
|
+
* Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
|
|
31009
|
+
* the notification's title/body, and clearing it (`template: null`) must not
|
|
31010
|
+
* silently clear the caption too.
|
|
31011
|
+
*/
|
|
31012
|
+
previewText: PreviewTextField.optional(),
|
|
31013
|
+
/** Still or animation — see {@link PreviewModeField}. */
|
|
31014
|
+
previewMode: PreviewModeField.default("image"),
|
|
31015
|
+
/** Classes the notification counts — see {@link ReportClassesField}. */
|
|
31016
|
+
reportClasses: ReportClassesField.optional(),
|
|
30437
31017
|
/** Canonical notification priority ordinal (1..5); per-target overridable. */
|
|
30438
31018
|
priority: PriorityField.default(3)
|
|
30439
31019
|
});
|
|
@@ -30444,8 +31024,13 @@ object({
|
|
|
30444
31024
|
schedule: NcScheduleSchema.optional(),
|
|
30445
31025
|
cadenceSec: CadenceSecField.optional(),
|
|
30446
31026
|
framerate: FramerateField.optional(),
|
|
31027
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
31028
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
30447
31029
|
targets: TargetsField.optional(),
|
|
30448
31030
|
template: TimelapseTemplateSchema.nullable().optional(),
|
|
31031
|
+
previewText: PreviewTextField.optional(),
|
|
31032
|
+
previewMode: PreviewModeField.optional(),
|
|
31033
|
+
reportClasses: ReportClassesField.optional(),
|
|
30449
31034
|
priority: PriorityField.optional()
|
|
30450
31035
|
});
|
|
30451
31036
|
TimelapseRuleInputSchema.extend({
|
|
@@ -30457,10 +31042,28 @@ TimelapseRuleInputSchema.extend({
|
|
|
30457
31042
|
*/
|
|
30458
31043
|
ownerUserId: string().optional(),
|
|
30459
31044
|
/**
|
|
30460
|
-
* Epoch-ms of the
|
|
30461
|
-
*
|
|
31045
|
+
* Epoch-ms of the NEWEST successful generation across every camera of this
|
|
31046
|
+
* rule. What a UI shows, and the compatibility floor for
|
|
31047
|
+
* {@link readTimelapseGeneratedAt}. Absent = never generated.
|
|
30462
31048
|
*/
|
|
30463
31049
|
lastGeneratedAt: number().optional(),
|
|
31050
|
+
/**
|
|
31051
|
+
* PER-CAMERA generation state, keyed by `String(deviceId)` — the
|
|
31052
|
+
* re-generation guard's real durable state.
|
|
31053
|
+
*
|
|
31054
|
+
* One rule covers several cameras and each renders its own video, so a rule
|
|
31055
|
+
* -wide stamp is wrong in the direction that DESTROYS work: camera A
|
|
31056
|
+
* succeeding at 06:05 tells camera B, whose render failed, that it is
|
|
31057
|
+
* already done — and B's night is gone for good, because the window will not
|
|
31058
|
+
* come back.
|
|
31059
|
+
*
|
|
31060
|
+
* ADDITIVE, so the migration is free: a row written before this field simply
|
|
31061
|
+
* has no map, and {@link readTimelapseGeneratedAt} falls back to
|
|
31062
|
+
* {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
|
|
31063
|
+
* "never generated" would re-render and re-notify every camera of every rule
|
|
31064
|
+
* once, on the deploy that shipped the map.
|
|
31065
|
+
*/
|
|
31066
|
+
generatedByDevice: record(string(), number()).optional(),
|
|
30464
31067
|
/** userId of the caller who created the rule (server-stamped). */
|
|
30465
31068
|
createdBy: string(),
|
|
30466
31069
|
createdAt: number(),
|