@camstack/addon-provider-wyze 0.2.12 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addon.js +643 -36
- package/dist/addon.mjs +643 -36
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -7236,8 +7236,31 @@ var AdoptionJobSchema = object({
|
|
|
7236
7236
|
error: string().nullable()
|
|
7237
7237
|
});
|
|
7238
7238
|
/**
|
|
7239
|
-
* Per-camera FUNCTION SWITCHES
|
|
7240
|
-
*
|
|
7239
|
+
* Per-camera FUNCTION SWITCHES.
|
|
7240
|
+
*
|
|
7241
|
+
* ## The aggregate group is being withdrawn — the BADGE is not (D113)
|
|
7242
|
+
*
|
|
7243
|
+
* This file shipped as "the one coherent on/off surface over the pipeline
|
|
7244
|
+
* functions an operator thinks in terms of". The operator's verdict on
|
|
7245
|
+
* 2026-08-12 was that the coherent surface bought complexity and no clarity:
|
|
7246
|
+
* every function already had a settings page of its own, and a second place to
|
|
7247
|
+
* turn it off is a second place to look. Each switch is going back to its own
|
|
7248
|
+
* component's original options — detection to the detection-pipeline wrapper
|
|
7249
|
+
* binding, audio analysis to its own, recording to `RecordingConfig.enabled`
|
|
7250
|
+
* (which was always first-class; the switch was a veneer over
|
|
7251
|
+
* `recording.setDeviceConfig`), notifications to a notification-center
|
|
7252
|
+
* per-device setting, the two camera planes to their own components.
|
|
7253
|
+
*
|
|
7254
|
+
* What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
|
|
7255
|
+
* thing that lets a status surface say DISABLED instead of BROKEN, recomposed
|
|
7256
|
+
* straight from the authorities with no group in the middle. That rule was
|
|
7257
|
+
* never about a control panel.
|
|
7258
|
+
*
|
|
7259
|
+
* Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
|
|
7260
|
+
* {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
|
|
7261
|
+
* `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
|
|
7262
|
+
* viewers (v1.0.305) and the admin UI still call it. It is deleted when they
|
|
7263
|
+
* stop; nothing new may be built on it.
|
|
7241
7264
|
*
|
|
7242
7265
|
* ## This file adds no state
|
|
7243
7266
|
*
|
|
@@ -7588,7 +7611,15 @@ var RecordingConfigSchema = object({
|
|
|
7588
7611
|
* Each completed/failed run also lands one durable ops-log row on its owning
|
|
7589
7612
|
* addon surface.
|
|
7590
7613
|
*/
|
|
7614
|
+
/**
|
|
7615
|
+
* `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
|
|
7616
|
+
* rebalance enqueues one job per (camera, profile). Refusing the second job —
|
|
7617
|
+
* what the engine did before — turned a fifteen-camera rebalance into fifteen
|
|
7618
|
+
* manual retries. Queued jobs run FIFO; a queued job that is cancelled never
|
|
7619
|
+
* runs at all.
|
|
7620
|
+
*/
|
|
7591
7621
|
var RelocateJobStateSchema = _enum([
|
|
7622
|
+
"queued",
|
|
7592
7623
|
"running",
|
|
7593
7624
|
"done",
|
|
7594
7625
|
"failed",
|
|
@@ -7623,6 +7654,15 @@ var RelocateFootageInputSchema = object({
|
|
|
7623
7654
|
/** Limits relocation to the logical profile class. Omit only for the
|
|
7624
7655
|
* pre-orchestration compatibility path. */
|
|
7625
7656
|
footageClass: RelocateFootageClassSchema.optional(),
|
|
7657
|
+
/** Scope the move to ONE camera. Absent = every camera on the source, which
|
|
7658
|
+
* is what a whole-disk drain means. The rebalance path always sets it: its
|
|
7659
|
+
* unit is a (camera, profile) pile, not a disk. */
|
|
7660
|
+
deviceId: number().int().optional(),
|
|
7661
|
+
/** Scope the move to specific segment profiles (`high` / `mid` / `low`).
|
|
7662
|
+
* Finer than `footageClass`, which cannot separate high from mid — and the
|
|
7663
|
+
* placement plan assigns those two independently, so a rebalance that could
|
|
7664
|
+
* only say "recordings" would move footage the plan never asked to move. */
|
|
7665
|
+
profiles: array(string()).optional(),
|
|
7626
7666
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
7627
7667
|
* never allowed to starve live writers. */
|
|
7628
7668
|
throttleMbps: number().min(1).max(1e3).optional()
|
|
@@ -7758,6 +7798,21 @@ var StorageLocationSchema = object({
|
|
|
7758
7798
|
nodeId: string().optional(),
|
|
7759
7799
|
isDefault: boolean().default(false),
|
|
7760
7800
|
isSystem: boolean().default(false),
|
|
7801
|
+
/**
|
|
7802
|
+
* Operator opt-in: whether consumers that BALANCE across several locations
|
|
7803
|
+
* of a type may write here. Recordings reads it today; event media and
|
|
7804
|
+
* backups are the next consumers, which is why the flag lives on the
|
|
7805
|
+
* location rather than in any one addon's store — nothing has to be
|
|
7806
|
+
* extended to add the next consumer.
|
|
7807
|
+
*
|
|
7808
|
+
* OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
|
|
7809
|
+
* flag existed reads back with no flag and keeps working exactly as before;
|
|
7810
|
+
* that is the whole compat story, and it is why no migration ships with it.
|
|
7811
|
+
* A newly CREATED sibling is stamped `false` by the orchestrator (creating a
|
|
7812
|
+
* disk must not silently start writing to it); the default of a type is
|
|
7813
|
+
* always stamped `true`.
|
|
7814
|
+
*/
|
|
7815
|
+
enabled: boolean().optional(),
|
|
7761
7816
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
7762
7817
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
7763
7818
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -12327,7 +12382,8 @@ method(object({
|
|
|
12327
12382
|
}), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
|
|
12328
12383
|
/**
|
|
12329
12384
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
12330
|
-
* filesystem
|
|
12385
|
+
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
12386
|
+
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
12331
12387
|
* admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
|
|
12332
12388
|
* (one provider per node); the hub calls it with `{nodeId}` so the codegen
|
|
12333
12389
|
* routes to that exact node (default `nodeIdMode:'routing'`).
|
|
@@ -14168,6 +14224,13 @@ var MaskGridDimsSchema = object({
|
|
|
14168
14224
|
* `package-event` are pure trigger kinds (no urgency dimension). Extending
|
|
14169
14225
|
* this one field keeps the schema additive — a rule still declares exactly
|
|
14170
14226
|
* one trigger.
|
|
14227
|
+
*
|
|
14228
|
+
* AUDIO rules add no member here, for the reason occupancy added none: the
|
|
14229
|
+
* enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
|
|
14230
|
+
* mirror.ts` fails the build on a member the app cannot render) and every
|
|
14231
|
+
* member costs a release train. A sustained-sound rule is therefore an
|
|
14232
|
+
* `immediate` rule carrying {@link NcConditions.audio} — the condition is the
|
|
14233
|
+
* trigger discriminator, exactly as `occupancy` is on `device-event`.
|
|
14171
14234
|
*/
|
|
14172
14235
|
var NcDeliverySchema = _enum([
|
|
14173
14236
|
"immediate",
|
|
@@ -14182,15 +14245,32 @@ var NcDeliverySchema = _enum([
|
|
|
14182
14245
|
* depend on a provider's raw event name or payload shape.
|
|
14183
14246
|
*/
|
|
14184
14247
|
var NcSystemEventKindSchema = _enum([
|
|
14185
|
-
"
|
|
14186
|
-
"
|
|
14248
|
+
"device-online",
|
|
14249
|
+
"device-offline",
|
|
14250
|
+
"device-disabled",
|
|
14251
|
+
"device-enabled",
|
|
14187
14252
|
"stream-online",
|
|
14188
14253
|
"stream-offline",
|
|
14189
14254
|
"node-online",
|
|
14190
14255
|
"node-offline",
|
|
14191
14256
|
"addon-update-available",
|
|
14192
|
-
"server-update-available"
|
|
14257
|
+
"server-update-available",
|
|
14258
|
+
"alarm-triggered",
|
|
14259
|
+
"alarm-armed",
|
|
14260
|
+
"alarm-disarmed",
|
|
14261
|
+
"camera-online",
|
|
14262
|
+
"camera-offline",
|
|
14263
|
+
"camera-disabled",
|
|
14264
|
+
"camera-enabled"
|
|
14265
|
+
]);
|
|
14266
|
+
/** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
|
|
14267
|
+
var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
|
|
14268
|
+
"camera-online",
|
|
14269
|
+
"camera-offline",
|
|
14270
|
+
"camera-disabled",
|
|
14271
|
+
"camera-enabled"
|
|
14193
14272
|
]);
|
|
14273
|
+
NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
|
|
14194
14274
|
/**
|
|
14195
14275
|
* One coherent system-event condition. `kinds` is the required opt-in safety
|
|
14196
14276
|
* gate; the remaining lists are optional narrowing filters relevant to the
|
|
@@ -14199,6 +14279,18 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14199
14279
|
var NcSystemEventConditionSchema = object({
|
|
14200
14280
|
kinds: array(NcSystemEventKindSchema).min(1),
|
|
14201
14281
|
deviceIds: array(number().int()).min(1).optional(),
|
|
14282
|
+
/**
|
|
14283
|
+
* Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
|
|
14284
|
+
* `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
|
|
14285
|
+
* is what a liveness rule means when nobody said otherwise.
|
|
14286
|
+
*
|
|
14287
|
+
* This is where "only my cameras" is expressed, and it lives on the rule for
|
|
14288
|
+
* one reason: the intake cannot know which devices this household cares
|
|
14289
|
+
* about, and a producer-side filter is one no operator can change. Fails
|
|
14290
|
+
* CLOSED — a subject whose device type is unknown (an id the device mirror
|
|
14291
|
+
* does not carry) matches no `deviceTypes` list.
|
|
14292
|
+
*/
|
|
14293
|
+
deviceTypes: array(string().min(1)).min(1).optional(),
|
|
14202
14294
|
nodeIds: array(string().min(1)).min(1).optional(),
|
|
14203
14295
|
packageNames: array(string().min(1)).min(1).optional()
|
|
14204
14296
|
});
|
|
@@ -14249,6 +14341,47 @@ var NcOccupancyConditionSchema = object({
|
|
|
14249
14341
|
sustainSeconds: number().int().min(0).max(3600).default(15)
|
|
14250
14342
|
});
|
|
14251
14343
|
/**
|
|
14344
|
+
* Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
|
|
14345
|
+
*
|
|
14346
|
+
* Operator-approved vocabulary (2026-08-12, option A — the same one the
|
|
14347
|
+
* reference notifier uses, so an operator moving between them re-uses what
|
|
14348
|
+
* they already know): a rule matches when, over a sampling window of
|
|
14349
|
+
* `samplingSeconds`, at least `hitPercent`% of the audio samples in that
|
|
14350
|
+
* window are HITS. A sample is a hit when it satisfies BOTH present filters:
|
|
14351
|
+
*
|
|
14352
|
+
* - `dbThreshold` — its level is at or above this many dBFS (see
|
|
14353
|
+
* {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
|
|
14354
|
+
* - `labels` — the classifier put at least one of these labels on it.
|
|
14355
|
+
*
|
|
14356
|
+
* Both are OPTIONAL and independent, which is the point of the shape: a
|
|
14357
|
+
* loudness rule ("something loud at 3am") needs no model to be right, and a
|
|
14358
|
+
* label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
|
|
14359
|
+
* is given** — a window in which every sample is trivially a hit would fire on
|
|
14360
|
+
* silence, so the engine refuses such a condition rather than notifying on
|
|
14361
|
+
* nothing (the schema cannot express "at least one of" without becoming a
|
|
14362
|
+
* ZodEffects the cap path would have to special-case).
|
|
14363
|
+
*
|
|
14364
|
+
* `hitPercent` is over the samples the window actually HOLDS, and the window
|
|
14365
|
+
* must be FULL before it can match — a window that has been open for two
|
|
14366
|
+
* seconds of its ten is 100% of nothing, and firing on it would make
|
|
14367
|
+
* `samplingSeconds` decorative.
|
|
14368
|
+
*
|
|
14369
|
+
* Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
|
|
14370
|
+
* `audio-*` ids). Both spellings are accepted — the matcher normalizes the
|
|
14371
|
+
* `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
|
|
14372
|
+
* an operator who typed `dog` mean the same thing.
|
|
14373
|
+
*/
|
|
14374
|
+
var NcAudioConditionSchema = object({
|
|
14375
|
+
/** Audio macro labels; absent = any sound (level-only rule). */
|
|
14376
|
+
labels: array(string().min(1)).min(1).optional(),
|
|
14377
|
+
/** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
|
|
14378
|
+
dbThreshold: number().min(-96).max(0).optional(),
|
|
14379
|
+
/** Percentage of the window's samples that must be hits (1–100). */
|
|
14380
|
+
hitPercent: number().int().min(1).max(100).default(60),
|
|
14381
|
+
/** Length of the sampling window in seconds. */
|
|
14382
|
+
samplingSeconds: number().int().min(1).max(300).default(10)
|
|
14383
|
+
});
|
|
14384
|
+
/**
|
|
14252
14385
|
* Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
|
|
14253
14386
|
*
|
|
14254
14387
|
* The values are not symmetric, and deliberately so — the absent value has to
|
|
@@ -14521,7 +14654,33 @@ var NcConditionsSchema = object({
|
|
|
14521
14654
|
* threshold and holds for `sustainSeconds`. Fail-closed on missing
|
|
14522
14655
|
* substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
|
|
14523
14656
|
*/
|
|
14524
|
-
occupancy: NcOccupancyConditionSchema.optional()
|
|
14657
|
+
occupancy: NcOccupancyConditionSchema.optional(),
|
|
14658
|
+
/**
|
|
14659
|
+
* IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
|
|
14660
|
+
* `samplingSeconds` window clear the optional `dbThreshold` and carry one of
|
|
14661
|
+
* the optional `labels`. Fail-closed on missing substrate (no audio samples,
|
|
14662
|
+
* a window that is not full yet, neither filter given). See
|
|
14663
|
+
* {@link NcAudioCondition}.
|
|
14664
|
+
*
|
|
14665
|
+
* Presence of this key is what makes a rule an AUDIO rule: the engine fires
|
|
14666
|
+
* it ONLY on a confirmed audio window, and a rule carrying it never fires on
|
|
14667
|
+
* a detection, a track or a device event (the same fail-closed pairing
|
|
14668
|
+
* `occupancy` has with the `device-event` trigger). That is how audio labels
|
|
14669
|
+
* leave `classes`: an audio rule names its sounds HERE, and the legacy path
|
|
14670
|
+
* (an `immediate` rule naming an `audio-*` class, one notification per
|
|
14671
|
+
* classified sample) stays exactly as it was for rules that already use it.
|
|
14672
|
+
*
|
|
14673
|
+
* NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
|
|
14674
|
+
* rather than an oversight: the viewer mirrors the descriptor enums BY HAND
|
|
14675
|
+
* (`camstack/src/data/notification-center.ts`, guarded by
|
|
14676
|
+
* `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
|
|
14677
|
+
* condition fields it does not know when a rule is saved from the phone.
|
|
14678
|
+
* Publishing an editor for a condition the app cannot round-trip is how an
|
|
14679
|
+
* operator loses a rule's conditions by opening it — so the descriptor, the
|
|
14680
|
+
* admin widget and the viewer mirror land together (P2 + P3), and only then
|
|
14681
|
+
* does an audio rule become authorable.
|
|
14682
|
+
*/
|
|
14683
|
+
audio: NcAudioConditionSchema.optional()
|
|
14525
14684
|
});
|
|
14526
14685
|
/** One delivery target: a `notification-output` Target ref + passthrough params. */
|
|
14527
14686
|
var NcRuleTargetSchema = object({
|
|
@@ -14635,6 +14794,73 @@ var NcThrottleSchema = object({
|
|
|
14635
14794
|
*/
|
|
14636
14795
|
granularity: NcThrottleGranularitySchema.optional()
|
|
14637
14796
|
});
|
|
14797
|
+
/**
|
|
14798
|
+
* How long the confirm gate may hold ONE notification, and how big the picture
|
|
14799
|
+
* it judges may be.
|
|
14800
|
+
*
|
|
14801
|
+
* The clamp is the product decision, not a coincidence of the model: p50 was
|
|
14802
|
+
* 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
|
|
14803
|
+
* arrives after the visitor has gone is not a notification. 448 px was enough
|
|
14804
|
+
* to score 16/16 on the operator's parking scenario — bigger costs latency and
|
|
14805
|
+
* tokens for pixels the model pools away.
|
|
14806
|
+
*/
|
|
14807
|
+
var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
|
|
14808
|
+
var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
|
|
14809
|
+
var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
|
|
14810
|
+
/** Comparison the model's COUNT must satisfy for the notification to fire. */
|
|
14811
|
+
var NcConfirmExpectSchema = object({
|
|
14812
|
+
op: _enum([
|
|
14813
|
+
">=",
|
|
14814
|
+
">",
|
|
14815
|
+
"<=",
|
|
14816
|
+
"<",
|
|
14817
|
+
"=="
|
|
14818
|
+
]),
|
|
14819
|
+
count: number().int().min(0).max(1e3)
|
|
14820
|
+
});
|
|
14821
|
+
/**
|
|
14822
|
+
* AI CONFIRM — a vision model looks at the picture this notification is about
|
|
14823
|
+
* to ship and says whether it agrees with the rule.
|
|
14824
|
+
*
|
|
14825
|
+
* It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
|
|
14826
|
+
* crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
|
|
14827
|
+
* on the operator's phone is not a verdict about this notification.
|
|
14828
|
+
*
|
|
14829
|
+
* FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
|
|
14830
|
+
* whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
|
|
14831
|
+
* the default and every fail-open is COUNTED, because a gate that always fails
|
|
14832
|
+
* open looks in the log exactly like a gate that works.
|
|
14833
|
+
*
|
|
14834
|
+
* Every field is `.optional()` rather than relied on as a Zod default at the
|
|
14835
|
+
* runtime seam: a Zod default does NOT run on the addon→addon cap path (three
|
|
14836
|
+
* production failures in one day), so the gate reads absent as the constant
|
|
14837
|
+
* above rather than trusting a parse it may never have seen.
|
|
14838
|
+
*/
|
|
14839
|
+
var NcConfirmSchema = object({
|
|
14840
|
+
/** Off unless asked for. An absent `confirm` and `enabled:false` are the
|
|
14841
|
+
* same thing, and both mean "deliver exactly as before". */
|
|
14842
|
+
enabled: boolean().default(false),
|
|
14843
|
+
/** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
|
|
14844
|
+
profileId: string().optional(),
|
|
14845
|
+
/**
|
|
14846
|
+
* The operator's question, in his own words. Absent = a question derived
|
|
14847
|
+
* from the rule (its class and its expectation).
|
|
14848
|
+
*
|
|
14849
|
+
* NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
|
|
14850
|
+
* banners, signage and plates as instructions if you let them reach the
|
|
14851
|
+
* prompt — proven live — so the authoritative contract stays in the system
|
|
14852
|
+
* turn and only rule-authored words land here.
|
|
14853
|
+
*/
|
|
14854
|
+
prompt: string().max(1e3).optional(),
|
|
14855
|
+
/** Fire only when the model's count satisfies this. Absent = the model's
|
|
14856
|
+
* own boolean verdict decides. */
|
|
14857
|
+
expect: NcConfirmExpectSchema.optional(),
|
|
14858
|
+
timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
|
|
14859
|
+
/** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
|
|
14860
|
+
onTimeout: _enum(["fire", "suppress"]).default("fire"),
|
|
14861
|
+
/** Longest edge the judged image is downscaled to before it is sent. */
|
|
14862
|
+
maxImagePx: number().int().min(64).max(2048).default(448)
|
|
14863
|
+
});
|
|
14638
14864
|
/** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
|
|
14639
14865
|
var NcRuleInputSchema = object({
|
|
14640
14866
|
name: string().min(1).max(200),
|
|
@@ -14695,7 +14921,13 @@ var NcRuleInputSchema = object({
|
|
|
14695
14921
|
* `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
|
|
14696
14922
|
* shape as every other actuation.
|
|
14697
14923
|
*/
|
|
14698
|
-
actions: NcRuleActionsSchema.optional()
|
|
14924
|
+
actions: NcRuleActionsSchema.optional(),
|
|
14925
|
+
/**
|
|
14926
|
+
* AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
|
|
14927
|
+
* a rule that predates the gate must keep delivering byte-for-byte as it
|
|
14928
|
+
* did, and absent is the only way to say that without a migration.
|
|
14929
|
+
*/
|
|
14930
|
+
confirm: NcConfirmSchema.optional()
|
|
14699
14931
|
});
|
|
14700
14932
|
/**
|
|
14701
14933
|
* Partial patch for `updateRule` — any subset of the input fields, plus the
|
|
@@ -14706,7 +14938,37 @@ var NcRuleInputSchema = object({
|
|
|
14706
14938
|
* still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
|
|
14707
14939
|
* `updateRule` patch.
|
|
14708
14940
|
*/
|
|
14709
|
-
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
14941
|
+
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
14942
|
+
disabledTargetIds: array(string()).optional(),
|
|
14943
|
+
/**
|
|
14944
|
+
* `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
|
|
14945
|
+
*
|
|
14946
|
+
* It makes the key optional to SUPPLY; the parse still materialises the
|
|
14947
|
+
* default when the key is absent. And `NcRuleStore.update` merges with
|
|
14948
|
+
* `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
|
|
14949
|
+
* one — which made every partial edit destructive:
|
|
14950
|
+
*
|
|
14951
|
+
* nc.updateRule({ throttle }) → conditions reset to `{}`
|
|
14952
|
+
* nc.setRuleTargetEnabled(...) → conditions reset to `{}`
|
|
14953
|
+
* setEnabled(ruleId, false) → conditions reset to `{}`
|
|
14954
|
+
*
|
|
14955
|
+
* A rule scoped to one camera and one zone silently became a rule that
|
|
14956
|
+
* matches EVERY event on EVERY camera, and lost its `media` policy
|
|
14957
|
+
* (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
|
|
14958
|
+
* live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
|
|
14959
|
+
* within a minute of a two-field patch.
|
|
14960
|
+
*
|
|
14961
|
+
* So every defaulted field is re-declared here WITHOUT its default. The
|
|
14962
|
+
* inner defaults still apply when the caller DOES send the key — `{}` for
|
|
14963
|
+
* conditions remains a real instruction ("clear them") — and only the
|
|
14964
|
+
* absent key is now genuinely absent.
|
|
14965
|
+
*/
|
|
14966
|
+
enabled: boolean().optional(),
|
|
14967
|
+
conditions: NcConditionsSchema.optional(),
|
|
14968
|
+
media: NcMediaPolicySchema.optional(),
|
|
14969
|
+
throttle: NcThrottleSchema.optional(),
|
|
14970
|
+
priority: number().int().min(1).max(5).optional()
|
|
14971
|
+
});
|
|
14710
14972
|
/** A persisted rule. */
|
|
14711
14973
|
var NcRuleSchema = NcRuleInputSchema.extend({
|
|
14712
14974
|
id: string(),
|
|
@@ -15007,6 +15269,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
|
|
|
15007
15269
|
* Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
|
|
15008
15270
|
* copy would lie the first time a rule is disabled.
|
|
15009
15271
|
*/
|
|
15272
|
+
/**
|
|
15273
|
+
* Why a device a mode NAMES is nonetheless not armed by it.
|
|
15274
|
+
*
|
|
15275
|
+
* Each value is an existing authority, never a new flag (D62): `muted` is the
|
|
15276
|
+
* per-camera notification switch the Notification Center already owns,
|
|
15277
|
+
* `detection-off` is the device's own detection binding being inactive, and
|
|
15278
|
+
* `offline` is the device manager's liveness. A fourth reason would mean a
|
|
15279
|
+
* fourth authority, and inventing one here is how a panel starts disagreeing
|
|
15280
|
+
* with the switches the operator actually used.
|
|
15281
|
+
*/
|
|
15282
|
+
var NcAlarmSkipReasonSchema = _enum([
|
|
15283
|
+
"muted",
|
|
15284
|
+
"detection-off",
|
|
15285
|
+
"offline"
|
|
15286
|
+
]);
|
|
15287
|
+
var NcAlarmSkippedDeviceSchema = object({
|
|
15288
|
+
deviceId: number().int(),
|
|
15289
|
+
reason: NcAlarmSkipReasonSchema
|
|
15290
|
+
});
|
|
15010
15291
|
var NcAlarmModeCoverageSchema = object({
|
|
15011
15292
|
mode: AlarmArmModeSchema,
|
|
15012
15293
|
/** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
|
|
@@ -15014,7 +15295,18 @@ var NcAlarmModeCoverageSchema = object({
|
|
|
15014
15295
|
/** At least one covering rule has no device scope, so the mode covers all. */
|
|
15015
15296
|
allDevices: boolean(),
|
|
15016
15297
|
/** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
|
|
15017
|
-
deviceIds: array(number().int())
|
|
15298
|
+
deviceIds: array(number().int()),
|
|
15299
|
+
/**
|
|
15300
|
+
* Devices this mode NAMES but cannot actually arm, each with the switch that
|
|
15301
|
+
* excludes it.
|
|
15302
|
+
*
|
|
15303
|
+
* "Away armed — 12 cameras" is a promise, and a muted camera among those
|
|
15304
|
+
* twelve makes it false in exactly the way nobody notices until an incident.
|
|
15305
|
+
* Defaulted to `[]` so a coverage answer computed before this field existed
|
|
15306
|
+
* still parses as "nothing known to be skipped" rather than failing the whole
|
|
15307
|
+
* alarm tab.
|
|
15308
|
+
*/
|
|
15309
|
+
skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
|
|
15018
15310
|
});
|
|
15019
15311
|
var NcAlarmConfigSchema = object({
|
|
15020
15312
|
/**
|
|
@@ -17846,9 +18138,16 @@ var CameraStatusSchema = object({
|
|
|
17846
18138
|
audio: CameraAudioStatusSchema.nullable(),
|
|
17847
18139
|
recording: CameraRecordingStatusSchema.nullable(),
|
|
17848
18140
|
/**
|
|
17849
|
-
* Per-camera
|
|
18141
|
+
* Per-camera functions an OPERATOR has turned off
|
|
17850
18142
|
* ([D61](../../../../docs/decisions/adr-0067.md)).
|
|
17851
18143
|
*
|
|
18144
|
+
* Composed from the AUTHORITIES themselves — the wrapper bindings,
|
|
18145
|
+
* `RecordingConfig.enabled`, the notification mute, the broker's audio
|
|
18146
|
+
* policy, the camera's own microphone — via `composeSwitchedOff`, not from
|
|
18147
|
+
* the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
|
|
18148
|
+
* The badge outlives the control panel: the panel was a convenience, this is
|
|
18149
|
+
* the difference between a camera being off and a camera being dead.
|
|
18150
|
+
*
|
|
17852
18151
|
* This is the difference between DISABLED and BROKEN. A camera whose
|
|
17853
18152
|
* `detection` block reports zero fps and whose `switchedOff` contains
|
|
17854
18153
|
* `'object-detection'` was switched off by a person; the same camera with an
|
|
@@ -18455,24 +18754,28 @@ var snapshotCapability = {
|
|
|
18455
18754
|
*
|
|
18456
18755
|
* `getSnapshotOverview` is cache-only by contract: it answers from whatever
|
|
18457
18756
|
* the wrapper happens to hold and never captures. Under D93 the client
|
|
18458
|
-
* versions its image URL on that answer, and an image REQUEST
|
|
18459
|
-
*
|
|
18460
|
-
*
|
|
18461
|
-
*
|
|
18462
|
-
*
|
|
18463
|
-
*
|
|
18464
|
-
*
|
|
18465
|
-
*
|
|
18757
|
+
* versions its image URL on that answer, and an image REQUEST was the only
|
|
18758
|
+
* demand signal. Both of those are satisfiable by the client's own image
|
|
18759
|
+
* cache — `expo-image` is URL-keyed and never revalidates — so a URL painted
|
|
18760
|
+
* in a previous session comes off disk with no network, no demand, and no
|
|
18761
|
+
* capture. Measured on the live hub: reopening after two minutes idle
|
|
18762
|
+
* painted 15 of 16 tiles at **168 s old** with zero HTTP requests, and the
|
|
18763
|
+
* fleet only recovered because a later poll happened to observe a different
|
|
18764
|
+
* identity.
|
|
18466
18765
|
*
|
|
18467
18766
|
* ## The two properties that fix it
|
|
18468
18767
|
*
|
|
18469
18768
|
* **It is an RPC, so no client cache can answer it.** The demand signal
|
|
18470
|
-
* always reaches the wrapper. This method therefore
|
|
18471
|
-
*
|
|
18472
|
-
*
|
|
18473
|
-
*
|
|
18474
|
-
*
|
|
18475
|
-
*
|
|
18769
|
+
* always reaches the wrapper. This method therefore CAPTURES, where
|
|
18770
|
+
* `getSnapshotOverview` must never (D93) — the distinction is not "one is
|
|
18771
|
+
* newer" but that the overview poll is app-wide (a capturing overview would
|
|
18772
|
+
* dial every camera on the install) while this is called by a rendered
|
|
18773
|
+
* surface naming the tiles it is actually painting, at the width it is
|
|
18774
|
+
* painting them.
|
|
18775
|
+
*
|
|
18776
|
+
* Since 2026-08-11 this is the ONLY thing that refreshes a snapshot: the
|
|
18777
|
+
* server-side keep-warm loop was removed (operator directive — on-demand,
|
|
18778
|
+
* always), so a camera nobody is looking at costs nothing at all.
|
|
18476
18779
|
*
|
|
18477
18780
|
* **It waits, briefly and boundedly, for the capture it triggered.** The
|
|
18478
18781
|
* returned `capturedAt` is the frame the link will serve, not the frame the
|
|
@@ -24732,7 +25035,19 @@ var RecordingManifestSchema = object({
|
|
|
24732
25035
|
* profiles/subtrees/locations on this node). */
|
|
24733
25036
|
var RecordingDeviceUsageSchema = object({
|
|
24734
25037
|
deviceId: number(),
|
|
24735
|
-
usedBytes: number()
|
|
25038
|
+
usedBytes: number(),
|
|
25039
|
+
/**
|
|
25040
|
+
* Start of this camera's OLDEST indexed segment, across every profile and
|
|
25041
|
+
* location — the "Oldest footage" column in Recordings → Storage, and the
|
|
25042
|
+
* only honest answer to "is retention actually holding?" per camera.
|
|
25043
|
+
*
|
|
25044
|
+
* `null` = the camera has no footage. OPTIONAL because a recorder that
|
|
25045
|
+
* predates this field omits it entirely, and a hub whose types carry the
|
|
25046
|
+
* field must keep validating that older provider's payload: the framework
|
|
25047
|
+
* (types) and the addon ship on different trains, and the addon is usually
|
|
25048
|
+
* the later of the two.
|
|
25049
|
+
*/
|
|
25050
|
+
oldestMs: number().nullable().optional()
|
|
24736
25051
|
});
|
|
24737
25052
|
/** Recording storage usage + capacity for one storage location. */
|
|
24738
25053
|
var RecordingLocationUsageSchema = object({
|
|
@@ -24760,6 +25075,57 @@ var RecordingStorageUsageSchema = object({
|
|
|
24760
25075
|
locations: array(RecordingLocationUsageSchema)
|
|
24761
25076
|
});
|
|
24762
25077
|
/**
|
|
25078
|
+
* The OPERATOR-ARMED half of multi-location recordings (D116).
|
|
25079
|
+
*
|
|
25080
|
+
* The placement plan decides where NEW writes go and moves nothing. A rebalance
|
|
25081
|
+
* is the operator asking for the EXISTING archive to be brought into line with
|
|
25082
|
+
* that plan: one relocate job per (camera, profile) pile that sits on the wrong
|
|
25083
|
+
* location, run FIFO behind the single-flight mover.
|
|
25084
|
+
*
|
|
25085
|
+
* `plan…` and `start…` return the SAME shape deliberately — what the operator
|
|
25086
|
+
* confirms is exactly what gets enqueued, and `jobIds` is the only difference
|
|
25087
|
+
* (empty on the plan).
|
|
25088
|
+
*/
|
|
25089
|
+
var RecordingRebalanceMoveSchema = object({
|
|
25090
|
+
deviceId: number(),
|
|
25091
|
+
profile: string(),
|
|
25092
|
+
fromLocationId: string(),
|
|
25093
|
+
toLocationId: string(),
|
|
25094
|
+
bytes: number(),
|
|
25095
|
+
files: number().int()
|
|
25096
|
+
});
|
|
25097
|
+
/** Why a pile that is out of place is staying there. Every refusal is
|
|
25098
|
+
* reported: a rebalance that silently drops a camera reads exactly like one
|
|
25099
|
+
* that had nothing to do. */
|
|
25100
|
+
var RecordingRebalanceSkipReasonSchema = _enum([
|
|
25101
|
+
"unassigned",
|
|
25102
|
+
"target-not-writable",
|
|
25103
|
+
"below-threshold",
|
|
25104
|
+
"no-headroom"
|
|
25105
|
+
]);
|
|
25106
|
+
var RecordingRebalanceSkipSchema = object({
|
|
25107
|
+
deviceId: number(),
|
|
25108
|
+
profile: string(),
|
|
25109
|
+
fromLocationId: string(),
|
|
25110
|
+
/** The location the plan wants; null when the camera has no assignment. */
|
|
25111
|
+
toLocationId: string().nullable(),
|
|
25112
|
+
bytes: number(),
|
|
25113
|
+
reason: RecordingRebalanceSkipReasonSchema
|
|
25114
|
+
});
|
|
25115
|
+
var RecordingRebalancePlanSchema = object({
|
|
25116
|
+
moves: array(RecordingRebalanceMoveSchema),
|
|
25117
|
+
skipped: array(RecordingRebalanceSkipSchema),
|
|
25118
|
+
bytesToMove: number(),
|
|
25119
|
+
/** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
|
|
25120
|
+
jobIds: array(string())
|
|
25121
|
+
});
|
|
25122
|
+
var RecordingRebalanceInputSchema = object({
|
|
25123
|
+
/** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
|
|
25124
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
25125
|
+
/** Ignore piles smaller than this (default 1 GB). */
|
|
25126
|
+
minMoveGb: number().min(0).optional()
|
|
25127
|
+
});
|
|
25128
|
+
/**
|
|
24763
25129
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
24764
25130
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
24765
25131
|
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
@@ -24922,9 +25288,24 @@ method(object({
|
|
|
24922
25288
|
}), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
24923
25289
|
kind: "mutation",
|
|
24924
25290
|
auth: "admin"
|
|
25291
|
+
}), method(RelocateFootageInputSchema, object({ jobId: string() }), {
|
|
25292
|
+
kind: "mutation",
|
|
25293
|
+
auth: "admin"
|
|
25294
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
25295
|
+
kind: "query",
|
|
25296
|
+
auth: "admin"
|
|
25297
|
+
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
25298
|
+
kind: "mutation",
|
|
25299
|
+
auth: "admin"
|
|
25300
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
25301
|
+
kind: "query",
|
|
25302
|
+
auth: "admin"
|
|
25303
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
25304
|
+
kind: "mutation",
|
|
25305
|
+
auth: "admin"
|
|
24925
25306
|
});
|
|
24926
25307
|
/**
|
|
24927
|
-
* `
|
|
25308
|
+
* `recording-export` cap — render a footage time range into a single downloadable
|
|
24928
25309
|
* MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
|
|
24929
25310
|
* bounded lifetime with a durable history, auto-expiry, and optional
|
|
24930
25311
|
* delete-after-download.
|
|
@@ -24939,10 +25320,42 @@ method(object({
|
|
|
24939
25320
|
*/
|
|
24940
25321
|
/** Playback-speed multiplier for the render (1 = realtime). */
|
|
24941
25322
|
var ExportSpeedSchema = number().min(.25).max(32);
|
|
25323
|
+
/**
|
|
25324
|
+
* One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
|
|
25325
|
+
*
|
|
25326
|
+
* Relative and not absolute epoch on purpose: the renderer's frame-select
|
|
25327
|
+
* expression sees ffmpeg's `t`, which starts at 0 for the export's source
|
|
25328
|
+
* playlist. Handing it absolute epochs would make every call site responsible
|
|
25329
|
+
* for the same subtraction, and the one that forgot would emit a filter that
|
|
25330
|
+
* selects nothing — silently, as a uniform timelapse.
|
|
25331
|
+
*/
|
|
25332
|
+
var ExportDenseRangeSchema = object({
|
|
25333
|
+
fromSec: number().nonnegative(),
|
|
25334
|
+
toSec: number().nonnegative()
|
|
25335
|
+
}).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
|
|
25336
|
+
/**
|
|
25337
|
+
* Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
|
|
25338
|
+
* listed ranges and at the base `everyMs` everywhere else.
|
|
25339
|
+
*
|
|
25340
|
+
* `everyMs` must be strictly smaller than the base cadence — a dense rate that
|
|
25341
|
+
* is not denser renders a uniform timelapse the operator believes is two-rate.
|
|
25342
|
+
*/
|
|
25343
|
+
var ExportDenseSchema = object({
|
|
25344
|
+
everyMs: number().int().positive(),
|
|
25345
|
+
ranges: array(ExportDenseRangeSchema).min(1).max(200)
|
|
25346
|
+
});
|
|
24942
25347
|
/** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
|
|
24943
25348
|
var ExportTimelapseSchema = object({
|
|
24944
25349
|
everyMs: number().int().positive(),
|
|
24945
|
-
outputFps: number().int().min(1).max(60).optional()
|
|
25350
|
+
outputFps: number().int().min(1).max(60).optional(),
|
|
25351
|
+
/** Optional second, FASTER rate over the intervals that matter. */
|
|
25352
|
+
dense: ExportDenseSchema.optional()
|
|
25353
|
+
}).superRefine((v, ctx) => {
|
|
25354
|
+
if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
|
|
25355
|
+
code: ZodIssueCode.custom,
|
|
25356
|
+
message: "dense.everyMs must be strictly smaller than the base everyMs",
|
|
25357
|
+
path: ["dense", "everyMs"]
|
|
25358
|
+
});
|
|
24946
25359
|
});
|
|
24947
25360
|
/**
|
|
24948
25361
|
* Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
|
|
@@ -25000,6 +25413,19 @@ var ExportDownloadSchema = object({
|
|
|
25000
25413
|
url: string(),
|
|
25001
25414
|
endpoints: array(string())
|
|
25002
25415
|
});
|
|
25416
|
+
/**
|
|
25417
|
+
* A finished export's bytes, inline.
|
|
25418
|
+
*
|
|
25419
|
+
* `bytes` is the DECODED length — the number the caller bounds and logs
|
|
25420
|
+
* against, so nobody has to infer it from the base64 length.
|
|
25421
|
+
*/
|
|
25422
|
+
var ExportBytesSchema = object({
|
|
25423
|
+
base64: string(),
|
|
25424
|
+
contentType: string(),
|
|
25425
|
+
/** Suggested filename, extension included. */
|
|
25426
|
+
name: string(),
|
|
25427
|
+
bytes: number().int().nonnegative()
|
|
25428
|
+
});
|
|
25003
25429
|
method(object({
|
|
25004
25430
|
deviceId: number(),
|
|
25005
25431
|
profile: string(),
|
|
@@ -25024,6 +25450,9 @@ method(object({
|
|
|
25024
25450
|
}), method(object({ exportId: string() }), ExportDownloadSchema, {
|
|
25025
25451
|
kind: "query",
|
|
25026
25452
|
auth: "protected"
|
|
25453
|
+
}), method(object({ exportId: string() }), ExportBytesSchema, {
|
|
25454
|
+
kind: "query",
|
|
25455
|
+
auth: "protected"
|
|
25027
25456
|
});
|
|
25028
25457
|
/**
|
|
25029
25458
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
@@ -31714,6 +32143,12 @@ Object.freeze({
|
|
|
31714
32143
|
addonId: null,
|
|
31715
32144
|
access: "create"
|
|
31716
32145
|
},
|
|
32146
|
+
"recording.cancelRelocateJob": {
|
|
32147
|
+
capName: "recording",
|
|
32148
|
+
capScope: "system",
|
|
32149
|
+
addonId: null,
|
|
32150
|
+
access: "create"
|
|
32151
|
+
},
|
|
31717
32152
|
"recording.cancelStorageMigrationMove": {
|
|
31718
32153
|
capName: "recording",
|
|
31719
32154
|
capScope: "system",
|
|
@@ -31768,6 +32203,12 @@ Object.freeze({
|
|
|
31768
32203
|
addonId: null,
|
|
31769
32204
|
access: "view"
|
|
31770
32205
|
},
|
|
32206
|
+
"recording.listRelocateJobs": {
|
|
32207
|
+
capName: "recording",
|
|
32208
|
+
capScope: "system",
|
|
32209
|
+
addonId: null,
|
|
32210
|
+
access: "view"
|
|
32211
|
+
},
|
|
31771
32212
|
"recording.locateSegment": {
|
|
31772
32213
|
capName: "recording",
|
|
31773
32214
|
capScope: "system",
|
|
@@ -31780,6 +32221,12 @@ Object.freeze({
|
|
|
31780
32221
|
addonId: null,
|
|
31781
32222
|
access: "create"
|
|
31782
32223
|
},
|
|
32224
|
+
"recording.planStorageRebalance": {
|
|
32225
|
+
capName: "recording",
|
|
32226
|
+
capScope: "system",
|
|
32227
|
+
addonId: null,
|
|
32228
|
+
access: "view"
|
|
32229
|
+
},
|
|
31783
32230
|
"recording.pruneFootage": {
|
|
31784
32231
|
capName: "recording",
|
|
31785
32232
|
capScope: "system",
|
|
@@ -31804,6 +32251,12 @@ Object.freeze({
|
|
|
31804
32251
|
addonId: null,
|
|
31805
32252
|
access: "create"
|
|
31806
32253
|
},
|
|
32254
|
+
"recording.relocateFootage": {
|
|
32255
|
+
capName: "recording",
|
|
32256
|
+
capScope: "system",
|
|
32257
|
+
addonId: null,
|
|
32258
|
+
access: "create"
|
|
32259
|
+
},
|
|
31807
32260
|
"recording.renderClip": {
|
|
31808
32261
|
capName: "recording",
|
|
31809
32262
|
capScope: "system",
|
|
@@ -31840,38 +32293,50 @@ Object.freeze({
|
|
|
31840
32293
|
addonId: null,
|
|
31841
32294
|
access: "create"
|
|
31842
32295
|
},
|
|
32296
|
+
"recording.startStorageRebalance": {
|
|
32297
|
+
capName: "recording",
|
|
32298
|
+
capScope: "system",
|
|
32299
|
+
addonId: null,
|
|
32300
|
+
access: "create"
|
|
32301
|
+
},
|
|
31843
32302
|
"recordingExport.cancelExport": {
|
|
31844
|
-
capName: "
|
|
32303
|
+
capName: "recording-export",
|
|
31845
32304
|
capScope: "system",
|
|
31846
32305
|
addonId: null,
|
|
31847
32306
|
access: "create"
|
|
31848
32307
|
},
|
|
31849
32308
|
"recordingExport.createExport": {
|
|
31850
|
-
capName: "
|
|
32309
|
+
capName: "recording-export",
|
|
31851
32310
|
capScope: "system",
|
|
31852
32311
|
addonId: null,
|
|
31853
32312
|
access: "create"
|
|
31854
32313
|
},
|
|
31855
32314
|
"recordingExport.deleteExport": {
|
|
31856
|
-
capName: "
|
|
32315
|
+
capName: "recording-export",
|
|
31857
32316
|
capScope: "system",
|
|
31858
32317
|
addonId: null,
|
|
31859
32318
|
access: "delete"
|
|
31860
32319
|
},
|
|
31861
32320
|
"recordingExport.getDownloadUrl": {
|
|
31862
|
-
capName: "
|
|
32321
|
+
capName: "recording-export",
|
|
31863
32322
|
capScope: "system",
|
|
31864
32323
|
addonId: null,
|
|
31865
32324
|
access: "view"
|
|
31866
32325
|
},
|
|
31867
32326
|
"recordingExport.getExport": {
|
|
31868
|
-
capName: "
|
|
32327
|
+
capName: "recording-export",
|
|
31869
32328
|
capScope: "system",
|
|
31870
32329
|
addonId: null,
|
|
31871
32330
|
access: "view"
|
|
31872
32331
|
},
|
|
31873
32332
|
"recordingExport.listExports": {
|
|
31874
|
-
capName: "
|
|
32333
|
+
capName: "recording-export",
|
|
32334
|
+
capScope: "system",
|
|
32335
|
+
addonId: null,
|
|
32336
|
+
access: "view"
|
|
32337
|
+
},
|
|
32338
|
+
"recordingExport.readExportBytes": {
|
|
32339
|
+
capName: "recording-export",
|
|
31875
32340
|
capScope: "system",
|
|
31876
32341
|
addonId: null,
|
|
31877
32342
|
access: "view"
|
|
@@ -33248,6 +33713,104 @@ var FramerateField = number().int().min(1).max(60);
|
|
|
33248
33713
|
var TargetsField = array(NcRuleTargetSchema).min(1);
|
|
33249
33714
|
var PriorityField = number().int().min(1).max(5);
|
|
33250
33715
|
/**
|
|
33716
|
+
* Explicit override of the DENSE sampling cadence, seconds.
|
|
33717
|
+
*
|
|
33718
|
+
* Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
|
|
33719
|
+
* 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
|
|
33720
|
+
* made that same base 3 s and rendered a person pass as two frames.)
|
|
33721
|
+
*
|
|
33722
|
+
* THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
|
|
33723
|
+
* `denseCadenceSec` and played at `framerate` occupies
|
|
33724
|
+
*
|
|
33725
|
+
* outputSeconds = (rangeSec / denseCadenceSec) / framerate
|
|
33726
|
+
*
|
|
33727
|
+
* 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.
|
|
33728
|
+
* Halving this field doubles the frames INSIDE ranges only — the base cadence,
|
|
33729
|
+
* and therefore the length of a quiet night, does not move.
|
|
33730
|
+
*
|
|
33731
|
+
* Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
|
|
33732
|
+
* the recording has them returns the same frames, requested twice. Must be
|
|
33733
|
+
* STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
|
|
33734
|
+
* a uniform video the operator believes is two-rate — and upsert refuses it
|
|
33735
|
+
* rather than letting the export cap reject the render hours after the window.
|
|
33736
|
+
*/
|
|
33737
|
+
var DenseCadenceSecField = number().min(.1).max(3600);
|
|
33738
|
+
/**
|
|
33739
|
+
* Minimum seconds of OUTPUT video each detection range must occupy.
|
|
33740
|
+
*
|
|
33741
|
+
* The operator-facing form of the arithmetic above: instead of solving for a
|
|
33742
|
+
* cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
|
|
33743
|
+
* 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
|
|
33744
|
+
* that range every ~583 ms.
|
|
33745
|
+
*
|
|
33746
|
+
* ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
|
|
33747
|
+
* ranges are terms of a single ffmpeg `select` expression that cannot vary rate
|
|
33748
|
+
* per term — so the MOST DEMANDING (shortest) range sets the rate and longer
|
|
33749
|
+
* ranges are sampled denser than they need. Per-range cadences require a cap
|
|
33750
|
+
* schema change and are the tracked follow-up.
|
|
33751
|
+
*
|
|
33752
|
+
* A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
|
|
33753
|
+
* is rendered with every frame that EXISTS and no more: the guarantee is capped
|
|
33754
|
+
* by real footage, never met by duplicating frames into motion that never
|
|
33755
|
+
* happened.
|
|
33756
|
+
*/
|
|
33757
|
+
var MinDwellSecField = number().min(0).max(60);
|
|
33758
|
+
/**
|
|
33759
|
+
* Caption burned into the notification's preview frame.
|
|
33760
|
+
*
|
|
33761
|
+
* Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
|
|
33762
|
+
* `rule`, `from`, `to`) and rendered by the SAME renderer — a second
|
|
33763
|
+
* templating dialect for one field would be a second thing to explain.
|
|
33764
|
+
*
|
|
33765
|
+
* Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
|
|
33766
|
+
* operator saying "the frame, no caption" — a distinct, reachable answer, and
|
|
33767
|
+
* the reason this is not `.min(1)`.
|
|
33768
|
+
*/
|
|
33769
|
+
var PreviewTextField = string().max(200);
|
|
33770
|
+
/**
|
|
33771
|
+
* Whether the notification's preview is a STILL or a short animation.
|
|
33772
|
+
*
|
|
33773
|
+
* The operator's ask, verbatim: *"inviato come gif o video (come per le altre
|
|
33774
|
+
* rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
|
|
33775
|
+
* night reads better as three seconds of motion than as one frame of it. Both
|
|
33776
|
+
* modes get the SAME treatment (blurred frame, large centred title); `'gif'`
|
|
33777
|
+
* simply applies it to a dozen frames sampled across the render and assembles
|
|
33778
|
+
* them.
|
|
33779
|
+
*
|
|
33780
|
+
* `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
|
|
33781
|
+
* seeks and a palette pass, and no rule that never asked for one should start
|
|
33782
|
+
* paying that on the deploy that shipped it.
|
|
33783
|
+
*
|
|
33784
|
+
* A GIF that cannot be assembled DEGRADES to the still — never to nothing.
|
|
33785
|
+
*/
|
|
33786
|
+
var PreviewModeField = _enum(["image", "gif"]);
|
|
33787
|
+
/**
|
|
33788
|
+
* Which detection classes the notification reports counts for.
|
|
33789
|
+
*
|
|
33790
|
+
* The counts come from the tracks the render ALREADY fetched for its dense-range
|
|
33791
|
+
* plan — no second query — aggregated per class. Absent or empty means "every
|
|
33792
|
+
* class the window actually contained", which is what an operator who never
|
|
33793
|
+
* opened the field wants; a list narrows it (`['person']` on a driveway that
|
|
33794
|
+
* counts cars all night).
|
|
33795
|
+
*
|
|
33796
|
+
* Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
|
|
33797
|
+
* …). An unknown name simply never matches and reports nothing — it is not an
|
|
33798
|
+
* error, because a rule may legitimately name a class this camera's model does
|
|
33799
|
+
* not emit.
|
|
33800
|
+
*
|
|
33801
|
+
* The counts are exposed to {@link TimelapseTemplateSchema} as:
|
|
33802
|
+
* - `{{detections}}` — total over the reported classes
|
|
33803
|
+
* - `{{detectionSummary}}` — `2 persone, 1 veicolo`
|
|
33804
|
+
* - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
|
|
33805
|
+
* one per class, `count_` + the class name
|
|
33806
|
+
*
|
|
33807
|
+
* With NO custom body template the summary is appended to the derived body, and
|
|
33808
|
+
* only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
|
|
33809
|
+
* reads. With a custom template the operator owns every word — nothing is
|
|
33810
|
+
* appended, so `{{detectionSummary}}` is how he asks for it.
|
|
33811
|
+
*/
|
|
33812
|
+
var ReportClassesField = array(string().min(1).max(40)).max(20);
|
|
33813
|
+
/**
|
|
33251
33814
|
* Client-supplied timelapse-rule fields. The server stamps id / createdBy /
|
|
33252
33815
|
* createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
|
|
33253
33816
|
* here (see the ownership note above).
|
|
@@ -33267,9 +33830,30 @@ var TimelapseRuleInputSchema = object({
|
|
|
33267
33830
|
cadenceSec: CadenceSecField.default(15),
|
|
33268
33831
|
/** Output frames per second of the assembled mp4 (predecessor parity). */
|
|
33269
33832
|
framerate: FramerateField.default(10),
|
|
33833
|
+
/**
|
|
33834
|
+
* Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
|
|
33835
|
+
* as `max(1s, cadenceSec / 30)`, which is what every rule written before this
|
|
33836
|
+
* field gets.
|
|
33837
|
+
*/
|
|
33838
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
33839
|
+
/** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
|
|
33840
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
33270
33841
|
/** `notification-output` targets the finished video/thumbnail is sent to. */
|
|
33271
33842
|
targets: TargetsField,
|
|
33272
33843
|
template: TimelapseTemplateSchema.optional(),
|
|
33844
|
+
/**
|
|
33845
|
+
* Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
|
|
33846
|
+
* and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
|
|
33847
|
+
*
|
|
33848
|
+
* Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
|
|
33849
|
+
* the notification's title/body, and clearing it (`template: null`) must not
|
|
33850
|
+
* silently clear the caption too.
|
|
33851
|
+
*/
|
|
33852
|
+
previewText: PreviewTextField.optional(),
|
|
33853
|
+
/** Still or animation — see {@link PreviewModeField}. */
|
|
33854
|
+
previewMode: PreviewModeField.default("image"),
|
|
33855
|
+
/** Classes the notification counts — see {@link ReportClassesField}. */
|
|
33856
|
+
reportClasses: ReportClassesField.optional(),
|
|
33273
33857
|
/** Canonical notification priority ordinal (1..5); per-target overridable. */
|
|
33274
33858
|
priority: PriorityField.default(3)
|
|
33275
33859
|
});
|
|
@@ -33280,8 +33864,13 @@ object({
|
|
|
33280
33864
|
schedule: NcScheduleSchema.optional(),
|
|
33281
33865
|
cadenceSec: CadenceSecField.optional(),
|
|
33282
33866
|
framerate: FramerateField.optional(),
|
|
33867
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
33868
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
33283
33869
|
targets: TargetsField.optional(),
|
|
33284
33870
|
template: TimelapseTemplateSchema.nullable().optional(),
|
|
33871
|
+
previewText: PreviewTextField.optional(),
|
|
33872
|
+
previewMode: PreviewModeField.optional(),
|
|
33873
|
+
reportClasses: ReportClassesField.optional(),
|
|
33285
33874
|
priority: PriorityField.optional()
|
|
33286
33875
|
});
|
|
33287
33876
|
TimelapseRuleInputSchema.extend({
|
|
@@ -33293,10 +33882,28 @@ TimelapseRuleInputSchema.extend({
|
|
|
33293
33882
|
*/
|
|
33294
33883
|
ownerUserId: string().optional(),
|
|
33295
33884
|
/**
|
|
33296
|
-
* Epoch-ms of the
|
|
33297
|
-
*
|
|
33885
|
+
* Epoch-ms of the NEWEST successful generation across every camera of this
|
|
33886
|
+
* rule. What a UI shows, and the compatibility floor for
|
|
33887
|
+
* {@link readTimelapseGeneratedAt}. Absent = never generated.
|
|
33298
33888
|
*/
|
|
33299
33889
|
lastGeneratedAt: number().optional(),
|
|
33890
|
+
/**
|
|
33891
|
+
* PER-CAMERA generation state, keyed by `String(deviceId)` — the
|
|
33892
|
+
* re-generation guard's real durable state.
|
|
33893
|
+
*
|
|
33894
|
+
* One rule covers several cameras and each renders its own video, so a rule
|
|
33895
|
+
* -wide stamp is wrong in the direction that DESTROYS work: camera A
|
|
33896
|
+
* succeeding at 06:05 tells camera B, whose render failed, that it is
|
|
33897
|
+
* already done — and B's night is gone for good, because the window will not
|
|
33898
|
+
* come back.
|
|
33899
|
+
*
|
|
33900
|
+
* ADDITIVE, so the migration is free: a row written before this field simply
|
|
33901
|
+
* has no map, and {@link readTimelapseGeneratedAt} falls back to
|
|
33902
|
+
* {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
|
|
33903
|
+
* "never generated" would re-render and re-notify every camera of every rule
|
|
33904
|
+
* once, on the deploy that shipped the map.
|
|
33905
|
+
*/
|
|
33906
|
+
generatedByDevice: record(string(), number()).optional(),
|
|
33300
33907
|
/** userId of the caller who created the rule (server-stamped). */
|
|
33301
33908
|
createdBy: string(),
|
|
33302
33909
|
createdAt: number(),
|