@camstack/addon-provider-rtsp 1.2.13 → 1.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 +643 -36
- package/dist/addon.mjs +643 -36
- package/package.json +1 -1
package/dist/addon.mjs
CHANGED
|
@@ -7219,8 +7219,31 @@ var AdoptionJobSchema = object({
|
|
|
7219
7219
|
error: string().nullable()
|
|
7220
7220
|
});
|
|
7221
7221
|
/**
|
|
7222
|
-
* Per-camera FUNCTION SWITCHES
|
|
7223
|
-
*
|
|
7222
|
+
* Per-camera FUNCTION SWITCHES.
|
|
7223
|
+
*
|
|
7224
|
+
* ## The aggregate group is being withdrawn — the BADGE is not (D113)
|
|
7225
|
+
*
|
|
7226
|
+
* This file shipped as "the one coherent on/off surface over the pipeline
|
|
7227
|
+
* functions an operator thinks in terms of". The operator's verdict on
|
|
7228
|
+
* 2026-08-12 was that the coherent surface bought complexity and no clarity:
|
|
7229
|
+
* every function already had a settings page of its own, and a second place to
|
|
7230
|
+
* turn it off is a second place to look. Each switch is going back to its own
|
|
7231
|
+
* component's original options — detection to the detection-pipeline wrapper
|
|
7232
|
+
* binding, audio analysis to its own, recording to `RecordingConfig.enabled`
|
|
7233
|
+
* (which was always first-class; the switch was a veneer over
|
|
7234
|
+
* `recording.setDeviceConfig`), notifications to a notification-center
|
|
7235
|
+
* per-device setting, the two camera planes to their own components.
|
|
7236
|
+
*
|
|
7237
|
+
* What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
|
|
7238
|
+
* thing that lets a status surface say DISABLED instead of BROKEN, recomposed
|
|
7239
|
+
* straight from the authorities with no group in the middle. That rule was
|
|
7240
|
+
* never about a control panel.
|
|
7241
|
+
*
|
|
7242
|
+
* Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
|
|
7243
|
+
* {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
|
|
7244
|
+
* `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
|
|
7245
|
+
* viewers (v1.0.305) and the admin UI still call it. It is deleted when they
|
|
7246
|
+
* stop; nothing new may be built on it.
|
|
7224
7247
|
*
|
|
7225
7248
|
* ## This file adds no state
|
|
7226
7249
|
*
|
|
@@ -7603,7 +7626,15 @@ var RecordingConfigSchema = object({
|
|
|
7603
7626
|
* Each completed/failed run also lands one durable ops-log row on its owning
|
|
7604
7627
|
* addon surface.
|
|
7605
7628
|
*/
|
|
7629
|
+
/**
|
|
7630
|
+
* `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
|
|
7631
|
+
* rebalance enqueues one job per (camera, profile). Refusing the second job —
|
|
7632
|
+
* what the engine did before — turned a fifteen-camera rebalance into fifteen
|
|
7633
|
+
* manual retries. Queued jobs run FIFO; a queued job that is cancelled never
|
|
7634
|
+
* runs at all.
|
|
7635
|
+
*/
|
|
7606
7636
|
var RelocateJobStateSchema = _enum([
|
|
7637
|
+
"queued",
|
|
7607
7638
|
"running",
|
|
7608
7639
|
"done",
|
|
7609
7640
|
"failed",
|
|
@@ -7638,6 +7669,15 @@ var RelocateFootageInputSchema = object({
|
|
|
7638
7669
|
/** Limits relocation to the logical profile class. Omit only for the
|
|
7639
7670
|
* pre-orchestration compatibility path. */
|
|
7640
7671
|
footageClass: RelocateFootageClassSchema.optional(),
|
|
7672
|
+
/** Scope the move to ONE camera. Absent = every camera on the source, which
|
|
7673
|
+
* is what a whole-disk drain means. The rebalance path always sets it: its
|
|
7674
|
+
* unit is a (camera, profile) pile, not a disk. */
|
|
7675
|
+
deviceId: number().int().optional(),
|
|
7676
|
+
/** Scope the move to specific segment profiles (`high` / `mid` / `low`).
|
|
7677
|
+
* Finer than `footageClass`, which cannot separate high from mid — and the
|
|
7678
|
+
* placement plan assigns those two independently, so a rebalance that could
|
|
7679
|
+
* only say "recordings" would move footage the plan never asked to move. */
|
|
7680
|
+
profiles: array(string()).optional(),
|
|
7641
7681
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
7642
7682
|
* never allowed to starve live writers. */
|
|
7643
7683
|
throttleMbps: number().min(1).max(1e3).optional()
|
|
@@ -7773,6 +7813,21 @@ var StorageLocationSchema = object({
|
|
|
7773
7813
|
nodeId: string().optional(),
|
|
7774
7814
|
isDefault: boolean().default(false),
|
|
7775
7815
|
isSystem: boolean().default(false),
|
|
7816
|
+
/**
|
|
7817
|
+
* Operator opt-in: whether consumers that BALANCE across several locations
|
|
7818
|
+
* of a type may write here. Recordings reads it today; event media and
|
|
7819
|
+
* backups are the next consumers, which is why the flag lives on the
|
|
7820
|
+
* location rather than in any one addon's store — nothing has to be
|
|
7821
|
+
* extended to add the next consumer.
|
|
7822
|
+
*
|
|
7823
|
+
* OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
|
|
7824
|
+
* flag existed reads back with no flag and keeps working exactly as before;
|
|
7825
|
+
* that is the whole compat story, and it is why no migration ships with it.
|
|
7826
|
+
* A newly CREATED sibling is stamped `false` by the orchestrator (creating a
|
|
7827
|
+
* disk must not silently start writing to it); the default of a type is
|
|
7828
|
+
* always stamped `true`.
|
|
7829
|
+
*/
|
|
7830
|
+
enabled: boolean().optional(),
|
|
7776
7831
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
7777
7832
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
7778
7833
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -12325,7 +12380,8 @@ method(object({
|
|
|
12325
12380
|
}), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
|
|
12326
12381
|
/**
|
|
12327
12382
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
12328
|
-
* filesystem
|
|
12383
|
+
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
12384
|
+
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
12329
12385
|
* admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
|
|
12330
12386
|
* (one provider per node); the hub calls it with `{nodeId}` so the codegen
|
|
12331
12387
|
* routes to that exact node (default `nodeIdMode:'routing'`).
|
|
@@ -14166,6 +14222,13 @@ var MaskGridDimsSchema = object({
|
|
|
14166
14222
|
* `package-event` are pure trigger kinds (no urgency dimension). Extending
|
|
14167
14223
|
* this one field keeps the schema additive — a rule still declares exactly
|
|
14168
14224
|
* one trigger.
|
|
14225
|
+
*
|
|
14226
|
+
* AUDIO rules add no member here, for the reason occupancy added none: the
|
|
14227
|
+
* enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
|
|
14228
|
+
* mirror.ts` fails the build on a member the app cannot render) and every
|
|
14229
|
+
* member costs a release train. A sustained-sound rule is therefore an
|
|
14230
|
+
* `immediate` rule carrying {@link NcConditions.audio} — the condition is the
|
|
14231
|
+
* trigger discriminator, exactly as `occupancy` is on `device-event`.
|
|
14169
14232
|
*/
|
|
14170
14233
|
var NcDeliverySchema = _enum([
|
|
14171
14234
|
"immediate",
|
|
@@ -14180,15 +14243,32 @@ var NcDeliverySchema = _enum([
|
|
|
14180
14243
|
* depend on a provider's raw event name or payload shape.
|
|
14181
14244
|
*/
|
|
14182
14245
|
var NcSystemEventKindSchema = _enum([
|
|
14183
|
-
"
|
|
14184
|
-
"
|
|
14246
|
+
"device-online",
|
|
14247
|
+
"device-offline",
|
|
14248
|
+
"device-disabled",
|
|
14249
|
+
"device-enabled",
|
|
14185
14250
|
"stream-online",
|
|
14186
14251
|
"stream-offline",
|
|
14187
14252
|
"node-online",
|
|
14188
14253
|
"node-offline",
|
|
14189
14254
|
"addon-update-available",
|
|
14190
|
-
"server-update-available"
|
|
14255
|
+
"server-update-available",
|
|
14256
|
+
"alarm-triggered",
|
|
14257
|
+
"alarm-armed",
|
|
14258
|
+
"alarm-disarmed",
|
|
14259
|
+
"camera-online",
|
|
14260
|
+
"camera-offline",
|
|
14261
|
+
"camera-disabled",
|
|
14262
|
+
"camera-enabled"
|
|
14263
|
+
]);
|
|
14264
|
+
/** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
|
|
14265
|
+
var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
|
|
14266
|
+
"camera-online",
|
|
14267
|
+
"camera-offline",
|
|
14268
|
+
"camera-disabled",
|
|
14269
|
+
"camera-enabled"
|
|
14191
14270
|
]);
|
|
14271
|
+
NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
|
|
14192
14272
|
/**
|
|
14193
14273
|
* One coherent system-event condition. `kinds` is the required opt-in safety
|
|
14194
14274
|
* gate; the remaining lists are optional narrowing filters relevant to the
|
|
@@ -14197,6 +14277,18 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14197
14277
|
var NcSystemEventConditionSchema = object({
|
|
14198
14278
|
kinds: array(NcSystemEventKindSchema).min(1),
|
|
14199
14279
|
deviceIds: array(number().int()).min(1).optional(),
|
|
14280
|
+
/**
|
|
14281
|
+
* Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
|
|
14282
|
+
* `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
|
|
14283
|
+
* is what a liveness rule means when nobody said otherwise.
|
|
14284
|
+
*
|
|
14285
|
+
* This is where "only my cameras" is expressed, and it lives on the rule for
|
|
14286
|
+
* one reason: the intake cannot know which devices this household cares
|
|
14287
|
+
* about, and a producer-side filter is one no operator can change. Fails
|
|
14288
|
+
* CLOSED — a subject whose device type is unknown (an id the device mirror
|
|
14289
|
+
* does not carry) matches no `deviceTypes` list.
|
|
14290
|
+
*/
|
|
14291
|
+
deviceTypes: array(string().min(1)).min(1).optional(),
|
|
14200
14292
|
nodeIds: array(string().min(1)).min(1).optional(),
|
|
14201
14293
|
packageNames: array(string().min(1)).min(1).optional()
|
|
14202
14294
|
});
|
|
@@ -14247,6 +14339,47 @@ var NcOccupancyConditionSchema = object({
|
|
|
14247
14339
|
sustainSeconds: number().int().min(0).max(3600).default(15)
|
|
14248
14340
|
});
|
|
14249
14341
|
/**
|
|
14342
|
+
* Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
|
|
14343
|
+
*
|
|
14344
|
+
* Operator-approved vocabulary (2026-08-12, option A — the same one the
|
|
14345
|
+
* reference notifier uses, so an operator moving between them re-uses what
|
|
14346
|
+
* they already know): a rule matches when, over a sampling window of
|
|
14347
|
+
* `samplingSeconds`, at least `hitPercent`% of the audio samples in that
|
|
14348
|
+
* window are HITS. A sample is a hit when it satisfies BOTH present filters:
|
|
14349
|
+
*
|
|
14350
|
+
* - `dbThreshold` — its level is at or above this many dBFS (see
|
|
14351
|
+
* {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
|
|
14352
|
+
* - `labels` — the classifier put at least one of these labels on it.
|
|
14353
|
+
*
|
|
14354
|
+
* Both are OPTIONAL and independent, which is the point of the shape: a
|
|
14355
|
+
* loudness rule ("something loud at 3am") needs no model to be right, and a
|
|
14356
|
+
* label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
|
|
14357
|
+
* is given** — a window in which every sample is trivially a hit would fire on
|
|
14358
|
+
* silence, so the engine refuses such a condition rather than notifying on
|
|
14359
|
+
* nothing (the schema cannot express "at least one of" without becoming a
|
|
14360
|
+
* ZodEffects the cap path would have to special-case).
|
|
14361
|
+
*
|
|
14362
|
+
* `hitPercent` is over the samples the window actually HOLDS, and the window
|
|
14363
|
+
* must be FULL before it can match — a window that has been open for two
|
|
14364
|
+
* seconds of its ten is 100% of nothing, and firing on it would make
|
|
14365
|
+
* `samplingSeconds` decorative.
|
|
14366
|
+
*
|
|
14367
|
+
* Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
|
|
14368
|
+
* `audio-*` ids). Both spellings are accepted — the matcher normalizes the
|
|
14369
|
+
* `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
|
|
14370
|
+
* an operator who typed `dog` mean the same thing.
|
|
14371
|
+
*/
|
|
14372
|
+
var NcAudioConditionSchema = object({
|
|
14373
|
+
/** Audio macro labels; absent = any sound (level-only rule). */
|
|
14374
|
+
labels: array(string().min(1)).min(1).optional(),
|
|
14375
|
+
/** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
|
|
14376
|
+
dbThreshold: number().min(-96).max(0).optional(),
|
|
14377
|
+
/** Percentage of the window's samples that must be hits (1–100). */
|
|
14378
|
+
hitPercent: number().int().min(1).max(100).default(60),
|
|
14379
|
+
/** Length of the sampling window in seconds. */
|
|
14380
|
+
samplingSeconds: number().int().min(1).max(300).default(10)
|
|
14381
|
+
});
|
|
14382
|
+
/**
|
|
14250
14383
|
* Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
|
|
14251
14384
|
*
|
|
14252
14385
|
* The values are not symmetric, and deliberately so — the absent value has to
|
|
@@ -14519,7 +14652,33 @@ var NcConditionsSchema = object({
|
|
|
14519
14652
|
* threshold and holds for `sustainSeconds`. Fail-closed on missing
|
|
14520
14653
|
* substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
|
|
14521
14654
|
*/
|
|
14522
|
-
occupancy: NcOccupancyConditionSchema.optional()
|
|
14655
|
+
occupancy: NcOccupancyConditionSchema.optional(),
|
|
14656
|
+
/**
|
|
14657
|
+
* IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
|
|
14658
|
+
* `samplingSeconds` window clear the optional `dbThreshold` and carry one of
|
|
14659
|
+
* the optional `labels`. Fail-closed on missing substrate (no audio samples,
|
|
14660
|
+
* a window that is not full yet, neither filter given). See
|
|
14661
|
+
* {@link NcAudioCondition}.
|
|
14662
|
+
*
|
|
14663
|
+
* Presence of this key is what makes a rule an AUDIO rule: the engine fires
|
|
14664
|
+
* it ONLY on a confirmed audio window, and a rule carrying it never fires on
|
|
14665
|
+
* a detection, a track or a device event (the same fail-closed pairing
|
|
14666
|
+
* `occupancy` has with the `device-event` trigger). That is how audio labels
|
|
14667
|
+
* leave `classes`: an audio rule names its sounds HERE, and the legacy path
|
|
14668
|
+
* (an `immediate` rule naming an `audio-*` class, one notification per
|
|
14669
|
+
* classified sample) stays exactly as it was for rules that already use it.
|
|
14670
|
+
*
|
|
14671
|
+
* NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
|
|
14672
|
+
* rather than an oversight: the viewer mirrors the descriptor enums BY HAND
|
|
14673
|
+
* (`camstack/src/data/notification-center.ts`, guarded by
|
|
14674
|
+
* `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
|
|
14675
|
+
* condition fields it does not know when a rule is saved from the phone.
|
|
14676
|
+
* Publishing an editor for a condition the app cannot round-trip is how an
|
|
14677
|
+
* operator loses a rule's conditions by opening it — so the descriptor, the
|
|
14678
|
+
* admin widget and the viewer mirror land together (P2 + P3), and only then
|
|
14679
|
+
* does an audio rule become authorable.
|
|
14680
|
+
*/
|
|
14681
|
+
audio: NcAudioConditionSchema.optional()
|
|
14523
14682
|
});
|
|
14524
14683
|
/** One delivery target: a `notification-output` Target ref + passthrough params. */
|
|
14525
14684
|
var NcRuleTargetSchema = object({
|
|
@@ -14633,6 +14792,73 @@ var NcThrottleSchema = object({
|
|
|
14633
14792
|
*/
|
|
14634
14793
|
granularity: NcThrottleGranularitySchema.optional()
|
|
14635
14794
|
});
|
|
14795
|
+
/**
|
|
14796
|
+
* How long the confirm gate may hold ONE notification, and how big the picture
|
|
14797
|
+
* it judges may be.
|
|
14798
|
+
*
|
|
14799
|
+
* The clamp is the product decision, not a coincidence of the model: p50 was
|
|
14800
|
+
* 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
|
|
14801
|
+
* arrives after the visitor has gone is not a notification. 448 px was enough
|
|
14802
|
+
* to score 16/16 on the operator's parking scenario — bigger costs latency and
|
|
14803
|
+
* tokens for pixels the model pools away.
|
|
14804
|
+
*/
|
|
14805
|
+
var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
|
|
14806
|
+
var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
|
|
14807
|
+
var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
|
|
14808
|
+
/** Comparison the model's COUNT must satisfy for the notification to fire. */
|
|
14809
|
+
var NcConfirmExpectSchema = object({
|
|
14810
|
+
op: _enum([
|
|
14811
|
+
">=",
|
|
14812
|
+
">",
|
|
14813
|
+
"<=",
|
|
14814
|
+
"<",
|
|
14815
|
+
"=="
|
|
14816
|
+
]),
|
|
14817
|
+
count: number().int().min(0).max(1e3)
|
|
14818
|
+
});
|
|
14819
|
+
/**
|
|
14820
|
+
* AI CONFIRM — a vision model looks at the picture this notification is about
|
|
14821
|
+
* to ship and says whether it agrees with the rule.
|
|
14822
|
+
*
|
|
14823
|
+
* It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
|
|
14824
|
+
* crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
|
|
14825
|
+
* on the operator's phone is not a verdict about this notification.
|
|
14826
|
+
*
|
|
14827
|
+
* FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
|
|
14828
|
+
* whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
|
|
14829
|
+
* the default and every fail-open is COUNTED, because a gate that always fails
|
|
14830
|
+
* open looks in the log exactly like a gate that works.
|
|
14831
|
+
*
|
|
14832
|
+
* Every field is `.optional()` rather than relied on as a Zod default at the
|
|
14833
|
+
* runtime seam: a Zod default does NOT run on the addon→addon cap path (three
|
|
14834
|
+
* production failures in one day), so the gate reads absent as the constant
|
|
14835
|
+
* above rather than trusting a parse it may never have seen.
|
|
14836
|
+
*/
|
|
14837
|
+
var NcConfirmSchema = object({
|
|
14838
|
+
/** Off unless asked for. An absent `confirm` and `enabled:false` are the
|
|
14839
|
+
* same thing, and both mean "deliver exactly as before". */
|
|
14840
|
+
enabled: boolean().default(false),
|
|
14841
|
+
/** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
|
|
14842
|
+
profileId: string().optional(),
|
|
14843
|
+
/**
|
|
14844
|
+
* The operator's question, in his own words. Absent = a question derived
|
|
14845
|
+
* from the rule (its class and its expectation).
|
|
14846
|
+
*
|
|
14847
|
+
* NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
|
|
14848
|
+
* banners, signage and plates as instructions if you let them reach the
|
|
14849
|
+
* prompt — proven live — so the authoritative contract stays in the system
|
|
14850
|
+
* turn and only rule-authored words land here.
|
|
14851
|
+
*/
|
|
14852
|
+
prompt: string().max(1e3).optional(),
|
|
14853
|
+
/** Fire only when the model's count satisfies this. Absent = the model's
|
|
14854
|
+
* own boolean verdict decides. */
|
|
14855
|
+
expect: NcConfirmExpectSchema.optional(),
|
|
14856
|
+
timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
|
|
14857
|
+
/** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
|
|
14858
|
+
onTimeout: _enum(["fire", "suppress"]).default("fire"),
|
|
14859
|
+
/** Longest edge the judged image is downscaled to before it is sent. */
|
|
14860
|
+
maxImagePx: number().int().min(64).max(2048).default(448)
|
|
14861
|
+
});
|
|
14636
14862
|
/** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
|
|
14637
14863
|
var NcRuleInputSchema = object({
|
|
14638
14864
|
name: string().min(1).max(200),
|
|
@@ -14693,7 +14919,13 @@ var NcRuleInputSchema = object({
|
|
|
14693
14919
|
* `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
|
|
14694
14920
|
* shape as every other actuation.
|
|
14695
14921
|
*/
|
|
14696
|
-
actions: NcRuleActionsSchema.optional()
|
|
14922
|
+
actions: NcRuleActionsSchema.optional(),
|
|
14923
|
+
/**
|
|
14924
|
+
* AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
|
|
14925
|
+
* a rule that predates the gate must keep delivering byte-for-byte as it
|
|
14926
|
+
* did, and absent is the only way to say that without a migration.
|
|
14927
|
+
*/
|
|
14928
|
+
confirm: NcConfirmSchema.optional()
|
|
14697
14929
|
});
|
|
14698
14930
|
/**
|
|
14699
14931
|
* Partial patch for `updateRule` — any subset of the input fields, plus the
|
|
@@ -14704,7 +14936,37 @@ var NcRuleInputSchema = object({
|
|
|
14704
14936
|
* still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
|
|
14705
14937
|
* `updateRule` patch.
|
|
14706
14938
|
*/
|
|
14707
|
-
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
14939
|
+
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
14940
|
+
disabledTargetIds: array(string()).optional(),
|
|
14941
|
+
/**
|
|
14942
|
+
* `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
|
|
14943
|
+
*
|
|
14944
|
+
* It makes the key optional to SUPPLY; the parse still materialises the
|
|
14945
|
+
* default when the key is absent. And `NcRuleStore.update` merges with
|
|
14946
|
+
* `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
|
|
14947
|
+
* one — which made every partial edit destructive:
|
|
14948
|
+
*
|
|
14949
|
+
* nc.updateRule({ throttle }) → conditions reset to `{}`
|
|
14950
|
+
* nc.setRuleTargetEnabled(...) → conditions reset to `{}`
|
|
14951
|
+
* setEnabled(ruleId, false) → conditions reset to `{}`
|
|
14952
|
+
*
|
|
14953
|
+
* A rule scoped to one camera and one zone silently became a rule that
|
|
14954
|
+
* matches EVERY event on EVERY camera, and lost its `media` policy
|
|
14955
|
+
* (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
|
|
14956
|
+
* live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
|
|
14957
|
+
* within a minute of a two-field patch.
|
|
14958
|
+
*
|
|
14959
|
+
* So every defaulted field is re-declared here WITHOUT its default. The
|
|
14960
|
+
* inner defaults still apply when the caller DOES send the key — `{}` for
|
|
14961
|
+
* conditions remains a real instruction ("clear them") — and only the
|
|
14962
|
+
* absent key is now genuinely absent.
|
|
14963
|
+
*/
|
|
14964
|
+
enabled: boolean().optional(),
|
|
14965
|
+
conditions: NcConditionsSchema.optional(),
|
|
14966
|
+
media: NcMediaPolicySchema.optional(),
|
|
14967
|
+
throttle: NcThrottleSchema.optional(),
|
|
14968
|
+
priority: number().int().min(1).max(5).optional()
|
|
14969
|
+
});
|
|
14708
14970
|
/** A persisted rule. */
|
|
14709
14971
|
var NcRuleSchema = NcRuleInputSchema.extend({
|
|
14710
14972
|
id: string(),
|
|
@@ -15005,6 +15267,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
|
|
|
15005
15267
|
* Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
|
|
15006
15268
|
* copy would lie the first time a rule is disabled.
|
|
15007
15269
|
*/
|
|
15270
|
+
/**
|
|
15271
|
+
* Why a device a mode NAMES is nonetheless not armed by it.
|
|
15272
|
+
*
|
|
15273
|
+
* Each value is an existing authority, never a new flag (D62): `muted` is the
|
|
15274
|
+
* per-camera notification switch the Notification Center already owns,
|
|
15275
|
+
* `detection-off` is the device's own detection binding being inactive, and
|
|
15276
|
+
* `offline` is the device manager's liveness. A fourth reason would mean a
|
|
15277
|
+
* fourth authority, and inventing one here is how a panel starts disagreeing
|
|
15278
|
+
* with the switches the operator actually used.
|
|
15279
|
+
*/
|
|
15280
|
+
var NcAlarmSkipReasonSchema = _enum([
|
|
15281
|
+
"muted",
|
|
15282
|
+
"detection-off",
|
|
15283
|
+
"offline"
|
|
15284
|
+
]);
|
|
15285
|
+
var NcAlarmSkippedDeviceSchema = object({
|
|
15286
|
+
deviceId: number().int(),
|
|
15287
|
+
reason: NcAlarmSkipReasonSchema
|
|
15288
|
+
});
|
|
15008
15289
|
var NcAlarmModeCoverageSchema = object({
|
|
15009
15290
|
mode: AlarmArmModeSchema,
|
|
15010
15291
|
/** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
|
|
@@ -15012,7 +15293,18 @@ var NcAlarmModeCoverageSchema = object({
|
|
|
15012
15293
|
/** At least one covering rule has no device scope, so the mode covers all. */
|
|
15013
15294
|
allDevices: boolean(),
|
|
15014
15295
|
/** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
|
|
15015
|
-
deviceIds: array(number().int())
|
|
15296
|
+
deviceIds: array(number().int()),
|
|
15297
|
+
/**
|
|
15298
|
+
* Devices this mode NAMES but cannot actually arm, each with the switch that
|
|
15299
|
+
* excludes it.
|
|
15300
|
+
*
|
|
15301
|
+
* "Away armed — 12 cameras" is a promise, and a muted camera among those
|
|
15302
|
+
* twelve makes it false in exactly the way nobody notices until an incident.
|
|
15303
|
+
* Defaulted to `[]` so a coverage answer computed before this field existed
|
|
15304
|
+
* still parses as "nothing known to be skipped" rather than failing the whole
|
|
15305
|
+
* alarm tab.
|
|
15306
|
+
*/
|
|
15307
|
+
skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
|
|
15016
15308
|
});
|
|
15017
15309
|
var NcAlarmConfigSchema = object({
|
|
15018
15310
|
/**
|
|
@@ -17844,9 +18136,16 @@ var CameraStatusSchema = object({
|
|
|
17844
18136
|
audio: CameraAudioStatusSchema.nullable(),
|
|
17845
18137
|
recording: CameraRecordingStatusSchema.nullable(),
|
|
17846
18138
|
/**
|
|
17847
|
-
* Per-camera
|
|
18139
|
+
* Per-camera functions an OPERATOR has turned off
|
|
17848
18140
|
* ([D61](../../../../docs/decisions/adr-0067.md)).
|
|
17849
18141
|
*
|
|
18142
|
+
* Composed from the AUTHORITIES themselves — the wrapper bindings,
|
|
18143
|
+
* `RecordingConfig.enabled`, the notification mute, the broker's audio
|
|
18144
|
+
* policy, the camera's own microphone — via `composeSwitchedOff`, not from
|
|
18145
|
+
* the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
|
|
18146
|
+
* The badge outlives the control panel: the panel was a convenience, this is
|
|
18147
|
+
* the difference between a camera being off and a camera being dead.
|
|
18148
|
+
*
|
|
17850
18149
|
* This is the difference between DISABLED and BROKEN. A camera whose
|
|
17851
18150
|
* `detection` block reports zero fps and whose `switchedOff` contains
|
|
17852
18151
|
* `'object-detection'` was switched off by a person; the same camera with an
|
|
@@ -18453,24 +18752,28 @@ var snapshotCapability = {
|
|
|
18453
18752
|
*
|
|
18454
18753
|
* `getSnapshotOverview` is cache-only by contract: it answers from whatever
|
|
18455
18754
|
* the wrapper happens to hold and never captures. Under D93 the client
|
|
18456
|
-
* versions its image URL on that answer, and an image REQUEST
|
|
18457
|
-
*
|
|
18458
|
-
*
|
|
18459
|
-
*
|
|
18460
|
-
*
|
|
18461
|
-
*
|
|
18462
|
-
*
|
|
18463
|
-
*
|
|
18755
|
+
* versions its image URL on that answer, and an image REQUEST was the only
|
|
18756
|
+
* demand signal. Both of those are satisfiable by the client's own image
|
|
18757
|
+
* cache — `expo-image` is URL-keyed and never revalidates — so a URL painted
|
|
18758
|
+
* in a previous session comes off disk with no network, no demand, and no
|
|
18759
|
+
* capture. Measured on the live hub: reopening after two minutes idle
|
|
18760
|
+
* painted 15 of 16 tiles at **168 s old** with zero HTTP requests, and the
|
|
18761
|
+
* fleet only recovered because a later poll happened to observe a different
|
|
18762
|
+
* identity.
|
|
18464
18763
|
*
|
|
18465
18764
|
* ## The two properties that fix it
|
|
18466
18765
|
*
|
|
18467
18766
|
* **It is an RPC, so no client cache can answer it.** The demand signal
|
|
18468
|
-
* always reaches the wrapper. This method therefore
|
|
18469
|
-
*
|
|
18470
|
-
*
|
|
18471
|
-
*
|
|
18472
|
-
*
|
|
18473
|
-
*
|
|
18767
|
+
* always reaches the wrapper. This method therefore CAPTURES, where
|
|
18768
|
+
* `getSnapshotOverview` must never (D93) — the distinction is not "one is
|
|
18769
|
+
* newer" but that the overview poll is app-wide (a capturing overview would
|
|
18770
|
+
* dial every camera on the install) while this is called by a rendered
|
|
18771
|
+
* surface naming the tiles it is actually painting, at the width it is
|
|
18772
|
+
* painting them.
|
|
18773
|
+
*
|
|
18774
|
+
* Since 2026-08-11 this is the ONLY thing that refreshes a snapshot: the
|
|
18775
|
+
* server-side keep-warm loop was removed (operator directive — on-demand,
|
|
18776
|
+
* always), so a camera nobody is looking at costs nothing at all.
|
|
18474
18777
|
*
|
|
18475
18778
|
* **It waits, briefly and boundedly, for the capture it triggered.** The
|
|
18476
18779
|
* returned `capturedAt` is the frame the link will serve, not the frame the
|
|
@@ -24687,7 +24990,19 @@ var RecordingManifestSchema = object({
|
|
|
24687
24990
|
* profiles/subtrees/locations on this node). */
|
|
24688
24991
|
var RecordingDeviceUsageSchema = object({
|
|
24689
24992
|
deviceId: number(),
|
|
24690
|
-
usedBytes: number()
|
|
24993
|
+
usedBytes: number(),
|
|
24994
|
+
/**
|
|
24995
|
+
* Start of this camera's OLDEST indexed segment, across every profile and
|
|
24996
|
+
* location — the "Oldest footage" column in Recordings → Storage, and the
|
|
24997
|
+
* only honest answer to "is retention actually holding?" per camera.
|
|
24998
|
+
*
|
|
24999
|
+
* `null` = the camera has no footage. OPTIONAL because a recorder that
|
|
25000
|
+
* predates this field omits it entirely, and a hub whose types carry the
|
|
25001
|
+
* field must keep validating that older provider's payload: the framework
|
|
25002
|
+
* (types) and the addon ship on different trains, and the addon is usually
|
|
25003
|
+
* the later of the two.
|
|
25004
|
+
*/
|
|
25005
|
+
oldestMs: number().nullable().optional()
|
|
24691
25006
|
});
|
|
24692
25007
|
/** Recording storage usage + capacity for one storage location. */
|
|
24693
25008
|
var RecordingLocationUsageSchema = object({
|
|
@@ -24715,6 +25030,57 @@ var RecordingStorageUsageSchema = object({
|
|
|
24715
25030
|
locations: array(RecordingLocationUsageSchema)
|
|
24716
25031
|
});
|
|
24717
25032
|
/**
|
|
25033
|
+
* The OPERATOR-ARMED half of multi-location recordings (D116).
|
|
25034
|
+
*
|
|
25035
|
+
* The placement plan decides where NEW writes go and moves nothing. A rebalance
|
|
25036
|
+
* is the operator asking for the EXISTING archive to be brought into line with
|
|
25037
|
+
* that plan: one relocate job per (camera, profile) pile that sits on the wrong
|
|
25038
|
+
* location, run FIFO behind the single-flight mover.
|
|
25039
|
+
*
|
|
25040
|
+
* `plan…` and `start…` return the SAME shape deliberately — what the operator
|
|
25041
|
+
* confirms is exactly what gets enqueued, and `jobIds` is the only difference
|
|
25042
|
+
* (empty on the plan).
|
|
25043
|
+
*/
|
|
25044
|
+
var RecordingRebalanceMoveSchema = object({
|
|
25045
|
+
deviceId: number(),
|
|
25046
|
+
profile: string(),
|
|
25047
|
+
fromLocationId: string(),
|
|
25048
|
+
toLocationId: string(),
|
|
25049
|
+
bytes: number(),
|
|
25050
|
+
files: number().int()
|
|
25051
|
+
});
|
|
25052
|
+
/** Why a pile that is out of place is staying there. Every refusal is
|
|
25053
|
+
* reported: a rebalance that silently drops a camera reads exactly like one
|
|
25054
|
+
* that had nothing to do. */
|
|
25055
|
+
var RecordingRebalanceSkipReasonSchema = _enum([
|
|
25056
|
+
"unassigned",
|
|
25057
|
+
"target-not-writable",
|
|
25058
|
+
"below-threshold",
|
|
25059
|
+
"no-headroom"
|
|
25060
|
+
]);
|
|
25061
|
+
var RecordingRebalanceSkipSchema = object({
|
|
25062
|
+
deviceId: number(),
|
|
25063
|
+
profile: string(),
|
|
25064
|
+
fromLocationId: string(),
|
|
25065
|
+
/** The location the plan wants; null when the camera has no assignment. */
|
|
25066
|
+
toLocationId: string().nullable(),
|
|
25067
|
+
bytes: number(),
|
|
25068
|
+
reason: RecordingRebalanceSkipReasonSchema
|
|
25069
|
+
});
|
|
25070
|
+
var RecordingRebalancePlanSchema = object({
|
|
25071
|
+
moves: array(RecordingRebalanceMoveSchema),
|
|
25072
|
+
skipped: array(RecordingRebalanceSkipSchema),
|
|
25073
|
+
bytesToMove: number(),
|
|
25074
|
+
/** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
|
|
25075
|
+
jobIds: array(string())
|
|
25076
|
+
});
|
|
25077
|
+
var RecordingRebalanceInputSchema = object({
|
|
25078
|
+
/** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
|
|
25079
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
25080
|
+
/** Ignore piles smaller than this (default 1 GB). */
|
|
25081
|
+
minMoveGb: number().min(0).optional()
|
|
25082
|
+
});
|
|
25083
|
+
/**
|
|
24718
25084
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
24719
25085
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
24720
25086
|
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
@@ -24877,9 +25243,24 @@ method(object({
|
|
|
24877
25243
|
}), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
24878
25244
|
kind: "mutation",
|
|
24879
25245
|
auth: "admin"
|
|
25246
|
+
}), method(RelocateFootageInputSchema, object({ jobId: string() }), {
|
|
25247
|
+
kind: "mutation",
|
|
25248
|
+
auth: "admin"
|
|
25249
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
25250
|
+
kind: "query",
|
|
25251
|
+
auth: "admin"
|
|
25252
|
+
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
25253
|
+
kind: "mutation",
|
|
25254
|
+
auth: "admin"
|
|
25255
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
25256
|
+
kind: "query",
|
|
25257
|
+
auth: "admin"
|
|
25258
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
25259
|
+
kind: "mutation",
|
|
25260
|
+
auth: "admin"
|
|
24880
25261
|
});
|
|
24881
25262
|
/**
|
|
24882
|
-
* `
|
|
25263
|
+
* `recording-export` cap — render a footage time range into a single downloadable
|
|
24883
25264
|
* MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
|
|
24884
25265
|
* bounded lifetime with a durable history, auto-expiry, and optional
|
|
24885
25266
|
* delete-after-download.
|
|
@@ -24894,10 +25275,42 @@ method(object({
|
|
|
24894
25275
|
*/
|
|
24895
25276
|
/** Playback-speed multiplier for the render (1 = realtime). */
|
|
24896
25277
|
var ExportSpeedSchema = number().min(.25).max(32);
|
|
25278
|
+
/**
|
|
25279
|
+
* One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
|
|
25280
|
+
*
|
|
25281
|
+
* Relative and not absolute epoch on purpose: the renderer's frame-select
|
|
25282
|
+
* expression sees ffmpeg's `t`, which starts at 0 for the export's source
|
|
25283
|
+
* playlist. Handing it absolute epochs would make every call site responsible
|
|
25284
|
+
* for the same subtraction, and the one that forgot would emit a filter that
|
|
25285
|
+
* selects nothing — silently, as a uniform timelapse.
|
|
25286
|
+
*/
|
|
25287
|
+
var ExportDenseRangeSchema = object({
|
|
25288
|
+
fromSec: number().nonnegative(),
|
|
25289
|
+
toSec: number().nonnegative()
|
|
25290
|
+
}).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
|
|
25291
|
+
/**
|
|
25292
|
+
* Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
|
|
25293
|
+
* listed ranges and at the base `everyMs` everywhere else.
|
|
25294
|
+
*
|
|
25295
|
+
* `everyMs` must be strictly smaller than the base cadence — a dense rate that
|
|
25296
|
+
* is not denser renders a uniform timelapse the operator believes is two-rate.
|
|
25297
|
+
*/
|
|
25298
|
+
var ExportDenseSchema = object({
|
|
25299
|
+
everyMs: number().int().positive(),
|
|
25300
|
+
ranges: array(ExportDenseRangeSchema).min(1).max(200)
|
|
25301
|
+
});
|
|
24897
25302
|
/** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
|
|
24898
25303
|
var ExportTimelapseSchema = object({
|
|
24899
25304
|
everyMs: number().int().positive(),
|
|
24900
|
-
outputFps: number().int().min(1).max(60).optional()
|
|
25305
|
+
outputFps: number().int().min(1).max(60).optional(),
|
|
25306
|
+
/** Optional second, FASTER rate over the intervals that matter. */
|
|
25307
|
+
dense: ExportDenseSchema.optional()
|
|
25308
|
+
}).superRefine((v, ctx) => {
|
|
25309
|
+
if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
|
|
25310
|
+
code: ZodIssueCode.custom,
|
|
25311
|
+
message: "dense.everyMs must be strictly smaller than the base everyMs",
|
|
25312
|
+
path: ["dense", "everyMs"]
|
|
25313
|
+
});
|
|
24901
25314
|
});
|
|
24902
25315
|
/**
|
|
24903
25316
|
* Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
|
|
@@ -24955,6 +25368,19 @@ var ExportDownloadSchema = object({
|
|
|
24955
25368
|
url: string(),
|
|
24956
25369
|
endpoints: array(string())
|
|
24957
25370
|
});
|
|
25371
|
+
/**
|
|
25372
|
+
* A finished export's bytes, inline.
|
|
25373
|
+
*
|
|
25374
|
+
* `bytes` is the DECODED length — the number the caller bounds and logs
|
|
25375
|
+
* against, so nobody has to infer it from the base64 length.
|
|
25376
|
+
*/
|
|
25377
|
+
var ExportBytesSchema = object({
|
|
25378
|
+
base64: string(),
|
|
25379
|
+
contentType: string(),
|
|
25380
|
+
/** Suggested filename, extension included. */
|
|
25381
|
+
name: string(),
|
|
25382
|
+
bytes: number().int().nonnegative()
|
|
25383
|
+
});
|
|
24958
25384
|
method(object({
|
|
24959
25385
|
deviceId: number(),
|
|
24960
25386
|
profile: string(),
|
|
@@ -24979,6 +25405,9 @@ method(object({
|
|
|
24979
25405
|
}), method(object({ exportId: string() }), ExportDownloadSchema, {
|
|
24980
25406
|
kind: "query",
|
|
24981
25407
|
auth: "protected"
|
|
25408
|
+
}), method(object({ exportId: string() }), ExportBytesSchema, {
|
|
25409
|
+
kind: "query",
|
|
25410
|
+
auth: "protected"
|
|
24982
25411
|
});
|
|
24983
25412
|
/**
|
|
24984
25413
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
@@ -31735,6 +32164,12 @@ Object.freeze({
|
|
|
31735
32164
|
addonId: null,
|
|
31736
32165
|
access: "create"
|
|
31737
32166
|
},
|
|
32167
|
+
"recording.cancelRelocateJob": {
|
|
32168
|
+
capName: "recording",
|
|
32169
|
+
capScope: "system",
|
|
32170
|
+
addonId: null,
|
|
32171
|
+
access: "create"
|
|
32172
|
+
},
|
|
31738
32173
|
"recording.cancelStorageMigrationMove": {
|
|
31739
32174
|
capName: "recording",
|
|
31740
32175
|
capScope: "system",
|
|
@@ -31789,6 +32224,12 @@ Object.freeze({
|
|
|
31789
32224
|
addonId: null,
|
|
31790
32225
|
access: "view"
|
|
31791
32226
|
},
|
|
32227
|
+
"recording.listRelocateJobs": {
|
|
32228
|
+
capName: "recording",
|
|
32229
|
+
capScope: "system",
|
|
32230
|
+
addonId: null,
|
|
32231
|
+
access: "view"
|
|
32232
|
+
},
|
|
31792
32233
|
"recording.locateSegment": {
|
|
31793
32234
|
capName: "recording",
|
|
31794
32235
|
capScope: "system",
|
|
@@ -31801,6 +32242,12 @@ Object.freeze({
|
|
|
31801
32242
|
addonId: null,
|
|
31802
32243
|
access: "create"
|
|
31803
32244
|
},
|
|
32245
|
+
"recording.planStorageRebalance": {
|
|
32246
|
+
capName: "recording",
|
|
32247
|
+
capScope: "system",
|
|
32248
|
+
addonId: null,
|
|
32249
|
+
access: "view"
|
|
32250
|
+
},
|
|
31804
32251
|
"recording.pruneFootage": {
|
|
31805
32252
|
capName: "recording",
|
|
31806
32253
|
capScope: "system",
|
|
@@ -31825,6 +32272,12 @@ Object.freeze({
|
|
|
31825
32272
|
addonId: null,
|
|
31826
32273
|
access: "create"
|
|
31827
32274
|
},
|
|
32275
|
+
"recording.relocateFootage": {
|
|
32276
|
+
capName: "recording",
|
|
32277
|
+
capScope: "system",
|
|
32278
|
+
addonId: null,
|
|
32279
|
+
access: "create"
|
|
32280
|
+
},
|
|
31828
32281
|
"recording.renderClip": {
|
|
31829
32282
|
capName: "recording",
|
|
31830
32283
|
capScope: "system",
|
|
@@ -31861,38 +32314,50 @@ Object.freeze({
|
|
|
31861
32314
|
addonId: null,
|
|
31862
32315
|
access: "create"
|
|
31863
32316
|
},
|
|
32317
|
+
"recording.startStorageRebalance": {
|
|
32318
|
+
capName: "recording",
|
|
32319
|
+
capScope: "system",
|
|
32320
|
+
addonId: null,
|
|
32321
|
+
access: "create"
|
|
32322
|
+
},
|
|
31864
32323
|
"recordingExport.cancelExport": {
|
|
31865
|
-
capName: "
|
|
32324
|
+
capName: "recording-export",
|
|
31866
32325
|
capScope: "system",
|
|
31867
32326
|
addonId: null,
|
|
31868
32327
|
access: "create"
|
|
31869
32328
|
},
|
|
31870
32329
|
"recordingExport.createExport": {
|
|
31871
|
-
capName: "
|
|
32330
|
+
capName: "recording-export",
|
|
31872
32331
|
capScope: "system",
|
|
31873
32332
|
addonId: null,
|
|
31874
32333
|
access: "create"
|
|
31875
32334
|
},
|
|
31876
32335
|
"recordingExport.deleteExport": {
|
|
31877
|
-
capName: "
|
|
32336
|
+
capName: "recording-export",
|
|
31878
32337
|
capScope: "system",
|
|
31879
32338
|
addonId: null,
|
|
31880
32339
|
access: "delete"
|
|
31881
32340
|
},
|
|
31882
32341
|
"recordingExport.getDownloadUrl": {
|
|
31883
|
-
capName: "
|
|
32342
|
+
capName: "recording-export",
|
|
31884
32343
|
capScope: "system",
|
|
31885
32344
|
addonId: null,
|
|
31886
32345
|
access: "view"
|
|
31887
32346
|
},
|
|
31888
32347
|
"recordingExport.getExport": {
|
|
31889
|
-
capName: "
|
|
32348
|
+
capName: "recording-export",
|
|
31890
32349
|
capScope: "system",
|
|
31891
32350
|
addonId: null,
|
|
31892
32351
|
access: "view"
|
|
31893
32352
|
},
|
|
31894
32353
|
"recordingExport.listExports": {
|
|
31895
|
-
capName: "
|
|
32354
|
+
capName: "recording-export",
|
|
32355
|
+
capScope: "system",
|
|
32356
|
+
addonId: null,
|
|
32357
|
+
access: "view"
|
|
32358
|
+
},
|
|
32359
|
+
"recordingExport.readExportBytes": {
|
|
32360
|
+
capName: "recording-export",
|
|
31896
32361
|
capScope: "system",
|
|
31897
32362
|
addonId: null,
|
|
31898
32363
|
access: "view"
|
|
@@ -33269,6 +33734,104 @@ var FramerateField = number().int().min(1).max(60);
|
|
|
33269
33734
|
var TargetsField = array(NcRuleTargetSchema).min(1);
|
|
33270
33735
|
var PriorityField = number().int().min(1).max(5);
|
|
33271
33736
|
/**
|
|
33737
|
+
* Explicit override of the DENSE sampling cadence, seconds.
|
|
33738
|
+
*
|
|
33739
|
+
* Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
|
|
33740
|
+
* 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
|
|
33741
|
+
* made that same base 3 s and rendered a person pass as two frames.)
|
|
33742
|
+
*
|
|
33743
|
+
* THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
|
|
33744
|
+
* `denseCadenceSec` and played at `framerate` occupies
|
|
33745
|
+
*
|
|
33746
|
+
* outputSeconds = (rangeSec / denseCadenceSec) / framerate
|
|
33747
|
+
*
|
|
33748
|
+
* 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.
|
|
33749
|
+
* Halving this field doubles the frames INSIDE ranges only — the base cadence,
|
|
33750
|
+
* and therefore the length of a quiet night, does not move.
|
|
33751
|
+
*
|
|
33752
|
+
* Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
|
|
33753
|
+
* the recording has them returns the same frames, requested twice. Must be
|
|
33754
|
+
* STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
|
|
33755
|
+
* a uniform video the operator believes is two-rate — and upsert refuses it
|
|
33756
|
+
* rather than letting the export cap reject the render hours after the window.
|
|
33757
|
+
*/
|
|
33758
|
+
var DenseCadenceSecField = number().min(.1).max(3600);
|
|
33759
|
+
/**
|
|
33760
|
+
* Minimum seconds of OUTPUT video each detection range must occupy.
|
|
33761
|
+
*
|
|
33762
|
+
* The operator-facing form of the arithmetic above: instead of solving for a
|
|
33763
|
+
* cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
|
|
33764
|
+
* 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
|
|
33765
|
+
* that range every ~583 ms.
|
|
33766
|
+
*
|
|
33767
|
+
* ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
|
|
33768
|
+
* ranges are terms of a single ffmpeg `select` expression that cannot vary rate
|
|
33769
|
+
* per term — so the MOST DEMANDING (shortest) range sets the rate and longer
|
|
33770
|
+
* ranges are sampled denser than they need. Per-range cadences require a cap
|
|
33771
|
+
* schema change and are the tracked follow-up.
|
|
33772
|
+
*
|
|
33773
|
+
* A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
|
|
33774
|
+
* is rendered with every frame that EXISTS and no more: the guarantee is capped
|
|
33775
|
+
* by real footage, never met by duplicating frames into motion that never
|
|
33776
|
+
* happened.
|
|
33777
|
+
*/
|
|
33778
|
+
var MinDwellSecField = number().min(0).max(60);
|
|
33779
|
+
/**
|
|
33780
|
+
* Caption burned into the notification's preview frame.
|
|
33781
|
+
*
|
|
33782
|
+
* Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
|
|
33783
|
+
* `rule`, `from`, `to`) and rendered by the SAME renderer — a second
|
|
33784
|
+
* templating dialect for one field would be a second thing to explain.
|
|
33785
|
+
*
|
|
33786
|
+
* Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
|
|
33787
|
+
* operator saying "the frame, no caption" — a distinct, reachable answer, and
|
|
33788
|
+
* the reason this is not `.min(1)`.
|
|
33789
|
+
*/
|
|
33790
|
+
var PreviewTextField = string().max(200);
|
|
33791
|
+
/**
|
|
33792
|
+
* Whether the notification's preview is a STILL or a short animation.
|
|
33793
|
+
*
|
|
33794
|
+
* The operator's ask, verbatim: *"inviato come gif o video (come per le altre
|
|
33795
|
+
* rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
|
|
33796
|
+
* night reads better as three seconds of motion than as one frame of it. Both
|
|
33797
|
+
* modes get the SAME treatment (blurred frame, large centred title); `'gif'`
|
|
33798
|
+
* simply applies it to a dozen frames sampled across the render and assembles
|
|
33799
|
+
* them.
|
|
33800
|
+
*
|
|
33801
|
+
* `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
|
|
33802
|
+
* seeks and a palette pass, and no rule that never asked for one should start
|
|
33803
|
+
* paying that on the deploy that shipped it.
|
|
33804
|
+
*
|
|
33805
|
+
* A GIF that cannot be assembled DEGRADES to the still — never to nothing.
|
|
33806
|
+
*/
|
|
33807
|
+
var PreviewModeField = _enum(["image", "gif"]);
|
|
33808
|
+
/**
|
|
33809
|
+
* Which detection classes the notification reports counts for.
|
|
33810
|
+
*
|
|
33811
|
+
* The counts come from the tracks the render ALREADY fetched for its dense-range
|
|
33812
|
+
* plan — no second query — aggregated per class. Absent or empty means "every
|
|
33813
|
+
* class the window actually contained", which is what an operator who never
|
|
33814
|
+
* opened the field wants; a list narrows it (`['person']` on a driveway that
|
|
33815
|
+
* counts cars all night).
|
|
33816
|
+
*
|
|
33817
|
+
* Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
|
|
33818
|
+
* …). An unknown name simply never matches and reports nothing — it is not an
|
|
33819
|
+
* error, because a rule may legitimately name a class this camera's model does
|
|
33820
|
+
* not emit.
|
|
33821
|
+
*
|
|
33822
|
+
* The counts are exposed to {@link TimelapseTemplateSchema} as:
|
|
33823
|
+
* - `{{detections}}` — total over the reported classes
|
|
33824
|
+
* - `{{detectionSummary}}` — `2 persone, 1 veicolo`
|
|
33825
|
+
* - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
|
|
33826
|
+
* one per class, `count_` + the class name
|
|
33827
|
+
*
|
|
33828
|
+
* With NO custom body template the summary is appended to the derived body, and
|
|
33829
|
+
* only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
|
|
33830
|
+
* reads. With a custom template the operator owns every word — nothing is
|
|
33831
|
+
* appended, so `{{detectionSummary}}` is how he asks for it.
|
|
33832
|
+
*/
|
|
33833
|
+
var ReportClassesField = array(string().min(1).max(40)).max(20);
|
|
33834
|
+
/**
|
|
33272
33835
|
* Client-supplied timelapse-rule fields. The server stamps id / createdBy /
|
|
33273
33836
|
* createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
|
|
33274
33837
|
* here (see the ownership note above).
|
|
@@ -33288,9 +33851,30 @@ var TimelapseRuleInputSchema = object({
|
|
|
33288
33851
|
cadenceSec: CadenceSecField.default(15),
|
|
33289
33852
|
/** Output frames per second of the assembled mp4 (predecessor parity). */
|
|
33290
33853
|
framerate: FramerateField.default(10),
|
|
33854
|
+
/**
|
|
33855
|
+
* Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
|
|
33856
|
+
* as `max(1s, cadenceSec / 30)`, which is what every rule written before this
|
|
33857
|
+
* field gets.
|
|
33858
|
+
*/
|
|
33859
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
33860
|
+
/** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
|
|
33861
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
33291
33862
|
/** `notification-output` targets the finished video/thumbnail is sent to. */
|
|
33292
33863
|
targets: TargetsField,
|
|
33293
33864
|
template: TimelapseTemplateSchema.optional(),
|
|
33865
|
+
/**
|
|
33866
|
+
* Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
|
|
33867
|
+
* and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
|
|
33868
|
+
*
|
|
33869
|
+
* Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
|
|
33870
|
+
* the notification's title/body, and clearing it (`template: null`) must not
|
|
33871
|
+
* silently clear the caption too.
|
|
33872
|
+
*/
|
|
33873
|
+
previewText: PreviewTextField.optional(),
|
|
33874
|
+
/** Still or animation — see {@link PreviewModeField}. */
|
|
33875
|
+
previewMode: PreviewModeField.default("image"),
|
|
33876
|
+
/** Classes the notification counts — see {@link ReportClassesField}. */
|
|
33877
|
+
reportClasses: ReportClassesField.optional(),
|
|
33294
33878
|
/** Canonical notification priority ordinal (1..5); per-target overridable. */
|
|
33295
33879
|
priority: PriorityField.default(3)
|
|
33296
33880
|
});
|
|
@@ -33301,8 +33885,13 @@ object({
|
|
|
33301
33885
|
schedule: NcScheduleSchema.optional(),
|
|
33302
33886
|
cadenceSec: CadenceSecField.optional(),
|
|
33303
33887
|
framerate: FramerateField.optional(),
|
|
33888
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
33889
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
33304
33890
|
targets: TargetsField.optional(),
|
|
33305
33891
|
template: TimelapseTemplateSchema.nullable().optional(),
|
|
33892
|
+
previewText: PreviewTextField.optional(),
|
|
33893
|
+
previewMode: PreviewModeField.optional(),
|
|
33894
|
+
reportClasses: ReportClassesField.optional(),
|
|
33306
33895
|
priority: PriorityField.optional()
|
|
33307
33896
|
});
|
|
33308
33897
|
TimelapseRuleInputSchema.extend({
|
|
@@ -33314,10 +33903,28 @@ TimelapseRuleInputSchema.extend({
|
|
|
33314
33903
|
*/
|
|
33315
33904
|
ownerUserId: string().optional(),
|
|
33316
33905
|
/**
|
|
33317
|
-
* Epoch-ms of the
|
|
33318
|
-
*
|
|
33906
|
+
* Epoch-ms of the NEWEST successful generation across every camera of this
|
|
33907
|
+
* rule. What a UI shows, and the compatibility floor for
|
|
33908
|
+
* {@link readTimelapseGeneratedAt}. Absent = never generated.
|
|
33319
33909
|
*/
|
|
33320
33910
|
lastGeneratedAt: number().optional(),
|
|
33911
|
+
/**
|
|
33912
|
+
* PER-CAMERA generation state, keyed by `String(deviceId)` — the
|
|
33913
|
+
* re-generation guard's real durable state.
|
|
33914
|
+
*
|
|
33915
|
+
* One rule covers several cameras and each renders its own video, so a rule
|
|
33916
|
+
* -wide stamp is wrong in the direction that DESTROYS work: camera A
|
|
33917
|
+
* succeeding at 06:05 tells camera B, whose render failed, that it is
|
|
33918
|
+
* already done — and B's night is gone for good, because the window will not
|
|
33919
|
+
* come back.
|
|
33920
|
+
*
|
|
33921
|
+
* ADDITIVE, so the migration is free: a row written before this field simply
|
|
33922
|
+
* has no map, and {@link readTimelapseGeneratedAt} falls back to
|
|
33923
|
+
* {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
|
|
33924
|
+
* "never generated" would re-render and re-notify every camera of every rule
|
|
33925
|
+
* once, on the deploy that shipped the map.
|
|
33926
|
+
*/
|
|
33927
|
+
generatedByDevice: record(string(), number()).optional(),
|
|
33321
33928
|
/** userId of the caller who created the rule (server-stamped). */
|
|
33322
33929
|
createdBy: string(),
|
|
33323
33930
|
createdAt: number(),
|