@camstack/addon-provider-ecowitt 0.2.12 → 0.2.13
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
|
@@ -7221,8 +7221,31 @@ var AdoptionJobSchema = object({
|
|
|
7221
7221
|
error: string().nullable()
|
|
7222
7222
|
});
|
|
7223
7223
|
/**
|
|
7224
|
-
* Per-camera FUNCTION SWITCHES
|
|
7225
|
-
*
|
|
7224
|
+
* Per-camera FUNCTION SWITCHES.
|
|
7225
|
+
*
|
|
7226
|
+
* ## The aggregate group is being withdrawn — the BADGE is not (D113)
|
|
7227
|
+
*
|
|
7228
|
+
* This file shipped as "the one coherent on/off surface over the pipeline
|
|
7229
|
+
* functions an operator thinks in terms of". The operator's verdict on
|
|
7230
|
+
* 2026-08-12 was that the coherent surface bought complexity and no clarity:
|
|
7231
|
+
* every function already had a settings page of its own, and a second place to
|
|
7232
|
+
* turn it off is a second place to look. Each switch is going back to its own
|
|
7233
|
+
* component's original options — detection to the detection-pipeline wrapper
|
|
7234
|
+
* binding, audio analysis to its own, recording to `RecordingConfig.enabled`
|
|
7235
|
+
* (which was always first-class; the switch was a veneer over
|
|
7236
|
+
* `recording.setDeviceConfig`), notifications to a notification-center
|
|
7237
|
+
* per-device setting, the two camera planes to their own components.
|
|
7238
|
+
*
|
|
7239
|
+
* What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
|
|
7240
|
+
* thing that lets a status surface say DISABLED instead of BROKEN, recomposed
|
|
7241
|
+
* straight from the authorities with no group in the middle. That rule was
|
|
7242
|
+
* never about a control panel.
|
|
7243
|
+
*
|
|
7244
|
+
* Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
|
|
7245
|
+
* {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
|
|
7246
|
+
* `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
|
|
7247
|
+
* viewers (v1.0.305) and the admin UI still call it. It is deleted when they
|
|
7248
|
+
* stop; nothing new may be built on it.
|
|
7226
7249
|
*
|
|
7227
7250
|
* ## This file adds no state
|
|
7228
7251
|
*
|
|
@@ -7573,7 +7596,15 @@ var RecordingConfigSchema = object({
|
|
|
7573
7596
|
* Each completed/failed run also lands one durable ops-log row on its owning
|
|
7574
7597
|
* addon surface.
|
|
7575
7598
|
*/
|
|
7599
|
+
/**
|
|
7600
|
+
* `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
|
|
7601
|
+
* rebalance enqueues one job per (camera, profile). Refusing the second job —
|
|
7602
|
+
* what the engine did before — turned a fifteen-camera rebalance into fifteen
|
|
7603
|
+
* manual retries. Queued jobs run FIFO; a queued job that is cancelled never
|
|
7604
|
+
* runs at all.
|
|
7605
|
+
*/
|
|
7576
7606
|
var RelocateJobStateSchema = _enum([
|
|
7607
|
+
"queued",
|
|
7577
7608
|
"running",
|
|
7578
7609
|
"done",
|
|
7579
7610
|
"failed",
|
|
@@ -7608,6 +7639,15 @@ var RelocateFootageInputSchema = object({
|
|
|
7608
7639
|
/** Limits relocation to the logical profile class. Omit only for the
|
|
7609
7640
|
* pre-orchestration compatibility path. */
|
|
7610
7641
|
footageClass: RelocateFootageClassSchema.optional(),
|
|
7642
|
+
/** Scope the move to ONE camera. Absent = every camera on the source, which
|
|
7643
|
+
* is what a whole-disk drain means. The rebalance path always sets it: its
|
|
7644
|
+
* unit is a (camera, profile) pile, not a disk. */
|
|
7645
|
+
deviceId: number().int().optional(),
|
|
7646
|
+
/** Scope the move to specific segment profiles (`high` / `mid` / `low`).
|
|
7647
|
+
* Finer than `footageClass`, which cannot separate high from mid — and the
|
|
7648
|
+
* placement plan assigns those two independently, so a rebalance that could
|
|
7649
|
+
* only say "recordings" would move footage the plan never asked to move. */
|
|
7650
|
+
profiles: array(string()).optional(),
|
|
7611
7651
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
7612
7652
|
* never allowed to starve live writers. */
|
|
7613
7653
|
throttleMbps: number().min(1).max(1e3).optional()
|
|
@@ -7743,6 +7783,21 @@ var StorageLocationSchema = object({
|
|
|
7743
7783
|
nodeId: string().optional(),
|
|
7744
7784
|
isDefault: boolean().default(false),
|
|
7745
7785
|
isSystem: boolean().default(false),
|
|
7786
|
+
/**
|
|
7787
|
+
* Operator opt-in: whether consumers that BALANCE across several locations
|
|
7788
|
+
* of a type may write here. Recordings reads it today; event media and
|
|
7789
|
+
* backups are the next consumers, which is why the flag lives on the
|
|
7790
|
+
* location rather than in any one addon's store — nothing has to be
|
|
7791
|
+
* extended to add the next consumer.
|
|
7792
|
+
*
|
|
7793
|
+
* OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
|
|
7794
|
+
* flag existed reads back with no flag and keeps working exactly as before;
|
|
7795
|
+
* that is the whole compat story, and it is why no migration ships with it.
|
|
7796
|
+
* A newly CREATED sibling is stamped `false` by the orchestrator (creating a
|
|
7797
|
+
* disk must not silently start writing to it); the default of a type is
|
|
7798
|
+
* always stamped `true`.
|
|
7799
|
+
*/
|
|
7800
|
+
enabled: boolean().optional(),
|
|
7746
7801
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
7747
7802
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
7748
7803
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -12295,7 +12350,8 @@ method(object({
|
|
|
12295
12350
|
}), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
|
|
12296
12351
|
/**
|
|
12297
12352
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
12298
|
-
* filesystem
|
|
12353
|
+
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
12354
|
+
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
12299
12355
|
* admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
|
|
12300
12356
|
* (one provider per node); the hub calls it with `{nodeId}` so the codegen
|
|
12301
12357
|
* routes to that exact node (default `nodeIdMode:'routing'`).
|
|
@@ -14136,6 +14192,13 @@ var MaskGridDimsSchema = object({
|
|
|
14136
14192
|
* `package-event` are pure trigger kinds (no urgency dimension). Extending
|
|
14137
14193
|
* this one field keeps the schema additive — a rule still declares exactly
|
|
14138
14194
|
* one trigger.
|
|
14195
|
+
*
|
|
14196
|
+
* AUDIO rules add no member here, for the reason occupancy added none: the
|
|
14197
|
+
* enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
|
|
14198
|
+
* mirror.ts` fails the build on a member the app cannot render) and every
|
|
14199
|
+
* member costs a release train. A sustained-sound rule is therefore an
|
|
14200
|
+
* `immediate` rule carrying {@link NcConditions.audio} — the condition is the
|
|
14201
|
+
* trigger discriminator, exactly as `occupancy` is on `device-event`.
|
|
14139
14202
|
*/
|
|
14140
14203
|
var NcDeliverySchema = _enum([
|
|
14141
14204
|
"immediate",
|
|
@@ -14150,15 +14213,32 @@ var NcDeliverySchema = _enum([
|
|
|
14150
14213
|
* depend on a provider's raw event name or payload shape.
|
|
14151
14214
|
*/
|
|
14152
14215
|
var NcSystemEventKindSchema = _enum([
|
|
14153
|
-
"
|
|
14154
|
-
"
|
|
14216
|
+
"device-online",
|
|
14217
|
+
"device-offline",
|
|
14218
|
+
"device-disabled",
|
|
14219
|
+
"device-enabled",
|
|
14155
14220
|
"stream-online",
|
|
14156
14221
|
"stream-offline",
|
|
14157
14222
|
"node-online",
|
|
14158
14223
|
"node-offline",
|
|
14159
14224
|
"addon-update-available",
|
|
14160
|
-
"server-update-available"
|
|
14225
|
+
"server-update-available",
|
|
14226
|
+
"alarm-triggered",
|
|
14227
|
+
"alarm-armed",
|
|
14228
|
+
"alarm-disarmed",
|
|
14229
|
+
"camera-online",
|
|
14230
|
+
"camera-offline",
|
|
14231
|
+
"camera-disabled",
|
|
14232
|
+
"camera-enabled"
|
|
14233
|
+
]);
|
|
14234
|
+
/** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
|
|
14235
|
+
var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
|
|
14236
|
+
"camera-online",
|
|
14237
|
+
"camera-offline",
|
|
14238
|
+
"camera-disabled",
|
|
14239
|
+
"camera-enabled"
|
|
14161
14240
|
]);
|
|
14241
|
+
NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
|
|
14162
14242
|
/**
|
|
14163
14243
|
* One coherent system-event condition. `kinds` is the required opt-in safety
|
|
14164
14244
|
* gate; the remaining lists are optional narrowing filters relevant to the
|
|
@@ -14167,6 +14247,18 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14167
14247
|
var NcSystemEventConditionSchema = object({
|
|
14168
14248
|
kinds: array(NcSystemEventKindSchema).min(1),
|
|
14169
14249
|
deviceIds: array(number().int()).min(1).optional(),
|
|
14250
|
+
/**
|
|
14251
|
+
* Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
|
|
14252
|
+
* `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
|
|
14253
|
+
* is what a liveness rule means when nobody said otherwise.
|
|
14254
|
+
*
|
|
14255
|
+
* This is where "only my cameras" is expressed, and it lives on the rule for
|
|
14256
|
+
* one reason: the intake cannot know which devices this household cares
|
|
14257
|
+
* about, and a producer-side filter is one no operator can change. Fails
|
|
14258
|
+
* CLOSED — a subject whose device type is unknown (an id the device mirror
|
|
14259
|
+
* does not carry) matches no `deviceTypes` list.
|
|
14260
|
+
*/
|
|
14261
|
+
deviceTypes: array(string().min(1)).min(1).optional(),
|
|
14170
14262
|
nodeIds: array(string().min(1)).min(1).optional(),
|
|
14171
14263
|
packageNames: array(string().min(1)).min(1).optional()
|
|
14172
14264
|
});
|
|
@@ -14217,6 +14309,47 @@ var NcOccupancyConditionSchema = object({
|
|
|
14217
14309
|
sustainSeconds: number().int().min(0).max(3600).default(15)
|
|
14218
14310
|
});
|
|
14219
14311
|
/**
|
|
14312
|
+
* Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
|
|
14313
|
+
*
|
|
14314
|
+
* Operator-approved vocabulary (2026-08-12, option A — the same one the
|
|
14315
|
+
* reference notifier uses, so an operator moving between them re-uses what
|
|
14316
|
+
* they already know): a rule matches when, over a sampling window of
|
|
14317
|
+
* `samplingSeconds`, at least `hitPercent`% of the audio samples in that
|
|
14318
|
+
* window are HITS. A sample is a hit when it satisfies BOTH present filters:
|
|
14319
|
+
*
|
|
14320
|
+
* - `dbThreshold` — its level is at or above this many dBFS (see
|
|
14321
|
+
* {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
|
|
14322
|
+
* - `labels` — the classifier put at least one of these labels on it.
|
|
14323
|
+
*
|
|
14324
|
+
* Both are OPTIONAL and independent, which is the point of the shape: a
|
|
14325
|
+
* loudness rule ("something loud at 3am") needs no model to be right, and a
|
|
14326
|
+
* label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
|
|
14327
|
+
* is given** — a window in which every sample is trivially a hit would fire on
|
|
14328
|
+
* silence, so the engine refuses such a condition rather than notifying on
|
|
14329
|
+
* nothing (the schema cannot express "at least one of" without becoming a
|
|
14330
|
+
* ZodEffects the cap path would have to special-case).
|
|
14331
|
+
*
|
|
14332
|
+
* `hitPercent` is over the samples the window actually HOLDS, and the window
|
|
14333
|
+
* must be FULL before it can match — a window that has been open for two
|
|
14334
|
+
* seconds of its ten is 100% of nothing, and firing on it would make
|
|
14335
|
+
* `samplingSeconds` decorative.
|
|
14336
|
+
*
|
|
14337
|
+
* Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
|
|
14338
|
+
* `audio-*` ids). Both spellings are accepted — the matcher normalizes the
|
|
14339
|
+
* `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
|
|
14340
|
+
* an operator who typed `dog` mean the same thing.
|
|
14341
|
+
*/
|
|
14342
|
+
var NcAudioConditionSchema = object({
|
|
14343
|
+
/** Audio macro labels; absent = any sound (level-only rule). */
|
|
14344
|
+
labels: array(string().min(1)).min(1).optional(),
|
|
14345
|
+
/** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
|
|
14346
|
+
dbThreshold: number().min(-96).max(0).optional(),
|
|
14347
|
+
/** Percentage of the window's samples that must be hits (1–100). */
|
|
14348
|
+
hitPercent: number().int().min(1).max(100).default(60),
|
|
14349
|
+
/** Length of the sampling window in seconds. */
|
|
14350
|
+
samplingSeconds: number().int().min(1).max(300).default(10)
|
|
14351
|
+
});
|
|
14352
|
+
/**
|
|
14220
14353
|
* Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
|
|
14221
14354
|
*
|
|
14222
14355
|
* The values are not symmetric, and deliberately so — the absent value has to
|
|
@@ -14489,7 +14622,33 @@ var NcConditionsSchema = object({
|
|
|
14489
14622
|
* threshold and holds for `sustainSeconds`. Fail-closed on missing
|
|
14490
14623
|
* substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
|
|
14491
14624
|
*/
|
|
14492
|
-
occupancy: NcOccupancyConditionSchema.optional()
|
|
14625
|
+
occupancy: NcOccupancyConditionSchema.optional(),
|
|
14626
|
+
/**
|
|
14627
|
+
* IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
|
|
14628
|
+
* `samplingSeconds` window clear the optional `dbThreshold` and carry one of
|
|
14629
|
+
* the optional `labels`. Fail-closed on missing substrate (no audio samples,
|
|
14630
|
+
* a window that is not full yet, neither filter given). See
|
|
14631
|
+
* {@link NcAudioCondition}.
|
|
14632
|
+
*
|
|
14633
|
+
* Presence of this key is what makes a rule an AUDIO rule: the engine fires
|
|
14634
|
+
* it ONLY on a confirmed audio window, and a rule carrying it never fires on
|
|
14635
|
+
* a detection, a track or a device event (the same fail-closed pairing
|
|
14636
|
+
* `occupancy` has with the `device-event` trigger). That is how audio labels
|
|
14637
|
+
* leave `classes`: an audio rule names its sounds HERE, and the legacy path
|
|
14638
|
+
* (an `immediate` rule naming an `audio-*` class, one notification per
|
|
14639
|
+
* classified sample) stays exactly as it was for rules that already use it.
|
|
14640
|
+
*
|
|
14641
|
+
* NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
|
|
14642
|
+
* rather than an oversight: the viewer mirrors the descriptor enums BY HAND
|
|
14643
|
+
* (`camstack/src/data/notification-center.ts`, guarded by
|
|
14644
|
+
* `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
|
|
14645
|
+
* condition fields it does not know when a rule is saved from the phone.
|
|
14646
|
+
* Publishing an editor for a condition the app cannot round-trip is how an
|
|
14647
|
+
* operator loses a rule's conditions by opening it — so the descriptor, the
|
|
14648
|
+
* admin widget and the viewer mirror land together (P2 + P3), and only then
|
|
14649
|
+
* does an audio rule become authorable.
|
|
14650
|
+
*/
|
|
14651
|
+
audio: NcAudioConditionSchema.optional()
|
|
14493
14652
|
});
|
|
14494
14653
|
/** One delivery target: a `notification-output` Target ref + passthrough params. */
|
|
14495
14654
|
var NcRuleTargetSchema = object({
|
|
@@ -14603,6 +14762,73 @@ var NcThrottleSchema = object({
|
|
|
14603
14762
|
*/
|
|
14604
14763
|
granularity: NcThrottleGranularitySchema.optional()
|
|
14605
14764
|
});
|
|
14765
|
+
/**
|
|
14766
|
+
* How long the confirm gate may hold ONE notification, and how big the picture
|
|
14767
|
+
* it judges may be.
|
|
14768
|
+
*
|
|
14769
|
+
* The clamp is the product decision, not a coincidence of the model: p50 was
|
|
14770
|
+
* 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
|
|
14771
|
+
* arrives after the visitor has gone is not a notification. 448 px was enough
|
|
14772
|
+
* to score 16/16 on the operator's parking scenario — bigger costs latency and
|
|
14773
|
+
* tokens for pixels the model pools away.
|
|
14774
|
+
*/
|
|
14775
|
+
var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
|
|
14776
|
+
var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
|
|
14777
|
+
var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
|
|
14778
|
+
/** Comparison the model's COUNT must satisfy for the notification to fire. */
|
|
14779
|
+
var NcConfirmExpectSchema = object({
|
|
14780
|
+
op: _enum([
|
|
14781
|
+
">=",
|
|
14782
|
+
">",
|
|
14783
|
+
"<=",
|
|
14784
|
+
"<",
|
|
14785
|
+
"=="
|
|
14786
|
+
]),
|
|
14787
|
+
count: number().int().min(0).max(1e3)
|
|
14788
|
+
});
|
|
14789
|
+
/**
|
|
14790
|
+
* AI CONFIRM — a vision model looks at the picture this notification is about
|
|
14791
|
+
* to ship and says whether it agrees with the rule.
|
|
14792
|
+
*
|
|
14793
|
+
* It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
|
|
14794
|
+
* crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
|
|
14795
|
+
* on the operator's phone is not a verdict about this notification.
|
|
14796
|
+
*
|
|
14797
|
+
* FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
|
|
14798
|
+
* whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
|
|
14799
|
+
* the default and every fail-open is COUNTED, because a gate that always fails
|
|
14800
|
+
* open looks in the log exactly like a gate that works.
|
|
14801
|
+
*
|
|
14802
|
+
* Every field is `.optional()` rather than relied on as a Zod default at the
|
|
14803
|
+
* runtime seam: a Zod default does NOT run on the addon→addon cap path (three
|
|
14804
|
+
* production failures in one day), so the gate reads absent as the constant
|
|
14805
|
+
* above rather than trusting a parse it may never have seen.
|
|
14806
|
+
*/
|
|
14807
|
+
var NcConfirmSchema = object({
|
|
14808
|
+
/** Off unless asked for. An absent `confirm` and `enabled:false` are the
|
|
14809
|
+
* same thing, and both mean "deliver exactly as before". */
|
|
14810
|
+
enabled: boolean().default(false),
|
|
14811
|
+
/** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
|
|
14812
|
+
profileId: string().optional(),
|
|
14813
|
+
/**
|
|
14814
|
+
* The operator's question, in his own words. Absent = a question derived
|
|
14815
|
+
* from the rule (its class and its expectation).
|
|
14816
|
+
*
|
|
14817
|
+
* NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
|
|
14818
|
+
* banners, signage and plates as instructions if you let them reach the
|
|
14819
|
+
* prompt — proven live — so the authoritative contract stays in the system
|
|
14820
|
+
* turn and only rule-authored words land here.
|
|
14821
|
+
*/
|
|
14822
|
+
prompt: string().max(1e3).optional(),
|
|
14823
|
+
/** Fire only when the model's count satisfies this. Absent = the model's
|
|
14824
|
+
* own boolean verdict decides. */
|
|
14825
|
+
expect: NcConfirmExpectSchema.optional(),
|
|
14826
|
+
timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
|
|
14827
|
+
/** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
|
|
14828
|
+
onTimeout: _enum(["fire", "suppress"]).default("fire"),
|
|
14829
|
+
/** Longest edge the judged image is downscaled to before it is sent. */
|
|
14830
|
+
maxImagePx: number().int().min(64).max(2048).default(448)
|
|
14831
|
+
});
|
|
14606
14832
|
/** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
|
|
14607
14833
|
var NcRuleInputSchema = object({
|
|
14608
14834
|
name: string().min(1).max(200),
|
|
@@ -14663,7 +14889,13 @@ var NcRuleInputSchema = object({
|
|
|
14663
14889
|
* `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
|
|
14664
14890
|
* shape as every other actuation.
|
|
14665
14891
|
*/
|
|
14666
|
-
actions: NcRuleActionsSchema.optional()
|
|
14892
|
+
actions: NcRuleActionsSchema.optional(),
|
|
14893
|
+
/**
|
|
14894
|
+
* AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
|
|
14895
|
+
* a rule that predates the gate must keep delivering byte-for-byte as it
|
|
14896
|
+
* did, and absent is the only way to say that without a migration.
|
|
14897
|
+
*/
|
|
14898
|
+
confirm: NcConfirmSchema.optional()
|
|
14667
14899
|
});
|
|
14668
14900
|
/**
|
|
14669
14901
|
* Partial patch for `updateRule` — any subset of the input fields, plus the
|
|
@@ -14674,7 +14906,37 @@ var NcRuleInputSchema = object({
|
|
|
14674
14906
|
* still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
|
|
14675
14907
|
* `updateRule` patch.
|
|
14676
14908
|
*/
|
|
14677
|
-
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
14909
|
+
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
14910
|
+
disabledTargetIds: array(string()).optional(),
|
|
14911
|
+
/**
|
|
14912
|
+
* `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
|
|
14913
|
+
*
|
|
14914
|
+
* It makes the key optional to SUPPLY; the parse still materialises the
|
|
14915
|
+
* default when the key is absent. And `NcRuleStore.update` merges with
|
|
14916
|
+
* `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
|
|
14917
|
+
* one — which made every partial edit destructive:
|
|
14918
|
+
*
|
|
14919
|
+
* nc.updateRule({ throttle }) → conditions reset to `{}`
|
|
14920
|
+
* nc.setRuleTargetEnabled(...) → conditions reset to `{}`
|
|
14921
|
+
* setEnabled(ruleId, false) → conditions reset to `{}`
|
|
14922
|
+
*
|
|
14923
|
+
* A rule scoped to one camera and one zone silently became a rule that
|
|
14924
|
+
* matches EVERY event on EVERY camera, and lost its `media` policy
|
|
14925
|
+
* (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
|
|
14926
|
+
* live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
|
|
14927
|
+
* within a minute of a two-field patch.
|
|
14928
|
+
*
|
|
14929
|
+
* So every defaulted field is re-declared here WITHOUT its default. The
|
|
14930
|
+
* inner defaults still apply when the caller DOES send the key — `{}` for
|
|
14931
|
+
* conditions remains a real instruction ("clear them") — and only the
|
|
14932
|
+
* absent key is now genuinely absent.
|
|
14933
|
+
*/
|
|
14934
|
+
enabled: boolean().optional(),
|
|
14935
|
+
conditions: NcConditionsSchema.optional(),
|
|
14936
|
+
media: NcMediaPolicySchema.optional(),
|
|
14937
|
+
throttle: NcThrottleSchema.optional(),
|
|
14938
|
+
priority: number().int().min(1).max(5).optional()
|
|
14939
|
+
});
|
|
14678
14940
|
/** A persisted rule. */
|
|
14679
14941
|
var NcRuleSchema = NcRuleInputSchema.extend({
|
|
14680
14942
|
id: string(),
|
|
@@ -14975,6 +15237,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
|
|
|
14975
15237
|
* Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
|
|
14976
15238
|
* copy would lie the first time a rule is disabled.
|
|
14977
15239
|
*/
|
|
15240
|
+
/**
|
|
15241
|
+
* Why a device a mode NAMES is nonetheless not armed by it.
|
|
15242
|
+
*
|
|
15243
|
+
* Each value is an existing authority, never a new flag (D62): `muted` is the
|
|
15244
|
+
* per-camera notification switch the Notification Center already owns,
|
|
15245
|
+
* `detection-off` is the device's own detection binding being inactive, and
|
|
15246
|
+
* `offline` is the device manager's liveness. A fourth reason would mean a
|
|
15247
|
+
* fourth authority, and inventing one here is how a panel starts disagreeing
|
|
15248
|
+
* with the switches the operator actually used.
|
|
15249
|
+
*/
|
|
15250
|
+
var NcAlarmSkipReasonSchema = _enum([
|
|
15251
|
+
"muted",
|
|
15252
|
+
"detection-off",
|
|
15253
|
+
"offline"
|
|
15254
|
+
]);
|
|
15255
|
+
var NcAlarmSkippedDeviceSchema = object({
|
|
15256
|
+
deviceId: number().int(),
|
|
15257
|
+
reason: NcAlarmSkipReasonSchema
|
|
15258
|
+
});
|
|
14978
15259
|
var NcAlarmModeCoverageSchema = object({
|
|
14979
15260
|
mode: AlarmArmModeSchema,
|
|
14980
15261
|
/** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
|
|
@@ -14982,7 +15263,18 @@ var NcAlarmModeCoverageSchema = object({
|
|
|
14982
15263
|
/** At least one covering rule has no device scope, so the mode covers all. */
|
|
14983
15264
|
allDevices: boolean(),
|
|
14984
15265
|
/** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
|
|
14985
|
-
deviceIds: array(number().int())
|
|
15266
|
+
deviceIds: array(number().int()),
|
|
15267
|
+
/**
|
|
15268
|
+
* Devices this mode NAMES but cannot actually arm, each with the switch that
|
|
15269
|
+
* excludes it.
|
|
15270
|
+
*
|
|
15271
|
+
* "Away armed — 12 cameras" is a promise, and a muted camera among those
|
|
15272
|
+
* twelve makes it false in exactly the way nobody notices until an incident.
|
|
15273
|
+
* Defaulted to `[]` so a coverage answer computed before this field existed
|
|
15274
|
+
* still parses as "nothing known to be skipped" rather than failing the whole
|
|
15275
|
+
* alarm tab.
|
|
15276
|
+
*/
|
|
15277
|
+
skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
|
|
14986
15278
|
});
|
|
14987
15279
|
var NcAlarmConfigSchema = object({
|
|
14988
15280
|
/**
|
|
@@ -17814,9 +18106,16 @@ var CameraStatusSchema = object({
|
|
|
17814
18106
|
audio: CameraAudioStatusSchema.nullable(),
|
|
17815
18107
|
recording: CameraRecordingStatusSchema.nullable(),
|
|
17816
18108
|
/**
|
|
17817
|
-
* Per-camera
|
|
18109
|
+
* Per-camera functions an OPERATOR has turned off
|
|
17818
18110
|
* ([D61](../../../../docs/decisions/adr-0067.md)).
|
|
17819
18111
|
*
|
|
18112
|
+
* Composed from the AUTHORITIES themselves — the wrapper bindings,
|
|
18113
|
+
* `RecordingConfig.enabled`, the notification mute, the broker's audio
|
|
18114
|
+
* policy, the camera's own microphone — via `composeSwitchedOff`, not from
|
|
18115
|
+
* the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
|
|
18116
|
+
* The badge outlives the control panel: the panel was a convenience, this is
|
|
18117
|
+
* the difference between a camera being off and a camera being dead.
|
|
18118
|
+
*
|
|
17820
18119
|
* This is the difference between DISABLED and BROKEN. A camera whose
|
|
17821
18120
|
* `detection` block reports zero fps and whose `switchedOff` contains
|
|
17822
18121
|
* `'object-detection'` was switched off by a person; the same camera with an
|
|
@@ -24558,7 +24857,19 @@ var RecordingManifestSchema = object({
|
|
|
24558
24857
|
* profiles/subtrees/locations on this node). */
|
|
24559
24858
|
var RecordingDeviceUsageSchema = object({
|
|
24560
24859
|
deviceId: number(),
|
|
24561
|
-
usedBytes: number()
|
|
24860
|
+
usedBytes: number(),
|
|
24861
|
+
/**
|
|
24862
|
+
* Start of this camera's OLDEST indexed segment, across every profile and
|
|
24863
|
+
* location — the "Oldest footage" column in Recordings → Storage, and the
|
|
24864
|
+
* only honest answer to "is retention actually holding?" per camera.
|
|
24865
|
+
*
|
|
24866
|
+
* `null` = the camera has no footage. OPTIONAL because a recorder that
|
|
24867
|
+
* predates this field omits it entirely, and a hub whose types carry the
|
|
24868
|
+
* field must keep validating that older provider's payload: the framework
|
|
24869
|
+
* (types) and the addon ship on different trains, and the addon is usually
|
|
24870
|
+
* the later of the two.
|
|
24871
|
+
*/
|
|
24872
|
+
oldestMs: number().nullable().optional()
|
|
24562
24873
|
});
|
|
24563
24874
|
/** Recording storage usage + capacity for one storage location. */
|
|
24564
24875
|
var RecordingLocationUsageSchema = object({
|
|
@@ -24586,6 +24897,57 @@ var RecordingStorageUsageSchema = object({
|
|
|
24586
24897
|
locations: array(RecordingLocationUsageSchema)
|
|
24587
24898
|
});
|
|
24588
24899
|
/**
|
|
24900
|
+
* The OPERATOR-ARMED half of multi-location recordings (D116).
|
|
24901
|
+
*
|
|
24902
|
+
* The placement plan decides where NEW writes go and moves nothing. A rebalance
|
|
24903
|
+
* is the operator asking for the EXISTING archive to be brought into line with
|
|
24904
|
+
* that plan: one relocate job per (camera, profile) pile that sits on the wrong
|
|
24905
|
+
* location, run FIFO behind the single-flight mover.
|
|
24906
|
+
*
|
|
24907
|
+
* `plan…` and `start…` return the SAME shape deliberately — what the operator
|
|
24908
|
+
* confirms is exactly what gets enqueued, and `jobIds` is the only difference
|
|
24909
|
+
* (empty on the plan).
|
|
24910
|
+
*/
|
|
24911
|
+
var RecordingRebalanceMoveSchema = object({
|
|
24912
|
+
deviceId: number(),
|
|
24913
|
+
profile: string(),
|
|
24914
|
+
fromLocationId: string(),
|
|
24915
|
+
toLocationId: string(),
|
|
24916
|
+
bytes: number(),
|
|
24917
|
+
files: number().int()
|
|
24918
|
+
});
|
|
24919
|
+
/** Why a pile that is out of place is staying there. Every refusal is
|
|
24920
|
+
* reported: a rebalance that silently drops a camera reads exactly like one
|
|
24921
|
+
* that had nothing to do. */
|
|
24922
|
+
var RecordingRebalanceSkipReasonSchema = _enum([
|
|
24923
|
+
"unassigned",
|
|
24924
|
+
"target-not-writable",
|
|
24925
|
+
"below-threshold",
|
|
24926
|
+
"no-headroom"
|
|
24927
|
+
]);
|
|
24928
|
+
var RecordingRebalanceSkipSchema = object({
|
|
24929
|
+
deviceId: number(),
|
|
24930
|
+
profile: string(),
|
|
24931
|
+
fromLocationId: string(),
|
|
24932
|
+
/** The location the plan wants; null when the camera has no assignment. */
|
|
24933
|
+
toLocationId: string().nullable(),
|
|
24934
|
+
bytes: number(),
|
|
24935
|
+
reason: RecordingRebalanceSkipReasonSchema
|
|
24936
|
+
});
|
|
24937
|
+
var RecordingRebalancePlanSchema = object({
|
|
24938
|
+
moves: array(RecordingRebalanceMoveSchema),
|
|
24939
|
+
skipped: array(RecordingRebalanceSkipSchema),
|
|
24940
|
+
bytesToMove: number(),
|
|
24941
|
+
/** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
|
|
24942
|
+
jobIds: array(string())
|
|
24943
|
+
});
|
|
24944
|
+
var RecordingRebalanceInputSchema = object({
|
|
24945
|
+
/** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
|
|
24946
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
24947
|
+
/** Ignore piles smaller than this (default 1 GB). */
|
|
24948
|
+
minMoveGb: number().min(0).optional()
|
|
24949
|
+
});
|
|
24950
|
+
/**
|
|
24589
24951
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
24590
24952
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
24591
24953
|
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
@@ -24748,9 +25110,24 @@ method(object({
|
|
|
24748
25110
|
}), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
24749
25111
|
kind: "mutation",
|
|
24750
25112
|
auth: "admin"
|
|
25113
|
+
}), method(RelocateFootageInputSchema, object({ jobId: string() }), {
|
|
25114
|
+
kind: "mutation",
|
|
25115
|
+
auth: "admin"
|
|
25116
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
25117
|
+
kind: "query",
|
|
25118
|
+
auth: "admin"
|
|
25119
|
+
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
25120
|
+
kind: "mutation",
|
|
25121
|
+
auth: "admin"
|
|
25122
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
25123
|
+
kind: "query",
|
|
25124
|
+
auth: "admin"
|
|
25125
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
25126
|
+
kind: "mutation",
|
|
25127
|
+
auth: "admin"
|
|
24751
25128
|
});
|
|
24752
25129
|
/**
|
|
24753
|
-
* `
|
|
25130
|
+
* `recording-export` cap — render a footage time range into a single downloadable
|
|
24754
25131
|
* MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
|
|
24755
25132
|
* bounded lifetime with a durable history, auto-expiry, and optional
|
|
24756
25133
|
* delete-after-download.
|
|
@@ -24765,10 +25142,42 @@ method(object({
|
|
|
24765
25142
|
*/
|
|
24766
25143
|
/** Playback-speed multiplier for the render (1 = realtime). */
|
|
24767
25144
|
var ExportSpeedSchema = number().min(.25).max(32);
|
|
25145
|
+
/**
|
|
25146
|
+
* One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
|
|
25147
|
+
*
|
|
25148
|
+
* Relative and not absolute epoch on purpose: the renderer's frame-select
|
|
25149
|
+
* expression sees ffmpeg's `t`, which starts at 0 for the export's source
|
|
25150
|
+
* playlist. Handing it absolute epochs would make every call site responsible
|
|
25151
|
+
* for the same subtraction, and the one that forgot would emit a filter that
|
|
25152
|
+
* selects nothing — silently, as a uniform timelapse.
|
|
25153
|
+
*/
|
|
25154
|
+
var ExportDenseRangeSchema = object({
|
|
25155
|
+
fromSec: number().nonnegative(),
|
|
25156
|
+
toSec: number().nonnegative()
|
|
25157
|
+
}).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
|
|
25158
|
+
/**
|
|
25159
|
+
* Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
|
|
25160
|
+
* listed ranges and at the base `everyMs` everywhere else.
|
|
25161
|
+
*
|
|
25162
|
+
* `everyMs` must be strictly smaller than the base cadence — a dense rate that
|
|
25163
|
+
* is not denser renders a uniform timelapse the operator believes is two-rate.
|
|
25164
|
+
*/
|
|
25165
|
+
var ExportDenseSchema = object({
|
|
25166
|
+
everyMs: number().int().positive(),
|
|
25167
|
+
ranges: array(ExportDenseRangeSchema).min(1).max(200)
|
|
25168
|
+
});
|
|
24768
25169
|
/** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
|
|
24769
25170
|
var ExportTimelapseSchema = object({
|
|
24770
25171
|
everyMs: number().int().positive(),
|
|
24771
|
-
outputFps: number().int().min(1).max(60).optional()
|
|
25172
|
+
outputFps: number().int().min(1).max(60).optional(),
|
|
25173
|
+
/** Optional second, FASTER rate over the intervals that matter. */
|
|
25174
|
+
dense: ExportDenseSchema.optional()
|
|
25175
|
+
}).superRefine((v, ctx) => {
|
|
25176
|
+
if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
|
|
25177
|
+
code: ZodIssueCode$1.custom,
|
|
25178
|
+
message: "dense.everyMs must be strictly smaller than the base everyMs",
|
|
25179
|
+
path: ["dense", "everyMs"]
|
|
25180
|
+
});
|
|
24772
25181
|
});
|
|
24773
25182
|
/**
|
|
24774
25183
|
* Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
|
|
@@ -24826,6 +25235,19 @@ var ExportDownloadSchema = object({
|
|
|
24826
25235
|
url: string(),
|
|
24827
25236
|
endpoints: array(string())
|
|
24828
25237
|
});
|
|
25238
|
+
/**
|
|
25239
|
+
* A finished export's bytes, inline.
|
|
25240
|
+
*
|
|
25241
|
+
* `bytes` is the DECODED length — the number the caller bounds and logs
|
|
25242
|
+
* against, so nobody has to infer it from the base64 length.
|
|
25243
|
+
*/
|
|
25244
|
+
var ExportBytesSchema = object({
|
|
25245
|
+
base64: string(),
|
|
25246
|
+
contentType: string(),
|
|
25247
|
+
/** Suggested filename, extension included. */
|
|
25248
|
+
name: string(),
|
|
25249
|
+
bytes: number().int().nonnegative()
|
|
25250
|
+
});
|
|
24829
25251
|
method(object({
|
|
24830
25252
|
deviceId: number(),
|
|
24831
25253
|
profile: string(),
|
|
@@ -24850,6 +25272,9 @@ method(object({
|
|
|
24850
25272
|
}), method(object({ exportId: string() }), ExportDownloadSchema, {
|
|
24851
25273
|
kind: "query",
|
|
24852
25274
|
auth: "protected"
|
|
25275
|
+
}), method(object({ exportId: string() }), ExportBytesSchema, {
|
|
25276
|
+
kind: "query",
|
|
25277
|
+
auth: "protected"
|
|
24853
25278
|
});
|
|
24854
25279
|
/**
|
|
24855
25280
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
@@ -31527,6 +31952,12 @@ Object.freeze({
|
|
|
31527
31952
|
addonId: null,
|
|
31528
31953
|
access: "create"
|
|
31529
31954
|
},
|
|
31955
|
+
"recording.cancelRelocateJob": {
|
|
31956
|
+
capName: "recording",
|
|
31957
|
+
capScope: "system",
|
|
31958
|
+
addonId: null,
|
|
31959
|
+
access: "create"
|
|
31960
|
+
},
|
|
31530
31961
|
"recording.cancelStorageMigrationMove": {
|
|
31531
31962
|
capName: "recording",
|
|
31532
31963
|
capScope: "system",
|
|
@@ -31581,6 +32012,12 @@ Object.freeze({
|
|
|
31581
32012
|
addonId: null,
|
|
31582
32013
|
access: "view"
|
|
31583
32014
|
},
|
|
32015
|
+
"recording.listRelocateJobs": {
|
|
32016
|
+
capName: "recording",
|
|
32017
|
+
capScope: "system",
|
|
32018
|
+
addonId: null,
|
|
32019
|
+
access: "view"
|
|
32020
|
+
},
|
|
31584
32021
|
"recording.locateSegment": {
|
|
31585
32022
|
capName: "recording",
|
|
31586
32023
|
capScope: "system",
|
|
@@ -31593,6 +32030,12 @@ Object.freeze({
|
|
|
31593
32030
|
addonId: null,
|
|
31594
32031
|
access: "create"
|
|
31595
32032
|
},
|
|
32033
|
+
"recording.planStorageRebalance": {
|
|
32034
|
+
capName: "recording",
|
|
32035
|
+
capScope: "system",
|
|
32036
|
+
addonId: null,
|
|
32037
|
+
access: "view"
|
|
32038
|
+
},
|
|
31596
32039
|
"recording.pruneFootage": {
|
|
31597
32040
|
capName: "recording",
|
|
31598
32041
|
capScope: "system",
|
|
@@ -31617,6 +32060,12 @@ Object.freeze({
|
|
|
31617
32060
|
addonId: null,
|
|
31618
32061
|
access: "create"
|
|
31619
32062
|
},
|
|
32063
|
+
"recording.relocateFootage": {
|
|
32064
|
+
capName: "recording",
|
|
32065
|
+
capScope: "system",
|
|
32066
|
+
addonId: null,
|
|
32067
|
+
access: "create"
|
|
32068
|
+
},
|
|
31620
32069
|
"recording.renderClip": {
|
|
31621
32070
|
capName: "recording",
|
|
31622
32071
|
capScope: "system",
|
|
@@ -31653,38 +32102,50 @@ Object.freeze({
|
|
|
31653
32102
|
addonId: null,
|
|
31654
32103
|
access: "create"
|
|
31655
32104
|
},
|
|
32105
|
+
"recording.startStorageRebalance": {
|
|
32106
|
+
capName: "recording",
|
|
32107
|
+
capScope: "system",
|
|
32108
|
+
addonId: null,
|
|
32109
|
+
access: "create"
|
|
32110
|
+
},
|
|
31656
32111
|
"recordingExport.cancelExport": {
|
|
31657
|
-
capName: "
|
|
32112
|
+
capName: "recording-export",
|
|
31658
32113
|
capScope: "system",
|
|
31659
32114
|
addonId: null,
|
|
31660
32115
|
access: "create"
|
|
31661
32116
|
},
|
|
31662
32117
|
"recordingExport.createExport": {
|
|
31663
|
-
capName: "
|
|
32118
|
+
capName: "recording-export",
|
|
31664
32119
|
capScope: "system",
|
|
31665
32120
|
addonId: null,
|
|
31666
32121
|
access: "create"
|
|
31667
32122
|
},
|
|
31668
32123
|
"recordingExport.deleteExport": {
|
|
31669
|
-
capName: "
|
|
32124
|
+
capName: "recording-export",
|
|
31670
32125
|
capScope: "system",
|
|
31671
32126
|
addonId: null,
|
|
31672
32127
|
access: "delete"
|
|
31673
32128
|
},
|
|
31674
32129
|
"recordingExport.getDownloadUrl": {
|
|
31675
|
-
capName: "
|
|
32130
|
+
capName: "recording-export",
|
|
31676
32131
|
capScope: "system",
|
|
31677
32132
|
addonId: null,
|
|
31678
32133
|
access: "view"
|
|
31679
32134
|
},
|
|
31680
32135
|
"recordingExport.getExport": {
|
|
31681
|
-
capName: "
|
|
32136
|
+
capName: "recording-export",
|
|
31682
32137
|
capScope: "system",
|
|
31683
32138
|
addonId: null,
|
|
31684
32139
|
access: "view"
|
|
31685
32140
|
},
|
|
31686
32141
|
"recordingExport.listExports": {
|
|
31687
|
-
capName: "
|
|
32142
|
+
capName: "recording-export",
|
|
32143
|
+
capScope: "system",
|
|
32144
|
+
addonId: null,
|
|
32145
|
+
access: "view"
|
|
32146
|
+
},
|
|
32147
|
+
"recordingExport.readExportBytes": {
|
|
32148
|
+
capName: "recording-export",
|
|
31688
32149
|
capScope: "system",
|
|
31689
32150
|
addonId: null,
|
|
31690
32151
|
access: "view"
|
|
@@ -33061,6 +33522,104 @@ var FramerateField = number().int().min(1).max(60);
|
|
|
33061
33522
|
var TargetsField = array(NcRuleTargetSchema).min(1);
|
|
33062
33523
|
var PriorityField = number().int().min(1).max(5);
|
|
33063
33524
|
/**
|
|
33525
|
+
* Explicit override of the DENSE sampling cadence, seconds.
|
|
33526
|
+
*
|
|
33527
|
+
* Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
|
|
33528
|
+
* 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
|
|
33529
|
+
* made that same base 3 s and rendered a person pass as two frames.)
|
|
33530
|
+
*
|
|
33531
|
+
* THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
|
|
33532
|
+
* `denseCadenceSec` and played at `framerate` occupies
|
|
33533
|
+
*
|
|
33534
|
+
* outputSeconds = (rangeSec / denseCadenceSec) / framerate
|
|
33535
|
+
*
|
|
33536
|
+
* 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.
|
|
33537
|
+
* Halving this field doubles the frames INSIDE ranges only — the base cadence,
|
|
33538
|
+
* and therefore the length of a quiet night, does not move.
|
|
33539
|
+
*
|
|
33540
|
+
* Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
|
|
33541
|
+
* the recording has them returns the same frames, requested twice. Must be
|
|
33542
|
+
* STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
|
|
33543
|
+
* a uniform video the operator believes is two-rate — and upsert refuses it
|
|
33544
|
+
* rather than letting the export cap reject the render hours after the window.
|
|
33545
|
+
*/
|
|
33546
|
+
var DenseCadenceSecField = number().min(.1).max(3600);
|
|
33547
|
+
/**
|
|
33548
|
+
* Minimum seconds of OUTPUT video each detection range must occupy.
|
|
33549
|
+
*
|
|
33550
|
+
* The operator-facing form of the arithmetic above: instead of solving for a
|
|
33551
|
+
* cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
|
|
33552
|
+
* 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
|
|
33553
|
+
* that range every ~583 ms.
|
|
33554
|
+
*
|
|
33555
|
+
* ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
|
|
33556
|
+
* ranges are terms of a single ffmpeg `select` expression that cannot vary rate
|
|
33557
|
+
* per term — so the MOST DEMANDING (shortest) range sets the rate and longer
|
|
33558
|
+
* ranges are sampled denser than they need. Per-range cadences require a cap
|
|
33559
|
+
* schema change and are the tracked follow-up.
|
|
33560
|
+
*
|
|
33561
|
+
* A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
|
|
33562
|
+
* is rendered with every frame that EXISTS and no more: the guarantee is capped
|
|
33563
|
+
* by real footage, never met by duplicating frames into motion that never
|
|
33564
|
+
* happened.
|
|
33565
|
+
*/
|
|
33566
|
+
var MinDwellSecField = number().min(0).max(60);
|
|
33567
|
+
/**
|
|
33568
|
+
* Caption burned into the notification's preview frame.
|
|
33569
|
+
*
|
|
33570
|
+
* Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
|
|
33571
|
+
* `rule`, `from`, `to`) and rendered by the SAME renderer — a second
|
|
33572
|
+
* templating dialect for one field would be a second thing to explain.
|
|
33573
|
+
*
|
|
33574
|
+
* Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
|
|
33575
|
+
* operator saying "the frame, no caption" — a distinct, reachable answer, and
|
|
33576
|
+
* the reason this is not `.min(1)`.
|
|
33577
|
+
*/
|
|
33578
|
+
var PreviewTextField = string().max(200);
|
|
33579
|
+
/**
|
|
33580
|
+
* Whether the notification's preview is a STILL or a short animation.
|
|
33581
|
+
*
|
|
33582
|
+
* The operator's ask, verbatim: *"inviato come gif o video (come per le altre
|
|
33583
|
+
* rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
|
|
33584
|
+
* night reads better as three seconds of motion than as one frame of it. Both
|
|
33585
|
+
* modes get the SAME treatment (blurred frame, large centred title); `'gif'`
|
|
33586
|
+
* simply applies it to a dozen frames sampled across the render and assembles
|
|
33587
|
+
* them.
|
|
33588
|
+
*
|
|
33589
|
+
* `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
|
|
33590
|
+
* seeks and a palette pass, and no rule that never asked for one should start
|
|
33591
|
+
* paying that on the deploy that shipped it.
|
|
33592
|
+
*
|
|
33593
|
+
* A GIF that cannot be assembled DEGRADES to the still — never to nothing.
|
|
33594
|
+
*/
|
|
33595
|
+
var PreviewModeField = _enum(["image", "gif"]);
|
|
33596
|
+
/**
|
|
33597
|
+
* Which detection classes the notification reports counts for.
|
|
33598
|
+
*
|
|
33599
|
+
* The counts come from the tracks the render ALREADY fetched for its dense-range
|
|
33600
|
+
* plan — no second query — aggregated per class. Absent or empty means "every
|
|
33601
|
+
* class the window actually contained", which is what an operator who never
|
|
33602
|
+
* opened the field wants; a list narrows it (`['person']` on a driveway that
|
|
33603
|
+
* counts cars all night).
|
|
33604
|
+
*
|
|
33605
|
+
* Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
|
|
33606
|
+
* …). An unknown name simply never matches and reports nothing — it is not an
|
|
33607
|
+
* error, because a rule may legitimately name a class this camera's model does
|
|
33608
|
+
* not emit.
|
|
33609
|
+
*
|
|
33610
|
+
* The counts are exposed to {@link TimelapseTemplateSchema} as:
|
|
33611
|
+
* - `{{detections}}` — total over the reported classes
|
|
33612
|
+
* - `{{detectionSummary}}` — `2 persone, 1 veicolo`
|
|
33613
|
+
* - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
|
|
33614
|
+
* one per class, `count_` + the class name
|
|
33615
|
+
*
|
|
33616
|
+
* With NO custom body template the summary is appended to the derived body, and
|
|
33617
|
+
* only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
|
|
33618
|
+
* reads. With a custom template the operator owns every word — nothing is
|
|
33619
|
+
* appended, so `{{detectionSummary}}` is how he asks for it.
|
|
33620
|
+
*/
|
|
33621
|
+
var ReportClassesField = array(string().min(1).max(40)).max(20);
|
|
33622
|
+
/**
|
|
33064
33623
|
* Client-supplied timelapse-rule fields. The server stamps id / createdBy /
|
|
33065
33624
|
* createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
|
|
33066
33625
|
* here (see the ownership note above).
|
|
@@ -33080,9 +33639,30 @@ var TimelapseRuleInputSchema = object({
|
|
|
33080
33639
|
cadenceSec: CadenceSecField.default(15),
|
|
33081
33640
|
/** Output frames per second of the assembled mp4 (predecessor parity). */
|
|
33082
33641
|
framerate: FramerateField.default(10),
|
|
33642
|
+
/**
|
|
33643
|
+
* Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
|
|
33644
|
+
* as `max(1s, cadenceSec / 30)`, which is what every rule written before this
|
|
33645
|
+
* field gets.
|
|
33646
|
+
*/
|
|
33647
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
33648
|
+
/** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
|
|
33649
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
33083
33650
|
/** `notification-output` targets the finished video/thumbnail is sent to. */
|
|
33084
33651
|
targets: TargetsField,
|
|
33085
33652
|
template: TimelapseTemplateSchema.optional(),
|
|
33653
|
+
/**
|
|
33654
|
+
* Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
|
|
33655
|
+
* and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
|
|
33656
|
+
*
|
|
33657
|
+
* Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
|
|
33658
|
+
* the notification's title/body, and clearing it (`template: null`) must not
|
|
33659
|
+
* silently clear the caption too.
|
|
33660
|
+
*/
|
|
33661
|
+
previewText: PreviewTextField.optional(),
|
|
33662
|
+
/** Still or animation — see {@link PreviewModeField}. */
|
|
33663
|
+
previewMode: PreviewModeField.default("image"),
|
|
33664
|
+
/** Classes the notification counts — see {@link ReportClassesField}. */
|
|
33665
|
+
reportClasses: ReportClassesField.optional(),
|
|
33086
33666
|
/** Canonical notification priority ordinal (1..5); per-target overridable. */
|
|
33087
33667
|
priority: PriorityField.default(3)
|
|
33088
33668
|
});
|
|
@@ -33093,8 +33673,13 @@ object({
|
|
|
33093
33673
|
schedule: NcScheduleSchema.optional(),
|
|
33094
33674
|
cadenceSec: CadenceSecField.optional(),
|
|
33095
33675
|
framerate: FramerateField.optional(),
|
|
33676
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
33677
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
33096
33678
|
targets: TargetsField.optional(),
|
|
33097
33679
|
template: TimelapseTemplateSchema.nullable().optional(),
|
|
33680
|
+
previewText: PreviewTextField.optional(),
|
|
33681
|
+
previewMode: PreviewModeField.optional(),
|
|
33682
|
+
reportClasses: ReportClassesField.optional(),
|
|
33098
33683
|
priority: PriorityField.optional()
|
|
33099
33684
|
});
|
|
33100
33685
|
TimelapseRuleInputSchema.extend({
|
|
@@ -33106,10 +33691,28 @@ TimelapseRuleInputSchema.extend({
|
|
|
33106
33691
|
*/
|
|
33107
33692
|
ownerUserId: string().optional(),
|
|
33108
33693
|
/**
|
|
33109
|
-
* Epoch-ms of the
|
|
33110
|
-
*
|
|
33694
|
+
* Epoch-ms of the NEWEST successful generation across every camera of this
|
|
33695
|
+
* rule. What a UI shows, and the compatibility floor for
|
|
33696
|
+
* {@link readTimelapseGeneratedAt}. Absent = never generated.
|
|
33111
33697
|
*/
|
|
33112
33698
|
lastGeneratedAt: number().optional(),
|
|
33699
|
+
/**
|
|
33700
|
+
* PER-CAMERA generation state, keyed by `String(deviceId)` — the
|
|
33701
|
+
* re-generation guard's real durable state.
|
|
33702
|
+
*
|
|
33703
|
+
* One rule covers several cameras and each renders its own video, so a rule
|
|
33704
|
+
* -wide stamp is wrong in the direction that DESTROYS work: camera A
|
|
33705
|
+
* succeeding at 06:05 tells camera B, whose render failed, that it is
|
|
33706
|
+
* already done — and B's night is gone for good, because the window will not
|
|
33707
|
+
* come back.
|
|
33708
|
+
*
|
|
33709
|
+
* ADDITIVE, so the migration is free: a row written before this field simply
|
|
33710
|
+
* has no map, and {@link readTimelapseGeneratedAt} falls back to
|
|
33711
|
+
* {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
|
|
33712
|
+
* "never generated" would re-render and re-notify every camera of every rule
|
|
33713
|
+
* once, on the deploy that shipped the map.
|
|
33714
|
+
*/
|
|
33715
|
+
generatedByDevice: record(string(), number()).optional(),
|
|
33113
33716
|
/** userId of the caller who created the rule (server-stamped). */
|
|
33114
33717
|
createdBy: string(),
|
|
33115
33718
|
createdAt: number(),
|