@camstack/addon-provider-dreo 0.2.13 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addon.js +625 -22
- package/dist/addon.mjs +625 -22
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -7241,8 +7241,31 @@ var AdoptionJobSchema = object({
|
|
|
7241
7241
|
error: string().nullable()
|
|
7242
7242
|
});
|
|
7243
7243
|
/**
|
|
7244
|
-
* Per-camera FUNCTION SWITCHES
|
|
7245
|
-
*
|
|
7244
|
+
* Per-camera FUNCTION SWITCHES.
|
|
7245
|
+
*
|
|
7246
|
+
* ## The aggregate group is being withdrawn — the BADGE is not (D113)
|
|
7247
|
+
*
|
|
7248
|
+
* This file shipped as "the one coherent on/off surface over the pipeline
|
|
7249
|
+
* functions an operator thinks in terms of". The operator's verdict on
|
|
7250
|
+
* 2026-08-12 was that the coherent surface bought complexity and no clarity:
|
|
7251
|
+
* every function already had a settings page of its own, and a second place to
|
|
7252
|
+
* turn it off is a second place to look. Each switch is going back to its own
|
|
7253
|
+
* component's original options — detection to the detection-pipeline wrapper
|
|
7254
|
+
* binding, audio analysis to its own, recording to `RecordingConfig.enabled`
|
|
7255
|
+
* (which was always first-class; the switch was a veneer over
|
|
7256
|
+
* `recording.setDeviceConfig`), notifications to a notification-center
|
|
7257
|
+
* per-device setting, the two camera planes to their own components.
|
|
7258
|
+
*
|
|
7259
|
+
* What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
|
|
7260
|
+
* thing that lets a status surface say DISABLED instead of BROKEN, recomposed
|
|
7261
|
+
* straight from the authorities with no group in the middle. That rule was
|
|
7262
|
+
* never about a control panel.
|
|
7263
|
+
*
|
|
7264
|
+
* Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
|
|
7265
|
+
* {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
|
|
7266
|
+
* `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
|
|
7267
|
+
* viewers (v1.0.305) and the admin UI still call it. It is deleted when they
|
|
7268
|
+
* stop; nothing new may be built on it.
|
|
7246
7269
|
*
|
|
7247
7270
|
* ## This file adds no state
|
|
7248
7271
|
*
|
|
@@ -7593,7 +7616,15 @@ var RecordingConfigSchema = object({
|
|
|
7593
7616
|
* Each completed/failed run also lands one durable ops-log row on its owning
|
|
7594
7617
|
* addon surface.
|
|
7595
7618
|
*/
|
|
7619
|
+
/**
|
|
7620
|
+
* `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
|
|
7621
|
+
* rebalance enqueues one job per (camera, profile). Refusing the second job —
|
|
7622
|
+
* what the engine did before — turned a fifteen-camera rebalance into fifteen
|
|
7623
|
+
* manual retries. Queued jobs run FIFO; a queued job that is cancelled never
|
|
7624
|
+
* runs at all.
|
|
7625
|
+
*/
|
|
7596
7626
|
var RelocateJobStateSchema = _enum([
|
|
7627
|
+
"queued",
|
|
7597
7628
|
"running",
|
|
7598
7629
|
"done",
|
|
7599
7630
|
"failed",
|
|
@@ -7628,6 +7659,15 @@ var RelocateFootageInputSchema = object({
|
|
|
7628
7659
|
/** Limits relocation to the logical profile class. Omit only for the
|
|
7629
7660
|
* pre-orchestration compatibility path. */
|
|
7630
7661
|
footageClass: RelocateFootageClassSchema.optional(),
|
|
7662
|
+
/** Scope the move to ONE camera. Absent = every camera on the source, which
|
|
7663
|
+
* is what a whole-disk drain means. The rebalance path always sets it: its
|
|
7664
|
+
* unit is a (camera, profile) pile, not a disk. */
|
|
7665
|
+
deviceId: number().int().optional(),
|
|
7666
|
+
/** Scope the move to specific segment profiles (`high` / `mid` / `low`).
|
|
7667
|
+
* Finer than `footageClass`, which cannot separate high from mid — and the
|
|
7668
|
+
* placement plan assigns those two independently, so a rebalance that could
|
|
7669
|
+
* only say "recordings" would move footage the plan never asked to move. */
|
|
7670
|
+
profiles: array(string()).optional(),
|
|
7631
7671
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
7632
7672
|
* never allowed to starve live writers. */
|
|
7633
7673
|
throttleMbps: number().min(1).max(1e3).optional()
|
|
@@ -7763,6 +7803,21 @@ var StorageLocationSchema = object({
|
|
|
7763
7803
|
nodeId: string().optional(),
|
|
7764
7804
|
isDefault: boolean().default(false),
|
|
7765
7805
|
isSystem: boolean().default(false),
|
|
7806
|
+
/**
|
|
7807
|
+
* Operator opt-in: whether consumers that BALANCE across several locations
|
|
7808
|
+
* of a type may write here. Recordings reads it today; event media and
|
|
7809
|
+
* backups are the next consumers, which is why the flag lives on the
|
|
7810
|
+
* location rather than in any one addon's store — nothing has to be
|
|
7811
|
+
* extended to add the next consumer.
|
|
7812
|
+
*
|
|
7813
|
+
* OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
|
|
7814
|
+
* flag existed reads back with no flag and keeps working exactly as before;
|
|
7815
|
+
* that is the whole compat story, and it is why no migration ships with it.
|
|
7816
|
+
* A newly CREATED sibling is stamped `false` by the orchestrator (creating a
|
|
7817
|
+
* disk must not silently start writing to it); the default of a type is
|
|
7818
|
+
* always stamped `true`.
|
|
7819
|
+
*/
|
|
7820
|
+
enabled: boolean().optional(),
|
|
7766
7821
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
7767
7822
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
7768
7823
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -12332,7 +12387,8 @@ method(object({
|
|
|
12332
12387
|
}), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
|
|
12333
12388
|
/**
|
|
12334
12389
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
12335
|
-
* filesystem
|
|
12390
|
+
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
12391
|
+
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
12336
12392
|
* admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
|
|
12337
12393
|
* (one provider per node); the hub calls it with `{nodeId}` so the codegen
|
|
12338
12394
|
* routes to that exact node (default `nodeIdMode:'routing'`).
|
|
@@ -14173,6 +14229,13 @@ var MaskGridDimsSchema = object({
|
|
|
14173
14229
|
* `package-event` are pure trigger kinds (no urgency dimension). Extending
|
|
14174
14230
|
* this one field keeps the schema additive — a rule still declares exactly
|
|
14175
14231
|
* one trigger.
|
|
14232
|
+
*
|
|
14233
|
+
* AUDIO rules add no member here, for the reason occupancy added none: the
|
|
14234
|
+
* enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
|
|
14235
|
+
* mirror.ts` fails the build on a member the app cannot render) and every
|
|
14236
|
+
* member costs a release train. A sustained-sound rule is therefore an
|
|
14237
|
+
* `immediate` rule carrying {@link NcConditions.audio} — the condition is the
|
|
14238
|
+
* trigger discriminator, exactly as `occupancy` is on `device-event`.
|
|
14176
14239
|
*/
|
|
14177
14240
|
var NcDeliverySchema = _enum([
|
|
14178
14241
|
"immediate",
|
|
@@ -14187,15 +14250,32 @@ var NcDeliverySchema = _enum([
|
|
|
14187
14250
|
* depend on a provider's raw event name or payload shape.
|
|
14188
14251
|
*/
|
|
14189
14252
|
var NcSystemEventKindSchema = _enum([
|
|
14190
|
-
"
|
|
14191
|
-
"
|
|
14253
|
+
"device-online",
|
|
14254
|
+
"device-offline",
|
|
14255
|
+
"device-disabled",
|
|
14256
|
+
"device-enabled",
|
|
14192
14257
|
"stream-online",
|
|
14193
14258
|
"stream-offline",
|
|
14194
14259
|
"node-online",
|
|
14195
14260
|
"node-offline",
|
|
14196
14261
|
"addon-update-available",
|
|
14197
|
-
"server-update-available"
|
|
14262
|
+
"server-update-available",
|
|
14263
|
+
"alarm-triggered",
|
|
14264
|
+
"alarm-armed",
|
|
14265
|
+
"alarm-disarmed",
|
|
14266
|
+
"camera-online",
|
|
14267
|
+
"camera-offline",
|
|
14268
|
+
"camera-disabled",
|
|
14269
|
+
"camera-enabled"
|
|
14270
|
+
]);
|
|
14271
|
+
/** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
|
|
14272
|
+
var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
|
|
14273
|
+
"camera-online",
|
|
14274
|
+
"camera-offline",
|
|
14275
|
+
"camera-disabled",
|
|
14276
|
+
"camera-enabled"
|
|
14198
14277
|
]);
|
|
14278
|
+
NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
|
|
14199
14279
|
/**
|
|
14200
14280
|
* One coherent system-event condition. `kinds` is the required opt-in safety
|
|
14201
14281
|
* gate; the remaining lists are optional narrowing filters relevant to the
|
|
@@ -14204,6 +14284,18 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14204
14284
|
var NcSystemEventConditionSchema = object({
|
|
14205
14285
|
kinds: array(NcSystemEventKindSchema).min(1),
|
|
14206
14286
|
deviceIds: array(number().int()).min(1).optional(),
|
|
14287
|
+
/**
|
|
14288
|
+
* Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
|
|
14289
|
+
* `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
|
|
14290
|
+
* is what a liveness rule means when nobody said otherwise.
|
|
14291
|
+
*
|
|
14292
|
+
* This is where "only my cameras" is expressed, and it lives on the rule for
|
|
14293
|
+
* one reason: the intake cannot know which devices this household cares
|
|
14294
|
+
* about, and a producer-side filter is one no operator can change. Fails
|
|
14295
|
+
* CLOSED — a subject whose device type is unknown (an id the device mirror
|
|
14296
|
+
* does not carry) matches no `deviceTypes` list.
|
|
14297
|
+
*/
|
|
14298
|
+
deviceTypes: array(string().min(1)).min(1).optional(),
|
|
14207
14299
|
nodeIds: array(string().min(1)).min(1).optional(),
|
|
14208
14300
|
packageNames: array(string().min(1)).min(1).optional()
|
|
14209
14301
|
});
|
|
@@ -14254,6 +14346,47 @@ var NcOccupancyConditionSchema = object({
|
|
|
14254
14346
|
sustainSeconds: number().int().min(0).max(3600).default(15)
|
|
14255
14347
|
});
|
|
14256
14348
|
/**
|
|
14349
|
+
* Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
|
|
14350
|
+
*
|
|
14351
|
+
* Operator-approved vocabulary (2026-08-12, option A — the same one the
|
|
14352
|
+
* reference notifier uses, so an operator moving between them re-uses what
|
|
14353
|
+
* they already know): a rule matches when, over a sampling window of
|
|
14354
|
+
* `samplingSeconds`, at least `hitPercent`% of the audio samples in that
|
|
14355
|
+
* window are HITS. A sample is a hit when it satisfies BOTH present filters:
|
|
14356
|
+
*
|
|
14357
|
+
* - `dbThreshold` — its level is at or above this many dBFS (see
|
|
14358
|
+
* {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
|
|
14359
|
+
* - `labels` — the classifier put at least one of these labels on it.
|
|
14360
|
+
*
|
|
14361
|
+
* Both are OPTIONAL and independent, which is the point of the shape: a
|
|
14362
|
+
* loudness rule ("something loud at 3am") needs no model to be right, and a
|
|
14363
|
+
* label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
|
|
14364
|
+
* is given** — a window in which every sample is trivially a hit would fire on
|
|
14365
|
+
* silence, so the engine refuses such a condition rather than notifying on
|
|
14366
|
+
* nothing (the schema cannot express "at least one of" without becoming a
|
|
14367
|
+
* ZodEffects the cap path would have to special-case).
|
|
14368
|
+
*
|
|
14369
|
+
* `hitPercent` is over the samples the window actually HOLDS, and the window
|
|
14370
|
+
* must be FULL before it can match — a window that has been open for two
|
|
14371
|
+
* seconds of its ten is 100% of nothing, and firing on it would make
|
|
14372
|
+
* `samplingSeconds` decorative.
|
|
14373
|
+
*
|
|
14374
|
+
* Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
|
|
14375
|
+
* `audio-*` ids). Both spellings are accepted — the matcher normalizes the
|
|
14376
|
+
* `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
|
|
14377
|
+
* an operator who typed `dog` mean the same thing.
|
|
14378
|
+
*/
|
|
14379
|
+
var NcAudioConditionSchema = object({
|
|
14380
|
+
/** Audio macro labels; absent = any sound (level-only rule). */
|
|
14381
|
+
labels: array(string().min(1)).min(1).optional(),
|
|
14382
|
+
/** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
|
|
14383
|
+
dbThreshold: number().min(-96).max(0).optional(),
|
|
14384
|
+
/** Percentage of the window's samples that must be hits (1–100). */
|
|
14385
|
+
hitPercent: number().int().min(1).max(100).default(60),
|
|
14386
|
+
/** Length of the sampling window in seconds. */
|
|
14387
|
+
samplingSeconds: number().int().min(1).max(300).default(10)
|
|
14388
|
+
});
|
|
14389
|
+
/**
|
|
14257
14390
|
* Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
|
|
14258
14391
|
*
|
|
14259
14392
|
* The values are not symmetric, and deliberately so — the absent value has to
|
|
@@ -14526,7 +14659,33 @@ var NcConditionsSchema = object({
|
|
|
14526
14659
|
* threshold and holds for `sustainSeconds`. Fail-closed on missing
|
|
14527
14660
|
* substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
|
|
14528
14661
|
*/
|
|
14529
|
-
occupancy: NcOccupancyConditionSchema.optional()
|
|
14662
|
+
occupancy: NcOccupancyConditionSchema.optional(),
|
|
14663
|
+
/**
|
|
14664
|
+
* IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
|
|
14665
|
+
* `samplingSeconds` window clear the optional `dbThreshold` and carry one of
|
|
14666
|
+
* the optional `labels`. Fail-closed on missing substrate (no audio samples,
|
|
14667
|
+
* a window that is not full yet, neither filter given). See
|
|
14668
|
+
* {@link NcAudioCondition}.
|
|
14669
|
+
*
|
|
14670
|
+
* Presence of this key is what makes a rule an AUDIO rule: the engine fires
|
|
14671
|
+
* it ONLY on a confirmed audio window, and a rule carrying it never fires on
|
|
14672
|
+
* a detection, a track or a device event (the same fail-closed pairing
|
|
14673
|
+
* `occupancy` has with the `device-event` trigger). That is how audio labels
|
|
14674
|
+
* leave `classes`: an audio rule names its sounds HERE, and the legacy path
|
|
14675
|
+
* (an `immediate` rule naming an `audio-*` class, one notification per
|
|
14676
|
+
* classified sample) stays exactly as it was for rules that already use it.
|
|
14677
|
+
*
|
|
14678
|
+
* NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
|
|
14679
|
+
* rather than an oversight: the viewer mirrors the descriptor enums BY HAND
|
|
14680
|
+
* (`camstack/src/data/notification-center.ts`, guarded by
|
|
14681
|
+
* `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
|
|
14682
|
+
* condition fields it does not know when a rule is saved from the phone.
|
|
14683
|
+
* Publishing an editor for a condition the app cannot round-trip is how an
|
|
14684
|
+
* operator loses a rule's conditions by opening it — so the descriptor, the
|
|
14685
|
+
* admin widget and the viewer mirror land together (P2 + P3), and only then
|
|
14686
|
+
* does an audio rule become authorable.
|
|
14687
|
+
*/
|
|
14688
|
+
audio: NcAudioConditionSchema.optional()
|
|
14530
14689
|
});
|
|
14531
14690
|
/** One delivery target: a `notification-output` Target ref + passthrough params. */
|
|
14532
14691
|
var NcRuleTargetSchema = object({
|
|
@@ -14640,6 +14799,73 @@ var NcThrottleSchema = object({
|
|
|
14640
14799
|
*/
|
|
14641
14800
|
granularity: NcThrottleGranularitySchema.optional()
|
|
14642
14801
|
});
|
|
14802
|
+
/**
|
|
14803
|
+
* How long the confirm gate may hold ONE notification, and how big the picture
|
|
14804
|
+
* it judges may be.
|
|
14805
|
+
*
|
|
14806
|
+
* The clamp is the product decision, not a coincidence of the model: p50 was
|
|
14807
|
+
* 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
|
|
14808
|
+
* arrives after the visitor has gone is not a notification. 448 px was enough
|
|
14809
|
+
* to score 16/16 on the operator's parking scenario — bigger costs latency and
|
|
14810
|
+
* tokens for pixels the model pools away.
|
|
14811
|
+
*/
|
|
14812
|
+
var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
|
|
14813
|
+
var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
|
|
14814
|
+
var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
|
|
14815
|
+
/** Comparison the model's COUNT must satisfy for the notification to fire. */
|
|
14816
|
+
var NcConfirmExpectSchema = object({
|
|
14817
|
+
op: _enum([
|
|
14818
|
+
">=",
|
|
14819
|
+
">",
|
|
14820
|
+
"<=",
|
|
14821
|
+
"<",
|
|
14822
|
+
"=="
|
|
14823
|
+
]),
|
|
14824
|
+
count: number().int().min(0).max(1e3)
|
|
14825
|
+
});
|
|
14826
|
+
/**
|
|
14827
|
+
* AI CONFIRM — a vision model looks at the picture this notification is about
|
|
14828
|
+
* to ship and says whether it agrees with the rule.
|
|
14829
|
+
*
|
|
14830
|
+
* It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
|
|
14831
|
+
* crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
|
|
14832
|
+
* on the operator's phone is not a verdict about this notification.
|
|
14833
|
+
*
|
|
14834
|
+
* FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
|
|
14835
|
+
* whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
|
|
14836
|
+
* the default and every fail-open is COUNTED, because a gate that always fails
|
|
14837
|
+
* open looks in the log exactly like a gate that works.
|
|
14838
|
+
*
|
|
14839
|
+
* Every field is `.optional()` rather than relied on as a Zod default at the
|
|
14840
|
+
* runtime seam: a Zod default does NOT run on the addon→addon cap path (three
|
|
14841
|
+
* production failures in one day), so the gate reads absent as the constant
|
|
14842
|
+
* above rather than trusting a parse it may never have seen.
|
|
14843
|
+
*/
|
|
14844
|
+
var NcConfirmSchema = object({
|
|
14845
|
+
/** Off unless asked for. An absent `confirm` and `enabled:false` are the
|
|
14846
|
+
* same thing, and both mean "deliver exactly as before". */
|
|
14847
|
+
enabled: boolean().default(false),
|
|
14848
|
+
/** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
|
|
14849
|
+
profileId: string().optional(),
|
|
14850
|
+
/**
|
|
14851
|
+
* The operator's question, in his own words. Absent = a question derived
|
|
14852
|
+
* from the rule (its class and its expectation).
|
|
14853
|
+
*
|
|
14854
|
+
* NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
|
|
14855
|
+
* banners, signage and plates as instructions if you let them reach the
|
|
14856
|
+
* prompt — proven live — so the authoritative contract stays in the system
|
|
14857
|
+
* turn and only rule-authored words land here.
|
|
14858
|
+
*/
|
|
14859
|
+
prompt: string().max(1e3).optional(),
|
|
14860
|
+
/** Fire only when the model's count satisfies this. Absent = the model's
|
|
14861
|
+
* own boolean verdict decides. */
|
|
14862
|
+
expect: NcConfirmExpectSchema.optional(),
|
|
14863
|
+
timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
|
|
14864
|
+
/** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
|
|
14865
|
+
onTimeout: _enum(["fire", "suppress"]).default("fire"),
|
|
14866
|
+
/** Longest edge the judged image is downscaled to before it is sent. */
|
|
14867
|
+
maxImagePx: number().int().min(64).max(2048).default(448)
|
|
14868
|
+
});
|
|
14643
14869
|
/** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
|
|
14644
14870
|
var NcRuleInputSchema = object({
|
|
14645
14871
|
name: string().min(1).max(200),
|
|
@@ -14700,7 +14926,13 @@ var NcRuleInputSchema = object({
|
|
|
14700
14926
|
* `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
|
|
14701
14927
|
* shape as every other actuation.
|
|
14702
14928
|
*/
|
|
14703
|
-
actions: NcRuleActionsSchema.optional()
|
|
14929
|
+
actions: NcRuleActionsSchema.optional(),
|
|
14930
|
+
/**
|
|
14931
|
+
* AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
|
|
14932
|
+
* a rule that predates the gate must keep delivering byte-for-byte as it
|
|
14933
|
+
* did, and absent is the only way to say that without a migration.
|
|
14934
|
+
*/
|
|
14935
|
+
confirm: NcConfirmSchema.optional()
|
|
14704
14936
|
});
|
|
14705
14937
|
/**
|
|
14706
14938
|
* Partial patch for `updateRule` — any subset of the input fields, plus the
|
|
@@ -14711,7 +14943,37 @@ var NcRuleInputSchema = object({
|
|
|
14711
14943
|
* still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
|
|
14712
14944
|
* `updateRule` patch.
|
|
14713
14945
|
*/
|
|
14714
|
-
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
14946
|
+
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
14947
|
+
disabledTargetIds: array(string()).optional(),
|
|
14948
|
+
/**
|
|
14949
|
+
* `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
|
|
14950
|
+
*
|
|
14951
|
+
* It makes the key optional to SUPPLY; the parse still materialises the
|
|
14952
|
+
* default when the key is absent. And `NcRuleStore.update` merges with
|
|
14953
|
+
* `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
|
|
14954
|
+
* one — which made every partial edit destructive:
|
|
14955
|
+
*
|
|
14956
|
+
* nc.updateRule({ throttle }) → conditions reset to `{}`
|
|
14957
|
+
* nc.setRuleTargetEnabled(...) → conditions reset to `{}`
|
|
14958
|
+
* setEnabled(ruleId, false) → conditions reset to `{}`
|
|
14959
|
+
*
|
|
14960
|
+
* A rule scoped to one camera and one zone silently became a rule that
|
|
14961
|
+
* matches EVERY event on EVERY camera, and lost its `media` policy
|
|
14962
|
+
* (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
|
|
14963
|
+
* live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
|
|
14964
|
+
* within a minute of a two-field patch.
|
|
14965
|
+
*
|
|
14966
|
+
* So every defaulted field is re-declared here WITHOUT its default. The
|
|
14967
|
+
* inner defaults still apply when the caller DOES send the key — `{}` for
|
|
14968
|
+
* conditions remains a real instruction ("clear them") — and only the
|
|
14969
|
+
* absent key is now genuinely absent.
|
|
14970
|
+
*/
|
|
14971
|
+
enabled: boolean().optional(),
|
|
14972
|
+
conditions: NcConditionsSchema.optional(),
|
|
14973
|
+
media: NcMediaPolicySchema.optional(),
|
|
14974
|
+
throttle: NcThrottleSchema.optional(),
|
|
14975
|
+
priority: number().int().min(1).max(5).optional()
|
|
14976
|
+
});
|
|
14715
14977
|
/** A persisted rule. */
|
|
14716
14978
|
var NcRuleSchema = NcRuleInputSchema.extend({
|
|
14717
14979
|
id: string(),
|
|
@@ -15012,6 +15274,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
|
|
|
15012
15274
|
* Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
|
|
15013
15275
|
* copy would lie the first time a rule is disabled.
|
|
15014
15276
|
*/
|
|
15277
|
+
/**
|
|
15278
|
+
* Why a device a mode NAMES is nonetheless not armed by it.
|
|
15279
|
+
*
|
|
15280
|
+
* Each value is an existing authority, never a new flag (D62): `muted` is the
|
|
15281
|
+
* per-camera notification switch the Notification Center already owns,
|
|
15282
|
+
* `detection-off` is the device's own detection binding being inactive, and
|
|
15283
|
+
* `offline` is the device manager's liveness. A fourth reason would mean a
|
|
15284
|
+
* fourth authority, and inventing one here is how a panel starts disagreeing
|
|
15285
|
+
* with the switches the operator actually used.
|
|
15286
|
+
*/
|
|
15287
|
+
var NcAlarmSkipReasonSchema = _enum([
|
|
15288
|
+
"muted",
|
|
15289
|
+
"detection-off",
|
|
15290
|
+
"offline"
|
|
15291
|
+
]);
|
|
15292
|
+
var NcAlarmSkippedDeviceSchema = object({
|
|
15293
|
+
deviceId: number().int(),
|
|
15294
|
+
reason: NcAlarmSkipReasonSchema
|
|
15295
|
+
});
|
|
15015
15296
|
var NcAlarmModeCoverageSchema = object({
|
|
15016
15297
|
mode: AlarmArmModeSchema,
|
|
15017
15298
|
/** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
|
|
@@ -15019,7 +15300,18 @@ var NcAlarmModeCoverageSchema = object({
|
|
|
15019
15300
|
/** At least one covering rule has no device scope, so the mode covers all. */
|
|
15020
15301
|
allDevices: boolean(),
|
|
15021
15302
|
/** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
|
|
15022
|
-
deviceIds: array(number().int())
|
|
15303
|
+
deviceIds: array(number().int()),
|
|
15304
|
+
/**
|
|
15305
|
+
* Devices this mode NAMES but cannot actually arm, each with the switch that
|
|
15306
|
+
* excludes it.
|
|
15307
|
+
*
|
|
15308
|
+
* "Away armed — 12 cameras" is a promise, and a muted camera among those
|
|
15309
|
+
* twelve makes it false in exactly the way nobody notices until an incident.
|
|
15310
|
+
* Defaulted to `[]` so a coverage answer computed before this field existed
|
|
15311
|
+
* still parses as "nothing known to be skipped" rather than failing the whole
|
|
15312
|
+
* alarm tab.
|
|
15313
|
+
*/
|
|
15314
|
+
skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
|
|
15023
15315
|
});
|
|
15024
15316
|
var NcAlarmConfigSchema = object({
|
|
15025
15317
|
/**
|
|
@@ -17851,9 +18143,16 @@ var CameraStatusSchema = object({
|
|
|
17851
18143
|
audio: CameraAudioStatusSchema.nullable(),
|
|
17852
18144
|
recording: CameraRecordingStatusSchema.nullable(),
|
|
17853
18145
|
/**
|
|
17854
|
-
* Per-camera
|
|
18146
|
+
* Per-camera functions an OPERATOR has turned off
|
|
17855
18147
|
* ([D61](../../../../docs/decisions/adr-0067.md)).
|
|
17856
18148
|
*
|
|
18149
|
+
* Composed from the AUTHORITIES themselves — the wrapper bindings,
|
|
18150
|
+
* `RecordingConfig.enabled`, the notification mute, the broker's audio
|
|
18151
|
+
* policy, the camera's own microphone — via `composeSwitchedOff`, not from
|
|
18152
|
+
* the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
|
|
18153
|
+
* The badge outlives the control panel: the panel was a convenience, this is
|
|
18154
|
+
* the difference between a camera being off and a camera being dead.
|
|
18155
|
+
*
|
|
17857
18156
|
* This is the difference between DISABLED and BROKEN. A camera whose
|
|
17858
18157
|
* `detection` block reports zero fps and whose `switchedOff` contains
|
|
17859
18158
|
* `'object-detection'` was switched off by a person; the same camera with an
|
|
@@ -24603,7 +24902,19 @@ var RecordingManifestSchema = object({
|
|
|
24603
24902
|
* profiles/subtrees/locations on this node). */
|
|
24604
24903
|
var RecordingDeviceUsageSchema = object({
|
|
24605
24904
|
deviceId: number(),
|
|
24606
|
-
usedBytes: number()
|
|
24905
|
+
usedBytes: number(),
|
|
24906
|
+
/**
|
|
24907
|
+
* Start of this camera's OLDEST indexed segment, across every profile and
|
|
24908
|
+
* location — the "Oldest footage" column in Recordings → Storage, and the
|
|
24909
|
+
* only honest answer to "is retention actually holding?" per camera.
|
|
24910
|
+
*
|
|
24911
|
+
* `null` = the camera has no footage. OPTIONAL because a recorder that
|
|
24912
|
+
* predates this field omits it entirely, and a hub whose types carry the
|
|
24913
|
+
* field must keep validating that older provider's payload: the framework
|
|
24914
|
+
* (types) and the addon ship on different trains, and the addon is usually
|
|
24915
|
+
* the later of the two.
|
|
24916
|
+
*/
|
|
24917
|
+
oldestMs: number().nullable().optional()
|
|
24607
24918
|
});
|
|
24608
24919
|
/** Recording storage usage + capacity for one storage location. */
|
|
24609
24920
|
var RecordingLocationUsageSchema = object({
|
|
@@ -24631,6 +24942,57 @@ var RecordingStorageUsageSchema = object({
|
|
|
24631
24942
|
locations: array(RecordingLocationUsageSchema)
|
|
24632
24943
|
});
|
|
24633
24944
|
/**
|
|
24945
|
+
* The OPERATOR-ARMED half of multi-location recordings (D116).
|
|
24946
|
+
*
|
|
24947
|
+
* The placement plan decides where NEW writes go and moves nothing. A rebalance
|
|
24948
|
+
* is the operator asking for the EXISTING archive to be brought into line with
|
|
24949
|
+
* that plan: one relocate job per (camera, profile) pile that sits on the wrong
|
|
24950
|
+
* location, run FIFO behind the single-flight mover.
|
|
24951
|
+
*
|
|
24952
|
+
* `plan…` and `start…` return the SAME shape deliberately — what the operator
|
|
24953
|
+
* confirms is exactly what gets enqueued, and `jobIds` is the only difference
|
|
24954
|
+
* (empty on the plan).
|
|
24955
|
+
*/
|
|
24956
|
+
var RecordingRebalanceMoveSchema = object({
|
|
24957
|
+
deviceId: number(),
|
|
24958
|
+
profile: string(),
|
|
24959
|
+
fromLocationId: string(),
|
|
24960
|
+
toLocationId: string(),
|
|
24961
|
+
bytes: number(),
|
|
24962
|
+
files: number().int()
|
|
24963
|
+
});
|
|
24964
|
+
/** Why a pile that is out of place is staying there. Every refusal is
|
|
24965
|
+
* reported: a rebalance that silently drops a camera reads exactly like one
|
|
24966
|
+
* that had nothing to do. */
|
|
24967
|
+
var RecordingRebalanceSkipReasonSchema = _enum([
|
|
24968
|
+
"unassigned",
|
|
24969
|
+
"target-not-writable",
|
|
24970
|
+
"below-threshold",
|
|
24971
|
+
"no-headroom"
|
|
24972
|
+
]);
|
|
24973
|
+
var RecordingRebalanceSkipSchema = object({
|
|
24974
|
+
deviceId: number(),
|
|
24975
|
+
profile: string(),
|
|
24976
|
+
fromLocationId: string(),
|
|
24977
|
+
/** The location the plan wants; null when the camera has no assignment. */
|
|
24978
|
+
toLocationId: string().nullable(),
|
|
24979
|
+
bytes: number(),
|
|
24980
|
+
reason: RecordingRebalanceSkipReasonSchema
|
|
24981
|
+
});
|
|
24982
|
+
var RecordingRebalancePlanSchema = object({
|
|
24983
|
+
moves: array(RecordingRebalanceMoveSchema),
|
|
24984
|
+
skipped: array(RecordingRebalanceSkipSchema),
|
|
24985
|
+
bytesToMove: number(),
|
|
24986
|
+
/** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
|
|
24987
|
+
jobIds: array(string())
|
|
24988
|
+
});
|
|
24989
|
+
var RecordingRebalanceInputSchema = object({
|
|
24990
|
+
/** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
|
|
24991
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
24992
|
+
/** Ignore piles smaller than this (default 1 GB). */
|
|
24993
|
+
minMoveGb: number().min(0).optional()
|
|
24994
|
+
});
|
|
24995
|
+
/**
|
|
24634
24996
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
24635
24997
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
24636
24998
|
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
@@ -24793,9 +25155,24 @@ method(object({
|
|
|
24793
25155
|
}), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
24794
25156
|
kind: "mutation",
|
|
24795
25157
|
auth: "admin"
|
|
25158
|
+
}), method(RelocateFootageInputSchema, object({ jobId: string() }), {
|
|
25159
|
+
kind: "mutation",
|
|
25160
|
+
auth: "admin"
|
|
25161
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
25162
|
+
kind: "query",
|
|
25163
|
+
auth: "admin"
|
|
25164
|
+
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
25165
|
+
kind: "mutation",
|
|
25166
|
+
auth: "admin"
|
|
25167
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
25168
|
+
kind: "query",
|
|
25169
|
+
auth: "admin"
|
|
25170
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
25171
|
+
kind: "mutation",
|
|
25172
|
+
auth: "admin"
|
|
24796
25173
|
});
|
|
24797
25174
|
/**
|
|
24798
|
-
* `
|
|
25175
|
+
* `recording-export` cap — render a footage time range into a single downloadable
|
|
24799
25176
|
* MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
|
|
24800
25177
|
* bounded lifetime with a durable history, auto-expiry, and optional
|
|
24801
25178
|
* delete-after-download.
|
|
@@ -24810,10 +25187,42 @@ method(object({
|
|
|
24810
25187
|
*/
|
|
24811
25188
|
/** Playback-speed multiplier for the render (1 = realtime). */
|
|
24812
25189
|
var ExportSpeedSchema = number().min(.25).max(32);
|
|
25190
|
+
/**
|
|
25191
|
+
* One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
|
|
25192
|
+
*
|
|
25193
|
+
* Relative and not absolute epoch on purpose: the renderer's frame-select
|
|
25194
|
+
* expression sees ffmpeg's `t`, which starts at 0 for the export's source
|
|
25195
|
+
* playlist. Handing it absolute epochs would make every call site responsible
|
|
25196
|
+
* for the same subtraction, and the one that forgot would emit a filter that
|
|
25197
|
+
* selects nothing — silently, as a uniform timelapse.
|
|
25198
|
+
*/
|
|
25199
|
+
var ExportDenseRangeSchema = object({
|
|
25200
|
+
fromSec: number().nonnegative(),
|
|
25201
|
+
toSec: number().nonnegative()
|
|
25202
|
+
}).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
|
|
25203
|
+
/**
|
|
25204
|
+
* Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
|
|
25205
|
+
* listed ranges and at the base `everyMs` everywhere else.
|
|
25206
|
+
*
|
|
25207
|
+
* `everyMs` must be strictly smaller than the base cadence — a dense rate that
|
|
25208
|
+
* is not denser renders a uniform timelapse the operator believes is two-rate.
|
|
25209
|
+
*/
|
|
25210
|
+
var ExportDenseSchema = object({
|
|
25211
|
+
everyMs: number().int().positive(),
|
|
25212
|
+
ranges: array(ExportDenseRangeSchema).min(1).max(200)
|
|
25213
|
+
});
|
|
24813
25214
|
/** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
|
|
24814
25215
|
var ExportTimelapseSchema = object({
|
|
24815
25216
|
everyMs: number().int().positive(),
|
|
24816
|
-
outputFps: number().int().min(1).max(60).optional()
|
|
25217
|
+
outputFps: number().int().min(1).max(60).optional(),
|
|
25218
|
+
/** Optional second, FASTER rate over the intervals that matter. */
|
|
25219
|
+
dense: ExportDenseSchema.optional()
|
|
25220
|
+
}).superRefine((v, ctx) => {
|
|
25221
|
+
if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
|
|
25222
|
+
code: ZodIssueCode.custom,
|
|
25223
|
+
message: "dense.everyMs must be strictly smaller than the base everyMs",
|
|
25224
|
+
path: ["dense", "everyMs"]
|
|
25225
|
+
});
|
|
24817
25226
|
});
|
|
24818
25227
|
/**
|
|
24819
25228
|
* Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
|
|
@@ -24871,6 +25280,19 @@ var ExportDownloadSchema = object({
|
|
|
24871
25280
|
url: string(),
|
|
24872
25281
|
endpoints: array(string())
|
|
24873
25282
|
});
|
|
25283
|
+
/**
|
|
25284
|
+
* A finished export's bytes, inline.
|
|
25285
|
+
*
|
|
25286
|
+
* `bytes` is the DECODED length — the number the caller bounds and logs
|
|
25287
|
+
* against, so nobody has to infer it from the base64 length.
|
|
25288
|
+
*/
|
|
25289
|
+
var ExportBytesSchema = object({
|
|
25290
|
+
base64: string(),
|
|
25291
|
+
contentType: string(),
|
|
25292
|
+
/** Suggested filename, extension included. */
|
|
25293
|
+
name: string(),
|
|
25294
|
+
bytes: number().int().nonnegative()
|
|
25295
|
+
});
|
|
24874
25296
|
method(object({
|
|
24875
25297
|
deviceId: number(),
|
|
24876
25298
|
profile: string(),
|
|
@@ -24895,6 +25317,9 @@ method(object({
|
|
|
24895
25317
|
}), method(object({ exportId: string() }), ExportDownloadSchema, {
|
|
24896
25318
|
kind: "query",
|
|
24897
25319
|
auth: "protected"
|
|
25320
|
+
}), method(object({ exportId: string() }), ExportBytesSchema, {
|
|
25321
|
+
kind: "query",
|
|
25322
|
+
auth: "protected"
|
|
24898
25323
|
});
|
|
24899
25324
|
/**
|
|
24900
25325
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
@@ -31572,6 +31997,12 @@ Object.freeze({
|
|
|
31572
31997
|
addonId: null,
|
|
31573
31998
|
access: "create"
|
|
31574
31999
|
},
|
|
32000
|
+
"recording.cancelRelocateJob": {
|
|
32001
|
+
capName: "recording",
|
|
32002
|
+
capScope: "system",
|
|
32003
|
+
addonId: null,
|
|
32004
|
+
access: "create"
|
|
32005
|
+
},
|
|
31575
32006
|
"recording.cancelStorageMigrationMove": {
|
|
31576
32007
|
capName: "recording",
|
|
31577
32008
|
capScope: "system",
|
|
@@ -31626,6 +32057,12 @@ Object.freeze({
|
|
|
31626
32057
|
addonId: null,
|
|
31627
32058
|
access: "view"
|
|
31628
32059
|
},
|
|
32060
|
+
"recording.listRelocateJobs": {
|
|
32061
|
+
capName: "recording",
|
|
32062
|
+
capScope: "system",
|
|
32063
|
+
addonId: null,
|
|
32064
|
+
access: "view"
|
|
32065
|
+
},
|
|
31629
32066
|
"recording.locateSegment": {
|
|
31630
32067
|
capName: "recording",
|
|
31631
32068
|
capScope: "system",
|
|
@@ -31638,6 +32075,12 @@ Object.freeze({
|
|
|
31638
32075
|
addonId: null,
|
|
31639
32076
|
access: "create"
|
|
31640
32077
|
},
|
|
32078
|
+
"recording.planStorageRebalance": {
|
|
32079
|
+
capName: "recording",
|
|
32080
|
+
capScope: "system",
|
|
32081
|
+
addonId: null,
|
|
32082
|
+
access: "view"
|
|
32083
|
+
},
|
|
31641
32084
|
"recording.pruneFootage": {
|
|
31642
32085
|
capName: "recording",
|
|
31643
32086
|
capScope: "system",
|
|
@@ -31662,6 +32105,12 @@ Object.freeze({
|
|
|
31662
32105
|
addonId: null,
|
|
31663
32106
|
access: "create"
|
|
31664
32107
|
},
|
|
32108
|
+
"recording.relocateFootage": {
|
|
32109
|
+
capName: "recording",
|
|
32110
|
+
capScope: "system",
|
|
32111
|
+
addonId: null,
|
|
32112
|
+
access: "create"
|
|
32113
|
+
},
|
|
31665
32114
|
"recording.renderClip": {
|
|
31666
32115
|
capName: "recording",
|
|
31667
32116
|
capScope: "system",
|
|
@@ -31698,38 +32147,50 @@ Object.freeze({
|
|
|
31698
32147
|
addonId: null,
|
|
31699
32148
|
access: "create"
|
|
31700
32149
|
},
|
|
32150
|
+
"recording.startStorageRebalance": {
|
|
32151
|
+
capName: "recording",
|
|
32152
|
+
capScope: "system",
|
|
32153
|
+
addonId: null,
|
|
32154
|
+
access: "create"
|
|
32155
|
+
},
|
|
31701
32156
|
"recordingExport.cancelExport": {
|
|
31702
|
-
capName: "
|
|
32157
|
+
capName: "recording-export",
|
|
31703
32158
|
capScope: "system",
|
|
31704
32159
|
addonId: null,
|
|
31705
32160
|
access: "create"
|
|
31706
32161
|
},
|
|
31707
32162
|
"recordingExport.createExport": {
|
|
31708
|
-
capName: "
|
|
32163
|
+
capName: "recording-export",
|
|
31709
32164
|
capScope: "system",
|
|
31710
32165
|
addonId: null,
|
|
31711
32166
|
access: "create"
|
|
31712
32167
|
},
|
|
31713
32168
|
"recordingExport.deleteExport": {
|
|
31714
|
-
capName: "
|
|
32169
|
+
capName: "recording-export",
|
|
31715
32170
|
capScope: "system",
|
|
31716
32171
|
addonId: null,
|
|
31717
32172
|
access: "delete"
|
|
31718
32173
|
},
|
|
31719
32174
|
"recordingExport.getDownloadUrl": {
|
|
31720
|
-
capName: "
|
|
32175
|
+
capName: "recording-export",
|
|
31721
32176
|
capScope: "system",
|
|
31722
32177
|
addonId: null,
|
|
31723
32178
|
access: "view"
|
|
31724
32179
|
},
|
|
31725
32180
|
"recordingExport.getExport": {
|
|
31726
|
-
capName: "
|
|
32181
|
+
capName: "recording-export",
|
|
31727
32182
|
capScope: "system",
|
|
31728
32183
|
addonId: null,
|
|
31729
32184
|
access: "view"
|
|
31730
32185
|
},
|
|
31731
32186
|
"recordingExport.listExports": {
|
|
31732
|
-
capName: "
|
|
32187
|
+
capName: "recording-export",
|
|
32188
|
+
capScope: "system",
|
|
32189
|
+
addonId: null,
|
|
32190
|
+
access: "view"
|
|
32191
|
+
},
|
|
32192
|
+
"recordingExport.readExportBytes": {
|
|
32193
|
+
capName: "recording-export",
|
|
31733
32194
|
capScope: "system",
|
|
31734
32195
|
addonId: null,
|
|
31735
32196
|
access: "view"
|
|
@@ -33106,6 +33567,104 @@ var FramerateField = number().int().min(1).max(60);
|
|
|
33106
33567
|
var TargetsField = array(NcRuleTargetSchema).min(1);
|
|
33107
33568
|
var PriorityField = number().int().min(1).max(5);
|
|
33108
33569
|
/**
|
|
33570
|
+
* Explicit override of the DENSE sampling cadence, seconds.
|
|
33571
|
+
*
|
|
33572
|
+
* Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
|
|
33573
|
+
* 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
|
|
33574
|
+
* made that same base 3 s and rendered a person pass as two frames.)
|
|
33575
|
+
*
|
|
33576
|
+
* THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
|
|
33577
|
+
* `denseCadenceSec` and played at `framerate` occupies
|
|
33578
|
+
*
|
|
33579
|
+
* outputSeconds = (rangeSec / denseCadenceSec) / framerate
|
|
33580
|
+
*
|
|
33581
|
+
* 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.
|
|
33582
|
+
* Halving this field doubles the frames INSIDE ranges only — the base cadence,
|
|
33583
|
+
* and therefore the length of a quiet night, does not move.
|
|
33584
|
+
*
|
|
33585
|
+
* Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
|
|
33586
|
+
* the recording has them returns the same frames, requested twice. Must be
|
|
33587
|
+
* STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
|
|
33588
|
+
* a uniform video the operator believes is two-rate — and upsert refuses it
|
|
33589
|
+
* rather than letting the export cap reject the render hours after the window.
|
|
33590
|
+
*/
|
|
33591
|
+
var DenseCadenceSecField = number().min(.1).max(3600);
|
|
33592
|
+
/**
|
|
33593
|
+
* Minimum seconds of OUTPUT video each detection range must occupy.
|
|
33594
|
+
*
|
|
33595
|
+
* The operator-facing form of the arithmetic above: instead of solving for a
|
|
33596
|
+
* cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
|
|
33597
|
+
* 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
|
|
33598
|
+
* that range every ~583 ms.
|
|
33599
|
+
*
|
|
33600
|
+
* ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
|
|
33601
|
+
* ranges are terms of a single ffmpeg `select` expression that cannot vary rate
|
|
33602
|
+
* per term — so the MOST DEMANDING (shortest) range sets the rate and longer
|
|
33603
|
+
* ranges are sampled denser than they need. Per-range cadences require a cap
|
|
33604
|
+
* schema change and are the tracked follow-up.
|
|
33605
|
+
*
|
|
33606
|
+
* A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
|
|
33607
|
+
* is rendered with every frame that EXISTS and no more: the guarantee is capped
|
|
33608
|
+
* by real footage, never met by duplicating frames into motion that never
|
|
33609
|
+
* happened.
|
|
33610
|
+
*/
|
|
33611
|
+
var MinDwellSecField = number().min(0).max(60);
|
|
33612
|
+
/**
|
|
33613
|
+
* Caption burned into the notification's preview frame.
|
|
33614
|
+
*
|
|
33615
|
+
* Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
|
|
33616
|
+
* `rule`, `from`, `to`) and rendered by the SAME renderer — a second
|
|
33617
|
+
* templating dialect for one field would be a second thing to explain.
|
|
33618
|
+
*
|
|
33619
|
+
* Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
|
|
33620
|
+
* operator saying "the frame, no caption" — a distinct, reachable answer, and
|
|
33621
|
+
* the reason this is not `.min(1)`.
|
|
33622
|
+
*/
|
|
33623
|
+
var PreviewTextField = string().max(200);
|
|
33624
|
+
/**
|
|
33625
|
+
* Whether the notification's preview is a STILL or a short animation.
|
|
33626
|
+
*
|
|
33627
|
+
* The operator's ask, verbatim: *"inviato come gif o video (come per le altre
|
|
33628
|
+
* rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
|
|
33629
|
+
* night reads better as three seconds of motion than as one frame of it. Both
|
|
33630
|
+
* modes get the SAME treatment (blurred frame, large centred title); `'gif'`
|
|
33631
|
+
* simply applies it to a dozen frames sampled across the render and assembles
|
|
33632
|
+
* them.
|
|
33633
|
+
*
|
|
33634
|
+
* `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
|
|
33635
|
+
* seeks and a palette pass, and no rule that never asked for one should start
|
|
33636
|
+
* paying that on the deploy that shipped it.
|
|
33637
|
+
*
|
|
33638
|
+
* A GIF that cannot be assembled DEGRADES to the still — never to nothing.
|
|
33639
|
+
*/
|
|
33640
|
+
var PreviewModeField = _enum(["image", "gif"]);
|
|
33641
|
+
/**
|
|
33642
|
+
* Which detection classes the notification reports counts for.
|
|
33643
|
+
*
|
|
33644
|
+
* The counts come from the tracks the render ALREADY fetched for its dense-range
|
|
33645
|
+
* plan — no second query — aggregated per class. Absent or empty means "every
|
|
33646
|
+
* class the window actually contained", which is what an operator who never
|
|
33647
|
+
* opened the field wants; a list narrows it (`['person']` on a driveway that
|
|
33648
|
+
* counts cars all night).
|
|
33649
|
+
*
|
|
33650
|
+
* Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
|
|
33651
|
+
* …). An unknown name simply never matches and reports nothing — it is not an
|
|
33652
|
+
* error, because a rule may legitimately name a class this camera's model does
|
|
33653
|
+
* not emit.
|
|
33654
|
+
*
|
|
33655
|
+
* The counts are exposed to {@link TimelapseTemplateSchema} as:
|
|
33656
|
+
* - `{{detections}}` — total over the reported classes
|
|
33657
|
+
* - `{{detectionSummary}}` — `2 persone, 1 veicolo`
|
|
33658
|
+
* - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
|
|
33659
|
+
* one per class, `count_` + the class name
|
|
33660
|
+
*
|
|
33661
|
+
* With NO custom body template the summary is appended to the derived body, and
|
|
33662
|
+
* only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
|
|
33663
|
+
* reads. With a custom template the operator owns every word — nothing is
|
|
33664
|
+
* appended, so `{{detectionSummary}}` is how he asks for it.
|
|
33665
|
+
*/
|
|
33666
|
+
var ReportClassesField = array(string().min(1).max(40)).max(20);
|
|
33667
|
+
/**
|
|
33109
33668
|
* Client-supplied timelapse-rule fields. The server stamps id / createdBy /
|
|
33110
33669
|
* createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
|
|
33111
33670
|
* here (see the ownership note above).
|
|
@@ -33125,9 +33684,30 @@ var TimelapseRuleInputSchema = object({
|
|
|
33125
33684
|
cadenceSec: CadenceSecField.default(15),
|
|
33126
33685
|
/** Output frames per second of the assembled mp4 (predecessor parity). */
|
|
33127
33686
|
framerate: FramerateField.default(10),
|
|
33687
|
+
/**
|
|
33688
|
+
* Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
|
|
33689
|
+
* as `max(1s, cadenceSec / 30)`, which is what every rule written before this
|
|
33690
|
+
* field gets.
|
|
33691
|
+
*/
|
|
33692
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
33693
|
+
/** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
|
|
33694
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
33128
33695
|
/** `notification-output` targets the finished video/thumbnail is sent to. */
|
|
33129
33696
|
targets: TargetsField,
|
|
33130
33697
|
template: TimelapseTemplateSchema.optional(),
|
|
33698
|
+
/**
|
|
33699
|
+
* Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
|
|
33700
|
+
* and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
|
|
33701
|
+
*
|
|
33702
|
+
* Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
|
|
33703
|
+
* the notification's title/body, and clearing it (`template: null`) must not
|
|
33704
|
+
* silently clear the caption too.
|
|
33705
|
+
*/
|
|
33706
|
+
previewText: PreviewTextField.optional(),
|
|
33707
|
+
/** Still or animation — see {@link PreviewModeField}. */
|
|
33708
|
+
previewMode: PreviewModeField.default("image"),
|
|
33709
|
+
/** Classes the notification counts — see {@link ReportClassesField}. */
|
|
33710
|
+
reportClasses: ReportClassesField.optional(),
|
|
33131
33711
|
/** Canonical notification priority ordinal (1..5); per-target overridable. */
|
|
33132
33712
|
priority: PriorityField.default(3)
|
|
33133
33713
|
});
|
|
@@ -33138,8 +33718,13 @@ object({
|
|
|
33138
33718
|
schedule: NcScheduleSchema.optional(),
|
|
33139
33719
|
cadenceSec: CadenceSecField.optional(),
|
|
33140
33720
|
framerate: FramerateField.optional(),
|
|
33721
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
33722
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
33141
33723
|
targets: TargetsField.optional(),
|
|
33142
33724
|
template: TimelapseTemplateSchema.nullable().optional(),
|
|
33725
|
+
previewText: PreviewTextField.optional(),
|
|
33726
|
+
previewMode: PreviewModeField.optional(),
|
|
33727
|
+
reportClasses: ReportClassesField.optional(),
|
|
33143
33728
|
priority: PriorityField.optional()
|
|
33144
33729
|
});
|
|
33145
33730
|
TimelapseRuleInputSchema.extend({
|
|
@@ -33151,10 +33736,28 @@ TimelapseRuleInputSchema.extend({
|
|
|
33151
33736
|
*/
|
|
33152
33737
|
ownerUserId: string().optional(),
|
|
33153
33738
|
/**
|
|
33154
|
-
* Epoch-ms of the
|
|
33155
|
-
*
|
|
33739
|
+
* Epoch-ms of the NEWEST successful generation across every camera of this
|
|
33740
|
+
* rule. What a UI shows, and the compatibility floor for
|
|
33741
|
+
* {@link readTimelapseGeneratedAt}. Absent = never generated.
|
|
33156
33742
|
*/
|
|
33157
33743
|
lastGeneratedAt: number().optional(),
|
|
33744
|
+
/**
|
|
33745
|
+
* PER-CAMERA generation state, keyed by `String(deviceId)` — the
|
|
33746
|
+
* re-generation guard's real durable state.
|
|
33747
|
+
*
|
|
33748
|
+
* One rule covers several cameras and each renders its own video, so a rule
|
|
33749
|
+
* -wide stamp is wrong in the direction that DESTROYS work: camera A
|
|
33750
|
+
* succeeding at 06:05 tells camera B, whose render failed, that it is
|
|
33751
|
+
* already done — and B's night is gone for good, because the window will not
|
|
33752
|
+
* come back.
|
|
33753
|
+
*
|
|
33754
|
+
* ADDITIVE, so the migration is free: a row written before this field simply
|
|
33755
|
+
* has no map, and {@link readTimelapseGeneratedAt} falls back to
|
|
33756
|
+
* {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
|
|
33757
|
+
* "never generated" would re-render and re-notify every camera of every rule
|
|
33758
|
+
* once, on the deploy that shipped the map.
|
|
33759
|
+
*/
|
|
33760
|
+
generatedByDevice: record(string(), number()).optional(),
|
|
33158
33761
|
/** userId of the caller who created the rule (server-stamped). */
|
|
33159
33762
|
createdBy: string(),
|
|
33160
33763
|
createdAt: number(),
|