@camstack/addon-provider-unraid 0.2.13 → 0.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 +686 -42
- package/dist/addon.mjs +686 -42
- package/package.json +1 -1
package/dist/addon.mjs
CHANGED
|
@@ -7218,8 +7218,31 @@ var AdoptionJobSchema = object({
|
|
|
7218
7218
|
error: string().nullable()
|
|
7219
7219
|
});
|
|
7220
7220
|
/**
|
|
7221
|
-
* Per-camera FUNCTION SWITCHES
|
|
7222
|
-
*
|
|
7221
|
+
* Per-camera FUNCTION SWITCHES.
|
|
7222
|
+
*
|
|
7223
|
+
* ## The aggregate group is being withdrawn — the BADGE is not (D113)
|
|
7224
|
+
*
|
|
7225
|
+
* This file shipped as "the one coherent on/off surface over the pipeline
|
|
7226
|
+
* functions an operator thinks in terms of". The operator's verdict on
|
|
7227
|
+
* 2026-08-12 was that the coherent surface bought complexity and no clarity:
|
|
7228
|
+
* every function already had a settings page of its own, and a second place to
|
|
7229
|
+
* turn it off is a second place to look. Each switch is going back to its own
|
|
7230
|
+
* component's original options — detection to the detection-pipeline wrapper
|
|
7231
|
+
* binding, audio analysis to its own, recording to `RecordingConfig.enabled`
|
|
7232
|
+
* (which was always first-class; the switch was a veneer over
|
|
7233
|
+
* `recording.setDeviceConfig`), notifications to a notification-center
|
|
7234
|
+
* per-device setting, the two camera planes to their own components.
|
|
7235
|
+
*
|
|
7236
|
+
* What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
|
|
7237
|
+
* thing that lets a status surface say DISABLED instead of BROKEN, recomposed
|
|
7238
|
+
* straight from the authorities with no group in the middle. That rule was
|
|
7239
|
+
* never about a control panel.
|
|
7240
|
+
*
|
|
7241
|
+
* Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
|
|
7242
|
+
* {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
|
|
7243
|
+
* `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
|
|
7244
|
+
* viewers (v1.0.305) and the admin UI still call it. It is deleted when they
|
|
7245
|
+
* stop; nothing new may be built on it.
|
|
7223
7246
|
*
|
|
7224
7247
|
* ## This file adds no state
|
|
7225
7248
|
*
|
|
@@ -7570,7 +7593,15 @@ var RecordingConfigSchema = object({
|
|
|
7570
7593
|
* Each completed/failed run also lands one durable ops-log row on its owning
|
|
7571
7594
|
* addon surface.
|
|
7572
7595
|
*/
|
|
7596
|
+
/**
|
|
7597
|
+
* `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
|
|
7598
|
+
* rebalance enqueues one job per (camera, profile). Refusing the second job —
|
|
7599
|
+
* what the engine did before — turned a fifteen-camera rebalance into fifteen
|
|
7600
|
+
* manual retries. Queued jobs run FIFO; a queued job that is cancelled never
|
|
7601
|
+
* runs at all.
|
|
7602
|
+
*/
|
|
7573
7603
|
var RelocateJobStateSchema = _enum([
|
|
7604
|
+
"queued",
|
|
7574
7605
|
"running",
|
|
7575
7606
|
"done",
|
|
7576
7607
|
"failed",
|
|
@@ -7605,6 +7636,15 @@ var RelocateFootageInputSchema = object({
|
|
|
7605
7636
|
/** Limits relocation to the logical profile class. Omit only for the
|
|
7606
7637
|
* pre-orchestration compatibility path. */
|
|
7607
7638
|
footageClass: RelocateFootageClassSchema.optional(),
|
|
7639
|
+
/** Scope the move to ONE camera. Absent = every camera on the source, which
|
|
7640
|
+
* is what a whole-disk drain means. The rebalance path always sets it: its
|
|
7641
|
+
* unit is a (camera, profile) pile, not a disk. */
|
|
7642
|
+
deviceId: number().int().optional(),
|
|
7643
|
+
/** Scope the move to specific segment profiles (`high` / `mid` / `low`).
|
|
7644
|
+
* Finer than `footageClass`, which cannot separate high from mid — and the
|
|
7645
|
+
* placement plan assigns those two independently, so a rebalance that could
|
|
7646
|
+
* only say "recordings" would move footage the plan never asked to move. */
|
|
7647
|
+
profiles: array(string()).optional(),
|
|
7608
7648
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
7609
7649
|
* never allowed to starve live writers. */
|
|
7610
7650
|
throttleMbps: number().min(1).max(1e3).optional()
|
|
@@ -7740,6 +7780,21 @@ var StorageLocationSchema = object({
|
|
|
7740
7780
|
nodeId: string().optional(),
|
|
7741
7781
|
isDefault: boolean().default(false),
|
|
7742
7782
|
isSystem: boolean().default(false),
|
|
7783
|
+
/**
|
|
7784
|
+
* Operator opt-in: whether consumers that BALANCE across several locations
|
|
7785
|
+
* of a type may write here. Recordings reads it today; event media and
|
|
7786
|
+
* backups are the next consumers, which is why the flag lives on the
|
|
7787
|
+
* location rather than in any one addon's store — nothing has to be
|
|
7788
|
+
* extended to add the next consumer.
|
|
7789
|
+
*
|
|
7790
|
+
* OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
|
|
7791
|
+
* flag existed reads back with no flag and keeps working exactly as before;
|
|
7792
|
+
* that is the whole compat story, and it is why no migration ships with it.
|
|
7793
|
+
* A newly CREATED sibling is stamped `false` by the orchestrator (creating a
|
|
7794
|
+
* disk must not silently start writing to it); the default of a type is
|
|
7795
|
+
* always stamped `true`.
|
|
7796
|
+
*/
|
|
7797
|
+
enabled: boolean().optional(),
|
|
7743
7798
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
7744
7799
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
7745
7800
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -12292,7 +12347,8 @@ method(object({
|
|
|
12292
12347
|
}), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
|
|
12293
12348
|
/**
|
|
12294
12349
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
12295
|
-
* filesystem
|
|
12350
|
+
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
12351
|
+
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
12296
12352
|
* admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
|
|
12297
12353
|
* (one provider per node); the hub calls it with `{nodeId}` so the codegen
|
|
12298
12354
|
* routes to that exact node (default `nodeIdMode:'routing'`).
|
|
@@ -14133,6 +14189,13 @@ var MaskGridDimsSchema = object({
|
|
|
14133
14189
|
* `package-event` are pure trigger kinds (no urgency dimension). Extending
|
|
14134
14190
|
* this one field keeps the schema additive — a rule still declares exactly
|
|
14135
14191
|
* one trigger.
|
|
14192
|
+
*
|
|
14193
|
+
* AUDIO rules add no member here, for the reason occupancy added none: the
|
|
14194
|
+
* enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
|
|
14195
|
+
* mirror.ts` fails the build on a member the app cannot render) and every
|
|
14196
|
+
* member costs a release train. A sustained-sound rule is therefore an
|
|
14197
|
+
* `immediate` rule carrying {@link NcConditions.audio} — the condition is the
|
|
14198
|
+
* trigger discriminator, exactly as `occupancy` is on `device-event`.
|
|
14136
14199
|
*/
|
|
14137
14200
|
var NcDeliverySchema = _enum([
|
|
14138
14201
|
"immediate",
|
|
@@ -14147,15 +14210,32 @@ var NcDeliverySchema = _enum([
|
|
|
14147
14210
|
* depend on a provider's raw event name or payload shape.
|
|
14148
14211
|
*/
|
|
14149
14212
|
var NcSystemEventKindSchema = _enum([
|
|
14150
|
-
"
|
|
14151
|
-
"
|
|
14213
|
+
"device-online",
|
|
14214
|
+
"device-offline",
|
|
14215
|
+
"device-disabled",
|
|
14216
|
+
"device-enabled",
|
|
14152
14217
|
"stream-online",
|
|
14153
14218
|
"stream-offline",
|
|
14154
14219
|
"node-online",
|
|
14155
14220
|
"node-offline",
|
|
14156
14221
|
"addon-update-available",
|
|
14157
|
-
"server-update-available"
|
|
14222
|
+
"server-update-available",
|
|
14223
|
+
"alarm-triggered",
|
|
14224
|
+
"alarm-armed",
|
|
14225
|
+
"alarm-disarmed",
|
|
14226
|
+
"camera-online",
|
|
14227
|
+
"camera-offline",
|
|
14228
|
+
"camera-disabled",
|
|
14229
|
+
"camera-enabled"
|
|
14230
|
+
]);
|
|
14231
|
+
/** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
|
|
14232
|
+
var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
|
|
14233
|
+
"camera-online",
|
|
14234
|
+
"camera-offline",
|
|
14235
|
+
"camera-disabled",
|
|
14236
|
+
"camera-enabled"
|
|
14158
14237
|
]);
|
|
14238
|
+
NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
|
|
14159
14239
|
/**
|
|
14160
14240
|
* One coherent system-event condition. `kinds` is the required opt-in safety
|
|
14161
14241
|
* gate; the remaining lists are optional narrowing filters relevant to the
|
|
@@ -14164,6 +14244,18 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14164
14244
|
var NcSystemEventConditionSchema = object({
|
|
14165
14245
|
kinds: array(NcSystemEventKindSchema).min(1),
|
|
14166
14246
|
deviceIds: array(number().int()).min(1).optional(),
|
|
14247
|
+
/**
|
|
14248
|
+
* Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
|
|
14249
|
+
* `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
|
|
14250
|
+
* is what a liveness rule means when nobody said otherwise.
|
|
14251
|
+
*
|
|
14252
|
+
* This is where "only my cameras" is expressed, and it lives on the rule for
|
|
14253
|
+
* one reason: the intake cannot know which devices this household cares
|
|
14254
|
+
* about, and a producer-side filter is one no operator can change. Fails
|
|
14255
|
+
* CLOSED — a subject whose device type is unknown (an id the device mirror
|
|
14256
|
+
* does not carry) matches no `deviceTypes` list.
|
|
14257
|
+
*/
|
|
14258
|
+
deviceTypes: array(string().min(1)).min(1).optional(),
|
|
14167
14259
|
nodeIds: array(string().min(1)).min(1).optional(),
|
|
14168
14260
|
packageNames: array(string().min(1)).min(1).optional()
|
|
14169
14261
|
});
|
|
@@ -14214,6 +14306,47 @@ var NcOccupancyConditionSchema = object({
|
|
|
14214
14306
|
sustainSeconds: number().int().min(0).max(3600).default(15)
|
|
14215
14307
|
});
|
|
14216
14308
|
/**
|
|
14309
|
+
* Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
|
|
14310
|
+
*
|
|
14311
|
+
* Operator-approved vocabulary (2026-08-12, option A — the same one the
|
|
14312
|
+
* reference notifier uses, so an operator moving between them re-uses what
|
|
14313
|
+
* they already know): a rule matches when, over a sampling window of
|
|
14314
|
+
* `samplingSeconds`, at least `hitPercent`% of the audio samples in that
|
|
14315
|
+
* window are HITS. A sample is a hit when it satisfies BOTH present filters:
|
|
14316
|
+
*
|
|
14317
|
+
* - `dbThreshold` — its level is at or above this many dBFS (see
|
|
14318
|
+
* {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
|
|
14319
|
+
* - `labels` — the classifier put at least one of these labels on it.
|
|
14320
|
+
*
|
|
14321
|
+
* Both are OPTIONAL and independent, which is the point of the shape: a
|
|
14322
|
+
* loudness rule ("something loud at 3am") needs no model to be right, and a
|
|
14323
|
+
* label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
|
|
14324
|
+
* is given** — a window in which every sample is trivially a hit would fire on
|
|
14325
|
+
* silence, so the engine refuses such a condition rather than notifying on
|
|
14326
|
+
* nothing (the schema cannot express "at least one of" without becoming a
|
|
14327
|
+
* ZodEffects the cap path would have to special-case).
|
|
14328
|
+
*
|
|
14329
|
+
* `hitPercent` is over the samples the window actually HOLDS, and the window
|
|
14330
|
+
* must be FULL before it can match — a window that has been open for two
|
|
14331
|
+
* seconds of its ten is 100% of nothing, and firing on it would make
|
|
14332
|
+
* `samplingSeconds` decorative.
|
|
14333
|
+
*
|
|
14334
|
+
* Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
|
|
14335
|
+
* `audio-*` ids). Both spellings are accepted — the matcher normalizes the
|
|
14336
|
+
* `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
|
|
14337
|
+
* an operator who typed `dog` mean the same thing.
|
|
14338
|
+
*/
|
|
14339
|
+
var NcAudioConditionSchema = object({
|
|
14340
|
+
/** Audio macro labels; absent = any sound (level-only rule). */
|
|
14341
|
+
labels: array(string().min(1)).min(1).optional(),
|
|
14342
|
+
/** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
|
|
14343
|
+
dbThreshold: number().min(-96).max(0).optional(),
|
|
14344
|
+
/** Percentage of the window's samples that must be hits (1–100). */
|
|
14345
|
+
hitPercent: number().int().min(1).max(100).default(60),
|
|
14346
|
+
/** Length of the sampling window in seconds. */
|
|
14347
|
+
samplingSeconds: number().int().min(1).max(300).default(10)
|
|
14348
|
+
});
|
|
14349
|
+
/**
|
|
14217
14350
|
* Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
|
|
14218
14351
|
*
|
|
14219
14352
|
* The values are not symmetric, and deliberately so — the absent value has to
|
|
@@ -14486,7 +14619,33 @@ var NcConditionsSchema = object({
|
|
|
14486
14619
|
* threshold and holds for `sustainSeconds`. Fail-closed on missing
|
|
14487
14620
|
* substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
|
|
14488
14621
|
*/
|
|
14489
|
-
occupancy: NcOccupancyConditionSchema.optional()
|
|
14622
|
+
occupancy: NcOccupancyConditionSchema.optional(),
|
|
14623
|
+
/**
|
|
14624
|
+
* IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
|
|
14625
|
+
* `samplingSeconds` window clear the optional `dbThreshold` and carry one of
|
|
14626
|
+
* the optional `labels`. Fail-closed on missing substrate (no audio samples,
|
|
14627
|
+
* a window that is not full yet, neither filter given). See
|
|
14628
|
+
* {@link NcAudioCondition}.
|
|
14629
|
+
*
|
|
14630
|
+
* Presence of this key is what makes a rule an AUDIO rule: the engine fires
|
|
14631
|
+
* it ONLY on a confirmed audio window, and a rule carrying it never fires on
|
|
14632
|
+
* a detection, a track or a device event (the same fail-closed pairing
|
|
14633
|
+
* `occupancy` has with the `device-event` trigger). That is how audio labels
|
|
14634
|
+
* leave `classes`: an audio rule names its sounds HERE, and the legacy path
|
|
14635
|
+
* (an `immediate` rule naming an `audio-*` class, one notification per
|
|
14636
|
+
* classified sample) stays exactly as it was for rules that already use it.
|
|
14637
|
+
*
|
|
14638
|
+
* NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
|
|
14639
|
+
* rather than an oversight: the viewer mirrors the descriptor enums BY HAND
|
|
14640
|
+
* (`camstack/src/data/notification-center.ts`, guarded by
|
|
14641
|
+
* `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
|
|
14642
|
+
* condition fields it does not know when a rule is saved from the phone.
|
|
14643
|
+
* Publishing an editor for a condition the app cannot round-trip is how an
|
|
14644
|
+
* operator loses a rule's conditions by opening it — so the descriptor, the
|
|
14645
|
+
* admin widget and the viewer mirror land together (P2 + P3), and only then
|
|
14646
|
+
* does an audio rule become authorable.
|
|
14647
|
+
*/
|
|
14648
|
+
audio: NcAudioConditionSchema.optional()
|
|
14490
14649
|
});
|
|
14491
14650
|
/** One delivery target: a `notification-output` Target ref + passthrough params. */
|
|
14492
14651
|
var NcRuleTargetSchema = object({
|
|
@@ -14600,6 +14759,73 @@ var NcThrottleSchema = object({
|
|
|
14600
14759
|
*/
|
|
14601
14760
|
granularity: NcThrottleGranularitySchema.optional()
|
|
14602
14761
|
});
|
|
14762
|
+
/**
|
|
14763
|
+
* How long the confirm gate may hold ONE notification, and how big the picture
|
|
14764
|
+
* it judges may be.
|
|
14765
|
+
*
|
|
14766
|
+
* The clamp is the product decision, not a coincidence of the model: p50 was
|
|
14767
|
+
* 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
|
|
14768
|
+
* arrives after the visitor has gone is not a notification. 448 px was enough
|
|
14769
|
+
* to score 16/16 on the operator's parking scenario — bigger costs latency and
|
|
14770
|
+
* tokens for pixels the model pools away.
|
|
14771
|
+
*/
|
|
14772
|
+
var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
|
|
14773
|
+
var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
|
|
14774
|
+
var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
|
|
14775
|
+
/** Comparison the model's COUNT must satisfy for the notification to fire. */
|
|
14776
|
+
var NcConfirmExpectSchema = object({
|
|
14777
|
+
op: _enum([
|
|
14778
|
+
">=",
|
|
14779
|
+
">",
|
|
14780
|
+
"<=",
|
|
14781
|
+
"<",
|
|
14782
|
+
"=="
|
|
14783
|
+
]),
|
|
14784
|
+
count: number().int().min(0).max(1e3)
|
|
14785
|
+
});
|
|
14786
|
+
/**
|
|
14787
|
+
* AI CONFIRM — a vision model looks at the picture this notification is about
|
|
14788
|
+
* to ship and says whether it agrees with the rule.
|
|
14789
|
+
*
|
|
14790
|
+
* It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
|
|
14791
|
+
* crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
|
|
14792
|
+
* on the operator's phone is not a verdict about this notification.
|
|
14793
|
+
*
|
|
14794
|
+
* FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
|
|
14795
|
+
* whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
|
|
14796
|
+
* the default and every fail-open is COUNTED, because a gate that always fails
|
|
14797
|
+
* open looks in the log exactly like a gate that works.
|
|
14798
|
+
*
|
|
14799
|
+
* Every field is `.optional()` rather than relied on as a Zod default at the
|
|
14800
|
+
* runtime seam: a Zod default does NOT run on the addon→addon cap path (three
|
|
14801
|
+
* production failures in one day), so the gate reads absent as the constant
|
|
14802
|
+
* above rather than trusting a parse it may never have seen.
|
|
14803
|
+
*/
|
|
14804
|
+
var NcConfirmSchema = object({
|
|
14805
|
+
/** Off unless asked for. An absent `confirm` and `enabled:false` are the
|
|
14806
|
+
* same thing, and both mean "deliver exactly as before". */
|
|
14807
|
+
enabled: boolean().default(false),
|
|
14808
|
+
/** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
|
|
14809
|
+
profileId: string().optional(),
|
|
14810
|
+
/**
|
|
14811
|
+
* The operator's question, in his own words. Absent = a question derived
|
|
14812
|
+
* from the rule (its class and its expectation).
|
|
14813
|
+
*
|
|
14814
|
+
* NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
|
|
14815
|
+
* banners, signage and plates as instructions if you let them reach the
|
|
14816
|
+
* prompt — proven live — so the authoritative contract stays in the system
|
|
14817
|
+
* turn and only rule-authored words land here.
|
|
14818
|
+
*/
|
|
14819
|
+
prompt: string().max(1e3).optional(),
|
|
14820
|
+
/** Fire only when the model's count satisfies this. Absent = the model's
|
|
14821
|
+
* own boolean verdict decides. */
|
|
14822
|
+
expect: NcConfirmExpectSchema.optional(),
|
|
14823
|
+
timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
|
|
14824
|
+
/** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
|
|
14825
|
+
onTimeout: _enum(["fire", "suppress"]).default("fire"),
|
|
14826
|
+
/** Longest edge the judged image is downscaled to before it is sent. */
|
|
14827
|
+
maxImagePx: number().int().min(64).max(2048).default(448)
|
|
14828
|
+
});
|
|
14603
14829
|
/** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
|
|
14604
14830
|
var NcRuleInputSchema = object({
|
|
14605
14831
|
name: string().min(1).max(200),
|
|
@@ -14660,7 +14886,13 @@ var NcRuleInputSchema = object({
|
|
|
14660
14886
|
* `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
|
|
14661
14887
|
* shape as every other actuation.
|
|
14662
14888
|
*/
|
|
14663
|
-
actions: NcRuleActionsSchema.optional()
|
|
14889
|
+
actions: NcRuleActionsSchema.optional(),
|
|
14890
|
+
/**
|
|
14891
|
+
* AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
|
|
14892
|
+
* a rule that predates the gate must keep delivering byte-for-byte as it
|
|
14893
|
+
* did, and absent is the only way to say that without a migration.
|
|
14894
|
+
*/
|
|
14895
|
+
confirm: NcConfirmSchema.optional()
|
|
14664
14896
|
});
|
|
14665
14897
|
/**
|
|
14666
14898
|
* Partial patch for `updateRule` — any subset of the input fields, plus the
|
|
@@ -14671,7 +14903,37 @@ var NcRuleInputSchema = object({
|
|
|
14671
14903
|
* still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
|
|
14672
14904
|
* `updateRule` patch.
|
|
14673
14905
|
*/
|
|
14674
|
-
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
14906
|
+
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
14907
|
+
disabledTargetIds: array(string()).optional(),
|
|
14908
|
+
/**
|
|
14909
|
+
* `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
|
|
14910
|
+
*
|
|
14911
|
+
* It makes the key optional to SUPPLY; the parse still materialises the
|
|
14912
|
+
* default when the key is absent. And `NcRuleStore.update` merges with
|
|
14913
|
+
* `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
|
|
14914
|
+
* one — which made every partial edit destructive:
|
|
14915
|
+
*
|
|
14916
|
+
* nc.updateRule({ throttle }) → conditions reset to `{}`
|
|
14917
|
+
* nc.setRuleTargetEnabled(...) → conditions reset to `{}`
|
|
14918
|
+
* setEnabled(ruleId, false) → conditions reset to `{}`
|
|
14919
|
+
*
|
|
14920
|
+
* A rule scoped to one camera and one zone silently became a rule that
|
|
14921
|
+
* matches EVERY event on EVERY camera, and lost its `media` policy
|
|
14922
|
+
* (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
|
|
14923
|
+
* live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
|
|
14924
|
+
* within a minute of a two-field patch.
|
|
14925
|
+
*
|
|
14926
|
+
* So every defaulted field is re-declared here WITHOUT its default. The
|
|
14927
|
+
* inner defaults still apply when the caller DOES send the key — `{}` for
|
|
14928
|
+
* conditions remains a real instruction ("clear them") — and only the
|
|
14929
|
+
* absent key is now genuinely absent.
|
|
14930
|
+
*/
|
|
14931
|
+
enabled: boolean().optional(),
|
|
14932
|
+
conditions: NcConditionsSchema.optional(),
|
|
14933
|
+
media: NcMediaPolicySchema.optional(),
|
|
14934
|
+
throttle: NcThrottleSchema.optional(),
|
|
14935
|
+
priority: number().int().min(1).max(5).optional()
|
|
14936
|
+
});
|
|
14675
14937
|
/** A persisted rule. */
|
|
14676
14938
|
var NcRuleSchema = NcRuleInputSchema.extend({
|
|
14677
14939
|
id: string(),
|
|
@@ -14972,6 +15234,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
|
|
|
14972
15234
|
* Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
|
|
14973
15235
|
* copy would lie the first time a rule is disabled.
|
|
14974
15236
|
*/
|
|
15237
|
+
/**
|
|
15238
|
+
* Why a device a mode NAMES is nonetheless not armed by it.
|
|
15239
|
+
*
|
|
15240
|
+
* Each value is an existing authority, never a new flag (D62): `muted` is the
|
|
15241
|
+
* per-camera notification switch the Notification Center already owns,
|
|
15242
|
+
* `detection-off` is the device's own detection binding being inactive, and
|
|
15243
|
+
* `offline` is the device manager's liveness. A fourth reason would mean a
|
|
15244
|
+
* fourth authority, and inventing one here is how a panel starts disagreeing
|
|
15245
|
+
* with the switches the operator actually used.
|
|
15246
|
+
*/
|
|
15247
|
+
var NcAlarmSkipReasonSchema = _enum([
|
|
15248
|
+
"muted",
|
|
15249
|
+
"detection-off",
|
|
15250
|
+
"offline"
|
|
15251
|
+
]);
|
|
15252
|
+
var NcAlarmSkippedDeviceSchema = object({
|
|
15253
|
+
deviceId: number().int(),
|
|
15254
|
+
reason: NcAlarmSkipReasonSchema
|
|
15255
|
+
});
|
|
14975
15256
|
var NcAlarmModeCoverageSchema = object({
|
|
14976
15257
|
mode: AlarmArmModeSchema,
|
|
14977
15258
|
/** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
|
|
@@ -14979,7 +15260,18 @@ var NcAlarmModeCoverageSchema = object({
|
|
|
14979
15260
|
/** At least one covering rule has no device scope, so the mode covers all. */
|
|
14980
15261
|
allDevices: boolean(),
|
|
14981
15262
|
/** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
|
|
14982
|
-
deviceIds: array(number().int())
|
|
15263
|
+
deviceIds: array(number().int()),
|
|
15264
|
+
/**
|
|
15265
|
+
* Devices this mode NAMES but cannot actually arm, each with the switch that
|
|
15266
|
+
* excludes it.
|
|
15267
|
+
*
|
|
15268
|
+
* "Away armed — 12 cameras" is a promise, and a muted camera among those
|
|
15269
|
+
* twelve makes it false in exactly the way nobody notices until an incident.
|
|
15270
|
+
* Defaulted to `[]` so a coverage answer computed before this field existed
|
|
15271
|
+
* still parses as "nothing known to be skipped" rather than failing the whole
|
|
15272
|
+
* alarm tab.
|
|
15273
|
+
*/
|
|
15274
|
+
skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
|
|
14983
15275
|
});
|
|
14984
15276
|
var NcAlarmConfigSchema = object({
|
|
14985
15277
|
/**
|
|
@@ -17811,9 +18103,16 @@ var CameraStatusSchema = object({
|
|
|
17811
18103
|
audio: CameraAudioStatusSchema.nullable(),
|
|
17812
18104
|
recording: CameraRecordingStatusSchema.nullable(),
|
|
17813
18105
|
/**
|
|
17814
|
-
* Per-camera
|
|
18106
|
+
* Per-camera functions an OPERATOR has turned off
|
|
17815
18107
|
* ([D61](../../../../docs/decisions/adr-0067.md)).
|
|
17816
18108
|
*
|
|
18109
|
+
* Composed from the AUTHORITIES themselves — the wrapper bindings,
|
|
18110
|
+
* `RecordingConfig.enabled`, the notification mute, the broker's audio
|
|
18111
|
+
* policy, the camera's own microphone — via `composeSwitchedOff`, not from
|
|
18112
|
+
* the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
|
|
18113
|
+
* The badge outlives the control panel: the panel was a convenience, this is
|
|
18114
|
+
* the difference between a camera being off and a camera being dead.
|
|
18115
|
+
*
|
|
17817
18116
|
* This is the difference between DISABLED and BROKEN. A camera whose
|
|
17818
18117
|
* `detection` block reports zero fps and whose `switchedOff` contains
|
|
17819
18118
|
* `'object-detection'` was switched off by a person; the same camera with an
|
|
@@ -24572,7 +24871,19 @@ var RecordingManifestSchema = object({
|
|
|
24572
24871
|
* profiles/subtrees/locations on this node). */
|
|
24573
24872
|
var RecordingDeviceUsageSchema = object({
|
|
24574
24873
|
deviceId: number(),
|
|
24575
|
-
usedBytes: number()
|
|
24874
|
+
usedBytes: number(),
|
|
24875
|
+
/**
|
|
24876
|
+
* Start of this camera's OLDEST indexed segment, across every profile and
|
|
24877
|
+
* location — the "Oldest footage" column in Recordings → Storage, and the
|
|
24878
|
+
* only honest answer to "is retention actually holding?" per camera.
|
|
24879
|
+
*
|
|
24880
|
+
* `null` = the camera has no footage. OPTIONAL because a recorder that
|
|
24881
|
+
* predates this field omits it entirely, and a hub whose types carry the
|
|
24882
|
+
* field must keep validating that older provider's payload: the framework
|
|
24883
|
+
* (types) and the addon ship on different trains, and the addon is usually
|
|
24884
|
+
* the later of the two.
|
|
24885
|
+
*/
|
|
24886
|
+
oldestMs: number().nullable().optional()
|
|
24576
24887
|
});
|
|
24577
24888
|
/** Recording storage usage + capacity for one storage location. */
|
|
24578
24889
|
var RecordingLocationUsageSchema = object({
|
|
@@ -24600,6 +24911,57 @@ var RecordingStorageUsageSchema = object({
|
|
|
24600
24911
|
locations: array(RecordingLocationUsageSchema)
|
|
24601
24912
|
});
|
|
24602
24913
|
/**
|
|
24914
|
+
* The OPERATOR-ARMED half of multi-location recordings (D116).
|
|
24915
|
+
*
|
|
24916
|
+
* The placement plan decides where NEW writes go and moves nothing. A rebalance
|
|
24917
|
+
* is the operator asking for the EXISTING archive to be brought into line with
|
|
24918
|
+
* that plan: one relocate job per (camera, profile) pile that sits on the wrong
|
|
24919
|
+
* location, run FIFO behind the single-flight mover.
|
|
24920
|
+
*
|
|
24921
|
+
* `plan…` and `start…` return the SAME shape deliberately — what the operator
|
|
24922
|
+
* confirms is exactly what gets enqueued, and `jobIds` is the only difference
|
|
24923
|
+
* (empty on the plan).
|
|
24924
|
+
*/
|
|
24925
|
+
var RecordingRebalanceMoveSchema = object({
|
|
24926
|
+
deviceId: number(),
|
|
24927
|
+
profile: string(),
|
|
24928
|
+
fromLocationId: string(),
|
|
24929
|
+
toLocationId: string(),
|
|
24930
|
+
bytes: number(),
|
|
24931
|
+
files: number().int()
|
|
24932
|
+
});
|
|
24933
|
+
/** Why a pile that is out of place is staying there. Every refusal is
|
|
24934
|
+
* reported: a rebalance that silently drops a camera reads exactly like one
|
|
24935
|
+
* that had nothing to do. */
|
|
24936
|
+
var RecordingRebalanceSkipReasonSchema = _enum([
|
|
24937
|
+
"unassigned",
|
|
24938
|
+
"target-not-writable",
|
|
24939
|
+
"below-threshold",
|
|
24940
|
+
"no-headroom"
|
|
24941
|
+
]);
|
|
24942
|
+
var RecordingRebalanceSkipSchema = object({
|
|
24943
|
+
deviceId: number(),
|
|
24944
|
+
profile: string(),
|
|
24945
|
+
fromLocationId: string(),
|
|
24946
|
+
/** The location the plan wants; null when the camera has no assignment. */
|
|
24947
|
+
toLocationId: string().nullable(),
|
|
24948
|
+
bytes: number(),
|
|
24949
|
+
reason: RecordingRebalanceSkipReasonSchema
|
|
24950
|
+
});
|
|
24951
|
+
var RecordingRebalancePlanSchema = object({
|
|
24952
|
+
moves: array(RecordingRebalanceMoveSchema),
|
|
24953
|
+
skipped: array(RecordingRebalanceSkipSchema),
|
|
24954
|
+
bytesToMove: number(),
|
|
24955
|
+
/** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
|
|
24956
|
+
jobIds: array(string())
|
|
24957
|
+
});
|
|
24958
|
+
var RecordingRebalanceInputSchema = object({
|
|
24959
|
+
/** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
|
|
24960
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
24961
|
+
/** Ignore piles smaller than this (default 1 GB). */
|
|
24962
|
+
minMoveGb: number().min(0).optional()
|
|
24963
|
+
});
|
|
24964
|
+
/**
|
|
24603
24965
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
24604
24966
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
24605
24967
|
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
@@ -24762,9 +25124,24 @@ method(object({
|
|
|
24762
25124
|
}), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
24763
25125
|
kind: "mutation",
|
|
24764
25126
|
auth: "admin"
|
|
25127
|
+
}), method(RelocateFootageInputSchema, object({ jobId: string() }), {
|
|
25128
|
+
kind: "mutation",
|
|
25129
|
+
auth: "admin"
|
|
25130
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
25131
|
+
kind: "query",
|
|
25132
|
+
auth: "admin"
|
|
25133
|
+
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
25134
|
+
kind: "mutation",
|
|
25135
|
+
auth: "admin"
|
|
25136
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
25137
|
+
kind: "query",
|
|
25138
|
+
auth: "admin"
|
|
25139
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
25140
|
+
kind: "mutation",
|
|
25141
|
+
auth: "admin"
|
|
24765
25142
|
});
|
|
24766
25143
|
/**
|
|
24767
|
-
* `
|
|
25144
|
+
* `recording-export` cap — render a footage time range into a single downloadable
|
|
24768
25145
|
* MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
|
|
24769
25146
|
* bounded lifetime with a durable history, auto-expiry, and optional
|
|
24770
25147
|
* delete-after-download.
|
|
@@ -24779,10 +25156,53 @@ method(object({
|
|
|
24779
25156
|
*/
|
|
24780
25157
|
/** Playback-speed multiplier for the render (1 = realtime). */
|
|
24781
25158
|
var ExportSpeedSchema = number().min(.25).max(32);
|
|
25159
|
+
/**
|
|
25160
|
+
* One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
|
|
25161
|
+
*
|
|
25162
|
+
* **Wall clock, not ffmpeg's `t`** — and the recorder translates. A caller
|
|
25163
|
+
* derives these bounds from things that happened at a TIME (a track's
|
|
25164
|
+
* `firstSeen`), while `t` runs over the source playlist: the concatenation of
|
|
25165
|
+
* every segment present for the range, with each recording GAP removed. The
|
|
25166
|
+
* two agree only on a window that recorded without one interruption, and only
|
|
25167
|
+
* the render side knows the segments, so the translation lives there
|
|
25168
|
+
* (`export-dense-map.ts`, addon-pipeline).
|
|
25169
|
+
*
|
|
25170
|
+
* It was not always so. These seconds were fed to `between(t,…)` verbatim, and
|
|
25171
|
+
* on a 10 h window holding 29,393 s of footage every range landed late by the
|
|
25172
|
+
* gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
|
|
25173
|
+
* the video was a uniform timelapse, and the log line reported the five ranges
|
|
25174
|
+
* that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
|
|
25175
|
+
*
|
|
25176
|
+
* Relative and not absolute epoch, because an absolute epoch would make every
|
|
25177
|
+
* call site responsible for the same subtraction.
|
|
25178
|
+
*/
|
|
25179
|
+
var ExportDenseRangeSchema = object({
|
|
25180
|
+
fromSec: number().nonnegative(),
|
|
25181
|
+
toSec: number().nonnegative()
|
|
25182
|
+
}).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
|
|
25183
|
+
/**
|
|
25184
|
+
* Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
|
|
25185
|
+
* listed ranges and at the base `everyMs` everywhere else.
|
|
25186
|
+
*
|
|
25187
|
+
* `everyMs` must be strictly smaller than the base cadence — a dense rate that
|
|
25188
|
+
* is not denser renders a uniform timelapse the operator believes is two-rate.
|
|
25189
|
+
*/
|
|
25190
|
+
var ExportDenseSchema = object({
|
|
25191
|
+
everyMs: number().int().positive(),
|
|
25192
|
+
ranges: array(ExportDenseRangeSchema).min(1).max(200)
|
|
25193
|
+
});
|
|
24782
25194
|
/** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
|
|
24783
25195
|
var ExportTimelapseSchema = object({
|
|
24784
25196
|
everyMs: number().int().positive(),
|
|
24785
|
-
outputFps: number().int().min(1).max(60).optional()
|
|
25197
|
+
outputFps: number().int().min(1).max(60).optional(),
|
|
25198
|
+
/** Optional second, FASTER rate over the intervals that matter. */
|
|
25199
|
+
dense: ExportDenseSchema.optional()
|
|
25200
|
+
}).superRefine((v, ctx) => {
|
|
25201
|
+
if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
|
|
25202
|
+
code: ZodIssueCode.custom,
|
|
25203
|
+
message: "dense.everyMs must be strictly smaller than the base everyMs",
|
|
25204
|
+
path: ["dense", "everyMs"]
|
|
25205
|
+
});
|
|
24786
25206
|
});
|
|
24787
25207
|
/**
|
|
24788
25208
|
* Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
|
|
@@ -24840,6 +25260,19 @@ var ExportDownloadSchema = object({
|
|
|
24840
25260
|
url: string(),
|
|
24841
25261
|
endpoints: array(string())
|
|
24842
25262
|
});
|
|
25263
|
+
/**
|
|
25264
|
+
* A finished export's bytes, inline.
|
|
25265
|
+
*
|
|
25266
|
+
* `bytes` is the DECODED length — the number the caller bounds and logs
|
|
25267
|
+
* against, so nobody has to infer it from the base64 length.
|
|
25268
|
+
*/
|
|
25269
|
+
var ExportBytesSchema = object({
|
|
25270
|
+
base64: string(),
|
|
25271
|
+
contentType: string(),
|
|
25272
|
+
/** Suggested filename, extension included. */
|
|
25273
|
+
name: string(),
|
|
25274
|
+
bytes: number().int().nonnegative()
|
|
25275
|
+
});
|
|
24843
25276
|
method(object({
|
|
24844
25277
|
deviceId: number(),
|
|
24845
25278
|
profile: string(),
|
|
@@ -24864,6 +25297,9 @@ method(object({
|
|
|
24864
25297
|
}), method(object({ exportId: string() }), ExportDownloadSchema, {
|
|
24865
25298
|
kind: "query",
|
|
24866
25299
|
auth: "protected"
|
|
25300
|
+
}), method(object({ exportId: string() }), ExportBytesSchema, {
|
|
25301
|
+
kind: "query",
|
|
25302
|
+
auth: "protected"
|
|
24867
25303
|
});
|
|
24868
25304
|
/**
|
|
24869
25305
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
@@ -31541,6 +31977,12 @@ Object.freeze({
|
|
|
31541
31977
|
addonId: null,
|
|
31542
31978
|
access: "create"
|
|
31543
31979
|
},
|
|
31980
|
+
"recording.cancelRelocateJob": {
|
|
31981
|
+
capName: "recording",
|
|
31982
|
+
capScope: "system",
|
|
31983
|
+
addonId: null,
|
|
31984
|
+
access: "create"
|
|
31985
|
+
},
|
|
31544
31986
|
"recording.cancelStorageMigrationMove": {
|
|
31545
31987
|
capName: "recording",
|
|
31546
31988
|
capScope: "system",
|
|
@@ -31595,6 +32037,12 @@ Object.freeze({
|
|
|
31595
32037
|
addonId: null,
|
|
31596
32038
|
access: "view"
|
|
31597
32039
|
},
|
|
32040
|
+
"recording.listRelocateJobs": {
|
|
32041
|
+
capName: "recording",
|
|
32042
|
+
capScope: "system",
|
|
32043
|
+
addonId: null,
|
|
32044
|
+
access: "view"
|
|
32045
|
+
},
|
|
31598
32046
|
"recording.locateSegment": {
|
|
31599
32047
|
capName: "recording",
|
|
31600
32048
|
capScope: "system",
|
|
@@ -31607,6 +32055,12 @@ Object.freeze({
|
|
|
31607
32055
|
addonId: null,
|
|
31608
32056
|
access: "create"
|
|
31609
32057
|
},
|
|
32058
|
+
"recording.planStorageRebalance": {
|
|
32059
|
+
capName: "recording",
|
|
32060
|
+
capScope: "system",
|
|
32061
|
+
addonId: null,
|
|
32062
|
+
access: "view"
|
|
32063
|
+
},
|
|
31610
32064
|
"recording.pruneFootage": {
|
|
31611
32065
|
capName: "recording",
|
|
31612
32066
|
capScope: "system",
|
|
@@ -31631,6 +32085,12 @@ Object.freeze({
|
|
|
31631
32085
|
addonId: null,
|
|
31632
32086
|
access: "create"
|
|
31633
32087
|
},
|
|
32088
|
+
"recording.relocateFootage": {
|
|
32089
|
+
capName: "recording",
|
|
32090
|
+
capScope: "system",
|
|
32091
|
+
addonId: null,
|
|
32092
|
+
access: "create"
|
|
32093
|
+
},
|
|
31634
32094
|
"recording.renderClip": {
|
|
31635
32095
|
capName: "recording",
|
|
31636
32096
|
capScope: "system",
|
|
@@ -31667,38 +32127,50 @@ Object.freeze({
|
|
|
31667
32127
|
addonId: null,
|
|
31668
32128
|
access: "create"
|
|
31669
32129
|
},
|
|
32130
|
+
"recording.startStorageRebalance": {
|
|
32131
|
+
capName: "recording",
|
|
32132
|
+
capScope: "system",
|
|
32133
|
+
addonId: null,
|
|
32134
|
+
access: "create"
|
|
32135
|
+
},
|
|
31670
32136
|
"recordingExport.cancelExport": {
|
|
31671
|
-
capName: "
|
|
32137
|
+
capName: "recording-export",
|
|
31672
32138
|
capScope: "system",
|
|
31673
32139
|
addonId: null,
|
|
31674
32140
|
access: "create"
|
|
31675
32141
|
},
|
|
31676
32142
|
"recordingExport.createExport": {
|
|
31677
|
-
capName: "
|
|
32143
|
+
capName: "recording-export",
|
|
31678
32144
|
capScope: "system",
|
|
31679
32145
|
addonId: null,
|
|
31680
32146
|
access: "create"
|
|
31681
32147
|
},
|
|
31682
32148
|
"recordingExport.deleteExport": {
|
|
31683
|
-
capName: "
|
|
32149
|
+
capName: "recording-export",
|
|
31684
32150
|
capScope: "system",
|
|
31685
32151
|
addonId: null,
|
|
31686
32152
|
access: "delete"
|
|
31687
32153
|
},
|
|
31688
32154
|
"recordingExport.getDownloadUrl": {
|
|
31689
|
-
capName: "
|
|
32155
|
+
capName: "recording-export",
|
|
31690
32156
|
capScope: "system",
|
|
31691
32157
|
addonId: null,
|
|
31692
32158
|
access: "view"
|
|
31693
32159
|
},
|
|
31694
32160
|
"recordingExport.getExport": {
|
|
31695
|
-
capName: "
|
|
32161
|
+
capName: "recording-export",
|
|
31696
32162
|
capScope: "system",
|
|
31697
32163
|
addonId: null,
|
|
31698
32164
|
access: "view"
|
|
31699
32165
|
},
|
|
31700
32166
|
"recordingExport.listExports": {
|
|
31701
|
-
capName: "
|
|
32167
|
+
capName: "recording-export",
|
|
32168
|
+
capScope: "system",
|
|
32169
|
+
addonId: null,
|
|
32170
|
+
access: "view"
|
|
32171
|
+
},
|
|
32172
|
+
"recordingExport.readExportBytes": {
|
|
32173
|
+
capName: "recording-export",
|
|
31702
32174
|
capScope: "system",
|
|
31703
32175
|
addonId: null,
|
|
31704
32176
|
access: "view"
|
|
@@ -33075,6 +33547,104 @@ var FramerateField = number().int().min(1).max(60);
|
|
|
33075
33547
|
var TargetsField = array(NcRuleTargetSchema).min(1);
|
|
33076
33548
|
var PriorityField = number().int().min(1).max(5);
|
|
33077
33549
|
/**
|
|
33550
|
+
* Explicit override of the DENSE sampling cadence, seconds.
|
|
33551
|
+
*
|
|
33552
|
+
* Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
|
|
33553
|
+
* 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
|
|
33554
|
+
* made that same base 3 s and rendered a person pass as two frames.)
|
|
33555
|
+
*
|
|
33556
|
+
* THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
|
|
33557
|
+
* `denseCadenceSec` and played at `framerate` occupies
|
|
33558
|
+
*
|
|
33559
|
+
* outputSeconds = (rangeSec / denseCadenceSec) / framerate
|
|
33560
|
+
*
|
|
33561
|
+
* 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.
|
|
33562
|
+
* Halving this field doubles the frames INSIDE ranges only — the base cadence,
|
|
33563
|
+
* and therefore the length of a quiet night, does not move.
|
|
33564
|
+
*
|
|
33565
|
+
* Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
|
|
33566
|
+
* the recording has them returns the same frames, requested twice. Must be
|
|
33567
|
+
* STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
|
|
33568
|
+
* a uniform video the operator believes is two-rate — and upsert refuses it
|
|
33569
|
+
* rather than letting the export cap reject the render hours after the window.
|
|
33570
|
+
*/
|
|
33571
|
+
var DenseCadenceSecField = number().min(.1).max(3600);
|
|
33572
|
+
/**
|
|
33573
|
+
* Minimum seconds of OUTPUT video each detection range must occupy.
|
|
33574
|
+
*
|
|
33575
|
+
* The operator-facing form of the arithmetic above: instead of solving for a
|
|
33576
|
+
* cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
|
|
33577
|
+
* 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
|
|
33578
|
+
* that range every ~583 ms.
|
|
33579
|
+
*
|
|
33580
|
+
* ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
|
|
33581
|
+
* ranges are terms of a single ffmpeg `select` expression that cannot vary rate
|
|
33582
|
+
* per term — so the MOST DEMANDING (shortest) range sets the rate and longer
|
|
33583
|
+
* ranges are sampled denser than they need. Per-range cadences require a cap
|
|
33584
|
+
* schema change and are the tracked follow-up.
|
|
33585
|
+
*
|
|
33586
|
+
* A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
|
|
33587
|
+
* is rendered with every frame that EXISTS and no more: the guarantee is capped
|
|
33588
|
+
* by real footage, never met by duplicating frames into motion that never
|
|
33589
|
+
* happened.
|
|
33590
|
+
*/
|
|
33591
|
+
var MinDwellSecField = number().min(0).max(60);
|
|
33592
|
+
/**
|
|
33593
|
+
* Caption burned into the notification's preview frame.
|
|
33594
|
+
*
|
|
33595
|
+
* Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
|
|
33596
|
+
* `rule`, `from`, `to`) and rendered by the SAME renderer — a second
|
|
33597
|
+
* templating dialect for one field would be a second thing to explain.
|
|
33598
|
+
*
|
|
33599
|
+
* Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
|
|
33600
|
+
* operator saying "the frame, no caption" — a distinct, reachable answer, and
|
|
33601
|
+
* the reason this is not `.min(1)`.
|
|
33602
|
+
*/
|
|
33603
|
+
var PreviewTextField = string().max(200);
|
|
33604
|
+
/**
|
|
33605
|
+
* Whether the notification's preview is a STILL or a short animation.
|
|
33606
|
+
*
|
|
33607
|
+
* The operator's ask, verbatim: *"inviato come gif o video (come per le altre
|
|
33608
|
+
* rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
|
|
33609
|
+
* night reads better as three seconds of motion than as one frame of it. Both
|
|
33610
|
+
* modes get the SAME treatment (blurred frame, large centred title); `'gif'`
|
|
33611
|
+
* simply applies it to a dozen frames sampled across the render and assembles
|
|
33612
|
+
* them.
|
|
33613
|
+
*
|
|
33614
|
+
* `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
|
|
33615
|
+
* seeks and a palette pass, and no rule that never asked for one should start
|
|
33616
|
+
* paying that on the deploy that shipped it.
|
|
33617
|
+
*
|
|
33618
|
+
* A GIF that cannot be assembled DEGRADES to the still — never to nothing.
|
|
33619
|
+
*/
|
|
33620
|
+
var PreviewModeField = _enum(["image", "gif"]);
|
|
33621
|
+
/**
|
|
33622
|
+
* Which detection classes the notification reports counts for.
|
|
33623
|
+
*
|
|
33624
|
+
* The counts come from the tracks the render ALREADY fetched for its dense-range
|
|
33625
|
+
* plan — no second query — aggregated per class. Absent or empty means "every
|
|
33626
|
+
* class the window actually contained", which is what an operator who never
|
|
33627
|
+
* opened the field wants; a list narrows it (`['person']` on a driveway that
|
|
33628
|
+
* counts cars all night).
|
|
33629
|
+
*
|
|
33630
|
+
* Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
|
|
33631
|
+
* …). An unknown name simply never matches and reports nothing — it is not an
|
|
33632
|
+
* error, because a rule may legitimately name a class this camera's model does
|
|
33633
|
+
* not emit.
|
|
33634
|
+
*
|
|
33635
|
+
* The counts are exposed to {@link TimelapseTemplateSchema} as:
|
|
33636
|
+
* - `{{detections}}` — total over the reported classes
|
|
33637
|
+
* - `{{detectionSummary}}` — `2 persone, 1 veicolo`
|
|
33638
|
+
* - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
|
|
33639
|
+
* one per class, `count_` + the class name
|
|
33640
|
+
*
|
|
33641
|
+
* With NO custom body template the summary is appended to the derived body, and
|
|
33642
|
+
* only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
|
|
33643
|
+
* reads. With a custom template the operator owns every word — nothing is
|
|
33644
|
+
* appended, so `{{detectionSummary}}` is how he asks for it.
|
|
33645
|
+
*/
|
|
33646
|
+
var ReportClassesField = array(string().min(1).max(40)).max(20);
|
|
33647
|
+
/**
|
|
33078
33648
|
* Client-supplied timelapse-rule fields. The server stamps id / createdBy /
|
|
33079
33649
|
* createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
|
|
33080
33650
|
* here (see the ownership note above).
|
|
@@ -33094,9 +33664,30 @@ var TimelapseRuleInputSchema = object({
|
|
|
33094
33664
|
cadenceSec: CadenceSecField.default(15),
|
|
33095
33665
|
/** Output frames per second of the assembled mp4 (predecessor parity). */
|
|
33096
33666
|
framerate: FramerateField.default(10),
|
|
33667
|
+
/**
|
|
33668
|
+
* Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
|
|
33669
|
+
* as `max(1s, cadenceSec / 30)`, which is what every rule written before this
|
|
33670
|
+
* field gets.
|
|
33671
|
+
*/
|
|
33672
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
33673
|
+
/** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
|
|
33674
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
33097
33675
|
/** `notification-output` targets the finished video/thumbnail is sent to. */
|
|
33098
33676
|
targets: TargetsField,
|
|
33099
33677
|
template: TimelapseTemplateSchema.optional(),
|
|
33678
|
+
/**
|
|
33679
|
+
* Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
|
|
33680
|
+
* and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
|
|
33681
|
+
*
|
|
33682
|
+
* Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
|
|
33683
|
+
* the notification's title/body, and clearing it (`template: null`) must not
|
|
33684
|
+
* silently clear the caption too.
|
|
33685
|
+
*/
|
|
33686
|
+
previewText: PreviewTextField.optional(),
|
|
33687
|
+
/** Still or animation — see {@link PreviewModeField}. */
|
|
33688
|
+
previewMode: PreviewModeField.default("image"),
|
|
33689
|
+
/** Classes the notification counts — see {@link ReportClassesField}. */
|
|
33690
|
+
reportClasses: ReportClassesField.optional(),
|
|
33100
33691
|
/** Canonical notification priority ordinal (1..5); per-target overridable. */
|
|
33101
33692
|
priority: PriorityField.default(3)
|
|
33102
33693
|
});
|
|
@@ -33107,8 +33698,13 @@ object({
|
|
|
33107
33698
|
schedule: NcScheduleSchema.optional(),
|
|
33108
33699
|
cadenceSec: CadenceSecField.optional(),
|
|
33109
33700
|
framerate: FramerateField.optional(),
|
|
33701
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
33702
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
33110
33703
|
targets: TargetsField.optional(),
|
|
33111
33704
|
template: TimelapseTemplateSchema.nullable().optional(),
|
|
33705
|
+
previewText: PreviewTextField.optional(),
|
|
33706
|
+
previewMode: PreviewModeField.optional(),
|
|
33707
|
+
reportClasses: ReportClassesField.optional(),
|
|
33112
33708
|
priority: PriorityField.optional()
|
|
33113
33709
|
});
|
|
33114
33710
|
TimelapseRuleInputSchema.extend({
|
|
@@ -33120,10 +33716,28 @@ TimelapseRuleInputSchema.extend({
|
|
|
33120
33716
|
*/
|
|
33121
33717
|
ownerUserId: string().optional(),
|
|
33122
33718
|
/**
|
|
33123
|
-
* Epoch-ms of the
|
|
33124
|
-
*
|
|
33719
|
+
* Epoch-ms of the NEWEST successful generation across every camera of this
|
|
33720
|
+
* rule. What a UI shows, and the compatibility floor for
|
|
33721
|
+
* {@link readTimelapseGeneratedAt}. Absent = never generated.
|
|
33125
33722
|
*/
|
|
33126
33723
|
lastGeneratedAt: number().optional(),
|
|
33724
|
+
/**
|
|
33725
|
+
* PER-CAMERA generation state, keyed by `String(deviceId)` — the
|
|
33726
|
+
* re-generation guard's real durable state.
|
|
33727
|
+
*
|
|
33728
|
+
* One rule covers several cameras and each renders its own video, so a rule
|
|
33729
|
+
* -wide stamp is wrong in the direction that DESTROYS work: camera A
|
|
33730
|
+
* succeeding at 06:05 tells camera B, whose render failed, that it is
|
|
33731
|
+
* already done — and B's night is gone for good, because the window will not
|
|
33732
|
+
* come back.
|
|
33733
|
+
*
|
|
33734
|
+
* ADDITIVE, so the migration is free: a row written before this field simply
|
|
33735
|
+
* has no map, and {@link readTimelapseGeneratedAt} falls back to
|
|
33736
|
+
* {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
|
|
33737
|
+
* "never generated" would re-render and re-notify every camera of every rule
|
|
33738
|
+
* once, on the deploy that shipped the map.
|
|
33739
|
+
*/
|
|
33740
|
+
generatedByDevice: record(string(), number()).optional(),
|
|
33127
33741
|
/** userId of the caller who created the rule (server-stamped). */
|
|
33128
33742
|
createdBy: string(),
|
|
33129
33743
|
createdAt: number(),
|
|
@@ -33174,25 +33788,32 @@ object({
|
|
|
33174
33788
|
var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
|
|
33175
33789
|
object({
|
|
33176
33790
|
/**
|
|
33177
|
-
* How
|
|
33791
|
+
* How many delivered frames the worker HOLDS at once, waiting for each one's
|
|
33792
|
+
* detection result.
|
|
33793
|
+
*
|
|
33794
|
+
* This replaced a TTL on 2026-08-13, and the replacement is the whole point:
|
|
33795
|
+
* a time window was never related to the event the pixels were waiting for.
|
|
33796
|
+
* A held frame now lives from delivery until the runner has its `FrameResult`
|
|
33797
|
+
* — at which moment the runner cuts the subject tiles it actually wanted and
|
|
33798
|
+
* releases the frame. The bound exists only so a runner that stops answering
|
|
33799
|
+
* cannot pin RAM: above it the OLDEST held frame is dropped and counted.
|
|
33178
33800
|
*
|
|
33179
|
-
*
|
|
33180
|
-
*
|
|
33181
|
-
*
|
|
33182
|
-
*
|
|
33183
|
-
*
|
|
33801
|
+
* Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
|
|
33802
|
+
* 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
|
|
33803
|
+
* without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
|
|
33804
|
+
* Raising it does not buy hit rate — it buys tolerance for a slow runner, and
|
|
33805
|
+
* `holdOverflow` on the metrics line is what says you need it.
|
|
33184
33806
|
*/
|
|
33185
|
-
|
|
33807
|
+
holdFrames: number().int().min(1).max(64),
|
|
33186
33808
|
/**
|
|
33187
33809
|
* Hard per-decode-worker RAM ceiling for retained native frames, in MB.
|
|
33188
33810
|
*
|
|
33189
|
-
*
|
|
33190
|
-
*
|
|
33191
|
-
*
|
|
33192
|
-
*
|
|
33193
|
-
*
|
|
33194
|
-
*
|
|
33195
|
-
* rather than giving RAM back — lower this knob if RAM is what you wanted.
|
|
33811
|
+
* Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
|
|
33812
|
+
* is what decides how much is held, and the ceiling is the number above which
|
|
33813
|
+
* something is wrong. Before that it was the effective cap — at 1024 MB with
|
|
33814
|
+
* a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
|
|
33815
|
+
* with the TTL expiring nothing, which is exactly the confusion the hold
|
|
33816
|
+
* removes. `leaseMb` / `leaseFrames` still say what is resident.
|
|
33196
33817
|
* `0` DISABLES the lease entirely and falls the worker back to the tiny
|
|
33197
33818
|
* leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
|
|
33198
33819
|
* to replace).
|
|
@@ -33218,22 +33839,45 @@ object({
|
|
|
33218
33839
|
* there is the signal that some caller names frames outside the inference set
|
|
33219
33840
|
* and that this must go back to `all`.
|
|
33220
33841
|
*/
|
|
33221
|
-
admission: NativeLeaseAdmissionSchema
|
|
33842
|
+
admission: NativeLeaseAdmissionSchema,
|
|
33843
|
+
/**
|
|
33844
|
+
* RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
|
|
33845
|
+
* compressed native crops the worker cuts at the moment a frame's detection
|
|
33846
|
+
* result arrives, and keeps long after the frame itself is freed.
|
|
33847
|
+
*
|
|
33848
|
+
* This is the knob that replaced the old retention window, and it buys about
|
|
33849
|
+
* three orders of magnitude more of it: a tile is one subject at native
|
|
33850
|
+
* resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
|
|
33851
|
+
* the frame it was cut from. A frame on which nothing was detected costs
|
|
33852
|
+
* nothing at all, which is the real change — the old lease paid per FRAME and
|
|
33853
|
+
* was interrogated per SUBJECT.
|
|
33854
|
+
*
|
|
33855
|
+
* `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
|
|
33856
|
+
* fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
|
|
33857
|
+
* reproduce that.
|
|
33858
|
+
*/
|
|
33859
|
+
tileBudgetMb: number().int().min(0).max(1024)
|
|
33222
33860
|
});
|
|
33223
33861
|
/**
|
|
33224
|
-
* The values in force when the operator has set nothing
|
|
33225
|
-
*
|
|
33226
|
-
*
|
|
33862
|
+
* The values in force when the operator has set nothing.
|
|
33863
|
+
*
|
|
33864
|
+
* `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
|
|
33865
|
+
* being the retention window and became the OOM ceiling, and lowering a ceiling
|
|
33866
|
+
* in the same change that redefines it would make a regression and a retune
|
|
33867
|
+
* indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
|
|
33868
|
+
* live traffic.
|
|
33227
33869
|
*/
|
|
33228
33870
|
var DEFAULT_NATIVE_LEASE_SETTINGS = {
|
|
33229
|
-
|
|
33871
|
+
holdFrames: 8,
|
|
33230
33872
|
budgetMb: 1024,
|
|
33231
33873
|
activityMs: 15e3,
|
|
33874
|
+
tileBudgetMb: 64,
|
|
33232
33875
|
admission: "inferred"
|
|
33233
33876
|
};
|
|
33234
|
-
DEFAULT_NATIVE_LEASE_SETTINGS.
|
|
33877
|
+
DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
|
|
33235
33878
|
DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
|
|
33236
33879
|
DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
|
|
33880
|
+
DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
|
|
33237
33881
|
DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
33238
33882
|
//#endregion
|
|
33239
33883
|
//#region src/config.ts
|