@camstack/addon-provider-rtsp 1.2.13 → 1.2.15
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 +704 -56
- package/dist/addon.mjs +704 -56
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -7243,8 +7243,31 @@ var AdoptionJobSchema = object({
|
|
|
7243
7243
|
error: string().nullable()
|
|
7244
7244
|
});
|
|
7245
7245
|
/**
|
|
7246
|
-
* Per-camera FUNCTION SWITCHES
|
|
7247
|
-
*
|
|
7246
|
+
* Per-camera FUNCTION SWITCHES.
|
|
7247
|
+
*
|
|
7248
|
+
* ## The aggregate group is being withdrawn — the BADGE is not (D113)
|
|
7249
|
+
*
|
|
7250
|
+
* This file shipped as "the one coherent on/off surface over the pipeline
|
|
7251
|
+
* functions an operator thinks in terms of". The operator's verdict on
|
|
7252
|
+
* 2026-08-12 was that the coherent surface bought complexity and no clarity:
|
|
7253
|
+
* every function already had a settings page of its own, and a second place to
|
|
7254
|
+
* turn it off is a second place to look. Each switch is going back to its own
|
|
7255
|
+
* component's original options — detection to the detection-pipeline wrapper
|
|
7256
|
+
* binding, audio analysis to its own, recording to `RecordingConfig.enabled`
|
|
7257
|
+
* (which was always first-class; the switch was a veneer over
|
|
7258
|
+
* `recording.setDeviceConfig`), notifications to a notification-center
|
|
7259
|
+
* per-device setting, the two camera planes to their own components.
|
|
7260
|
+
*
|
|
7261
|
+
* What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
|
|
7262
|
+
* thing that lets a status surface say DISABLED instead of BROKEN, recomposed
|
|
7263
|
+
* straight from the authorities with no group in the middle. That rule was
|
|
7264
|
+
* never about a control panel.
|
|
7265
|
+
*
|
|
7266
|
+
* Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
|
|
7267
|
+
* {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
|
|
7268
|
+
* `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
|
|
7269
|
+
* viewers (v1.0.305) and the admin UI still call it. It is deleted when they
|
|
7270
|
+
* stop; nothing new may be built on it.
|
|
7248
7271
|
*
|
|
7249
7272
|
* ## This file adds no state
|
|
7250
7273
|
*
|
|
@@ -7627,7 +7650,15 @@ var RecordingConfigSchema = object({
|
|
|
7627
7650
|
* Each completed/failed run also lands one durable ops-log row on its owning
|
|
7628
7651
|
* addon surface.
|
|
7629
7652
|
*/
|
|
7653
|
+
/**
|
|
7654
|
+
* `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
|
|
7655
|
+
* rebalance enqueues one job per (camera, profile). Refusing the second job —
|
|
7656
|
+
* what the engine did before — turned a fifteen-camera rebalance into fifteen
|
|
7657
|
+
* manual retries. Queued jobs run FIFO; a queued job that is cancelled never
|
|
7658
|
+
* runs at all.
|
|
7659
|
+
*/
|
|
7630
7660
|
var RelocateJobStateSchema = _enum([
|
|
7661
|
+
"queued",
|
|
7631
7662
|
"running",
|
|
7632
7663
|
"done",
|
|
7633
7664
|
"failed",
|
|
@@ -7662,6 +7693,15 @@ var RelocateFootageInputSchema = object({
|
|
|
7662
7693
|
/** Limits relocation to the logical profile class. Omit only for the
|
|
7663
7694
|
* pre-orchestration compatibility path. */
|
|
7664
7695
|
footageClass: RelocateFootageClassSchema.optional(),
|
|
7696
|
+
/** Scope the move to ONE camera. Absent = every camera on the source, which
|
|
7697
|
+
* is what a whole-disk drain means. The rebalance path always sets it: its
|
|
7698
|
+
* unit is a (camera, profile) pile, not a disk. */
|
|
7699
|
+
deviceId: number().int().optional(),
|
|
7700
|
+
/** Scope the move to specific segment profiles (`high` / `mid` / `low`).
|
|
7701
|
+
* Finer than `footageClass`, which cannot separate high from mid — and the
|
|
7702
|
+
* placement plan assigns those two independently, so a rebalance that could
|
|
7703
|
+
* only say "recordings" would move footage the plan never asked to move. */
|
|
7704
|
+
profiles: array(string()).optional(),
|
|
7665
7705
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
7666
7706
|
* never allowed to starve live writers. */
|
|
7667
7707
|
throttleMbps: number().min(1).max(1e3).optional()
|
|
@@ -7797,6 +7837,21 @@ var StorageLocationSchema = object({
|
|
|
7797
7837
|
nodeId: string().optional(),
|
|
7798
7838
|
isDefault: boolean().default(false),
|
|
7799
7839
|
isSystem: boolean().default(false),
|
|
7840
|
+
/**
|
|
7841
|
+
* Operator opt-in: whether consumers that BALANCE across several locations
|
|
7842
|
+
* of a type may write here. Recordings reads it today; event media and
|
|
7843
|
+
* backups are the next consumers, which is why the flag lives on the
|
|
7844
|
+
* location rather than in any one addon's store — nothing has to be
|
|
7845
|
+
* extended to add the next consumer.
|
|
7846
|
+
*
|
|
7847
|
+
* OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
|
|
7848
|
+
* flag existed reads back with no flag and keeps working exactly as before;
|
|
7849
|
+
* that is the whole compat story, and it is why no migration ships with it.
|
|
7850
|
+
* A newly CREATED sibling is stamped `false` by the orchestrator (creating a
|
|
7851
|
+
* disk must not silently start writing to it); the default of a type is
|
|
7852
|
+
* always stamped `true`.
|
|
7853
|
+
*/
|
|
7854
|
+
enabled: boolean().optional(),
|
|
7800
7855
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
7801
7856
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
7802
7857
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -12349,7 +12404,8 @@ method(object({
|
|
|
12349
12404
|
}), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
|
|
12350
12405
|
/**
|
|
12351
12406
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
12352
|
-
* filesystem
|
|
12407
|
+
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
12408
|
+
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
12353
12409
|
* admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
|
|
12354
12410
|
* (one provider per node); the hub calls it with `{nodeId}` so the codegen
|
|
12355
12411
|
* routes to that exact node (default `nodeIdMode:'routing'`).
|
|
@@ -14190,6 +14246,13 @@ var MaskGridDimsSchema = object({
|
|
|
14190
14246
|
* `package-event` are pure trigger kinds (no urgency dimension). Extending
|
|
14191
14247
|
* this one field keeps the schema additive — a rule still declares exactly
|
|
14192
14248
|
* one trigger.
|
|
14249
|
+
*
|
|
14250
|
+
* AUDIO rules add no member here, for the reason occupancy added none: the
|
|
14251
|
+
* enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
|
|
14252
|
+
* mirror.ts` fails the build on a member the app cannot render) and every
|
|
14253
|
+
* member costs a release train. A sustained-sound rule is therefore an
|
|
14254
|
+
* `immediate` rule carrying {@link NcConditions.audio} — the condition is the
|
|
14255
|
+
* trigger discriminator, exactly as `occupancy` is on `device-event`.
|
|
14193
14256
|
*/
|
|
14194
14257
|
var NcDeliverySchema = _enum([
|
|
14195
14258
|
"immediate",
|
|
@@ -14204,15 +14267,32 @@ var NcDeliverySchema = _enum([
|
|
|
14204
14267
|
* depend on a provider's raw event name or payload shape.
|
|
14205
14268
|
*/
|
|
14206
14269
|
var NcSystemEventKindSchema = _enum([
|
|
14207
|
-
"
|
|
14208
|
-
"
|
|
14270
|
+
"device-online",
|
|
14271
|
+
"device-offline",
|
|
14272
|
+
"device-disabled",
|
|
14273
|
+
"device-enabled",
|
|
14209
14274
|
"stream-online",
|
|
14210
14275
|
"stream-offline",
|
|
14211
14276
|
"node-online",
|
|
14212
14277
|
"node-offline",
|
|
14213
14278
|
"addon-update-available",
|
|
14214
|
-
"server-update-available"
|
|
14279
|
+
"server-update-available",
|
|
14280
|
+
"alarm-triggered",
|
|
14281
|
+
"alarm-armed",
|
|
14282
|
+
"alarm-disarmed",
|
|
14283
|
+
"camera-online",
|
|
14284
|
+
"camera-offline",
|
|
14285
|
+
"camera-disabled",
|
|
14286
|
+
"camera-enabled"
|
|
14287
|
+
]);
|
|
14288
|
+
/** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
|
|
14289
|
+
var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
|
|
14290
|
+
"camera-online",
|
|
14291
|
+
"camera-offline",
|
|
14292
|
+
"camera-disabled",
|
|
14293
|
+
"camera-enabled"
|
|
14215
14294
|
]);
|
|
14295
|
+
NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
|
|
14216
14296
|
/**
|
|
14217
14297
|
* One coherent system-event condition. `kinds` is the required opt-in safety
|
|
14218
14298
|
* gate; the remaining lists are optional narrowing filters relevant to the
|
|
@@ -14221,6 +14301,18 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14221
14301
|
var NcSystemEventConditionSchema = object({
|
|
14222
14302
|
kinds: array(NcSystemEventKindSchema).min(1),
|
|
14223
14303
|
deviceIds: array(number().int()).min(1).optional(),
|
|
14304
|
+
/**
|
|
14305
|
+
* Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
|
|
14306
|
+
* `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
|
|
14307
|
+
* is what a liveness rule means when nobody said otherwise.
|
|
14308
|
+
*
|
|
14309
|
+
* This is where "only my cameras" is expressed, and it lives on the rule for
|
|
14310
|
+
* one reason: the intake cannot know which devices this household cares
|
|
14311
|
+
* about, and a producer-side filter is one no operator can change. Fails
|
|
14312
|
+
* CLOSED — a subject whose device type is unknown (an id the device mirror
|
|
14313
|
+
* does not carry) matches no `deviceTypes` list.
|
|
14314
|
+
*/
|
|
14315
|
+
deviceTypes: array(string().min(1)).min(1).optional(),
|
|
14224
14316
|
nodeIds: array(string().min(1)).min(1).optional(),
|
|
14225
14317
|
packageNames: array(string().min(1)).min(1).optional()
|
|
14226
14318
|
});
|
|
@@ -14271,6 +14363,47 @@ var NcOccupancyConditionSchema = object({
|
|
|
14271
14363
|
sustainSeconds: number().int().min(0).max(3600).default(15)
|
|
14272
14364
|
});
|
|
14273
14365
|
/**
|
|
14366
|
+
* Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
|
|
14367
|
+
*
|
|
14368
|
+
* Operator-approved vocabulary (2026-08-12, option A — the same one the
|
|
14369
|
+
* reference notifier uses, so an operator moving between them re-uses what
|
|
14370
|
+
* they already know): a rule matches when, over a sampling window of
|
|
14371
|
+
* `samplingSeconds`, at least `hitPercent`% of the audio samples in that
|
|
14372
|
+
* window are HITS. A sample is a hit when it satisfies BOTH present filters:
|
|
14373
|
+
*
|
|
14374
|
+
* - `dbThreshold` — its level is at or above this many dBFS (see
|
|
14375
|
+
* {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
|
|
14376
|
+
* - `labels` — the classifier put at least one of these labels on it.
|
|
14377
|
+
*
|
|
14378
|
+
* Both are OPTIONAL and independent, which is the point of the shape: a
|
|
14379
|
+
* loudness rule ("something loud at 3am") needs no model to be right, and a
|
|
14380
|
+
* label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
|
|
14381
|
+
* is given** — a window in which every sample is trivially a hit would fire on
|
|
14382
|
+
* silence, so the engine refuses such a condition rather than notifying on
|
|
14383
|
+
* nothing (the schema cannot express "at least one of" without becoming a
|
|
14384
|
+
* ZodEffects the cap path would have to special-case).
|
|
14385
|
+
*
|
|
14386
|
+
* `hitPercent` is over the samples the window actually HOLDS, and the window
|
|
14387
|
+
* must be FULL before it can match — a window that has been open for two
|
|
14388
|
+
* seconds of its ten is 100% of nothing, and firing on it would make
|
|
14389
|
+
* `samplingSeconds` decorative.
|
|
14390
|
+
*
|
|
14391
|
+
* Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
|
|
14392
|
+
* `audio-*` ids). Both spellings are accepted — the matcher normalizes the
|
|
14393
|
+
* `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
|
|
14394
|
+
* an operator who typed `dog` mean the same thing.
|
|
14395
|
+
*/
|
|
14396
|
+
var NcAudioConditionSchema = object({
|
|
14397
|
+
/** Audio macro labels; absent = any sound (level-only rule). */
|
|
14398
|
+
labels: array(string().min(1)).min(1).optional(),
|
|
14399
|
+
/** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
|
|
14400
|
+
dbThreshold: number().min(-96).max(0).optional(),
|
|
14401
|
+
/** Percentage of the window's samples that must be hits (1–100). */
|
|
14402
|
+
hitPercent: number().int().min(1).max(100).default(60),
|
|
14403
|
+
/** Length of the sampling window in seconds. */
|
|
14404
|
+
samplingSeconds: number().int().min(1).max(300).default(10)
|
|
14405
|
+
});
|
|
14406
|
+
/**
|
|
14274
14407
|
* Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
|
|
14275
14408
|
*
|
|
14276
14409
|
* The values are not symmetric, and deliberately so — the absent value has to
|
|
@@ -14543,7 +14676,33 @@ var NcConditionsSchema = object({
|
|
|
14543
14676
|
* threshold and holds for `sustainSeconds`. Fail-closed on missing
|
|
14544
14677
|
* substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
|
|
14545
14678
|
*/
|
|
14546
|
-
occupancy: NcOccupancyConditionSchema.optional()
|
|
14679
|
+
occupancy: NcOccupancyConditionSchema.optional(),
|
|
14680
|
+
/**
|
|
14681
|
+
* IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
|
|
14682
|
+
* `samplingSeconds` window clear the optional `dbThreshold` and carry one of
|
|
14683
|
+
* the optional `labels`. Fail-closed on missing substrate (no audio samples,
|
|
14684
|
+
* a window that is not full yet, neither filter given). See
|
|
14685
|
+
* {@link NcAudioCondition}.
|
|
14686
|
+
*
|
|
14687
|
+
* Presence of this key is what makes a rule an AUDIO rule: the engine fires
|
|
14688
|
+
* it ONLY on a confirmed audio window, and a rule carrying it never fires on
|
|
14689
|
+
* a detection, a track or a device event (the same fail-closed pairing
|
|
14690
|
+
* `occupancy` has with the `device-event` trigger). That is how audio labels
|
|
14691
|
+
* leave `classes`: an audio rule names its sounds HERE, and the legacy path
|
|
14692
|
+
* (an `immediate` rule naming an `audio-*` class, one notification per
|
|
14693
|
+
* classified sample) stays exactly as it was for rules that already use it.
|
|
14694
|
+
*
|
|
14695
|
+
* NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
|
|
14696
|
+
* rather than an oversight: the viewer mirrors the descriptor enums BY HAND
|
|
14697
|
+
* (`camstack/src/data/notification-center.ts`, guarded by
|
|
14698
|
+
* `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
|
|
14699
|
+
* condition fields it does not know when a rule is saved from the phone.
|
|
14700
|
+
* Publishing an editor for a condition the app cannot round-trip is how an
|
|
14701
|
+
* operator loses a rule's conditions by opening it — so the descriptor, the
|
|
14702
|
+
* admin widget and the viewer mirror land together (P2 + P3), and only then
|
|
14703
|
+
* does an audio rule become authorable.
|
|
14704
|
+
*/
|
|
14705
|
+
audio: NcAudioConditionSchema.optional()
|
|
14547
14706
|
});
|
|
14548
14707
|
/** One delivery target: a `notification-output` Target ref + passthrough params. */
|
|
14549
14708
|
var NcRuleTargetSchema = object({
|
|
@@ -14657,6 +14816,73 @@ var NcThrottleSchema = object({
|
|
|
14657
14816
|
*/
|
|
14658
14817
|
granularity: NcThrottleGranularitySchema.optional()
|
|
14659
14818
|
});
|
|
14819
|
+
/**
|
|
14820
|
+
* How long the confirm gate may hold ONE notification, and how big the picture
|
|
14821
|
+
* it judges may be.
|
|
14822
|
+
*
|
|
14823
|
+
* The clamp is the product decision, not a coincidence of the model: p50 was
|
|
14824
|
+
* 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
|
|
14825
|
+
* arrives after the visitor has gone is not a notification. 448 px was enough
|
|
14826
|
+
* to score 16/16 on the operator's parking scenario — bigger costs latency and
|
|
14827
|
+
* tokens for pixels the model pools away.
|
|
14828
|
+
*/
|
|
14829
|
+
var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
|
|
14830
|
+
var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
|
|
14831
|
+
var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
|
|
14832
|
+
/** Comparison the model's COUNT must satisfy for the notification to fire. */
|
|
14833
|
+
var NcConfirmExpectSchema = object({
|
|
14834
|
+
op: _enum([
|
|
14835
|
+
">=",
|
|
14836
|
+
">",
|
|
14837
|
+
"<=",
|
|
14838
|
+
"<",
|
|
14839
|
+
"=="
|
|
14840
|
+
]),
|
|
14841
|
+
count: number().int().min(0).max(1e3)
|
|
14842
|
+
});
|
|
14843
|
+
/**
|
|
14844
|
+
* AI CONFIRM — a vision model looks at the picture this notification is about
|
|
14845
|
+
* to ship and says whether it agrees with the rule.
|
|
14846
|
+
*
|
|
14847
|
+
* It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
|
|
14848
|
+
* crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
|
|
14849
|
+
* on the operator's phone is not a verdict about this notification.
|
|
14850
|
+
*
|
|
14851
|
+
* FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
|
|
14852
|
+
* whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
|
|
14853
|
+
* the default and every fail-open is COUNTED, because a gate that always fails
|
|
14854
|
+
* open looks in the log exactly like a gate that works.
|
|
14855
|
+
*
|
|
14856
|
+
* Every field is `.optional()` rather than relied on as a Zod default at the
|
|
14857
|
+
* runtime seam: a Zod default does NOT run on the addon→addon cap path (three
|
|
14858
|
+
* production failures in one day), so the gate reads absent as the constant
|
|
14859
|
+
* above rather than trusting a parse it may never have seen.
|
|
14860
|
+
*/
|
|
14861
|
+
var NcConfirmSchema = object({
|
|
14862
|
+
/** Off unless asked for. An absent `confirm` and `enabled:false` are the
|
|
14863
|
+
* same thing, and both mean "deliver exactly as before". */
|
|
14864
|
+
enabled: boolean().default(false),
|
|
14865
|
+
/** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
|
|
14866
|
+
profileId: string().optional(),
|
|
14867
|
+
/**
|
|
14868
|
+
* The operator's question, in his own words. Absent = a question derived
|
|
14869
|
+
* from the rule (its class and its expectation).
|
|
14870
|
+
*
|
|
14871
|
+
* NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
|
|
14872
|
+
* banners, signage and plates as instructions if you let them reach the
|
|
14873
|
+
* prompt — proven live — so the authoritative contract stays in the system
|
|
14874
|
+
* turn and only rule-authored words land here.
|
|
14875
|
+
*/
|
|
14876
|
+
prompt: string().max(1e3).optional(),
|
|
14877
|
+
/** Fire only when the model's count satisfies this. Absent = the model's
|
|
14878
|
+
* own boolean verdict decides. */
|
|
14879
|
+
expect: NcConfirmExpectSchema.optional(),
|
|
14880
|
+
timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
|
|
14881
|
+
/** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
|
|
14882
|
+
onTimeout: _enum(["fire", "suppress"]).default("fire"),
|
|
14883
|
+
/** Longest edge the judged image is downscaled to before it is sent. */
|
|
14884
|
+
maxImagePx: number().int().min(64).max(2048).default(448)
|
|
14885
|
+
});
|
|
14660
14886
|
/** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
|
|
14661
14887
|
var NcRuleInputSchema = object({
|
|
14662
14888
|
name: string().min(1).max(200),
|
|
@@ -14717,7 +14943,13 @@ var NcRuleInputSchema = object({
|
|
|
14717
14943
|
* `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
|
|
14718
14944
|
* shape as every other actuation.
|
|
14719
14945
|
*/
|
|
14720
|
-
actions: NcRuleActionsSchema.optional()
|
|
14946
|
+
actions: NcRuleActionsSchema.optional(),
|
|
14947
|
+
/**
|
|
14948
|
+
* AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
|
|
14949
|
+
* a rule that predates the gate must keep delivering byte-for-byte as it
|
|
14950
|
+
* did, and absent is the only way to say that without a migration.
|
|
14951
|
+
*/
|
|
14952
|
+
confirm: NcConfirmSchema.optional()
|
|
14721
14953
|
});
|
|
14722
14954
|
/**
|
|
14723
14955
|
* Partial patch for `updateRule` — any subset of the input fields, plus the
|
|
@@ -14728,7 +14960,37 @@ var NcRuleInputSchema = object({
|
|
|
14728
14960
|
* still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
|
|
14729
14961
|
* `updateRule` patch.
|
|
14730
14962
|
*/
|
|
14731
|
-
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
14963
|
+
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
14964
|
+
disabledTargetIds: array(string()).optional(),
|
|
14965
|
+
/**
|
|
14966
|
+
* `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
|
|
14967
|
+
*
|
|
14968
|
+
* It makes the key optional to SUPPLY; the parse still materialises the
|
|
14969
|
+
* default when the key is absent. And `NcRuleStore.update` merges with
|
|
14970
|
+
* `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
|
|
14971
|
+
* one — which made every partial edit destructive:
|
|
14972
|
+
*
|
|
14973
|
+
* nc.updateRule({ throttle }) → conditions reset to `{}`
|
|
14974
|
+
* nc.setRuleTargetEnabled(...) → conditions reset to `{}`
|
|
14975
|
+
* setEnabled(ruleId, false) → conditions reset to `{}`
|
|
14976
|
+
*
|
|
14977
|
+
* A rule scoped to one camera and one zone silently became a rule that
|
|
14978
|
+
* matches EVERY event on EVERY camera, and lost its `media` policy
|
|
14979
|
+
* (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
|
|
14980
|
+
* live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
|
|
14981
|
+
* within a minute of a two-field patch.
|
|
14982
|
+
*
|
|
14983
|
+
* So every defaulted field is re-declared here WITHOUT its default. The
|
|
14984
|
+
* inner defaults still apply when the caller DOES send the key — `{}` for
|
|
14985
|
+
* conditions remains a real instruction ("clear them") — and only the
|
|
14986
|
+
* absent key is now genuinely absent.
|
|
14987
|
+
*/
|
|
14988
|
+
enabled: boolean().optional(),
|
|
14989
|
+
conditions: NcConditionsSchema.optional(),
|
|
14990
|
+
media: NcMediaPolicySchema.optional(),
|
|
14991
|
+
throttle: NcThrottleSchema.optional(),
|
|
14992
|
+
priority: number().int().min(1).max(5).optional()
|
|
14993
|
+
});
|
|
14732
14994
|
/** A persisted rule. */
|
|
14733
14995
|
var NcRuleSchema = NcRuleInputSchema.extend({
|
|
14734
14996
|
id: string(),
|
|
@@ -15029,6 +15291,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
|
|
|
15029
15291
|
* Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
|
|
15030
15292
|
* copy would lie the first time a rule is disabled.
|
|
15031
15293
|
*/
|
|
15294
|
+
/**
|
|
15295
|
+
* Why a device a mode NAMES is nonetheless not armed by it.
|
|
15296
|
+
*
|
|
15297
|
+
* Each value is an existing authority, never a new flag (D62): `muted` is the
|
|
15298
|
+
* per-camera notification switch the Notification Center already owns,
|
|
15299
|
+
* `detection-off` is the device's own detection binding being inactive, and
|
|
15300
|
+
* `offline` is the device manager's liveness. A fourth reason would mean a
|
|
15301
|
+
* fourth authority, and inventing one here is how a panel starts disagreeing
|
|
15302
|
+
* with the switches the operator actually used.
|
|
15303
|
+
*/
|
|
15304
|
+
var NcAlarmSkipReasonSchema = _enum([
|
|
15305
|
+
"muted",
|
|
15306
|
+
"detection-off",
|
|
15307
|
+
"offline"
|
|
15308
|
+
]);
|
|
15309
|
+
var NcAlarmSkippedDeviceSchema = object({
|
|
15310
|
+
deviceId: number().int(),
|
|
15311
|
+
reason: NcAlarmSkipReasonSchema
|
|
15312
|
+
});
|
|
15032
15313
|
var NcAlarmModeCoverageSchema = object({
|
|
15033
15314
|
mode: AlarmArmModeSchema,
|
|
15034
15315
|
/** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
|
|
@@ -15036,7 +15317,18 @@ var NcAlarmModeCoverageSchema = object({
|
|
|
15036
15317
|
/** At least one covering rule has no device scope, so the mode covers all. */
|
|
15037
15318
|
allDevices: boolean(),
|
|
15038
15319
|
/** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
|
|
15039
|
-
deviceIds: array(number().int())
|
|
15320
|
+
deviceIds: array(number().int()),
|
|
15321
|
+
/**
|
|
15322
|
+
* Devices this mode NAMES but cannot actually arm, each with the switch that
|
|
15323
|
+
* excludes it.
|
|
15324
|
+
*
|
|
15325
|
+
* "Away armed — 12 cameras" is a promise, and a muted camera among those
|
|
15326
|
+
* twelve makes it false in exactly the way nobody notices until an incident.
|
|
15327
|
+
* Defaulted to `[]` so a coverage answer computed before this field existed
|
|
15328
|
+
* still parses as "nothing known to be skipped" rather than failing the whole
|
|
15329
|
+
* alarm tab.
|
|
15330
|
+
*/
|
|
15331
|
+
skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
|
|
15040
15332
|
});
|
|
15041
15333
|
var NcAlarmConfigSchema = object({
|
|
15042
15334
|
/**
|
|
@@ -17868,9 +18160,16 @@ var CameraStatusSchema = object({
|
|
|
17868
18160
|
audio: CameraAudioStatusSchema.nullable(),
|
|
17869
18161
|
recording: CameraRecordingStatusSchema.nullable(),
|
|
17870
18162
|
/**
|
|
17871
|
-
* Per-camera
|
|
18163
|
+
* Per-camera functions an OPERATOR has turned off
|
|
17872
18164
|
* ([D61](../../../../docs/decisions/adr-0067.md)).
|
|
17873
18165
|
*
|
|
18166
|
+
* Composed from the AUTHORITIES themselves — the wrapper bindings,
|
|
18167
|
+
* `RecordingConfig.enabled`, the notification mute, the broker's audio
|
|
18168
|
+
* policy, the camera's own microphone — via `composeSwitchedOff`, not from
|
|
18169
|
+
* the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
|
|
18170
|
+
* The badge outlives the control panel: the panel was a convenience, this is
|
|
18171
|
+
* the difference between a camera being off and a camera being dead.
|
|
18172
|
+
*
|
|
17874
18173
|
* This is the difference between DISABLED and BROKEN. A camera whose
|
|
17875
18174
|
* `detection` block reports zero fps and whose `switchedOff` contains
|
|
17876
18175
|
* `'object-detection'` was switched off by a person; the same camera with an
|
|
@@ -18477,24 +18776,28 @@ var snapshotCapability = {
|
|
|
18477
18776
|
*
|
|
18478
18777
|
* `getSnapshotOverview` is cache-only by contract: it answers from whatever
|
|
18479
18778
|
* the wrapper happens to hold and never captures. Under D93 the client
|
|
18480
|
-
* versions its image URL on that answer, and an image REQUEST
|
|
18481
|
-
*
|
|
18482
|
-
*
|
|
18483
|
-
*
|
|
18484
|
-
*
|
|
18485
|
-
*
|
|
18486
|
-
*
|
|
18487
|
-
*
|
|
18779
|
+
* versions its image URL on that answer, and an image REQUEST was the only
|
|
18780
|
+
* demand signal. Both of those are satisfiable by the client's own image
|
|
18781
|
+
* cache — `expo-image` is URL-keyed and never revalidates — so a URL painted
|
|
18782
|
+
* in a previous session comes off disk with no network, no demand, and no
|
|
18783
|
+
* capture. Measured on the live hub: reopening after two minutes idle
|
|
18784
|
+
* painted 15 of 16 tiles at **168 s old** with zero HTTP requests, and the
|
|
18785
|
+
* fleet only recovered because a later poll happened to observe a different
|
|
18786
|
+
* identity.
|
|
18488
18787
|
*
|
|
18489
18788
|
* ## The two properties that fix it
|
|
18490
18789
|
*
|
|
18491
18790
|
* **It is an RPC, so no client cache can answer it.** The demand signal
|
|
18492
|
-
* always reaches the wrapper. This method therefore
|
|
18493
|
-
*
|
|
18494
|
-
*
|
|
18495
|
-
*
|
|
18496
|
-
*
|
|
18497
|
-
*
|
|
18791
|
+
* always reaches the wrapper. This method therefore CAPTURES, where
|
|
18792
|
+
* `getSnapshotOverview` must never (D93) — the distinction is not "one is
|
|
18793
|
+
* newer" but that the overview poll is app-wide (a capturing overview would
|
|
18794
|
+
* dial every camera on the install) while this is called by a rendered
|
|
18795
|
+
* surface naming the tiles it is actually painting, at the width it is
|
|
18796
|
+
* painting them.
|
|
18797
|
+
*
|
|
18798
|
+
* Since 2026-08-11 this is the ONLY thing that refreshes a snapshot: the
|
|
18799
|
+
* server-side keep-warm loop was removed (operator directive — on-demand,
|
|
18800
|
+
* always), so a camera nobody is looking at costs nothing at all.
|
|
18498
18801
|
*
|
|
18499
18802
|
* **It waits, briefly and boundedly, for the capture it triggered.** The
|
|
18500
18803
|
* returned `capturedAt` is the frame the link will serve, not the frame the
|
|
@@ -24711,7 +25014,19 @@ var RecordingManifestSchema = object({
|
|
|
24711
25014
|
* profiles/subtrees/locations on this node). */
|
|
24712
25015
|
var RecordingDeviceUsageSchema = object({
|
|
24713
25016
|
deviceId: number(),
|
|
24714
|
-
usedBytes: number()
|
|
25017
|
+
usedBytes: number(),
|
|
25018
|
+
/**
|
|
25019
|
+
* Start of this camera's OLDEST indexed segment, across every profile and
|
|
25020
|
+
* location — the "Oldest footage" column in Recordings → Storage, and the
|
|
25021
|
+
* only honest answer to "is retention actually holding?" per camera.
|
|
25022
|
+
*
|
|
25023
|
+
* `null` = the camera has no footage. OPTIONAL because a recorder that
|
|
25024
|
+
* predates this field omits it entirely, and a hub whose types carry the
|
|
25025
|
+
* field must keep validating that older provider's payload: the framework
|
|
25026
|
+
* (types) and the addon ship on different trains, and the addon is usually
|
|
25027
|
+
* the later of the two.
|
|
25028
|
+
*/
|
|
25029
|
+
oldestMs: number().nullable().optional()
|
|
24715
25030
|
});
|
|
24716
25031
|
/** Recording storage usage + capacity for one storage location. */
|
|
24717
25032
|
var RecordingLocationUsageSchema = object({
|
|
@@ -24739,6 +25054,57 @@ var RecordingStorageUsageSchema = object({
|
|
|
24739
25054
|
locations: array(RecordingLocationUsageSchema)
|
|
24740
25055
|
});
|
|
24741
25056
|
/**
|
|
25057
|
+
* The OPERATOR-ARMED half of multi-location recordings (D116).
|
|
25058
|
+
*
|
|
25059
|
+
* The placement plan decides where NEW writes go and moves nothing. A rebalance
|
|
25060
|
+
* is the operator asking for the EXISTING archive to be brought into line with
|
|
25061
|
+
* that plan: one relocate job per (camera, profile) pile that sits on the wrong
|
|
25062
|
+
* location, run FIFO behind the single-flight mover.
|
|
25063
|
+
*
|
|
25064
|
+
* `plan…` and `start…` return the SAME shape deliberately — what the operator
|
|
25065
|
+
* confirms is exactly what gets enqueued, and `jobIds` is the only difference
|
|
25066
|
+
* (empty on the plan).
|
|
25067
|
+
*/
|
|
25068
|
+
var RecordingRebalanceMoveSchema = object({
|
|
25069
|
+
deviceId: number(),
|
|
25070
|
+
profile: string(),
|
|
25071
|
+
fromLocationId: string(),
|
|
25072
|
+
toLocationId: string(),
|
|
25073
|
+
bytes: number(),
|
|
25074
|
+
files: number().int()
|
|
25075
|
+
});
|
|
25076
|
+
/** Why a pile that is out of place is staying there. Every refusal is
|
|
25077
|
+
* reported: a rebalance that silently drops a camera reads exactly like one
|
|
25078
|
+
* that had nothing to do. */
|
|
25079
|
+
var RecordingRebalanceSkipReasonSchema = _enum([
|
|
25080
|
+
"unassigned",
|
|
25081
|
+
"target-not-writable",
|
|
25082
|
+
"below-threshold",
|
|
25083
|
+
"no-headroom"
|
|
25084
|
+
]);
|
|
25085
|
+
var RecordingRebalanceSkipSchema = object({
|
|
25086
|
+
deviceId: number(),
|
|
25087
|
+
profile: string(),
|
|
25088
|
+
fromLocationId: string(),
|
|
25089
|
+
/** The location the plan wants; null when the camera has no assignment. */
|
|
25090
|
+
toLocationId: string().nullable(),
|
|
25091
|
+
bytes: number(),
|
|
25092
|
+
reason: RecordingRebalanceSkipReasonSchema
|
|
25093
|
+
});
|
|
25094
|
+
var RecordingRebalancePlanSchema = object({
|
|
25095
|
+
moves: array(RecordingRebalanceMoveSchema),
|
|
25096
|
+
skipped: array(RecordingRebalanceSkipSchema),
|
|
25097
|
+
bytesToMove: number(),
|
|
25098
|
+
/** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
|
|
25099
|
+
jobIds: array(string())
|
|
25100
|
+
});
|
|
25101
|
+
var RecordingRebalanceInputSchema = object({
|
|
25102
|
+
/** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
|
|
25103
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
25104
|
+
/** Ignore piles smaller than this (default 1 GB). */
|
|
25105
|
+
minMoveGb: number().min(0).optional()
|
|
25106
|
+
});
|
|
25107
|
+
/**
|
|
24742
25108
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
24743
25109
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
24744
25110
|
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
@@ -24901,9 +25267,24 @@ method(object({
|
|
|
24901
25267
|
}), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
24902
25268
|
kind: "mutation",
|
|
24903
25269
|
auth: "admin"
|
|
25270
|
+
}), method(RelocateFootageInputSchema, object({ jobId: string() }), {
|
|
25271
|
+
kind: "mutation",
|
|
25272
|
+
auth: "admin"
|
|
25273
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
25274
|
+
kind: "query",
|
|
25275
|
+
auth: "admin"
|
|
25276
|
+
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
25277
|
+
kind: "mutation",
|
|
25278
|
+
auth: "admin"
|
|
25279
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
25280
|
+
kind: "query",
|
|
25281
|
+
auth: "admin"
|
|
25282
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
25283
|
+
kind: "mutation",
|
|
25284
|
+
auth: "admin"
|
|
24904
25285
|
});
|
|
24905
25286
|
/**
|
|
24906
|
-
* `
|
|
25287
|
+
* `recording-export` cap — render a footage time range into a single downloadable
|
|
24907
25288
|
* MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
|
|
24908
25289
|
* bounded lifetime with a durable history, auto-expiry, and optional
|
|
24909
25290
|
* delete-after-download.
|
|
@@ -24918,10 +25299,53 @@ method(object({
|
|
|
24918
25299
|
*/
|
|
24919
25300
|
/** Playback-speed multiplier for the render (1 = realtime). */
|
|
24920
25301
|
var ExportSpeedSchema = number().min(.25).max(32);
|
|
25302
|
+
/**
|
|
25303
|
+
* One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
|
|
25304
|
+
*
|
|
25305
|
+
* **Wall clock, not ffmpeg's `t`** — and the recorder translates. A caller
|
|
25306
|
+
* derives these bounds from things that happened at a TIME (a track's
|
|
25307
|
+
* `firstSeen`), while `t` runs over the source playlist: the concatenation of
|
|
25308
|
+
* every segment present for the range, with each recording GAP removed. The
|
|
25309
|
+
* two agree only on a window that recorded without one interruption, and only
|
|
25310
|
+
* the render side knows the segments, so the translation lives there
|
|
25311
|
+
* (`export-dense-map.ts`, addon-pipeline).
|
|
25312
|
+
*
|
|
25313
|
+
* It was not always so. These seconds were fed to `between(t,…)` verbatim, and
|
|
25314
|
+
* on a 10 h window holding 29,393 s of footage every range landed late by the
|
|
25315
|
+
* gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
|
|
25316
|
+
* the video was a uniform timelapse, and the log line reported the five ranges
|
|
25317
|
+
* that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
|
|
25318
|
+
*
|
|
25319
|
+
* Relative and not absolute epoch, because an absolute epoch would make every
|
|
25320
|
+
* call site responsible for the same subtraction.
|
|
25321
|
+
*/
|
|
25322
|
+
var ExportDenseRangeSchema = object({
|
|
25323
|
+
fromSec: number().nonnegative(),
|
|
25324
|
+
toSec: number().nonnegative()
|
|
25325
|
+
}).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
|
|
25326
|
+
/**
|
|
25327
|
+
* Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
|
|
25328
|
+
* listed ranges and at the base `everyMs` everywhere else.
|
|
25329
|
+
*
|
|
25330
|
+
* `everyMs` must be strictly smaller than the base cadence — a dense rate that
|
|
25331
|
+
* is not denser renders a uniform timelapse the operator believes is two-rate.
|
|
25332
|
+
*/
|
|
25333
|
+
var ExportDenseSchema = object({
|
|
25334
|
+
everyMs: number().int().positive(),
|
|
25335
|
+
ranges: array(ExportDenseRangeSchema).min(1).max(200)
|
|
25336
|
+
});
|
|
24921
25337
|
/** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
|
|
24922
25338
|
var ExportTimelapseSchema = object({
|
|
24923
25339
|
everyMs: number().int().positive(),
|
|
24924
|
-
outputFps: number().int().min(1).max(60).optional()
|
|
25340
|
+
outputFps: number().int().min(1).max(60).optional(),
|
|
25341
|
+
/** Optional second, FASTER rate over the intervals that matter. */
|
|
25342
|
+
dense: ExportDenseSchema.optional()
|
|
25343
|
+
}).superRefine((v, ctx) => {
|
|
25344
|
+
if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
|
|
25345
|
+
code: ZodIssueCode.custom,
|
|
25346
|
+
message: "dense.everyMs must be strictly smaller than the base everyMs",
|
|
25347
|
+
path: ["dense", "everyMs"]
|
|
25348
|
+
});
|
|
24925
25349
|
});
|
|
24926
25350
|
/**
|
|
24927
25351
|
* Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
|
|
@@ -24979,6 +25403,19 @@ var ExportDownloadSchema = object({
|
|
|
24979
25403
|
url: string(),
|
|
24980
25404
|
endpoints: array(string())
|
|
24981
25405
|
});
|
|
25406
|
+
/**
|
|
25407
|
+
* A finished export's bytes, inline.
|
|
25408
|
+
*
|
|
25409
|
+
* `bytes` is the DECODED length — the number the caller bounds and logs
|
|
25410
|
+
* against, so nobody has to infer it from the base64 length.
|
|
25411
|
+
*/
|
|
25412
|
+
var ExportBytesSchema = object({
|
|
25413
|
+
base64: string(),
|
|
25414
|
+
contentType: string(),
|
|
25415
|
+
/** Suggested filename, extension included. */
|
|
25416
|
+
name: string(),
|
|
25417
|
+
bytes: number().int().nonnegative()
|
|
25418
|
+
});
|
|
24982
25419
|
method(object({
|
|
24983
25420
|
deviceId: number(),
|
|
24984
25421
|
profile: string(),
|
|
@@ -25003,6 +25440,9 @@ method(object({
|
|
|
25003
25440
|
}), method(object({ exportId: string() }), ExportDownloadSchema, {
|
|
25004
25441
|
kind: "query",
|
|
25005
25442
|
auth: "protected"
|
|
25443
|
+
}), method(object({ exportId: string() }), ExportBytesSchema, {
|
|
25444
|
+
kind: "query",
|
|
25445
|
+
auth: "protected"
|
|
25006
25446
|
});
|
|
25007
25447
|
/**
|
|
25008
25448
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
@@ -31759,6 +32199,12 @@ Object.freeze({
|
|
|
31759
32199
|
addonId: null,
|
|
31760
32200
|
access: "create"
|
|
31761
32201
|
},
|
|
32202
|
+
"recording.cancelRelocateJob": {
|
|
32203
|
+
capName: "recording",
|
|
32204
|
+
capScope: "system",
|
|
32205
|
+
addonId: null,
|
|
32206
|
+
access: "create"
|
|
32207
|
+
},
|
|
31762
32208
|
"recording.cancelStorageMigrationMove": {
|
|
31763
32209
|
capName: "recording",
|
|
31764
32210
|
capScope: "system",
|
|
@@ -31813,6 +32259,12 @@ Object.freeze({
|
|
|
31813
32259
|
addonId: null,
|
|
31814
32260
|
access: "view"
|
|
31815
32261
|
},
|
|
32262
|
+
"recording.listRelocateJobs": {
|
|
32263
|
+
capName: "recording",
|
|
32264
|
+
capScope: "system",
|
|
32265
|
+
addonId: null,
|
|
32266
|
+
access: "view"
|
|
32267
|
+
},
|
|
31816
32268
|
"recording.locateSegment": {
|
|
31817
32269
|
capName: "recording",
|
|
31818
32270
|
capScope: "system",
|
|
@@ -31825,6 +32277,12 @@ Object.freeze({
|
|
|
31825
32277
|
addonId: null,
|
|
31826
32278
|
access: "create"
|
|
31827
32279
|
},
|
|
32280
|
+
"recording.planStorageRebalance": {
|
|
32281
|
+
capName: "recording",
|
|
32282
|
+
capScope: "system",
|
|
32283
|
+
addonId: null,
|
|
32284
|
+
access: "view"
|
|
32285
|
+
},
|
|
31828
32286
|
"recording.pruneFootage": {
|
|
31829
32287
|
capName: "recording",
|
|
31830
32288
|
capScope: "system",
|
|
@@ -31849,6 +32307,12 @@ Object.freeze({
|
|
|
31849
32307
|
addonId: null,
|
|
31850
32308
|
access: "create"
|
|
31851
32309
|
},
|
|
32310
|
+
"recording.relocateFootage": {
|
|
32311
|
+
capName: "recording",
|
|
32312
|
+
capScope: "system",
|
|
32313
|
+
addonId: null,
|
|
32314
|
+
access: "create"
|
|
32315
|
+
},
|
|
31852
32316
|
"recording.renderClip": {
|
|
31853
32317
|
capName: "recording",
|
|
31854
32318
|
capScope: "system",
|
|
@@ -31885,38 +32349,50 @@ Object.freeze({
|
|
|
31885
32349
|
addonId: null,
|
|
31886
32350
|
access: "create"
|
|
31887
32351
|
},
|
|
32352
|
+
"recording.startStorageRebalance": {
|
|
32353
|
+
capName: "recording",
|
|
32354
|
+
capScope: "system",
|
|
32355
|
+
addonId: null,
|
|
32356
|
+
access: "create"
|
|
32357
|
+
},
|
|
31888
32358
|
"recordingExport.cancelExport": {
|
|
31889
|
-
capName: "
|
|
32359
|
+
capName: "recording-export",
|
|
31890
32360
|
capScope: "system",
|
|
31891
32361
|
addonId: null,
|
|
31892
32362
|
access: "create"
|
|
31893
32363
|
},
|
|
31894
32364
|
"recordingExport.createExport": {
|
|
31895
|
-
capName: "
|
|
32365
|
+
capName: "recording-export",
|
|
31896
32366
|
capScope: "system",
|
|
31897
32367
|
addonId: null,
|
|
31898
32368
|
access: "create"
|
|
31899
32369
|
},
|
|
31900
32370
|
"recordingExport.deleteExport": {
|
|
31901
|
-
capName: "
|
|
32371
|
+
capName: "recording-export",
|
|
31902
32372
|
capScope: "system",
|
|
31903
32373
|
addonId: null,
|
|
31904
32374
|
access: "delete"
|
|
31905
32375
|
},
|
|
31906
32376
|
"recordingExport.getDownloadUrl": {
|
|
31907
|
-
capName: "
|
|
32377
|
+
capName: "recording-export",
|
|
31908
32378
|
capScope: "system",
|
|
31909
32379
|
addonId: null,
|
|
31910
32380
|
access: "view"
|
|
31911
32381
|
},
|
|
31912
32382
|
"recordingExport.getExport": {
|
|
31913
|
-
capName: "
|
|
32383
|
+
capName: "recording-export",
|
|
31914
32384
|
capScope: "system",
|
|
31915
32385
|
addonId: null,
|
|
31916
32386
|
access: "view"
|
|
31917
32387
|
},
|
|
31918
32388
|
"recordingExport.listExports": {
|
|
31919
|
-
capName: "
|
|
32389
|
+
capName: "recording-export",
|
|
32390
|
+
capScope: "system",
|
|
32391
|
+
addonId: null,
|
|
32392
|
+
access: "view"
|
|
32393
|
+
},
|
|
32394
|
+
"recordingExport.readExportBytes": {
|
|
32395
|
+
capName: "recording-export",
|
|
31920
32396
|
capScope: "system",
|
|
31921
32397
|
addonId: null,
|
|
31922
32398
|
access: "view"
|
|
@@ -33293,6 +33769,104 @@ var FramerateField = number().int().min(1).max(60);
|
|
|
33293
33769
|
var TargetsField = array(NcRuleTargetSchema).min(1);
|
|
33294
33770
|
var PriorityField = number().int().min(1).max(5);
|
|
33295
33771
|
/**
|
|
33772
|
+
* Explicit override of the DENSE sampling cadence, seconds.
|
|
33773
|
+
*
|
|
33774
|
+
* Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
|
|
33775
|
+
* 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
|
|
33776
|
+
* made that same base 3 s and rendered a person pass as two frames.)
|
|
33777
|
+
*
|
|
33778
|
+
* THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
|
|
33779
|
+
* `denseCadenceSec` and played at `framerate` occupies
|
|
33780
|
+
*
|
|
33781
|
+
* outputSeconds = (rangeSec / denseCadenceSec) / framerate
|
|
33782
|
+
*
|
|
33783
|
+
* 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.
|
|
33784
|
+
* Halving this field doubles the frames INSIDE ranges only — the base cadence,
|
|
33785
|
+
* and therefore the length of a quiet night, does not move.
|
|
33786
|
+
*
|
|
33787
|
+
* Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
|
|
33788
|
+
* the recording has them returns the same frames, requested twice. Must be
|
|
33789
|
+
* STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
|
|
33790
|
+
* a uniform video the operator believes is two-rate — and upsert refuses it
|
|
33791
|
+
* rather than letting the export cap reject the render hours after the window.
|
|
33792
|
+
*/
|
|
33793
|
+
var DenseCadenceSecField = number().min(.1).max(3600);
|
|
33794
|
+
/**
|
|
33795
|
+
* Minimum seconds of OUTPUT video each detection range must occupy.
|
|
33796
|
+
*
|
|
33797
|
+
* The operator-facing form of the arithmetic above: instead of solving for a
|
|
33798
|
+
* cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
|
|
33799
|
+
* 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
|
|
33800
|
+
* that range every ~583 ms.
|
|
33801
|
+
*
|
|
33802
|
+
* ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
|
|
33803
|
+
* ranges are terms of a single ffmpeg `select` expression that cannot vary rate
|
|
33804
|
+
* per term — so the MOST DEMANDING (shortest) range sets the rate and longer
|
|
33805
|
+
* ranges are sampled denser than they need. Per-range cadences require a cap
|
|
33806
|
+
* schema change and are the tracked follow-up.
|
|
33807
|
+
*
|
|
33808
|
+
* A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
|
|
33809
|
+
* is rendered with every frame that EXISTS and no more: the guarantee is capped
|
|
33810
|
+
* by real footage, never met by duplicating frames into motion that never
|
|
33811
|
+
* happened.
|
|
33812
|
+
*/
|
|
33813
|
+
var MinDwellSecField = number().min(0).max(60);
|
|
33814
|
+
/**
|
|
33815
|
+
* Caption burned into the notification's preview frame.
|
|
33816
|
+
*
|
|
33817
|
+
* Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
|
|
33818
|
+
* `rule`, `from`, `to`) and rendered by the SAME renderer — a second
|
|
33819
|
+
* templating dialect for one field would be a second thing to explain.
|
|
33820
|
+
*
|
|
33821
|
+
* Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
|
|
33822
|
+
* operator saying "the frame, no caption" — a distinct, reachable answer, and
|
|
33823
|
+
* the reason this is not `.min(1)`.
|
|
33824
|
+
*/
|
|
33825
|
+
var PreviewTextField = string().max(200);
|
|
33826
|
+
/**
|
|
33827
|
+
* Whether the notification's preview is a STILL or a short animation.
|
|
33828
|
+
*
|
|
33829
|
+
* The operator's ask, verbatim: *"inviato come gif o video (come per le altre
|
|
33830
|
+
* rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
|
|
33831
|
+
* night reads better as three seconds of motion than as one frame of it. Both
|
|
33832
|
+
* modes get the SAME treatment (blurred frame, large centred title); `'gif'`
|
|
33833
|
+
* simply applies it to a dozen frames sampled across the render and assembles
|
|
33834
|
+
* them.
|
|
33835
|
+
*
|
|
33836
|
+
* `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
|
|
33837
|
+
* seeks and a palette pass, and no rule that never asked for one should start
|
|
33838
|
+
* paying that on the deploy that shipped it.
|
|
33839
|
+
*
|
|
33840
|
+
* A GIF that cannot be assembled DEGRADES to the still — never to nothing.
|
|
33841
|
+
*/
|
|
33842
|
+
var PreviewModeField = _enum(["image", "gif"]);
|
|
33843
|
+
/**
|
|
33844
|
+
* Which detection classes the notification reports counts for.
|
|
33845
|
+
*
|
|
33846
|
+
* The counts come from the tracks the render ALREADY fetched for its dense-range
|
|
33847
|
+
* plan — no second query — aggregated per class. Absent or empty means "every
|
|
33848
|
+
* class the window actually contained", which is what an operator who never
|
|
33849
|
+
* opened the field wants; a list narrows it (`['person']` on a driveway that
|
|
33850
|
+
* counts cars all night).
|
|
33851
|
+
*
|
|
33852
|
+
* Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
|
|
33853
|
+
* …). An unknown name simply never matches and reports nothing — it is not an
|
|
33854
|
+
* error, because a rule may legitimately name a class this camera's model does
|
|
33855
|
+
* not emit.
|
|
33856
|
+
*
|
|
33857
|
+
* The counts are exposed to {@link TimelapseTemplateSchema} as:
|
|
33858
|
+
* - `{{detections}}` — total over the reported classes
|
|
33859
|
+
* - `{{detectionSummary}}` — `2 persone, 1 veicolo`
|
|
33860
|
+
* - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
|
|
33861
|
+
* one per class, `count_` + the class name
|
|
33862
|
+
*
|
|
33863
|
+
* With NO custom body template the summary is appended to the derived body, and
|
|
33864
|
+
* only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
|
|
33865
|
+
* reads. With a custom template the operator owns every word — nothing is
|
|
33866
|
+
* appended, so `{{detectionSummary}}` is how he asks for it.
|
|
33867
|
+
*/
|
|
33868
|
+
var ReportClassesField = array(string().min(1).max(40)).max(20);
|
|
33869
|
+
/**
|
|
33296
33870
|
* Client-supplied timelapse-rule fields. The server stamps id / createdBy /
|
|
33297
33871
|
* createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
|
|
33298
33872
|
* here (see the ownership note above).
|
|
@@ -33312,9 +33886,30 @@ var TimelapseRuleInputSchema = object({
|
|
|
33312
33886
|
cadenceSec: CadenceSecField.default(15),
|
|
33313
33887
|
/** Output frames per second of the assembled mp4 (predecessor parity). */
|
|
33314
33888
|
framerate: FramerateField.default(10),
|
|
33889
|
+
/**
|
|
33890
|
+
* Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
|
|
33891
|
+
* as `max(1s, cadenceSec / 30)`, which is what every rule written before this
|
|
33892
|
+
* field gets.
|
|
33893
|
+
*/
|
|
33894
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
33895
|
+
/** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
|
|
33896
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
33315
33897
|
/** `notification-output` targets the finished video/thumbnail is sent to. */
|
|
33316
33898
|
targets: TargetsField,
|
|
33317
33899
|
template: TimelapseTemplateSchema.optional(),
|
|
33900
|
+
/**
|
|
33901
|
+
* Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
|
|
33902
|
+
* and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
|
|
33903
|
+
*
|
|
33904
|
+
* Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
|
|
33905
|
+
* the notification's title/body, and clearing it (`template: null`) must not
|
|
33906
|
+
* silently clear the caption too.
|
|
33907
|
+
*/
|
|
33908
|
+
previewText: PreviewTextField.optional(),
|
|
33909
|
+
/** Still or animation — see {@link PreviewModeField}. */
|
|
33910
|
+
previewMode: PreviewModeField.default("image"),
|
|
33911
|
+
/** Classes the notification counts — see {@link ReportClassesField}. */
|
|
33912
|
+
reportClasses: ReportClassesField.optional(),
|
|
33318
33913
|
/** Canonical notification priority ordinal (1..5); per-target overridable. */
|
|
33319
33914
|
priority: PriorityField.default(3)
|
|
33320
33915
|
});
|
|
@@ -33325,8 +33920,13 @@ object({
|
|
|
33325
33920
|
schedule: NcScheduleSchema.optional(),
|
|
33326
33921
|
cadenceSec: CadenceSecField.optional(),
|
|
33327
33922
|
framerate: FramerateField.optional(),
|
|
33923
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
33924
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
33328
33925
|
targets: TargetsField.optional(),
|
|
33329
33926
|
template: TimelapseTemplateSchema.nullable().optional(),
|
|
33927
|
+
previewText: PreviewTextField.optional(),
|
|
33928
|
+
previewMode: PreviewModeField.optional(),
|
|
33929
|
+
reportClasses: ReportClassesField.optional(),
|
|
33330
33930
|
priority: PriorityField.optional()
|
|
33331
33931
|
});
|
|
33332
33932
|
TimelapseRuleInputSchema.extend({
|
|
@@ -33338,10 +33938,28 @@ TimelapseRuleInputSchema.extend({
|
|
|
33338
33938
|
*/
|
|
33339
33939
|
ownerUserId: string().optional(),
|
|
33340
33940
|
/**
|
|
33341
|
-
* Epoch-ms of the
|
|
33342
|
-
*
|
|
33941
|
+
* Epoch-ms of the NEWEST successful generation across every camera of this
|
|
33942
|
+
* rule. What a UI shows, and the compatibility floor for
|
|
33943
|
+
* {@link readTimelapseGeneratedAt}. Absent = never generated.
|
|
33343
33944
|
*/
|
|
33344
33945
|
lastGeneratedAt: number().optional(),
|
|
33946
|
+
/**
|
|
33947
|
+
* PER-CAMERA generation state, keyed by `String(deviceId)` — the
|
|
33948
|
+
* re-generation guard's real durable state.
|
|
33949
|
+
*
|
|
33950
|
+
* One rule covers several cameras and each renders its own video, so a rule
|
|
33951
|
+
* -wide stamp is wrong in the direction that DESTROYS work: camera A
|
|
33952
|
+
* succeeding at 06:05 tells camera B, whose render failed, that it is
|
|
33953
|
+
* already done — and B's night is gone for good, because the window will not
|
|
33954
|
+
* come back.
|
|
33955
|
+
*
|
|
33956
|
+
* ADDITIVE, so the migration is free: a row written before this field simply
|
|
33957
|
+
* has no map, and {@link readTimelapseGeneratedAt} falls back to
|
|
33958
|
+
* {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
|
|
33959
|
+
* "never generated" would re-render and re-notify every camera of every rule
|
|
33960
|
+
* once, on the deploy that shipped the map.
|
|
33961
|
+
*/
|
|
33962
|
+
generatedByDevice: record(string(), number()).optional(),
|
|
33345
33963
|
/** userId of the caller who created the rule (server-stamped). */
|
|
33346
33964
|
createdBy: string(),
|
|
33347
33965
|
createdAt: number(),
|
|
@@ -33392,25 +34010,32 @@ object({
|
|
|
33392
34010
|
var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
|
|
33393
34011
|
object({
|
|
33394
34012
|
/**
|
|
33395
|
-
* How
|
|
34013
|
+
* How many delivered frames the worker HOLDS at once, waiting for each one's
|
|
34014
|
+
* detection result.
|
|
33396
34015
|
*
|
|
33397
|
-
*
|
|
33398
|
-
*
|
|
33399
|
-
*
|
|
33400
|
-
*
|
|
33401
|
-
*
|
|
34016
|
+
* This replaced a TTL on 2026-08-13, and the replacement is the whole point:
|
|
34017
|
+
* a time window was never related to the event the pixels were waiting for.
|
|
34018
|
+
* A held frame now lives from delivery until the runner has its `FrameResult`
|
|
34019
|
+
* — at which moment the runner cuts the subject tiles it actually wanted and
|
|
34020
|
+
* releases the frame. The bound exists only so a runner that stops answering
|
|
34021
|
+
* cannot pin RAM: above it the OLDEST held frame is dropped and counted.
|
|
34022
|
+
*
|
|
34023
|
+
* Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
|
|
34024
|
+
* 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
|
|
34025
|
+
* without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
|
|
34026
|
+
* Raising it does not buy hit rate — it buys tolerance for a slow runner, and
|
|
34027
|
+
* `holdOverflow` on the metrics line is what says you need it.
|
|
33402
34028
|
*/
|
|
33403
|
-
|
|
34029
|
+
holdFrames: number().int().min(1).max(64),
|
|
33404
34030
|
/**
|
|
33405
34031
|
* Hard per-decode-worker RAM ceiling for retained native frames, in MB.
|
|
33406
34032
|
*
|
|
33407
|
-
*
|
|
33408
|
-
*
|
|
33409
|
-
*
|
|
33410
|
-
*
|
|
33411
|
-
*
|
|
33412
|
-
*
|
|
33413
|
-
* rather than giving RAM back — lower this knob if RAM is what you wanted.
|
|
34033
|
+
* Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
|
|
34034
|
+
* is what decides how much is held, and the ceiling is the number above which
|
|
34035
|
+
* something is wrong. Before that it was the effective cap — at 1024 MB with
|
|
34036
|
+
* a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
|
|
34037
|
+
* with the TTL expiring nothing, which is exactly the confusion the hold
|
|
34038
|
+
* removes. `leaseMb` / `leaseFrames` still say what is resident.
|
|
33414
34039
|
* `0` DISABLES the lease entirely and falls the worker back to the tiny
|
|
33415
34040
|
* leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
|
|
33416
34041
|
* to replace).
|
|
@@ -33436,22 +34061,45 @@ object({
|
|
|
33436
34061
|
* there is the signal that some caller names frames outside the inference set
|
|
33437
34062
|
* and that this must go back to `all`.
|
|
33438
34063
|
*/
|
|
33439
|
-
admission: NativeLeaseAdmissionSchema
|
|
34064
|
+
admission: NativeLeaseAdmissionSchema,
|
|
34065
|
+
/**
|
|
34066
|
+
* RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
|
|
34067
|
+
* compressed native crops the worker cuts at the moment a frame's detection
|
|
34068
|
+
* result arrives, and keeps long after the frame itself is freed.
|
|
34069
|
+
*
|
|
34070
|
+
* This is the knob that replaced the old retention window, and it buys about
|
|
34071
|
+
* three orders of magnitude more of it: a tile is one subject at native
|
|
34072
|
+
* resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
|
|
34073
|
+
* the frame it was cut from. A frame on which nothing was detected costs
|
|
34074
|
+
* nothing at all, which is the real change — the old lease paid per FRAME and
|
|
34075
|
+
* was interrogated per SUBJECT.
|
|
34076
|
+
*
|
|
34077
|
+
* `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
|
|
34078
|
+
* fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
|
|
34079
|
+
* reproduce that.
|
|
34080
|
+
*/
|
|
34081
|
+
tileBudgetMb: number().int().min(0).max(1024)
|
|
33440
34082
|
});
|
|
33441
34083
|
/**
|
|
33442
|
-
* The values in force when the operator has set nothing
|
|
33443
|
-
*
|
|
33444
|
-
*
|
|
34084
|
+
* The values in force when the operator has set nothing.
|
|
34085
|
+
*
|
|
34086
|
+
* `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
|
|
34087
|
+
* being the retention window and became the OOM ceiling, and lowering a ceiling
|
|
34088
|
+
* in the same change that redefines it would make a regression and a retune
|
|
34089
|
+
* indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
|
|
34090
|
+
* live traffic.
|
|
33445
34091
|
*/
|
|
33446
34092
|
var DEFAULT_NATIVE_LEASE_SETTINGS = {
|
|
33447
|
-
|
|
34093
|
+
holdFrames: 8,
|
|
33448
34094
|
budgetMb: 1024,
|
|
33449
34095
|
activityMs: 15e3,
|
|
34096
|
+
tileBudgetMb: 64,
|
|
33450
34097
|
admission: "inferred"
|
|
33451
34098
|
};
|
|
33452
|
-
DEFAULT_NATIVE_LEASE_SETTINGS.
|
|
34099
|
+
DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
|
|
33453
34100
|
DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
|
|
33454
34101
|
DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
|
|
34102
|
+
DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
|
|
33455
34103
|
DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
33456
34104
|
/**
|
|
33457
34105
|
* Names that, when used as URL query parameters, almost certainly carry
|