@camstack/addon-decoder-ffmpeg 1.2.12 → 1.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +686 -42
- package/dist/index.mjs +686 -42
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -7202,8 +7202,31 @@ var AdoptionJobSchema = object({
|
|
|
7202
7202
|
error: string().nullable()
|
|
7203
7203
|
});
|
|
7204
7204
|
/**
|
|
7205
|
-
* Per-camera FUNCTION SWITCHES
|
|
7206
|
-
*
|
|
7205
|
+
* Per-camera FUNCTION SWITCHES.
|
|
7206
|
+
*
|
|
7207
|
+
* ## The aggregate group is being withdrawn — the BADGE is not (D113)
|
|
7208
|
+
*
|
|
7209
|
+
* This file shipped as "the one coherent on/off surface over the pipeline
|
|
7210
|
+
* functions an operator thinks in terms of". The operator's verdict on
|
|
7211
|
+
* 2026-08-12 was that the coherent surface bought complexity and no clarity:
|
|
7212
|
+
* every function already had a settings page of its own, and a second place to
|
|
7213
|
+
* turn it off is a second place to look. Each switch is going back to its own
|
|
7214
|
+
* component's original options — detection to the detection-pipeline wrapper
|
|
7215
|
+
* binding, audio analysis to its own, recording to `RecordingConfig.enabled`
|
|
7216
|
+
* (which was always first-class; the switch was a veneer over
|
|
7217
|
+
* `recording.setDeviceConfig`), notifications to a notification-center
|
|
7218
|
+
* per-device setting, the two camera planes to their own components.
|
|
7219
|
+
*
|
|
7220
|
+
* What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
|
|
7221
|
+
* thing that lets a status surface say DISABLED instead of BROKEN, recomposed
|
|
7222
|
+
* straight from the authorities with no group in the middle. That rule was
|
|
7223
|
+
* never about a control panel.
|
|
7224
|
+
*
|
|
7225
|
+
* Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
|
|
7226
|
+
* {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
|
|
7227
|
+
* `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
|
|
7228
|
+
* viewers (v1.0.305) and the admin UI still call it. It is deleted when they
|
|
7229
|
+
* stop; nothing new may be built on it.
|
|
7207
7230
|
*
|
|
7208
7231
|
* ## This file adds no state
|
|
7209
7232
|
*
|
|
@@ -7554,7 +7577,15 @@ var RecordingConfigSchema = object({
|
|
|
7554
7577
|
* Each completed/failed run also lands one durable ops-log row on its owning
|
|
7555
7578
|
* addon surface.
|
|
7556
7579
|
*/
|
|
7580
|
+
/**
|
|
7581
|
+
* `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
|
|
7582
|
+
* rebalance enqueues one job per (camera, profile). Refusing the second job —
|
|
7583
|
+
* what the engine did before — turned a fifteen-camera rebalance into fifteen
|
|
7584
|
+
* manual retries. Queued jobs run FIFO; a queued job that is cancelled never
|
|
7585
|
+
* runs at all.
|
|
7586
|
+
*/
|
|
7557
7587
|
var RelocateJobStateSchema = _enum([
|
|
7588
|
+
"queued",
|
|
7558
7589
|
"running",
|
|
7559
7590
|
"done",
|
|
7560
7591
|
"failed",
|
|
@@ -7589,6 +7620,15 @@ var RelocateFootageInputSchema = object({
|
|
|
7589
7620
|
/** Limits relocation to the logical profile class. Omit only for the
|
|
7590
7621
|
* pre-orchestration compatibility path. */
|
|
7591
7622
|
footageClass: RelocateFootageClassSchema.optional(),
|
|
7623
|
+
/** Scope the move to ONE camera. Absent = every camera on the source, which
|
|
7624
|
+
* is what a whole-disk drain means. The rebalance path always sets it: its
|
|
7625
|
+
* unit is a (camera, profile) pile, not a disk. */
|
|
7626
|
+
deviceId: number().int().optional(),
|
|
7627
|
+
/** Scope the move to specific segment profiles (`high` / `mid` / `low`).
|
|
7628
|
+
* Finer than `footageClass`, which cannot separate high from mid — and the
|
|
7629
|
+
* placement plan assigns those two independently, so a rebalance that could
|
|
7630
|
+
* only say "recordings" would move footage the plan never asked to move. */
|
|
7631
|
+
profiles: array(string()).optional(),
|
|
7592
7632
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
7593
7633
|
* never allowed to starve live writers. */
|
|
7594
7634
|
throttleMbps: number().min(1).max(1e3).optional()
|
|
@@ -7724,6 +7764,21 @@ var StorageLocationSchema = object({
|
|
|
7724
7764
|
nodeId: string().optional(),
|
|
7725
7765
|
isDefault: boolean().default(false),
|
|
7726
7766
|
isSystem: boolean().default(false),
|
|
7767
|
+
/**
|
|
7768
|
+
* Operator opt-in: whether consumers that BALANCE across several locations
|
|
7769
|
+
* of a type may write here. Recordings reads it today; event media and
|
|
7770
|
+
* backups are the next consumers, which is why the flag lives on the
|
|
7771
|
+
* location rather than in any one addon's store — nothing has to be
|
|
7772
|
+
* extended to add the next consumer.
|
|
7773
|
+
*
|
|
7774
|
+
* OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
|
|
7775
|
+
* flag existed reads back with no flag and keeps working exactly as before;
|
|
7776
|
+
* that is the whole compat story, and it is why no migration ships with it.
|
|
7777
|
+
* A newly CREATED sibling is stamped `false` by the orchestrator (creating a
|
|
7778
|
+
* disk must not silently start writing to it); the default of a type is
|
|
7779
|
+
* always stamped `true`.
|
|
7780
|
+
*/
|
|
7781
|
+
enabled: boolean().optional(),
|
|
7727
7782
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
7728
7783
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
7729
7784
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -12156,7 +12211,8 @@ method(object({
|
|
|
12156
12211
|
}), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
|
|
12157
12212
|
/**
|
|
12158
12213
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
12159
|
-
* filesystem
|
|
12214
|
+
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
12215
|
+
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
12160
12216
|
* admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
|
|
12161
12217
|
* (one provider per node); the hub calls it with `{nodeId}` so the codegen
|
|
12162
12218
|
* routes to that exact node (default `nodeIdMode:'routing'`).
|
|
@@ -13969,6 +14025,13 @@ var MaskGridDimsSchema = object({
|
|
|
13969
14025
|
* `package-event` are pure trigger kinds (no urgency dimension). Extending
|
|
13970
14026
|
* this one field keeps the schema additive — a rule still declares exactly
|
|
13971
14027
|
* one trigger.
|
|
14028
|
+
*
|
|
14029
|
+
* AUDIO rules add no member here, for the reason occupancy added none: the
|
|
14030
|
+
* enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
|
|
14031
|
+
* mirror.ts` fails the build on a member the app cannot render) and every
|
|
14032
|
+
* member costs a release train. A sustained-sound rule is therefore an
|
|
14033
|
+
* `immediate` rule carrying {@link NcConditions.audio} — the condition is the
|
|
14034
|
+
* trigger discriminator, exactly as `occupancy` is on `device-event`.
|
|
13972
14035
|
*/
|
|
13973
14036
|
var NcDeliverySchema = _enum([
|
|
13974
14037
|
"immediate",
|
|
@@ -13983,15 +14046,32 @@ var NcDeliverySchema = _enum([
|
|
|
13983
14046
|
* depend on a provider's raw event name or payload shape.
|
|
13984
14047
|
*/
|
|
13985
14048
|
var NcSystemEventKindSchema = _enum([
|
|
13986
|
-
"
|
|
13987
|
-
"
|
|
14049
|
+
"device-online",
|
|
14050
|
+
"device-offline",
|
|
14051
|
+
"device-disabled",
|
|
14052
|
+
"device-enabled",
|
|
13988
14053
|
"stream-online",
|
|
13989
14054
|
"stream-offline",
|
|
13990
14055
|
"node-online",
|
|
13991
14056
|
"node-offline",
|
|
13992
14057
|
"addon-update-available",
|
|
13993
|
-
"server-update-available"
|
|
14058
|
+
"server-update-available",
|
|
14059
|
+
"alarm-triggered",
|
|
14060
|
+
"alarm-armed",
|
|
14061
|
+
"alarm-disarmed",
|
|
14062
|
+
"camera-online",
|
|
14063
|
+
"camera-offline",
|
|
14064
|
+
"camera-disabled",
|
|
14065
|
+
"camera-enabled"
|
|
14066
|
+
]);
|
|
14067
|
+
/** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
|
|
14068
|
+
var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
|
|
14069
|
+
"camera-online",
|
|
14070
|
+
"camera-offline",
|
|
14071
|
+
"camera-disabled",
|
|
14072
|
+
"camera-enabled"
|
|
13994
14073
|
]);
|
|
14074
|
+
NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
|
|
13995
14075
|
/**
|
|
13996
14076
|
* One coherent system-event condition. `kinds` is the required opt-in safety
|
|
13997
14077
|
* gate; the remaining lists are optional narrowing filters relevant to the
|
|
@@ -14000,6 +14080,18 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14000
14080
|
var NcSystemEventConditionSchema = object({
|
|
14001
14081
|
kinds: array(NcSystemEventKindSchema).min(1),
|
|
14002
14082
|
deviceIds: array(number().int()).min(1).optional(),
|
|
14083
|
+
/**
|
|
14084
|
+
* Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
|
|
14085
|
+
* `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
|
|
14086
|
+
* is what a liveness rule means when nobody said otherwise.
|
|
14087
|
+
*
|
|
14088
|
+
* This is where "only my cameras" is expressed, and it lives on the rule for
|
|
14089
|
+
* one reason: the intake cannot know which devices this household cares
|
|
14090
|
+
* about, and a producer-side filter is one no operator can change. Fails
|
|
14091
|
+
* CLOSED — a subject whose device type is unknown (an id the device mirror
|
|
14092
|
+
* does not carry) matches no `deviceTypes` list.
|
|
14093
|
+
*/
|
|
14094
|
+
deviceTypes: array(string().min(1)).min(1).optional(),
|
|
14003
14095
|
nodeIds: array(string().min(1)).min(1).optional(),
|
|
14004
14096
|
packageNames: array(string().min(1)).min(1).optional()
|
|
14005
14097
|
});
|
|
@@ -14050,6 +14142,47 @@ var NcOccupancyConditionSchema = object({
|
|
|
14050
14142
|
sustainSeconds: number().int().min(0).max(3600).default(15)
|
|
14051
14143
|
});
|
|
14052
14144
|
/**
|
|
14145
|
+
* Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
|
|
14146
|
+
*
|
|
14147
|
+
* Operator-approved vocabulary (2026-08-12, option A — the same one the
|
|
14148
|
+
* reference notifier uses, so an operator moving between them re-uses what
|
|
14149
|
+
* they already know): a rule matches when, over a sampling window of
|
|
14150
|
+
* `samplingSeconds`, at least `hitPercent`% of the audio samples in that
|
|
14151
|
+
* window are HITS. A sample is a hit when it satisfies BOTH present filters:
|
|
14152
|
+
*
|
|
14153
|
+
* - `dbThreshold` — its level is at or above this many dBFS (see
|
|
14154
|
+
* {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
|
|
14155
|
+
* - `labels` — the classifier put at least one of these labels on it.
|
|
14156
|
+
*
|
|
14157
|
+
* Both are OPTIONAL and independent, which is the point of the shape: a
|
|
14158
|
+
* loudness rule ("something loud at 3am") needs no model to be right, and a
|
|
14159
|
+
* label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
|
|
14160
|
+
* is given** — a window in which every sample is trivially a hit would fire on
|
|
14161
|
+
* silence, so the engine refuses such a condition rather than notifying on
|
|
14162
|
+
* nothing (the schema cannot express "at least one of" without becoming a
|
|
14163
|
+
* ZodEffects the cap path would have to special-case).
|
|
14164
|
+
*
|
|
14165
|
+
* `hitPercent` is over the samples the window actually HOLDS, and the window
|
|
14166
|
+
* must be FULL before it can match — a window that has been open for two
|
|
14167
|
+
* seconds of its ten is 100% of nothing, and firing on it would make
|
|
14168
|
+
* `samplingSeconds` decorative.
|
|
14169
|
+
*
|
|
14170
|
+
* Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
|
|
14171
|
+
* `audio-*` ids). Both spellings are accepted — the matcher normalizes the
|
|
14172
|
+
* `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
|
|
14173
|
+
* an operator who typed `dog` mean the same thing.
|
|
14174
|
+
*/
|
|
14175
|
+
var NcAudioConditionSchema = object({
|
|
14176
|
+
/** Audio macro labels; absent = any sound (level-only rule). */
|
|
14177
|
+
labels: array(string().min(1)).min(1).optional(),
|
|
14178
|
+
/** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
|
|
14179
|
+
dbThreshold: number().min(-96).max(0).optional(),
|
|
14180
|
+
/** Percentage of the window's samples that must be hits (1–100). */
|
|
14181
|
+
hitPercent: number().int().min(1).max(100).default(60),
|
|
14182
|
+
/** Length of the sampling window in seconds. */
|
|
14183
|
+
samplingSeconds: number().int().min(1).max(300).default(10)
|
|
14184
|
+
});
|
|
14185
|
+
/**
|
|
14053
14186
|
* Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
|
|
14054
14187
|
*
|
|
14055
14188
|
* The values are not symmetric, and deliberately so — the absent value has to
|
|
@@ -14322,7 +14455,33 @@ var NcConditionsSchema = object({
|
|
|
14322
14455
|
* threshold and holds for `sustainSeconds`. Fail-closed on missing
|
|
14323
14456
|
* substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
|
|
14324
14457
|
*/
|
|
14325
|
-
occupancy: NcOccupancyConditionSchema.optional()
|
|
14458
|
+
occupancy: NcOccupancyConditionSchema.optional(),
|
|
14459
|
+
/**
|
|
14460
|
+
* IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
|
|
14461
|
+
* `samplingSeconds` window clear the optional `dbThreshold` and carry one of
|
|
14462
|
+
* the optional `labels`. Fail-closed on missing substrate (no audio samples,
|
|
14463
|
+
* a window that is not full yet, neither filter given). See
|
|
14464
|
+
* {@link NcAudioCondition}.
|
|
14465
|
+
*
|
|
14466
|
+
* Presence of this key is what makes a rule an AUDIO rule: the engine fires
|
|
14467
|
+
* it ONLY on a confirmed audio window, and a rule carrying it never fires on
|
|
14468
|
+
* a detection, a track or a device event (the same fail-closed pairing
|
|
14469
|
+
* `occupancy` has with the `device-event` trigger). That is how audio labels
|
|
14470
|
+
* leave `classes`: an audio rule names its sounds HERE, and the legacy path
|
|
14471
|
+
* (an `immediate` rule naming an `audio-*` class, one notification per
|
|
14472
|
+
* classified sample) stays exactly as it was for rules that already use it.
|
|
14473
|
+
*
|
|
14474
|
+
* NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
|
|
14475
|
+
* rather than an oversight: the viewer mirrors the descriptor enums BY HAND
|
|
14476
|
+
* (`camstack/src/data/notification-center.ts`, guarded by
|
|
14477
|
+
* `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
|
|
14478
|
+
* condition fields it does not know when a rule is saved from the phone.
|
|
14479
|
+
* Publishing an editor for a condition the app cannot round-trip is how an
|
|
14480
|
+
* operator loses a rule's conditions by opening it — so the descriptor, the
|
|
14481
|
+
* admin widget and the viewer mirror land together (P2 + P3), and only then
|
|
14482
|
+
* does an audio rule become authorable.
|
|
14483
|
+
*/
|
|
14484
|
+
audio: NcAudioConditionSchema.optional()
|
|
14326
14485
|
});
|
|
14327
14486
|
/** One delivery target: a `notification-output` Target ref + passthrough params. */
|
|
14328
14487
|
var NcRuleTargetSchema = object({
|
|
@@ -14436,6 +14595,73 @@ var NcThrottleSchema = object({
|
|
|
14436
14595
|
*/
|
|
14437
14596
|
granularity: NcThrottleGranularitySchema.optional()
|
|
14438
14597
|
});
|
|
14598
|
+
/**
|
|
14599
|
+
* How long the confirm gate may hold ONE notification, and how big the picture
|
|
14600
|
+
* it judges may be.
|
|
14601
|
+
*
|
|
14602
|
+
* The clamp is the product decision, not a coincidence of the model: p50 was
|
|
14603
|
+
* 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
|
|
14604
|
+
* arrives after the visitor has gone is not a notification. 448 px was enough
|
|
14605
|
+
* to score 16/16 on the operator's parking scenario — bigger costs latency and
|
|
14606
|
+
* tokens for pixels the model pools away.
|
|
14607
|
+
*/
|
|
14608
|
+
var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
|
|
14609
|
+
var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
|
|
14610
|
+
var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
|
|
14611
|
+
/** Comparison the model's COUNT must satisfy for the notification to fire. */
|
|
14612
|
+
var NcConfirmExpectSchema = object({
|
|
14613
|
+
op: _enum([
|
|
14614
|
+
">=",
|
|
14615
|
+
">",
|
|
14616
|
+
"<=",
|
|
14617
|
+
"<",
|
|
14618
|
+
"=="
|
|
14619
|
+
]),
|
|
14620
|
+
count: number().int().min(0).max(1e3)
|
|
14621
|
+
});
|
|
14622
|
+
/**
|
|
14623
|
+
* AI CONFIRM — a vision model looks at the picture this notification is about
|
|
14624
|
+
* to ship and says whether it agrees with the rule.
|
|
14625
|
+
*
|
|
14626
|
+
* It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
|
|
14627
|
+
* crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
|
|
14628
|
+
* on the operator's phone is not a verdict about this notification.
|
|
14629
|
+
*
|
|
14630
|
+
* FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
|
|
14631
|
+
* whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
|
|
14632
|
+
* the default and every fail-open is COUNTED, because a gate that always fails
|
|
14633
|
+
* open looks in the log exactly like a gate that works.
|
|
14634
|
+
*
|
|
14635
|
+
* Every field is `.optional()` rather than relied on as a Zod default at the
|
|
14636
|
+
* runtime seam: a Zod default does NOT run on the addon→addon cap path (three
|
|
14637
|
+
* production failures in one day), so the gate reads absent as the constant
|
|
14638
|
+
* above rather than trusting a parse it may never have seen.
|
|
14639
|
+
*/
|
|
14640
|
+
var NcConfirmSchema = object({
|
|
14641
|
+
/** Off unless asked for. An absent `confirm` and `enabled:false` are the
|
|
14642
|
+
* same thing, and both mean "deliver exactly as before". */
|
|
14643
|
+
enabled: boolean().default(false),
|
|
14644
|
+
/** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
|
|
14645
|
+
profileId: string().optional(),
|
|
14646
|
+
/**
|
|
14647
|
+
* The operator's question, in his own words. Absent = a question derived
|
|
14648
|
+
* from the rule (its class and its expectation).
|
|
14649
|
+
*
|
|
14650
|
+
* NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
|
|
14651
|
+
* banners, signage and plates as instructions if you let them reach the
|
|
14652
|
+
* prompt — proven live — so the authoritative contract stays in the system
|
|
14653
|
+
* turn and only rule-authored words land here.
|
|
14654
|
+
*/
|
|
14655
|
+
prompt: string().max(1e3).optional(),
|
|
14656
|
+
/** Fire only when the model's count satisfies this. Absent = the model's
|
|
14657
|
+
* own boolean verdict decides. */
|
|
14658
|
+
expect: NcConfirmExpectSchema.optional(),
|
|
14659
|
+
timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
|
|
14660
|
+
/** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
|
|
14661
|
+
onTimeout: _enum(["fire", "suppress"]).default("fire"),
|
|
14662
|
+
/** Longest edge the judged image is downscaled to before it is sent. */
|
|
14663
|
+
maxImagePx: number().int().min(64).max(2048).default(448)
|
|
14664
|
+
});
|
|
14439
14665
|
/** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
|
|
14440
14666
|
var NcRuleInputSchema = object({
|
|
14441
14667
|
name: string().min(1).max(200),
|
|
@@ -14496,7 +14722,13 @@ var NcRuleInputSchema = object({
|
|
|
14496
14722
|
* `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
|
|
14497
14723
|
* shape as every other actuation.
|
|
14498
14724
|
*/
|
|
14499
|
-
actions: NcRuleActionsSchema.optional()
|
|
14725
|
+
actions: NcRuleActionsSchema.optional(),
|
|
14726
|
+
/**
|
|
14727
|
+
* AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
|
|
14728
|
+
* a rule that predates the gate must keep delivering byte-for-byte as it
|
|
14729
|
+
* did, and absent is the only way to say that without a migration.
|
|
14730
|
+
*/
|
|
14731
|
+
confirm: NcConfirmSchema.optional()
|
|
14500
14732
|
});
|
|
14501
14733
|
/**
|
|
14502
14734
|
* Partial patch for `updateRule` — any subset of the input fields, plus the
|
|
@@ -14507,7 +14739,37 @@ var NcRuleInputSchema = object({
|
|
|
14507
14739
|
* still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
|
|
14508
14740
|
* `updateRule` patch.
|
|
14509
14741
|
*/
|
|
14510
|
-
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
14742
|
+
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
14743
|
+
disabledTargetIds: array(string()).optional(),
|
|
14744
|
+
/**
|
|
14745
|
+
* `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
|
|
14746
|
+
*
|
|
14747
|
+
* It makes the key optional to SUPPLY; the parse still materialises the
|
|
14748
|
+
* default when the key is absent. And `NcRuleStore.update` merges with
|
|
14749
|
+
* `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
|
|
14750
|
+
* one — which made every partial edit destructive:
|
|
14751
|
+
*
|
|
14752
|
+
* nc.updateRule({ throttle }) → conditions reset to `{}`
|
|
14753
|
+
* nc.setRuleTargetEnabled(...) → conditions reset to `{}`
|
|
14754
|
+
* setEnabled(ruleId, false) → conditions reset to `{}`
|
|
14755
|
+
*
|
|
14756
|
+
* A rule scoped to one camera and one zone silently became a rule that
|
|
14757
|
+
* matches EVERY event on EVERY camera, and lost its `media` policy
|
|
14758
|
+
* (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
|
|
14759
|
+
* live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
|
|
14760
|
+
* within a minute of a two-field patch.
|
|
14761
|
+
*
|
|
14762
|
+
* So every defaulted field is re-declared here WITHOUT its default. The
|
|
14763
|
+
* inner defaults still apply when the caller DOES send the key — `{}` for
|
|
14764
|
+
* conditions remains a real instruction ("clear them") — and only the
|
|
14765
|
+
* absent key is now genuinely absent.
|
|
14766
|
+
*/
|
|
14767
|
+
enabled: boolean().optional(),
|
|
14768
|
+
conditions: NcConditionsSchema.optional(),
|
|
14769
|
+
media: NcMediaPolicySchema.optional(),
|
|
14770
|
+
throttle: NcThrottleSchema.optional(),
|
|
14771
|
+
priority: number().int().min(1).max(5).optional()
|
|
14772
|
+
});
|
|
14511
14773
|
/** A persisted rule. */
|
|
14512
14774
|
var NcRuleSchema = NcRuleInputSchema.extend({
|
|
14513
14775
|
id: string(),
|
|
@@ -14808,6 +15070,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
|
|
|
14808
15070
|
* Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
|
|
14809
15071
|
* copy would lie the first time a rule is disabled.
|
|
14810
15072
|
*/
|
|
15073
|
+
/**
|
|
15074
|
+
* Why a device a mode NAMES is nonetheless not armed by it.
|
|
15075
|
+
*
|
|
15076
|
+
* Each value is an existing authority, never a new flag (D62): `muted` is the
|
|
15077
|
+
* per-camera notification switch the Notification Center already owns,
|
|
15078
|
+
* `detection-off` is the device's own detection binding being inactive, and
|
|
15079
|
+
* `offline` is the device manager's liveness. A fourth reason would mean a
|
|
15080
|
+
* fourth authority, and inventing one here is how a panel starts disagreeing
|
|
15081
|
+
* with the switches the operator actually used.
|
|
15082
|
+
*/
|
|
15083
|
+
var NcAlarmSkipReasonSchema = _enum([
|
|
15084
|
+
"muted",
|
|
15085
|
+
"detection-off",
|
|
15086
|
+
"offline"
|
|
15087
|
+
]);
|
|
15088
|
+
var NcAlarmSkippedDeviceSchema = object({
|
|
15089
|
+
deviceId: number().int(),
|
|
15090
|
+
reason: NcAlarmSkipReasonSchema
|
|
15091
|
+
});
|
|
14811
15092
|
var NcAlarmModeCoverageSchema = object({
|
|
14812
15093
|
mode: AlarmArmModeSchema,
|
|
14813
15094
|
/** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
|
|
@@ -14815,7 +15096,18 @@ var NcAlarmModeCoverageSchema = object({
|
|
|
14815
15096
|
/** At least one covering rule has no device scope, so the mode covers all. */
|
|
14816
15097
|
allDevices: boolean(),
|
|
14817
15098
|
/** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
|
|
14818
|
-
deviceIds: array(number().int())
|
|
15099
|
+
deviceIds: array(number().int()),
|
|
15100
|
+
/**
|
|
15101
|
+
* Devices this mode NAMES but cannot actually arm, each with the switch that
|
|
15102
|
+
* excludes it.
|
|
15103
|
+
*
|
|
15104
|
+
* "Away armed — 12 cameras" is a promise, and a muted camera among those
|
|
15105
|
+
* twelve makes it false in exactly the way nobody notices until an incident.
|
|
15106
|
+
* Defaulted to `[]` so a coverage answer computed before this field existed
|
|
15107
|
+
* still parses as "nothing known to be skipped" rather than failing the whole
|
|
15108
|
+
* alarm tab.
|
|
15109
|
+
*/
|
|
15110
|
+
skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
|
|
14819
15111
|
});
|
|
14820
15112
|
var NcAlarmConfigSchema = object({
|
|
14821
15113
|
/**
|
|
@@ -17614,9 +17906,16 @@ var CameraStatusSchema = object({
|
|
|
17614
17906
|
audio: CameraAudioStatusSchema.nullable(),
|
|
17615
17907
|
recording: CameraRecordingStatusSchema.nullable(),
|
|
17616
17908
|
/**
|
|
17617
|
-
* Per-camera
|
|
17909
|
+
* Per-camera functions an OPERATOR has turned off
|
|
17618
17910
|
* ([D61](../../../../docs/decisions/adr-0067.md)).
|
|
17619
17911
|
*
|
|
17912
|
+
* Composed from the AUTHORITIES themselves — the wrapper bindings,
|
|
17913
|
+
* `RecordingConfig.enabled`, the notification mute, the broker's audio
|
|
17914
|
+
* policy, the camera's own microphone — via `composeSwitchedOff`, not from
|
|
17915
|
+
* the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
|
|
17916
|
+
* The badge outlives the control panel: the panel was a convenience, this is
|
|
17917
|
+
* the difference between a camera being off and a camera being dead.
|
|
17918
|
+
*
|
|
17620
17919
|
* This is the difference between DISABLED and BROKEN. A camera whose
|
|
17621
17920
|
* `detection` block reports zero fps and whose `switchedOff` contains
|
|
17622
17921
|
* `'object-detection'` was switched off by a person; the same camera with an
|
|
@@ -23125,7 +23424,19 @@ var RecordingManifestSchema = object({
|
|
|
23125
23424
|
* profiles/subtrees/locations on this node). */
|
|
23126
23425
|
var RecordingDeviceUsageSchema = object({
|
|
23127
23426
|
deviceId: number(),
|
|
23128
|
-
usedBytes: number()
|
|
23427
|
+
usedBytes: number(),
|
|
23428
|
+
/**
|
|
23429
|
+
* Start of this camera's OLDEST indexed segment, across every profile and
|
|
23430
|
+
* location — the "Oldest footage" column in Recordings → Storage, and the
|
|
23431
|
+
* only honest answer to "is retention actually holding?" per camera.
|
|
23432
|
+
*
|
|
23433
|
+
* `null` = the camera has no footage. OPTIONAL because a recorder that
|
|
23434
|
+
* predates this field omits it entirely, and a hub whose types carry the
|
|
23435
|
+
* field must keep validating that older provider's payload: the framework
|
|
23436
|
+
* (types) and the addon ship on different trains, and the addon is usually
|
|
23437
|
+
* the later of the two.
|
|
23438
|
+
*/
|
|
23439
|
+
oldestMs: number().nullable().optional()
|
|
23129
23440
|
});
|
|
23130
23441
|
/** Recording storage usage + capacity for one storage location. */
|
|
23131
23442
|
var RecordingLocationUsageSchema = object({
|
|
@@ -23153,6 +23464,57 @@ var RecordingStorageUsageSchema = object({
|
|
|
23153
23464
|
locations: array(RecordingLocationUsageSchema)
|
|
23154
23465
|
});
|
|
23155
23466
|
/**
|
|
23467
|
+
* The OPERATOR-ARMED half of multi-location recordings (D116).
|
|
23468
|
+
*
|
|
23469
|
+
* The placement plan decides where NEW writes go and moves nothing. A rebalance
|
|
23470
|
+
* is the operator asking for the EXISTING archive to be brought into line with
|
|
23471
|
+
* that plan: one relocate job per (camera, profile) pile that sits on the wrong
|
|
23472
|
+
* location, run FIFO behind the single-flight mover.
|
|
23473
|
+
*
|
|
23474
|
+
* `plan…` and `start…` return the SAME shape deliberately — what the operator
|
|
23475
|
+
* confirms is exactly what gets enqueued, and `jobIds` is the only difference
|
|
23476
|
+
* (empty on the plan).
|
|
23477
|
+
*/
|
|
23478
|
+
var RecordingRebalanceMoveSchema = object({
|
|
23479
|
+
deviceId: number(),
|
|
23480
|
+
profile: string(),
|
|
23481
|
+
fromLocationId: string(),
|
|
23482
|
+
toLocationId: string(),
|
|
23483
|
+
bytes: number(),
|
|
23484
|
+
files: number().int()
|
|
23485
|
+
});
|
|
23486
|
+
/** Why a pile that is out of place is staying there. Every refusal is
|
|
23487
|
+
* reported: a rebalance that silently drops a camera reads exactly like one
|
|
23488
|
+
* that had nothing to do. */
|
|
23489
|
+
var RecordingRebalanceSkipReasonSchema = _enum([
|
|
23490
|
+
"unassigned",
|
|
23491
|
+
"target-not-writable",
|
|
23492
|
+
"below-threshold",
|
|
23493
|
+
"no-headroom"
|
|
23494
|
+
]);
|
|
23495
|
+
var RecordingRebalanceSkipSchema = object({
|
|
23496
|
+
deviceId: number(),
|
|
23497
|
+
profile: string(),
|
|
23498
|
+
fromLocationId: string(),
|
|
23499
|
+
/** The location the plan wants; null when the camera has no assignment. */
|
|
23500
|
+
toLocationId: string().nullable(),
|
|
23501
|
+
bytes: number(),
|
|
23502
|
+
reason: RecordingRebalanceSkipReasonSchema
|
|
23503
|
+
});
|
|
23504
|
+
var RecordingRebalancePlanSchema = object({
|
|
23505
|
+
moves: array(RecordingRebalanceMoveSchema),
|
|
23506
|
+
skipped: array(RecordingRebalanceSkipSchema),
|
|
23507
|
+
bytesToMove: number(),
|
|
23508
|
+
/** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
|
|
23509
|
+
jobIds: array(string())
|
|
23510
|
+
});
|
|
23511
|
+
var RecordingRebalanceInputSchema = object({
|
|
23512
|
+
/** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
|
|
23513
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
23514
|
+
/** Ignore piles smaller than this (default 1 GB). */
|
|
23515
|
+
minMoveGb: number().min(0).optional()
|
|
23516
|
+
});
|
|
23517
|
+
/**
|
|
23156
23518
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
23157
23519
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
23158
23520
|
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
@@ -23315,9 +23677,24 @@ method(object({
|
|
|
23315
23677
|
}), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
23316
23678
|
kind: "mutation",
|
|
23317
23679
|
auth: "admin"
|
|
23680
|
+
}), method(RelocateFootageInputSchema, object({ jobId: string() }), {
|
|
23681
|
+
kind: "mutation",
|
|
23682
|
+
auth: "admin"
|
|
23683
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
23684
|
+
kind: "query",
|
|
23685
|
+
auth: "admin"
|
|
23686
|
+
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
23687
|
+
kind: "mutation",
|
|
23688
|
+
auth: "admin"
|
|
23689
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
23690
|
+
kind: "query",
|
|
23691
|
+
auth: "admin"
|
|
23692
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
23693
|
+
kind: "mutation",
|
|
23694
|
+
auth: "admin"
|
|
23318
23695
|
});
|
|
23319
23696
|
/**
|
|
23320
|
-
* `
|
|
23697
|
+
* `recording-export` cap — render a footage time range into a single downloadable
|
|
23321
23698
|
* MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
|
|
23322
23699
|
* bounded lifetime with a durable history, auto-expiry, and optional
|
|
23323
23700
|
* delete-after-download.
|
|
@@ -23332,10 +23709,53 @@ method(object({
|
|
|
23332
23709
|
*/
|
|
23333
23710
|
/** Playback-speed multiplier for the render (1 = realtime). */
|
|
23334
23711
|
var ExportSpeedSchema = number().min(.25).max(32);
|
|
23712
|
+
/**
|
|
23713
|
+
* One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
|
|
23714
|
+
*
|
|
23715
|
+
* **Wall clock, not ffmpeg's `t`** — and the recorder translates. A caller
|
|
23716
|
+
* derives these bounds from things that happened at a TIME (a track's
|
|
23717
|
+
* `firstSeen`), while `t` runs over the source playlist: the concatenation of
|
|
23718
|
+
* every segment present for the range, with each recording GAP removed. The
|
|
23719
|
+
* two agree only on a window that recorded without one interruption, and only
|
|
23720
|
+
* the render side knows the segments, so the translation lives there
|
|
23721
|
+
* (`export-dense-map.ts`, addon-pipeline).
|
|
23722
|
+
*
|
|
23723
|
+
* It was not always so. These seconds were fed to `between(t,…)` verbatim, and
|
|
23724
|
+
* on a 10 h window holding 29,393 s of footage every range landed late by the
|
|
23725
|
+
* gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
|
|
23726
|
+
* the video was a uniform timelapse, and the log line reported the five ranges
|
|
23727
|
+
* that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
|
|
23728
|
+
*
|
|
23729
|
+
* Relative and not absolute epoch, because an absolute epoch would make every
|
|
23730
|
+
* call site responsible for the same subtraction.
|
|
23731
|
+
*/
|
|
23732
|
+
var ExportDenseRangeSchema = object({
|
|
23733
|
+
fromSec: number().nonnegative(),
|
|
23734
|
+
toSec: number().nonnegative()
|
|
23735
|
+
}).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
|
|
23736
|
+
/**
|
|
23737
|
+
* Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
|
|
23738
|
+
* listed ranges and at the base `everyMs` everywhere else.
|
|
23739
|
+
*
|
|
23740
|
+
* `everyMs` must be strictly smaller than the base cadence — a dense rate that
|
|
23741
|
+
* is not denser renders a uniform timelapse the operator believes is two-rate.
|
|
23742
|
+
*/
|
|
23743
|
+
var ExportDenseSchema = object({
|
|
23744
|
+
everyMs: number().int().positive(),
|
|
23745
|
+
ranges: array(ExportDenseRangeSchema).min(1).max(200)
|
|
23746
|
+
});
|
|
23335
23747
|
/** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
|
|
23336
23748
|
var ExportTimelapseSchema = object({
|
|
23337
23749
|
everyMs: number().int().positive(),
|
|
23338
|
-
outputFps: number().int().min(1).max(60).optional()
|
|
23750
|
+
outputFps: number().int().min(1).max(60).optional(),
|
|
23751
|
+
/** Optional second, FASTER rate over the intervals that matter. */
|
|
23752
|
+
dense: ExportDenseSchema.optional()
|
|
23753
|
+
}).superRefine((v, ctx) => {
|
|
23754
|
+
if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
|
|
23755
|
+
code: ZodIssueCode.custom,
|
|
23756
|
+
message: "dense.everyMs must be strictly smaller than the base everyMs",
|
|
23757
|
+
path: ["dense", "everyMs"]
|
|
23758
|
+
});
|
|
23339
23759
|
});
|
|
23340
23760
|
/**
|
|
23341
23761
|
* Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
|
|
@@ -23393,6 +23813,19 @@ var ExportDownloadSchema = object({
|
|
|
23393
23813
|
url: string(),
|
|
23394
23814
|
endpoints: array(string())
|
|
23395
23815
|
});
|
|
23816
|
+
/**
|
|
23817
|
+
* A finished export's bytes, inline.
|
|
23818
|
+
*
|
|
23819
|
+
* `bytes` is the DECODED length — the number the caller bounds and logs
|
|
23820
|
+
* against, so nobody has to infer it from the base64 length.
|
|
23821
|
+
*/
|
|
23822
|
+
var ExportBytesSchema = object({
|
|
23823
|
+
base64: string(),
|
|
23824
|
+
contentType: string(),
|
|
23825
|
+
/** Suggested filename, extension included. */
|
|
23826
|
+
name: string(),
|
|
23827
|
+
bytes: number().int().nonnegative()
|
|
23828
|
+
});
|
|
23396
23829
|
method(object({
|
|
23397
23830
|
deviceId: number(),
|
|
23398
23831
|
profile: string(),
|
|
@@ -23417,6 +23850,9 @@ method(object({
|
|
|
23417
23850
|
}), method(object({ exportId: string() }), ExportDownloadSchema, {
|
|
23418
23851
|
kind: "query",
|
|
23419
23852
|
auth: "protected"
|
|
23853
|
+
}), method(object({ exportId: string() }), ExportBytesSchema, {
|
|
23854
|
+
kind: "query",
|
|
23855
|
+
auth: "protected"
|
|
23420
23856
|
});
|
|
23421
23857
|
/**
|
|
23422
23858
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
@@ -28610,6 +29046,12 @@ Object.freeze({
|
|
|
28610
29046
|
addonId: null,
|
|
28611
29047
|
access: "create"
|
|
28612
29048
|
},
|
|
29049
|
+
"recording.cancelRelocateJob": {
|
|
29050
|
+
capName: "recording",
|
|
29051
|
+
capScope: "system",
|
|
29052
|
+
addonId: null,
|
|
29053
|
+
access: "create"
|
|
29054
|
+
},
|
|
28613
29055
|
"recording.cancelStorageMigrationMove": {
|
|
28614
29056
|
capName: "recording",
|
|
28615
29057
|
capScope: "system",
|
|
@@ -28664,6 +29106,12 @@ Object.freeze({
|
|
|
28664
29106
|
addonId: null,
|
|
28665
29107
|
access: "view"
|
|
28666
29108
|
},
|
|
29109
|
+
"recording.listRelocateJobs": {
|
|
29110
|
+
capName: "recording",
|
|
29111
|
+
capScope: "system",
|
|
29112
|
+
addonId: null,
|
|
29113
|
+
access: "view"
|
|
29114
|
+
},
|
|
28667
29115
|
"recording.locateSegment": {
|
|
28668
29116
|
capName: "recording",
|
|
28669
29117
|
capScope: "system",
|
|
@@ -28676,6 +29124,12 @@ Object.freeze({
|
|
|
28676
29124
|
addonId: null,
|
|
28677
29125
|
access: "create"
|
|
28678
29126
|
},
|
|
29127
|
+
"recording.planStorageRebalance": {
|
|
29128
|
+
capName: "recording",
|
|
29129
|
+
capScope: "system",
|
|
29130
|
+
addonId: null,
|
|
29131
|
+
access: "view"
|
|
29132
|
+
},
|
|
28679
29133
|
"recording.pruneFootage": {
|
|
28680
29134
|
capName: "recording",
|
|
28681
29135
|
capScope: "system",
|
|
@@ -28700,6 +29154,12 @@ Object.freeze({
|
|
|
28700
29154
|
addonId: null,
|
|
28701
29155
|
access: "create"
|
|
28702
29156
|
},
|
|
29157
|
+
"recording.relocateFootage": {
|
|
29158
|
+
capName: "recording",
|
|
29159
|
+
capScope: "system",
|
|
29160
|
+
addonId: null,
|
|
29161
|
+
access: "create"
|
|
29162
|
+
},
|
|
28703
29163
|
"recording.renderClip": {
|
|
28704
29164
|
capName: "recording",
|
|
28705
29165
|
capScope: "system",
|
|
@@ -28736,38 +29196,50 @@ Object.freeze({
|
|
|
28736
29196
|
addonId: null,
|
|
28737
29197
|
access: "create"
|
|
28738
29198
|
},
|
|
29199
|
+
"recording.startStorageRebalance": {
|
|
29200
|
+
capName: "recording",
|
|
29201
|
+
capScope: "system",
|
|
29202
|
+
addonId: null,
|
|
29203
|
+
access: "create"
|
|
29204
|
+
},
|
|
28739
29205
|
"recordingExport.cancelExport": {
|
|
28740
|
-
capName: "
|
|
29206
|
+
capName: "recording-export",
|
|
28741
29207
|
capScope: "system",
|
|
28742
29208
|
addonId: null,
|
|
28743
29209
|
access: "create"
|
|
28744
29210
|
},
|
|
28745
29211
|
"recordingExport.createExport": {
|
|
28746
|
-
capName: "
|
|
29212
|
+
capName: "recording-export",
|
|
28747
29213
|
capScope: "system",
|
|
28748
29214
|
addonId: null,
|
|
28749
29215
|
access: "create"
|
|
28750
29216
|
},
|
|
28751
29217
|
"recordingExport.deleteExport": {
|
|
28752
|
-
capName: "
|
|
29218
|
+
capName: "recording-export",
|
|
28753
29219
|
capScope: "system",
|
|
28754
29220
|
addonId: null,
|
|
28755
29221
|
access: "delete"
|
|
28756
29222
|
},
|
|
28757
29223
|
"recordingExport.getDownloadUrl": {
|
|
28758
|
-
capName: "
|
|
29224
|
+
capName: "recording-export",
|
|
28759
29225
|
capScope: "system",
|
|
28760
29226
|
addonId: null,
|
|
28761
29227
|
access: "view"
|
|
28762
29228
|
},
|
|
28763
29229
|
"recordingExport.getExport": {
|
|
28764
|
-
capName: "
|
|
29230
|
+
capName: "recording-export",
|
|
28765
29231
|
capScope: "system",
|
|
28766
29232
|
addonId: null,
|
|
28767
29233
|
access: "view"
|
|
28768
29234
|
},
|
|
28769
29235
|
"recordingExport.listExports": {
|
|
28770
|
-
capName: "
|
|
29236
|
+
capName: "recording-export",
|
|
29237
|
+
capScope: "system",
|
|
29238
|
+
addonId: null,
|
|
29239
|
+
access: "view"
|
|
29240
|
+
},
|
|
29241
|
+
"recordingExport.readExportBytes": {
|
|
29242
|
+
capName: "recording-export",
|
|
28771
29243
|
capScope: "system",
|
|
28772
29244
|
addonId: null,
|
|
28773
29245
|
access: "view"
|
|
@@ -30144,6 +30616,104 @@ var FramerateField = number().int().min(1).max(60);
|
|
|
30144
30616
|
var TargetsField = array(NcRuleTargetSchema).min(1);
|
|
30145
30617
|
var PriorityField = number().int().min(1).max(5);
|
|
30146
30618
|
/**
|
|
30619
|
+
* Explicit override of the DENSE sampling cadence, seconds.
|
|
30620
|
+
*
|
|
30621
|
+
* Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
|
|
30622
|
+
* 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
|
|
30623
|
+
* made that same base 3 s and rendered a person pass as two frames.)
|
|
30624
|
+
*
|
|
30625
|
+
* THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
|
|
30626
|
+
* `denseCadenceSec` and played at `framerate` occupies
|
|
30627
|
+
*
|
|
30628
|
+
* outputSeconds = (rangeSec / denseCadenceSec) / framerate
|
|
30629
|
+
*
|
|
30630
|
+
* 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.
|
|
30631
|
+
* Halving this field doubles the frames INSIDE ranges only — the base cadence,
|
|
30632
|
+
* and therefore the length of a quiet night, does not move.
|
|
30633
|
+
*
|
|
30634
|
+
* Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
|
|
30635
|
+
* the recording has them returns the same frames, requested twice. Must be
|
|
30636
|
+
* STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
|
|
30637
|
+
* a uniform video the operator believes is two-rate — and upsert refuses it
|
|
30638
|
+
* rather than letting the export cap reject the render hours after the window.
|
|
30639
|
+
*/
|
|
30640
|
+
var DenseCadenceSecField = number().min(.1).max(3600);
|
|
30641
|
+
/**
|
|
30642
|
+
* Minimum seconds of OUTPUT video each detection range must occupy.
|
|
30643
|
+
*
|
|
30644
|
+
* The operator-facing form of the arithmetic above: instead of solving for a
|
|
30645
|
+
* cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
|
|
30646
|
+
* 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
|
|
30647
|
+
* that range every ~583 ms.
|
|
30648
|
+
*
|
|
30649
|
+
* ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
|
|
30650
|
+
* ranges are terms of a single ffmpeg `select` expression that cannot vary rate
|
|
30651
|
+
* per term — so the MOST DEMANDING (shortest) range sets the rate and longer
|
|
30652
|
+
* ranges are sampled denser than they need. Per-range cadences require a cap
|
|
30653
|
+
* schema change and are the tracked follow-up.
|
|
30654
|
+
*
|
|
30655
|
+
* A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
|
|
30656
|
+
* is rendered with every frame that EXISTS and no more: the guarantee is capped
|
|
30657
|
+
* by real footage, never met by duplicating frames into motion that never
|
|
30658
|
+
* happened.
|
|
30659
|
+
*/
|
|
30660
|
+
var MinDwellSecField = number().min(0).max(60);
|
|
30661
|
+
/**
|
|
30662
|
+
* Caption burned into the notification's preview frame.
|
|
30663
|
+
*
|
|
30664
|
+
* Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
|
|
30665
|
+
* `rule`, `from`, `to`) and rendered by the SAME renderer — a second
|
|
30666
|
+
* templating dialect for one field would be a second thing to explain.
|
|
30667
|
+
*
|
|
30668
|
+
* Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
|
|
30669
|
+
* operator saying "the frame, no caption" — a distinct, reachable answer, and
|
|
30670
|
+
* the reason this is not `.min(1)`.
|
|
30671
|
+
*/
|
|
30672
|
+
var PreviewTextField = string().max(200);
|
|
30673
|
+
/**
|
|
30674
|
+
* Whether the notification's preview is a STILL or a short animation.
|
|
30675
|
+
*
|
|
30676
|
+
* The operator's ask, verbatim: *"inviato come gif o video (come per le altre
|
|
30677
|
+
* rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
|
|
30678
|
+
* night reads better as three seconds of motion than as one frame of it. Both
|
|
30679
|
+
* modes get the SAME treatment (blurred frame, large centred title); `'gif'`
|
|
30680
|
+
* simply applies it to a dozen frames sampled across the render and assembles
|
|
30681
|
+
* them.
|
|
30682
|
+
*
|
|
30683
|
+
* `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
|
|
30684
|
+
* seeks and a palette pass, and no rule that never asked for one should start
|
|
30685
|
+
* paying that on the deploy that shipped it.
|
|
30686
|
+
*
|
|
30687
|
+
* A GIF that cannot be assembled DEGRADES to the still — never to nothing.
|
|
30688
|
+
*/
|
|
30689
|
+
var PreviewModeField = _enum(["image", "gif"]);
|
|
30690
|
+
/**
|
|
30691
|
+
* Which detection classes the notification reports counts for.
|
|
30692
|
+
*
|
|
30693
|
+
* The counts come from the tracks the render ALREADY fetched for its dense-range
|
|
30694
|
+
* plan — no second query — aggregated per class. Absent or empty means "every
|
|
30695
|
+
* class the window actually contained", which is what an operator who never
|
|
30696
|
+
* opened the field wants; a list narrows it (`['person']` on a driveway that
|
|
30697
|
+
* counts cars all night).
|
|
30698
|
+
*
|
|
30699
|
+
* Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
|
|
30700
|
+
* …). An unknown name simply never matches and reports nothing — it is not an
|
|
30701
|
+
* error, because a rule may legitimately name a class this camera's model does
|
|
30702
|
+
* not emit.
|
|
30703
|
+
*
|
|
30704
|
+
* The counts are exposed to {@link TimelapseTemplateSchema} as:
|
|
30705
|
+
* - `{{detections}}` — total over the reported classes
|
|
30706
|
+
* - `{{detectionSummary}}` — `2 persone, 1 veicolo`
|
|
30707
|
+
* - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
|
|
30708
|
+
* one per class, `count_` + the class name
|
|
30709
|
+
*
|
|
30710
|
+
* With NO custom body template the summary is appended to the derived body, and
|
|
30711
|
+
* only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
|
|
30712
|
+
* reads. With a custom template the operator owns every word — nothing is
|
|
30713
|
+
* appended, so `{{detectionSummary}}` is how he asks for it.
|
|
30714
|
+
*/
|
|
30715
|
+
var ReportClassesField = array(string().min(1).max(40)).max(20);
|
|
30716
|
+
/**
|
|
30147
30717
|
* Client-supplied timelapse-rule fields. The server stamps id / createdBy /
|
|
30148
30718
|
* createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
|
|
30149
30719
|
* here (see the ownership note above).
|
|
@@ -30163,9 +30733,30 @@ var TimelapseRuleInputSchema = object({
|
|
|
30163
30733
|
cadenceSec: CadenceSecField.default(15),
|
|
30164
30734
|
/** Output frames per second of the assembled mp4 (predecessor parity). */
|
|
30165
30735
|
framerate: FramerateField.default(10),
|
|
30736
|
+
/**
|
|
30737
|
+
* Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
|
|
30738
|
+
* as `max(1s, cadenceSec / 30)`, which is what every rule written before this
|
|
30739
|
+
* field gets.
|
|
30740
|
+
*/
|
|
30741
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
30742
|
+
/** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
|
|
30743
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
30166
30744
|
/** `notification-output` targets the finished video/thumbnail is sent to. */
|
|
30167
30745
|
targets: TargetsField,
|
|
30168
30746
|
template: TimelapseTemplateSchema.optional(),
|
|
30747
|
+
/**
|
|
30748
|
+
* Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
|
|
30749
|
+
* and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
|
|
30750
|
+
*
|
|
30751
|
+
* Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
|
|
30752
|
+
* the notification's title/body, and clearing it (`template: null`) must not
|
|
30753
|
+
* silently clear the caption too.
|
|
30754
|
+
*/
|
|
30755
|
+
previewText: PreviewTextField.optional(),
|
|
30756
|
+
/** Still or animation — see {@link PreviewModeField}. */
|
|
30757
|
+
previewMode: PreviewModeField.default("image"),
|
|
30758
|
+
/** Classes the notification counts — see {@link ReportClassesField}. */
|
|
30759
|
+
reportClasses: ReportClassesField.optional(),
|
|
30169
30760
|
/** Canonical notification priority ordinal (1..5); per-target overridable. */
|
|
30170
30761
|
priority: PriorityField.default(3)
|
|
30171
30762
|
});
|
|
@@ -30176,8 +30767,13 @@ object({
|
|
|
30176
30767
|
schedule: NcScheduleSchema.optional(),
|
|
30177
30768
|
cadenceSec: CadenceSecField.optional(),
|
|
30178
30769
|
framerate: FramerateField.optional(),
|
|
30770
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
30771
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
30179
30772
|
targets: TargetsField.optional(),
|
|
30180
30773
|
template: TimelapseTemplateSchema.nullable().optional(),
|
|
30774
|
+
previewText: PreviewTextField.optional(),
|
|
30775
|
+
previewMode: PreviewModeField.optional(),
|
|
30776
|
+
reportClasses: ReportClassesField.optional(),
|
|
30181
30777
|
priority: PriorityField.optional()
|
|
30182
30778
|
});
|
|
30183
30779
|
TimelapseRuleInputSchema.extend({
|
|
@@ -30189,10 +30785,28 @@ TimelapseRuleInputSchema.extend({
|
|
|
30189
30785
|
*/
|
|
30190
30786
|
ownerUserId: string().optional(),
|
|
30191
30787
|
/**
|
|
30192
|
-
* Epoch-ms of the
|
|
30193
|
-
*
|
|
30788
|
+
* Epoch-ms of the NEWEST successful generation across every camera of this
|
|
30789
|
+
* rule. What a UI shows, and the compatibility floor for
|
|
30790
|
+
* {@link readTimelapseGeneratedAt}. Absent = never generated.
|
|
30194
30791
|
*/
|
|
30195
30792
|
lastGeneratedAt: number().optional(),
|
|
30793
|
+
/**
|
|
30794
|
+
* PER-CAMERA generation state, keyed by `String(deviceId)` — the
|
|
30795
|
+
* re-generation guard's real durable state.
|
|
30796
|
+
*
|
|
30797
|
+
* One rule covers several cameras and each renders its own video, so a rule
|
|
30798
|
+
* -wide stamp is wrong in the direction that DESTROYS work: camera A
|
|
30799
|
+
* succeeding at 06:05 tells camera B, whose render failed, that it is
|
|
30800
|
+
* already done — and B's night is gone for good, because the window will not
|
|
30801
|
+
* come back.
|
|
30802
|
+
*
|
|
30803
|
+
* ADDITIVE, so the migration is free: a row written before this field simply
|
|
30804
|
+
* has no map, and {@link readTimelapseGeneratedAt} falls back to
|
|
30805
|
+
* {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
|
|
30806
|
+
* "never generated" would re-render and re-notify every camera of every rule
|
|
30807
|
+
* once, on the deploy that shipped the map.
|
|
30808
|
+
*/
|
|
30809
|
+
generatedByDevice: record(string(), number()).optional(),
|
|
30196
30810
|
/** userId of the caller who created the rule (server-stamped). */
|
|
30197
30811
|
createdBy: string(),
|
|
30198
30812
|
createdAt: number(),
|
|
@@ -30243,25 +30857,32 @@ object({
|
|
|
30243
30857
|
var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
|
|
30244
30858
|
object({
|
|
30245
30859
|
/**
|
|
30246
|
-
* How
|
|
30860
|
+
* How many delivered frames the worker HOLDS at once, waiting for each one's
|
|
30861
|
+
* detection result.
|
|
30862
|
+
*
|
|
30863
|
+
* This replaced a TTL on 2026-08-13, and the replacement is the whole point:
|
|
30864
|
+
* a time window was never related to the event the pixels were waiting for.
|
|
30865
|
+
* A held frame now lives from delivery until the runner has its `FrameResult`
|
|
30866
|
+
* — at which moment the runner cuts the subject tiles it actually wanted and
|
|
30867
|
+
* releases the frame. The bound exists only so a runner that stops answering
|
|
30868
|
+
* cannot pin RAM: above it the OLDEST held frame is dropped and counted.
|
|
30247
30869
|
*
|
|
30248
|
-
*
|
|
30249
|
-
*
|
|
30250
|
-
*
|
|
30251
|
-
*
|
|
30252
|
-
*
|
|
30870
|
+
* Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
|
|
30871
|
+
* 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
|
|
30872
|
+
* without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
|
|
30873
|
+
* Raising it does not buy hit rate — it buys tolerance for a slow runner, and
|
|
30874
|
+
* `holdOverflow` on the metrics line is what says you need it.
|
|
30253
30875
|
*/
|
|
30254
|
-
|
|
30876
|
+
holdFrames: number().int().min(1).max(64),
|
|
30255
30877
|
/**
|
|
30256
30878
|
* Hard per-decode-worker RAM ceiling for retained native frames, in MB.
|
|
30257
30879
|
*
|
|
30258
|
-
*
|
|
30259
|
-
*
|
|
30260
|
-
*
|
|
30261
|
-
*
|
|
30262
|
-
*
|
|
30263
|
-
*
|
|
30264
|
-
* rather than giving RAM back — lower this knob if RAM is what you wanted.
|
|
30880
|
+
* Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
|
|
30881
|
+
* is what decides how much is held, and the ceiling is the number above which
|
|
30882
|
+
* something is wrong. Before that it was the effective cap — at 1024 MB with
|
|
30883
|
+
* a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
|
|
30884
|
+
* with the TTL expiring nothing, which is exactly the confusion the hold
|
|
30885
|
+
* removes. `leaseMb` / `leaseFrames` still say what is resident.
|
|
30265
30886
|
* `0` DISABLES the lease entirely and falls the worker back to the tiny
|
|
30266
30887
|
* leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
|
|
30267
30888
|
* to replace).
|
|
@@ -30287,22 +30908,45 @@ object({
|
|
|
30287
30908
|
* there is the signal that some caller names frames outside the inference set
|
|
30288
30909
|
* and that this must go back to `all`.
|
|
30289
30910
|
*/
|
|
30290
|
-
admission: NativeLeaseAdmissionSchema
|
|
30911
|
+
admission: NativeLeaseAdmissionSchema,
|
|
30912
|
+
/**
|
|
30913
|
+
* RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
|
|
30914
|
+
* compressed native crops the worker cuts at the moment a frame's detection
|
|
30915
|
+
* result arrives, and keeps long after the frame itself is freed.
|
|
30916
|
+
*
|
|
30917
|
+
* This is the knob that replaced the old retention window, and it buys about
|
|
30918
|
+
* three orders of magnitude more of it: a tile is one subject at native
|
|
30919
|
+
* resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
|
|
30920
|
+
* the frame it was cut from. A frame on which nothing was detected costs
|
|
30921
|
+
* nothing at all, which is the real change — the old lease paid per FRAME and
|
|
30922
|
+
* was interrogated per SUBJECT.
|
|
30923
|
+
*
|
|
30924
|
+
* `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
|
|
30925
|
+
* fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
|
|
30926
|
+
* reproduce that.
|
|
30927
|
+
*/
|
|
30928
|
+
tileBudgetMb: number().int().min(0).max(1024)
|
|
30291
30929
|
});
|
|
30292
30930
|
/**
|
|
30293
|
-
* The values in force when the operator has set nothing
|
|
30294
|
-
*
|
|
30295
|
-
*
|
|
30931
|
+
* The values in force when the operator has set nothing.
|
|
30932
|
+
*
|
|
30933
|
+
* `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
|
|
30934
|
+
* being the retention window and became the OOM ceiling, and lowering a ceiling
|
|
30935
|
+
* in the same change that redefines it would make a regression and a retune
|
|
30936
|
+
* indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
|
|
30937
|
+
* live traffic.
|
|
30296
30938
|
*/
|
|
30297
30939
|
var DEFAULT_NATIVE_LEASE_SETTINGS = {
|
|
30298
|
-
|
|
30940
|
+
holdFrames: 8,
|
|
30299
30941
|
budgetMb: 1024,
|
|
30300
30942
|
activityMs: 15e3,
|
|
30943
|
+
tileBudgetMb: 64,
|
|
30301
30944
|
admission: "inferred"
|
|
30302
30945
|
};
|
|
30303
|
-
DEFAULT_NATIVE_LEASE_SETTINGS.
|
|
30946
|
+
DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
|
|
30304
30947
|
DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
|
|
30305
30948
|
DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
|
|
30949
|
+
DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
|
|
30306
30950
|
DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
30307
30951
|
/**
|
|
30308
30952
|
* Fixed-capacity ring buffer. When full, push() overwrites the oldest entry.
|