@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.mjs
CHANGED
|
@@ -7311,8 +7311,31 @@ var AdoptionJobSchema = object({
|
|
|
7311
7311
|
error: string().nullable()
|
|
7312
7312
|
});
|
|
7313
7313
|
/**
|
|
7314
|
-
* Per-camera FUNCTION SWITCHES
|
|
7315
|
-
*
|
|
7314
|
+
* Per-camera FUNCTION SWITCHES.
|
|
7315
|
+
*
|
|
7316
|
+
* ## The aggregate group is being withdrawn — the BADGE is not (D113)
|
|
7317
|
+
*
|
|
7318
|
+
* This file shipped as "the one coherent on/off surface over the pipeline
|
|
7319
|
+
* functions an operator thinks in terms of". The operator's verdict on
|
|
7320
|
+
* 2026-08-12 was that the coherent surface bought complexity and no clarity:
|
|
7321
|
+
* every function already had a settings page of its own, and a second place to
|
|
7322
|
+
* turn it off is a second place to look. Each switch is going back to its own
|
|
7323
|
+
* component's original options — detection to the detection-pipeline wrapper
|
|
7324
|
+
* binding, audio analysis to its own, recording to `RecordingConfig.enabled`
|
|
7325
|
+
* (which was always first-class; the switch was a veneer over
|
|
7326
|
+
* `recording.setDeviceConfig`), notifications to a notification-center
|
|
7327
|
+
* per-device setting, the two camera planes to their own components.
|
|
7328
|
+
*
|
|
7329
|
+
* What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
|
|
7330
|
+
* thing that lets a status surface say DISABLED instead of BROKEN, recomposed
|
|
7331
|
+
* straight from the authorities with no group in the middle. That rule was
|
|
7332
|
+
* never about a control panel.
|
|
7333
|
+
*
|
|
7334
|
+
* Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
|
|
7335
|
+
* {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
|
|
7336
|
+
* `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
|
|
7337
|
+
* viewers (v1.0.305) and the admin UI still call it. It is deleted when they
|
|
7338
|
+
* stop; nothing new may be built on it.
|
|
7316
7339
|
*
|
|
7317
7340
|
* ## This file adds no state
|
|
7318
7341
|
*
|
|
@@ -7663,7 +7686,15 @@ var RecordingConfigSchema = object({
|
|
|
7663
7686
|
* Each completed/failed run also lands one durable ops-log row on its owning
|
|
7664
7687
|
* addon surface.
|
|
7665
7688
|
*/
|
|
7689
|
+
/**
|
|
7690
|
+
* `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
|
|
7691
|
+
* rebalance enqueues one job per (camera, profile). Refusing the second job —
|
|
7692
|
+
* what the engine did before — turned a fifteen-camera rebalance into fifteen
|
|
7693
|
+
* manual retries. Queued jobs run FIFO; a queued job that is cancelled never
|
|
7694
|
+
* runs at all.
|
|
7695
|
+
*/
|
|
7666
7696
|
var RelocateJobStateSchema = _enum([
|
|
7697
|
+
"queued",
|
|
7667
7698
|
"running",
|
|
7668
7699
|
"done",
|
|
7669
7700
|
"failed",
|
|
@@ -7698,6 +7729,15 @@ var RelocateFootageInputSchema = object({
|
|
|
7698
7729
|
/** Limits relocation to the logical profile class. Omit only for the
|
|
7699
7730
|
* pre-orchestration compatibility path. */
|
|
7700
7731
|
footageClass: RelocateFootageClassSchema.optional(),
|
|
7732
|
+
/** Scope the move to ONE camera. Absent = every camera on the source, which
|
|
7733
|
+
* is what a whole-disk drain means. The rebalance path always sets it: its
|
|
7734
|
+
* unit is a (camera, profile) pile, not a disk. */
|
|
7735
|
+
deviceId: number().int().optional(),
|
|
7736
|
+
/** Scope the move to specific segment profiles (`high` / `mid` / `low`).
|
|
7737
|
+
* Finer than `footageClass`, which cannot separate high from mid — and the
|
|
7738
|
+
* placement plan assigns those two independently, so a rebalance that could
|
|
7739
|
+
* only say "recordings" would move footage the plan never asked to move. */
|
|
7740
|
+
profiles: array(string()).optional(),
|
|
7701
7741
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
7702
7742
|
* never allowed to starve live writers. */
|
|
7703
7743
|
throttleMbps: number().min(1).max(1e3).optional()
|
|
@@ -7833,6 +7873,21 @@ var StorageLocationSchema = object({
|
|
|
7833
7873
|
nodeId: string().optional(),
|
|
7834
7874
|
isDefault: boolean().default(false),
|
|
7835
7875
|
isSystem: boolean().default(false),
|
|
7876
|
+
/**
|
|
7877
|
+
* Operator opt-in: whether consumers that BALANCE across several locations
|
|
7878
|
+
* of a type may write here. Recordings reads it today; event media and
|
|
7879
|
+
* backups are the next consumers, which is why the flag lives on the
|
|
7880
|
+
* location rather than in any one addon's store — nothing has to be
|
|
7881
|
+
* extended to add the next consumer.
|
|
7882
|
+
*
|
|
7883
|
+
* OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
|
|
7884
|
+
* flag existed reads back with no flag and keeps working exactly as before;
|
|
7885
|
+
* that is the whole compat story, and it is why no migration ships with it.
|
|
7886
|
+
* A newly CREATED sibling is stamped `false` by the orchestrator (creating a
|
|
7887
|
+
* disk must not silently start writing to it); the default of a type is
|
|
7888
|
+
* always stamped `true`.
|
|
7889
|
+
*/
|
|
7890
|
+
enabled: boolean().optional(),
|
|
7836
7891
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
7837
7892
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
7838
7893
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -12176,7 +12231,8 @@ method(object({
|
|
|
12176
12231
|
}), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
|
|
12177
12232
|
/**
|
|
12178
12233
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
12179
|
-
* filesystem
|
|
12234
|
+
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
12235
|
+
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
12180
12236
|
* admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
|
|
12181
12237
|
* (one provider per node); the hub calls it with `{nodeId}` so the codegen
|
|
12182
12238
|
* routes to that exact node (default `nodeIdMode:'routing'`).
|
|
@@ -14003,6 +14059,13 @@ var MaskGridDimsSchema = object({
|
|
|
14003
14059
|
* `package-event` are pure trigger kinds (no urgency dimension). Extending
|
|
14004
14060
|
* this one field keeps the schema additive — a rule still declares exactly
|
|
14005
14061
|
* one trigger.
|
|
14062
|
+
*
|
|
14063
|
+
* AUDIO rules add no member here, for the reason occupancy added none: the
|
|
14064
|
+
* enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
|
|
14065
|
+
* mirror.ts` fails the build on a member the app cannot render) and every
|
|
14066
|
+
* member costs a release train. A sustained-sound rule is therefore an
|
|
14067
|
+
* `immediate` rule carrying {@link NcConditions.audio} — the condition is the
|
|
14068
|
+
* trigger discriminator, exactly as `occupancy` is on `device-event`.
|
|
14006
14069
|
*/
|
|
14007
14070
|
var NcDeliverySchema = _enum([
|
|
14008
14071
|
"immediate",
|
|
@@ -14017,15 +14080,32 @@ var NcDeliverySchema = _enum([
|
|
|
14017
14080
|
* depend on a provider's raw event name or payload shape.
|
|
14018
14081
|
*/
|
|
14019
14082
|
var NcSystemEventKindSchema = _enum([
|
|
14020
|
-
"
|
|
14021
|
-
"
|
|
14083
|
+
"device-online",
|
|
14084
|
+
"device-offline",
|
|
14085
|
+
"device-disabled",
|
|
14086
|
+
"device-enabled",
|
|
14022
14087
|
"stream-online",
|
|
14023
14088
|
"stream-offline",
|
|
14024
14089
|
"node-online",
|
|
14025
14090
|
"node-offline",
|
|
14026
14091
|
"addon-update-available",
|
|
14027
|
-
"server-update-available"
|
|
14092
|
+
"server-update-available",
|
|
14093
|
+
"alarm-triggered",
|
|
14094
|
+
"alarm-armed",
|
|
14095
|
+
"alarm-disarmed",
|
|
14096
|
+
"camera-online",
|
|
14097
|
+
"camera-offline",
|
|
14098
|
+
"camera-disabled",
|
|
14099
|
+
"camera-enabled"
|
|
14100
|
+
]);
|
|
14101
|
+
/** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
|
|
14102
|
+
var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
|
|
14103
|
+
"camera-online",
|
|
14104
|
+
"camera-offline",
|
|
14105
|
+
"camera-disabled",
|
|
14106
|
+
"camera-enabled"
|
|
14028
14107
|
]);
|
|
14108
|
+
NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
|
|
14029
14109
|
/**
|
|
14030
14110
|
* One coherent system-event condition. `kinds` is the required opt-in safety
|
|
14031
14111
|
* gate; the remaining lists are optional narrowing filters relevant to the
|
|
@@ -14034,6 +14114,18 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14034
14114
|
var NcSystemEventConditionSchema = object({
|
|
14035
14115
|
kinds: array(NcSystemEventKindSchema).min(1),
|
|
14036
14116
|
deviceIds: array(number().int()).min(1).optional(),
|
|
14117
|
+
/**
|
|
14118
|
+
* Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
|
|
14119
|
+
* `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
|
|
14120
|
+
* is what a liveness rule means when nobody said otherwise.
|
|
14121
|
+
*
|
|
14122
|
+
* This is where "only my cameras" is expressed, and it lives on the rule for
|
|
14123
|
+
* one reason: the intake cannot know which devices this household cares
|
|
14124
|
+
* about, and a producer-side filter is one no operator can change. Fails
|
|
14125
|
+
* CLOSED — a subject whose device type is unknown (an id the device mirror
|
|
14126
|
+
* does not carry) matches no `deviceTypes` list.
|
|
14127
|
+
*/
|
|
14128
|
+
deviceTypes: array(string().min(1)).min(1).optional(),
|
|
14037
14129
|
nodeIds: array(string().min(1)).min(1).optional(),
|
|
14038
14130
|
packageNames: array(string().min(1)).min(1).optional()
|
|
14039
14131
|
});
|
|
@@ -14084,6 +14176,47 @@ var NcOccupancyConditionSchema = object({
|
|
|
14084
14176
|
sustainSeconds: number().int().min(0).max(3600).default(15)
|
|
14085
14177
|
});
|
|
14086
14178
|
/**
|
|
14179
|
+
* Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
|
|
14180
|
+
*
|
|
14181
|
+
* Operator-approved vocabulary (2026-08-12, option A — the same one the
|
|
14182
|
+
* reference notifier uses, so an operator moving between them re-uses what
|
|
14183
|
+
* they already know): a rule matches when, over a sampling window of
|
|
14184
|
+
* `samplingSeconds`, at least `hitPercent`% of the audio samples in that
|
|
14185
|
+
* window are HITS. A sample is a hit when it satisfies BOTH present filters:
|
|
14186
|
+
*
|
|
14187
|
+
* - `dbThreshold` — its level is at or above this many dBFS (see
|
|
14188
|
+
* {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
|
|
14189
|
+
* - `labels` — the classifier put at least one of these labels on it.
|
|
14190
|
+
*
|
|
14191
|
+
* Both are OPTIONAL and independent, which is the point of the shape: a
|
|
14192
|
+
* loudness rule ("something loud at 3am") needs no model to be right, and a
|
|
14193
|
+
* label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
|
|
14194
|
+
* is given** — a window in which every sample is trivially a hit would fire on
|
|
14195
|
+
* silence, so the engine refuses such a condition rather than notifying on
|
|
14196
|
+
* nothing (the schema cannot express "at least one of" without becoming a
|
|
14197
|
+
* ZodEffects the cap path would have to special-case).
|
|
14198
|
+
*
|
|
14199
|
+
* `hitPercent` is over the samples the window actually HOLDS, and the window
|
|
14200
|
+
* must be FULL before it can match — a window that has been open for two
|
|
14201
|
+
* seconds of its ten is 100% of nothing, and firing on it would make
|
|
14202
|
+
* `samplingSeconds` decorative.
|
|
14203
|
+
*
|
|
14204
|
+
* Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
|
|
14205
|
+
* `audio-*` ids). Both spellings are accepted — the matcher normalizes the
|
|
14206
|
+
* `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
|
|
14207
|
+
* an operator who typed `dog` mean the same thing.
|
|
14208
|
+
*/
|
|
14209
|
+
var NcAudioConditionSchema = object({
|
|
14210
|
+
/** Audio macro labels; absent = any sound (level-only rule). */
|
|
14211
|
+
labels: array(string().min(1)).min(1).optional(),
|
|
14212
|
+
/** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
|
|
14213
|
+
dbThreshold: number().min(-96).max(0).optional(),
|
|
14214
|
+
/** Percentage of the window's samples that must be hits (1–100). */
|
|
14215
|
+
hitPercent: number().int().min(1).max(100).default(60),
|
|
14216
|
+
/** Length of the sampling window in seconds. */
|
|
14217
|
+
samplingSeconds: number().int().min(1).max(300).default(10)
|
|
14218
|
+
});
|
|
14219
|
+
/**
|
|
14087
14220
|
* Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
|
|
14088
14221
|
*
|
|
14089
14222
|
* The values are not symmetric, and deliberately so — the absent value has to
|
|
@@ -14356,7 +14489,33 @@ var NcConditionsSchema = object({
|
|
|
14356
14489
|
* threshold and holds for `sustainSeconds`. Fail-closed on missing
|
|
14357
14490
|
* substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
|
|
14358
14491
|
*/
|
|
14359
|
-
occupancy: NcOccupancyConditionSchema.optional()
|
|
14492
|
+
occupancy: NcOccupancyConditionSchema.optional(),
|
|
14493
|
+
/**
|
|
14494
|
+
* IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
|
|
14495
|
+
* `samplingSeconds` window clear the optional `dbThreshold` and carry one of
|
|
14496
|
+
* the optional `labels`. Fail-closed on missing substrate (no audio samples,
|
|
14497
|
+
* a window that is not full yet, neither filter given). See
|
|
14498
|
+
* {@link NcAudioCondition}.
|
|
14499
|
+
*
|
|
14500
|
+
* Presence of this key is what makes a rule an AUDIO rule: the engine fires
|
|
14501
|
+
* it ONLY on a confirmed audio window, and a rule carrying it never fires on
|
|
14502
|
+
* a detection, a track or a device event (the same fail-closed pairing
|
|
14503
|
+
* `occupancy` has with the `device-event` trigger). That is how audio labels
|
|
14504
|
+
* leave `classes`: an audio rule names its sounds HERE, and the legacy path
|
|
14505
|
+
* (an `immediate` rule naming an `audio-*` class, one notification per
|
|
14506
|
+
* classified sample) stays exactly as it was for rules that already use it.
|
|
14507
|
+
*
|
|
14508
|
+
* NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
|
|
14509
|
+
* rather than an oversight: the viewer mirrors the descriptor enums BY HAND
|
|
14510
|
+
* (`camstack/src/data/notification-center.ts`, guarded by
|
|
14511
|
+
* `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
|
|
14512
|
+
* condition fields it does not know when a rule is saved from the phone.
|
|
14513
|
+
* Publishing an editor for a condition the app cannot round-trip is how an
|
|
14514
|
+
* operator loses a rule's conditions by opening it — so the descriptor, the
|
|
14515
|
+
* admin widget and the viewer mirror land together (P2 + P3), and only then
|
|
14516
|
+
* does an audio rule become authorable.
|
|
14517
|
+
*/
|
|
14518
|
+
audio: NcAudioConditionSchema.optional()
|
|
14360
14519
|
});
|
|
14361
14520
|
/** One delivery target: a `notification-output` Target ref + passthrough params. */
|
|
14362
14521
|
var NcRuleTargetSchema = object({
|
|
@@ -14470,6 +14629,73 @@ var NcThrottleSchema = object({
|
|
|
14470
14629
|
*/
|
|
14471
14630
|
granularity: NcThrottleGranularitySchema.optional()
|
|
14472
14631
|
});
|
|
14632
|
+
/**
|
|
14633
|
+
* How long the confirm gate may hold ONE notification, and how big the picture
|
|
14634
|
+
* it judges may be.
|
|
14635
|
+
*
|
|
14636
|
+
* The clamp is the product decision, not a coincidence of the model: p50 was
|
|
14637
|
+
* 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
|
|
14638
|
+
* arrives after the visitor has gone is not a notification. 448 px was enough
|
|
14639
|
+
* to score 16/16 on the operator's parking scenario — bigger costs latency and
|
|
14640
|
+
* tokens for pixels the model pools away.
|
|
14641
|
+
*/
|
|
14642
|
+
var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
|
|
14643
|
+
var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
|
|
14644
|
+
var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
|
|
14645
|
+
/** Comparison the model's COUNT must satisfy for the notification to fire. */
|
|
14646
|
+
var NcConfirmExpectSchema = object({
|
|
14647
|
+
op: _enum([
|
|
14648
|
+
">=",
|
|
14649
|
+
">",
|
|
14650
|
+
"<=",
|
|
14651
|
+
"<",
|
|
14652
|
+
"=="
|
|
14653
|
+
]),
|
|
14654
|
+
count: number().int().min(0).max(1e3)
|
|
14655
|
+
});
|
|
14656
|
+
/**
|
|
14657
|
+
* AI CONFIRM — a vision model looks at the picture this notification is about
|
|
14658
|
+
* to ship and says whether it agrees with the rule.
|
|
14659
|
+
*
|
|
14660
|
+
* It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
|
|
14661
|
+
* crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
|
|
14662
|
+
* on the operator's phone is not a verdict about this notification.
|
|
14663
|
+
*
|
|
14664
|
+
* FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
|
|
14665
|
+
* whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
|
|
14666
|
+
* the default and every fail-open is COUNTED, because a gate that always fails
|
|
14667
|
+
* open looks in the log exactly like a gate that works.
|
|
14668
|
+
*
|
|
14669
|
+
* Every field is `.optional()` rather than relied on as a Zod default at the
|
|
14670
|
+
* runtime seam: a Zod default does NOT run on the addon→addon cap path (three
|
|
14671
|
+
* production failures in one day), so the gate reads absent as the constant
|
|
14672
|
+
* above rather than trusting a parse it may never have seen.
|
|
14673
|
+
*/
|
|
14674
|
+
var NcConfirmSchema = object({
|
|
14675
|
+
/** Off unless asked for. An absent `confirm` and `enabled:false` are the
|
|
14676
|
+
* same thing, and both mean "deliver exactly as before". */
|
|
14677
|
+
enabled: boolean().default(false),
|
|
14678
|
+
/** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
|
|
14679
|
+
profileId: string().optional(),
|
|
14680
|
+
/**
|
|
14681
|
+
* The operator's question, in his own words. Absent = a question derived
|
|
14682
|
+
* from the rule (its class and its expectation).
|
|
14683
|
+
*
|
|
14684
|
+
* NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
|
|
14685
|
+
* banners, signage and plates as instructions if you let them reach the
|
|
14686
|
+
* prompt — proven live — so the authoritative contract stays in the system
|
|
14687
|
+
* turn and only rule-authored words land here.
|
|
14688
|
+
*/
|
|
14689
|
+
prompt: string().max(1e3).optional(),
|
|
14690
|
+
/** Fire only when the model's count satisfies this. Absent = the model's
|
|
14691
|
+
* own boolean verdict decides. */
|
|
14692
|
+
expect: NcConfirmExpectSchema.optional(),
|
|
14693
|
+
timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
|
|
14694
|
+
/** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
|
|
14695
|
+
onTimeout: _enum(["fire", "suppress"]).default("fire"),
|
|
14696
|
+
/** Longest edge the judged image is downscaled to before it is sent. */
|
|
14697
|
+
maxImagePx: number().int().min(64).max(2048).default(448)
|
|
14698
|
+
});
|
|
14473
14699
|
/** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
|
|
14474
14700
|
var NcRuleInputSchema = object({
|
|
14475
14701
|
name: string().min(1).max(200),
|
|
@@ -14530,7 +14756,13 @@ var NcRuleInputSchema = object({
|
|
|
14530
14756
|
* `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
|
|
14531
14757
|
* shape as every other actuation.
|
|
14532
14758
|
*/
|
|
14533
|
-
actions: NcRuleActionsSchema.optional()
|
|
14759
|
+
actions: NcRuleActionsSchema.optional(),
|
|
14760
|
+
/**
|
|
14761
|
+
* AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
|
|
14762
|
+
* a rule that predates the gate must keep delivering byte-for-byte as it
|
|
14763
|
+
* did, and absent is the only way to say that without a migration.
|
|
14764
|
+
*/
|
|
14765
|
+
confirm: NcConfirmSchema.optional()
|
|
14534
14766
|
});
|
|
14535
14767
|
/**
|
|
14536
14768
|
* Partial patch for `updateRule` — any subset of the input fields, plus the
|
|
@@ -14541,7 +14773,37 @@ var NcRuleInputSchema = object({
|
|
|
14541
14773
|
* still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
|
|
14542
14774
|
* `updateRule` patch.
|
|
14543
14775
|
*/
|
|
14544
|
-
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
14776
|
+
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
14777
|
+
disabledTargetIds: array(string()).optional(),
|
|
14778
|
+
/**
|
|
14779
|
+
* `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
|
|
14780
|
+
*
|
|
14781
|
+
* It makes the key optional to SUPPLY; the parse still materialises the
|
|
14782
|
+
* default when the key is absent. And `NcRuleStore.update` merges with
|
|
14783
|
+
* `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
|
|
14784
|
+
* one — which made every partial edit destructive:
|
|
14785
|
+
*
|
|
14786
|
+
* nc.updateRule({ throttle }) → conditions reset to `{}`
|
|
14787
|
+
* nc.setRuleTargetEnabled(...) → conditions reset to `{}`
|
|
14788
|
+
* setEnabled(ruleId, false) → conditions reset to `{}`
|
|
14789
|
+
*
|
|
14790
|
+
* A rule scoped to one camera and one zone silently became a rule that
|
|
14791
|
+
* matches EVERY event on EVERY camera, and lost its `media` policy
|
|
14792
|
+
* (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
|
|
14793
|
+
* live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
|
|
14794
|
+
* within a minute of a two-field patch.
|
|
14795
|
+
*
|
|
14796
|
+
* So every defaulted field is re-declared here WITHOUT its default. The
|
|
14797
|
+
* inner defaults still apply when the caller DOES send the key — `{}` for
|
|
14798
|
+
* conditions remains a real instruction ("clear them") — and only the
|
|
14799
|
+
* absent key is now genuinely absent.
|
|
14800
|
+
*/
|
|
14801
|
+
enabled: boolean().optional(),
|
|
14802
|
+
conditions: NcConditionsSchema.optional(),
|
|
14803
|
+
media: NcMediaPolicySchema.optional(),
|
|
14804
|
+
throttle: NcThrottleSchema.optional(),
|
|
14805
|
+
priority: number().int().min(1).max(5).optional()
|
|
14806
|
+
});
|
|
14545
14807
|
/** A persisted rule. */
|
|
14546
14808
|
var NcRuleSchema = NcRuleInputSchema.extend({
|
|
14547
14809
|
id: string(),
|
|
@@ -14842,6 +15104,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
|
|
|
14842
15104
|
* Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
|
|
14843
15105
|
* copy would lie the first time a rule is disabled.
|
|
14844
15106
|
*/
|
|
15107
|
+
/**
|
|
15108
|
+
* Why a device a mode NAMES is nonetheless not armed by it.
|
|
15109
|
+
*
|
|
15110
|
+
* Each value is an existing authority, never a new flag (D62): `muted` is the
|
|
15111
|
+
* per-camera notification switch the Notification Center already owns,
|
|
15112
|
+
* `detection-off` is the device's own detection binding being inactive, and
|
|
15113
|
+
* `offline` is the device manager's liveness. A fourth reason would mean a
|
|
15114
|
+
* fourth authority, and inventing one here is how a panel starts disagreeing
|
|
15115
|
+
* with the switches the operator actually used.
|
|
15116
|
+
*/
|
|
15117
|
+
var NcAlarmSkipReasonSchema = _enum([
|
|
15118
|
+
"muted",
|
|
15119
|
+
"detection-off",
|
|
15120
|
+
"offline"
|
|
15121
|
+
]);
|
|
15122
|
+
var NcAlarmSkippedDeviceSchema = object({
|
|
15123
|
+
deviceId: number().int(),
|
|
15124
|
+
reason: NcAlarmSkipReasonSchema
|
|
15125
|
+
});
|
|
14845
15126
|
var NcAlarmModeCoverageSchema = object({
|
|
14846
15127
|
mode: AlarmArmModeSchema,
|
|
14847
15128
|
/** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
|
|
@@ -14849,7 +15130,18 @@ var NcAlarmModeCoverageSchema = object({
|
|
|
14849
15130
|
/** At least one covering rule has no device scope, so the mode covers all. */
|
|
14850
15131
|
allDevices: boolean(),
|
|
14851
15132
|
/** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
|
|
14852
|
-
deviceIds: array(number().int())
|
|
15133
|
+
deviceIds: array(number().int()),
|
|
15134
|
+
/**
|
|
15135
|
+
* Devices this mode NAMES but cannot actually arm, each with the switch that
|
|
15136
|
+
* excludes it.
|
|
15137
|
+
*
|
|
15138
|
+
* "Away armed — 12 cameras" is a promise, and a muted camera among those
|
|
15139
|
+
* twelve makes it false in exactly the way nobody notices until an incident.
|
|
15140
|
+
* Defaulted to `[]` so a coverage answer computed before this field existed
|
|
15141
|
+
* still parses as "nothing known to be skipped" rather than failing the whole
|
|
15142
|
+
* alarm tab.
|
|
15143
|
+
*/
|
|
15144
|
+
skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
|
|
14853
15145
|
});
|
|
14854
15146
|
var NcAlarmConfigSchema = object({
|
|
14855
15147
|
/**
|
|
@@ -17648,9 +17940,16 @@ var CameraStatusSchema = object({
|
|
|
17648
17940
|
audio: CameraAudioStatusSchema.nullable(),
|
|
17649
17941
|
recording: CameraRecordingStatusSchema.nullable(),
|
|
17650
17942
|
/**
|
|
17651
|
-
* Per-camera
|
|
17943
|
+
* Per-camera functions an OPERATOR has turned off
|
|
17652
17944
|
* ([D61](../../../../docs/decisions/adr-0067.md)).
|
|
17653
17945
|
*
|
|
17946
|
+
* Composed from the AUTHORITIES themselves — the wrapper bindings,
|
|
17947
|
+
* `RecordingConfig.enabled`, the notification mute, the broker's audio
|
|
17948
|
+
* policy, the camera's own microphone — via `composeSwitchedOff`, not from
|
|
17949
|
+
* the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
|
|
17950
|
+
* The badge outlives the control panel: the panel was a convenience, this is
|
|
17951
|
+
* the difference between a camera being off and a camera being dead.
|
|
17952
|
+
*
|
|
17654
17953
|
* This is the difference between DISABLED and BROKEN. A camera whose
|
|
17655
17954
|
* `detection` block reports zero fps and whose `switchedOff` contains
|
|
17656
17955
|
* `'object-detection'` was switched off by a person; the same camera with an
|
|
@@ -23159,7 +23458,19 @@ var RecordingManifestSchema = object({
|
|
|
23159
23458
|
* profiles/subtrees/locations on this node). */
|
|
23160
23459
|
var RecordingDeviceUsageSchema = object({
|
|
23161
23460
|
deviceId: number(),
|
|
23162
|
-
usedBytes: number()
|
|
23461
|
+
usedBytes: number(),
|
|
23462
|
+
/**
|
|
23463
|
+
* Start of this camera's OLDEST indexed segment, across every profile and
|
|
23464
|
+
* location — the "Oldest footage" column in Recordings → Storage, and the
|
|
23465
|
+
* only honest answer to "is retention actually holding?" per camera.
|
|
23466
|
+
*
|
|
23467
|
+
* `null` = the camera has no footage. OPTIONAL because a recorder that
|
|
23468
|
+
* predates this field omits it entirely, and a hub whose types carry the
|
|
23469
|
+
* field must keep validating that older provider's payload: the framework
|
|
23470
|
+
* (types) and the addon ship on different trains, and the addon is usually
|
|
23471
|
+
* the later of the two.
|
|
23472
|
+
*/
|
|
23473
|
+
oldestMs: number().nullable().optional()
|
|
23163
23474
|
});
|
|
23164
23475
|
/** Recording storage usage + capacity for one storage location. */
|
|
23165
23476
|
var RecordingLocationUsageSchema = object({
|
|
@@ -23187,6 +23498,57 @@ var RecordingStorageUsageSchema = object({
|
|
|
23187
23498
|
locations: array(RecordingLocationUsageSchema)
|
|
23188
23499
|
});
|
|
23189
23500
|
/**
|
|
23501
|
+
* The OPERATOR-ARMED half of multi-location recordings (D116).
|
|
23502
|
+
*
|
|
23503
|
+
* The placement plan decides where NEW writes go and moves nothing. A rebalance
|
|
23504
|
+
* is the operator asking for the EXISTING archive to be brought into line with
|
|
23505
|
+
* that plan: one relocate job per (camera, profile) pile that sits on the wrong
|
|
23506
|
+
* location, run FIFO behind the single-flight mover.
|
|
23507
|
+
*
|
|
23508
|
+
* `plan…` and `start…` return the SAME shape deliberately — what the operator
|
|
23509
|
+
* confirms is exactly what gets enqueued, and `jobIds` is the only difference
|
|
23510
|
+
* (empty on the plan).
|
|
23511
|
+
*/
|
|
23512
|
+
var RecordingRebalanceMoveSchema = object({
|
|
23513
|
+
deviceId: number(),
|
|
23514
|
+
profile: string(),
|
|
23515
|
+
fromLocationId: string(),
|
|
23516
|
+
toLocationId: string(),
|
|
23517
|
+
bytes: number(),
|
|
23518
|
+
files: number().int()
|
|
23519
|
+
});
|
|
23520
|
+
/** Why a pile that is out of place is staying there. Every refusal is
|
|
23521
|
+
* reported: a rebalance that silently drops a camera reads exactly like one
|
|
23522
|
+
* that had nothing to do. */
|
|
23523
|
+
var RecordingRebalanceSkipReasonSchema = _enum([
|
|
23524
|
+
"unassigned",
|
|
23525
|
+
"target-not-writable",
|
|
23526
|
+
"below-threshold",
|
|
23527
|
+
"no-headroom"
|
|
23528
|
+
]);
|
|
23529
|
+
var RecordingRebalanceSkipSchema = object({
|
|
23530
|
+
deviceId: number(),
|
|
23531
|
+
profile: string(),
|
|
23532
|
+
fromLocationId: string(),
|
|
23533
|
+
/** The location the plan wants; null when the camera has no assignment. */
|
|
23534
|
+
toLocationId: string().nullable(),
|
|
23535
|
+
bytes: number(),
|
|
23536
|
+
reason: RecordingRebalanceSkipReasonSchema
|
|
23537
|
+
});
|
|
23538
|
+
var RecordingRebalancePlanSchema = object({
|
|
23539
|
+
moves: array(RecordingRebalanceMoveSchema),
|
|
23540
|
+
skipped: array(RecordingRebalanceSkipSchema),
|
|
23541
|
+
bytesToMove: number(),
|
|
23542
|
+
/** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
|
|
23543
|
+
jobIds: array(string())
|
|
23544
|
+
});
|
|
23545
|
+
var RecordingRebalanceInputSchema = object({
|
|
23546
|
+
/** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
|
|
23547
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
23548
|
+
/** Ignore piles smaller than this (default 1 GB). */
|
|
23549
|
+
minMoveGb: number().min(0).optional()
|
|
23550
|
+
});
|
|
23551
|
+
/**
|
|
23190
23552
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
23191
23553
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
23192
23554
|
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
@@ -23349,9 +23711,24 @@ method(object({
|
|
|
23349
23711
|
}), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
23350
23712
|
kind: "mutation",
|
|
23351
23713
|
auth: "admin"
|
|
23714
|
+
}), method(RelocateFootageInputSchema, object({ jobId: string() }), {
|
|
23715
|
+
kind: "mutation",
|
|
23716
|
+
auth: "admin"
|
|
23717
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
23718
|
+
kind: "query",
|
|
23719
|
+
auth: "admin"
|
|
23720
|
+
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
23721
|
+
kind: "mutation",
|
|
23722
|
+
auth: "admin"
|
|
23723
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
23724
|
+
kind: "query",
|
|
23725
|
+
auth: "admin"
|
|
23726
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
23727
|
+
kind: "mutation",
|
|
23728
|
+
auth: "admin"
|
|
23352
23729
|
});
|
|
23353
23730
|
/**
|
|
23354
|
-
* `
|
|
23731
|
+
* `recording-export` cap — render a footage time range into a single downloadable
|
|
23355
23732
|
* MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
|
|
23356
23733
|
* bounded lifetime with a durable history, auto-expiry, and optional
|
|
23357
23734
|
* delete-after-download.
|
|
@@ -23366,10 +23743,42 @@ method(object({
|
|
|
23366
23743
|
*/
|
|
23367
23744
|
/** Playback-speed multiplier for the render (1 = realtime). */
|
|
23368
23745
|
var ExportSpeedSchema = number().min(.25).max(32);
|
|
23746
|
+
/**
|
|
23747
|
+
* One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
|
|
23748
|
+
*
|
|
23749
|
+
* Relative and not absolute epoch on purpose: the renderer's frame-select
|
|
23750
|
+
* expression sees ffmpeg's `t`, which starts at 0 for the export's source
|
|
23751
|
+
* playlist. Handing it absolute epochs would make every call site responsible
|
|
23752
|
+
* for the same subtraction, and the one that forgot would emit a filter that
|
|
23753
|
+
* selects nothing — silently, as a uniform timelapse.
|
|
23754
|
+
*/
|
|
23755
|
+
var ExportDenseRangeSchema = object({
|
|
23756
|
+
fromSec: number().nonnegative(),
|
|
23757
|
+
toSec: number().nonnegative()
|
|
23758
|
+
}).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
|
|
23759
|
+
/**
|
|
23760
|
+
* Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
|
|
23761
|
+
* listed ranges and at the base `everyMs` everywhere else.
|
|
23762
|
+
*
|
|
23763
|
+
* `everyMs` must be strictly smaller than the base cadence — a dense rate that
|
|
23764
|
+
* is not denser renders a uniform timelapse the operator believes is two-rate.
|
|
23765
|
+
*/
|
|
23766
|
+
var ExportDenseSchema = object({
|
|
23767
|
+
everyMs: number().int().positive(),
|
|
23768
|
+
ranges: array(ExportDenseRangeSchema).min(1).max(200)
|
|
23769
|
+
});
|
|
23369
23770
|
/** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
|
|
23370
23771
|
var ExportTimelapseSchema = object({
|
|
23371
23772
|
everyMs: number().int().positive(),
|
|
23372
|
-
outputFps: number().int().min(1).max(60).optional()
|
|
23773
|
+
outputFps: number().int().min(1).max(60).optional(),
|
|
23774
|
+
/** Optional second, FASTER rate over the intervals that matter. */
|
|
23775
|
+
dense: ExportDenseSchema.optional()
|
|
23776
|
+
}).superRefine((v, ctx) => {
|
|
23777
|
+
if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
|
|
23778
|
+
code: ZodIssueCode.custom,
|
|
23779
|
+
message: "dense.everyMs must be strictly smaller than the base everyMs",
|
|
23780
|
+
path: ["dense", "everyMs"]
|
|
23781
|
+
});
|
|
23373
23782
|
});
|
|
23374
23783
|
/**
|
|
23375
23784
|
* Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
|
|
@@ -23427,6 +23836,19 @@ var ExportDownloadSchema = object({
|
|
|
23427
23836
|
url: string(),
|
|
23428
23837
|
endpoints: array(string())
|
|
23429
23838
|
});
|
|
23839
|
+
/**
|
|
23840
|
+
* A finished export's bytes, inline.
|
|
23841
|
+
*
|
|
23842
|
+
* `bytes` is the DECODED length — the number the caller bounds and logs
|
|
23843
|
+
* against, so nobody has to infer it from the base64 length.
|
|
23844
|
+
*/
|
|
23845
|
+
var ExportBytesSchema = object({
|
|
23846
|
+
base64: string(),
|
|
23847
|
+
contentType: string(),
|
|
23848
|
+
/** Suggested filename, extension included. */
|
|
23849
|
+
name: string(),
|
|
23850
|
+
bytes: number().int().nonnegative()
|
|
23851
|
+
});
|
|
23430
23852
|
method(object({
|
|
23431
23853
|
deviceId: number(),
|
|
23432
23854
|
profile: string(),
|
|
@@ -23451,6 +23873,9 @@ method(object({
|
|
|
23451
23873
|
}), method(object({ exportId: string() }), ExportDownloadSchema, {
|
|
23452
23874
|
kind: "query",
|
|
23453
23875
|
auth: "protected"
|
|
23876
|
+
}), method(object({ exportId: string() }), ExportBytesSchema, {
|
|
23877
|
+
kind: "query",
|
|
23878
|
+
auth: "protected"
|
|
23454
23879
|
});
|
|
23455
23880
|
/**
|
|
23456
23881
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
@@ -28644,6 +29069,12 @@ Object.freeze({
|
|
|
28644
29069
|
addonId: null,
|
|
28645
29070
|
access: "create"
|
|
28646
29071
|
},
|
|
29072
|
+
"recording.cancelRelocateJob": {
|
|
29073
|
+
capName: "recording",
|
|
29074
|
+
capScope: "system",
|
|
29075
|
+
addonId: null,
|
|
29076
|
+
access: "create"
|
|
29077
|
+
},
|
|
28647
29078
|
"recording.cancelStorageMigrationMove": {
|
|
28648
29079
|
capName: "recording",
|
|
28649
29080
|
capScope: "system",
|
|
@@ -28698,6 +29129,12 @@ Object.freeze({
|
|
|
28698
29129
|
addonId: null,
|
|
28699
29130
|
access: "view"
|
|
28700
29131
|
},
|
|
29132
|
+
"recording.listRelocateJobs": {
|
|
29133
|
+
capName: "recording",
|
|
29134
|
+
capScope: "system",
|
|
29135
|
+
addonId: null,
|
|
29136
|
+
access: "view"
|
|
29137
|
+
},
|
|
28701
29138
|
"recording.locateSegment": {
|
|
28702
29139
|
capName: "recording",
|
|
28703
29140
|
capScope: "system",
|
|
@@ -28710,6 +29147,12 @@ Object.freeze({
|
|
|
28710
29147
|
addonId: null,
|
|
28711
29148
|
access: "create"
|
|
28712
29149
|
},
|
|
29150
|
+
"recording.planStorageRebalance": {
|
|
29151
|
+
capName: "recording",
|
|
29152
|
+
capScope: "system",
|
|
29153
|
+
addonId: null,
|
|
29154
|
+
access: "view"
|
|
29155
|
+
},
|
|
28713
29156
|
"recording.pruneFootage": {
|
|
28714
29157
|
capName: "recording",
|
|
28715
29158
|
capScope: "system",
|
|
@@ -28734,6 +29177,12 @@ Object.freeze({
|
|
|
28734
29177
|
addonId: null,
|
|
28735
29178
|
access: "create"
|
|
28736
29179
|
},
|
|
29180
|
+
"recording.relocateFootage": {
|
|
29181
|
+
capName: "recording",
|
|
29182
|
+
capScope: "system",
|
|
29183
|
+
addonId: null,
|
|
29184
|
+
access: "create"
|
|
29185
|
+
},
|
|
28737
29186
|
"recording.renderClip": {
|
|
28738
29187
|
capName: "recording",
|
|
28739
29188
|
capScope: "system",
|
|
@@ -28770,38 +29219,50 @@ Object.freeze({
|
|
|
28770
29219
|
addonId: null,
|
|
28771
29220
|
access: "create"
|
|
28772
29221
|
},
|
|
29222
|
+
"recording.startStorageRebalance": {
|
|
29223
|
+
capName: "recording",
|
|
29224
|
+
capScope: "system",
|
|
29225
|
+
addonId: null,
|
|
29226
|
+
access: "create"
|
|
29227
|
+
},
|
|
28773
29228
|
"recordingExport.cancelExport": {
|
|
28774
|
-
capName: "
|
|
29229
|
+
capName: "recording-export",
|
|
28775
29230
|
capScope: "system",
|
|
28776
29231
|
addonId: null,
|
|
28777
29232
|
access: "create"
|
|
28778
29233
|
},
|
|
28779
29234
|
"recordingExport.createExport": {
|
|
28780
|
-
capName: "
|
|
29235
|
+
capName: "recording-export",
|
|
28781
29236
|
capScope: "system",
|
|
28782
29237
|
addonId: null,
|
|
28783
29238
|
access: "create"
|
|
28784
29239
|
},
|
|
28785
29240
|
"recordingExport.deleteExport": {
|
|
28786
|
-
capName: "
|
|
29241
|
+
capName: "recording-export",
|
|
28787
29242
|
capScope: "system",
|
|
28788
29243
|
addonId: null,
|
|
28789
29244
|
access: "delete"
|
|
28790
29245
|
},
|
|
28791
29246
|
"recordingExport.getDownloadUrl": {
|
|
28792
|
-
capName: "
|
|
29247
|
+
capName: "recording-export",
|
|
28793
29248
|
capScope: "system",
|
|
28794
29249
|
addonId: null,
|
|
28795
29250
|
access: "view"
|
|
28796
29251
|
},
|
|
28797
29252
|
"recordingExport.getExport": {
|
|
28798
|
-
capName: "
|
|
29253
|
+
capName: "recording-export",
|
|
28799
29254
|
capScope: "system",
|
|
28800
29255
|
addonId: null,
|
|
28801
29256
|
access: "view"
|
|
28802
29257
|
},
|
|
28803
29258
|
"recordingExport.listExports": {
|
|
28804
|
-
capName: "
|
|
29259
|
+
capName: "recording-export",
|
|
29260
|
+
capScope: "system",
|
|
29261
|
+
addonId: null,
|
|
29262
|
+
access: "view"
|
|
29263
|
+
},
|
|
29264
|
+
"recordingExport.readExportBytes": {
|
|
29265
|
+
capName: "recording-export",
|
|
28805
29266
|
capScope: "system",
|
|
28806
29267
|
addonId: null,
|
|
28807
29268
|
access: "view"
|
|
@@ -30385,6 +30846,104 @@ var FramerateField = number().int().min(1).max(60);
|
|
|
30385
30846
|
var TargetsField = array(NcRuleTargetSchema).min(1);
|
|
30386
30847
|
var PriorityField = number().int().min(1).max(5);
|
|
30387
30848
|
/**
|
|
30849
|
+
* Explicit override of the DENSE sampling cadence, seconds.
|
|
30850
|
+
*
|
|
30851
|
+
* Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
|
|
30852
|
+
* 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
|
|
30853
|
+
* made that same base 3 s and rendered a person pass as two frames.)
|
|
30854
|
+
*
|
|
30855
|
+
* THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
|
|
30856
|
+
* `denseCadenceSec` and played at `framerate` occupies
|
|
30857
|
+
*
|
|
30858
|
+
* outputSeconds = (rangeSec / denseCadenceSec) / framerate
|
|
30859
|
+
*
|
|
30860
|
+
* 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.
|
|
30861
|
+
* Halving this field doubles the frames INSIDE ranges only — the base cadence,
|
|
30862
|
+
* and therefore the length of a quiet night, does not move.
|
|
30863
|
+
*
|
|
30864
|
+
* Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
|
|
30865
|
+
* the recording has them returns the same frames, requested twice. Must be
|
|
30866
|
+
* STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
|
|
30867
|
+
* a uniform video the operator believes is two-rate — and upsert refuses it
|
|
30868
|
+
* rather than letting the export cap reject the render hours after the window.
|
|
30869
|
+
*/
|
|
30870
|
+
var DenseCadenceSecField = number().min(.1).max(3600);
|
|
30871
|
+
/**
|
|
30872
|
+
* Minimum seconds of OUTPUT video each detection range must occupy.
|
|
30873
|
+
*
|
|
30874
|
+
* The operator-facing form of the arithmetic above: instead of solving for a
|
|
30875
|
+
* cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
|
|
30876
|
+
* 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
|
|
30877
|
+
* that range every ~583 ms.
|
|
30878
|
+
*
|
|
30879
|
+
* ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
|
|
30880
|
+
* ranges are terms of a single ffmpeg `select` expression that cannot vary rate
|
|
30881
|
+
* per term — so the MOST DEMANDING (shortest) range sets the rate and longer
|
|
30882
|
+
* ranges are sampled denser than they need. Per-range cadences require a cap
|
|
30883
|
+
* schema change and are the tracked follow-up.
|
|
30884
|
+
*
|
|
30885
|
+
* A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
|
|
30886
|
+
* is rendered with every frame that EXISTS and no more: the guarantee is capped
|
|
30887
|
+
* by real footage, never met by duplicating frames into motion that never
|
|
30888
|
+
* happened.
|
|
30889
|
+
*/
|
|
30890
|
+
var MinDwellSecField = number().min(0).max(60);
|
|
30891
|
+
/**
|
|
30892
|
+
* Caption burned into the notification's preview frame.
|
|
30893
|
+
*
|
|
30894
|
+
* Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
|
|
30895
|
+
* `rule`, `from`, `to`) and rendered by the SAME renderer — a second
|
|
30896
|
+
* templating dialect for one field would be a second thing to explain.
|
|
30897
|
+
*
|
|
30898
|
+
* Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
|
|
30899
|
+
* operator saying "the frame, no caption" — a distinct, reachable answer, and
|
|
30900
|
+
* the reason this is not `.min(1)`.
|
|
30901
|
+
*/
|
|
30902
|
+
var PreviewTextField = string().max(200);
|
|
30903
|
+
/**
|
|
30904
|
+
* Whether the notification's preview is a STILL or a short animation.
|
|
30905
|
+
*
|
|
30906
|
+
* The operator's ask, verbatim: *"inviato come gif o video (come per le altre
|
|
30907
|
+
* rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
|
|
30908
|
+
* night reads better as three seconds of motion than as one frame of it. Both
|
|
30909
|
+
* modes get the SAME treatment (blurred frame, large centred title); `'gif'`
|
|
30910
|
+
* simply applies it to a dozen frames sampled across the render and assembles
|
|
30911
|
+
* them.
|
|
30912
|
+
*
|
|
30913
|
+
* `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
|
|
30914
|
+
* seeks and a palette pass, and no rule that never asked for one should start
|
|
30915
|
+
* paying that on the deploy that shipped it.
|
|
30916
|
+
*
|
|
30917
|
+
* A GIF that cannot be assembled DEGRADES to the still — never to nothing.
|
|
30918
|
+
*/
|
|
30919
|
+
var PreviewModeField = _enum(["image", "gif"]);
|
|
30920
|
+
/**
|
|
30921
|
+
* Which detection classes the notification reports counts for.
|
|
30922
|
+
*
|
|
30923
|
+
* The counts come from the tracks the render ALREADY fetched for its dense-range
|
|
30924
|
+
* plan — no second query — aggregated per class. Absent or empty means "every
|
|
30925
|
+
* class the window actually contained", which is what an operator who never
|
|
30926
|
+
* opened the field wants; a list narrows it (`['person']` on a driveway that
|
|
30927
|
+
* counts cars all night).
|
|
30928
|
+
*
|
|
30929
|
+
* Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
|
|
30930
|
+
* …). An unknown name simply never matches and reports nothing — it is not an
|
|
30931
|
+
* error, because a rule may legitimately name a class this camera's model does
|
|
30932
|
+
* not emit.
|
|
30933
|
+
*
|
|
30934
|
+
* The counts are exposed to {@link TimelapseTemplateSchema} as:
|
|
30935
|
+
* - `{{detections}}` — total over the reported classes
|
|
30936
|
+
* - `{{detectionSummary}}` — `2 persone, 1 veicolo`
|
|
30937
|
+
* - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
|
|
30938
|
+
* one per class, `count_` + the class name
|
|
30939
|
+
*
|
|
30940
|
+
* With NO custom body template the summary is appended to the derived body, and
|
|
30941
|
+
* only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
|
|
30942
|
+
* reads. With a custom template the operator owns every word — nothing is
|
|
30943
|
+
* appended, so `{{detectionSummary}}` is how he asks for it.
|
|
30944
|
+
*/
|
|
30945
|
+
var ReportClassesField = array(string().min(1).max(40)).max(20);
|
|
30946
|
+
/**
|
|
30388
30947
|
* Client-supplied timelapse-rule fields. The server stamps id / createdBy /
|
|
30389
30948
|
* createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
|
|
30390
30949
|
* here (see the ownership note above).
|
|
@@ -30404,9 +30963,30 @@ var TimelapseRuleInputSchema = object({
|
|
|
30404
30963
|
cadenceSec: CadenceSecField.default(15),
|
|
30405
30964
|
/** Output frames per second of the assembled mp4 (predecessor parity). */
|
|
30406
30965
|
framerate: FramerateField.default(10),
|
|
30966
|
+
/**
|
|
30967
|
+
* Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
|
|
30968
|
+
* as `max(1s, cadenceSec / 30)`, which is what every rule written before this
|
|
30969
|
+
* field gets.
|
|
30970
|
+
*/
|
|
30971
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
30972
|
+
/** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
|
|
30973
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
30407
30974
|
/** `notification-output` targets the finished video/thumbnail is sent to. */
|
|
30408
30975
|
targets: TargetsField,
|
|
30409
30976
|
template: TimelapseTemplateSchema.optional(),
|
|
30977
|
+
/**
|
|
30978
|
+
* Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
|
|
30979
|
+
* and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
|
|
30980
|
+
*
|
|
30981
|
+
* Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
|
|
30982
|
+
* the notification's title/body, and clearing it (`template: null`) must not
|
|
30983
|
+
* silently clear the caption too.
|
|
30984
|
+
*/
|
|
30985
|
+
previewText: PreviewTextField.optional(),
|
|
30986
|
+
/** Still or animation — see {@link PreviewModeField}. */
|
|
30987
|
+
previewMode: PreviewModeField.default("image"),
|
|
30988
|
+
/** Classes the notification counts — see {@link ReportClassesField}. */
|
|
30989
|
+
reportClasses: ReportClassesField.optional(),
|
|
30410
30990
|
/** Canonical notification priority ordinal (1..5); per-target overridable. */
|
|
30411
30991
|
priority: PriorityField.default(3)
|
|
30412
30992
|
});
|
|
@@ -30417,8 +30997,13 @@ object({
|
|
|
30417
30997
|
schedule: NcScheduleSchema.optional(),
|
|
30418
30998
|
cadenceSec: CadenceSecField.optional(),
|
|
30419
30999
|
framerate: FramerateField.optional(),
|
|
31000
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
31001
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
30420
31002
|
targets: TargetsField.optional(),
|
|
30421
31003
|
template: TimelapseTemplateSchema.nullable().optional(),
|
|
31004
|
+
previewText: PreviewTextField.optional(),
|
|
31005
|
+
previewMode: PreviewModeField.optional(),
|
|
31006
|
+
reportClasses: ReportClassesField.optional(),
|
|
30422
31007
|
priority: PriorityField.optional()
|
|
30423
31008
|
});
|
|
30424
31009
|
TimelapseRuleInputSchema.extend({
|
|
@@ -30430,10 +31015,28 @@ TimelapseRuleInputSchema.extend({
|
|
|
30430
31015
|
*/
|
|
30431
31016
|
ownerUserId: string().optional(),
|
|
30432
31017
|
/**
|
|
30433
|
-
* Epoch-ms of the
|
|
30434
|
-
*
|
|
31018
|
+
* Epoch-ms of the NEWEST successful generation across every camera of this
|
|
31019
|
+
* rule. What a UI shows, and the compatibility floor for
|
|
31020
|
+
* {@link readTimelapseGeneratedAt}. Absent = never generated.
|
|
30435
31021
|
*/
|
|
30436
31022
|
lastGeneratedAt: number().optional(),
|
|
31023
|
+
/**
|
|
31024
|
+
* PER-CAMERA generation state, keyed by `String(deviceId)` — the
|
|
31025
|
+
* re-generation guard's real durable state.
|
|
31026
|
+
*
|
|
31027
|
+
* One rule covers several cameras and each renders its own video, so a rule
|
|
31028
|
+
* -wide stamp is wrong in the direction that DESTROYS work: camera A
|
|
31029
|
+
* succeeding at 06:05 tells camera B, whose render failed, that it is
|
|
31030
|
+
* already done — and B's night is gone for good, because the window will not
|
|
31031
|
+
* come back.
|
|
31032
|
+
*
|
|
31033
|
+
* ADDITIVE, so the migration is free: a row written before this field simply
|
|
31034
|
+
* has no map, and {@link readTimelapseGeneratedAt} falls back to
|
|
31035
|
+
* {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
|
|
31036
|
+
* "never generated" would re-render and re-notify every camera of every rule
|
|
31037
|
+
* once, on the deploy that shipped the map.
|
|
31038
|
+
*/
|
|
31039
|
+
generatedByDevice: record(string(), number()).optional(),
|
|
30437
31040
|
/** userId of the caller who created the rule (server-stamped). */
|
|
30438
31041
|
createdBy: string(),
|
|
30439
31042
|
createdAt: number(),
|