@camstack/addon-static-turn 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/static-turn.addon.js +686 -42
- package/dist/static-turn.addon.mjs +686 -42
- package/package.json +1 -1
|
@@ -7189,8 +7189,31 @@ var AdoptionJobSchema = object({
|
|
|
7189
7189
|
error: string().nullable()
|
|
7190
7190
|
});
|
|
7191
7191
|
/**
|
|
7192
|
-
* Per-camera FUNCTION SWITCHES
|
|
7193
|
-
*
|
|
7192
|
+
* Per-camera FUNCTION SWITCHES.
|
|
7193
|
+
*
|
|
7194
|
+
* ## The aggregate group is being withdrawn — the BADGE is not (D113)
|
|
7195
|
+
*
|
|
7196
|
+
* This file shipped as "the one coherent on/off surface over the pipeline
|
|
7197
|
+
* functions an operator thinks in terms of". The operator's verdict on
|
|
7198
|
+
* 2026-08-12 was that the coherent surface bought complexity and no clarity:
|
|
7199
|
+
* every function already had a settings page of its own, and a second place to
|
|
7200
|
+
* turn it off is a second place to look. Each switch is going back to its own
|
|
7201
|
+
* component's original options — detection to the detection-pipeline wrapper
|
|
7202
|
+
* binding, audio analysis to its own, recording to `RecordingConfig.enabled`
|
|
7203
|
+
* (which was always first-class; the switch was a veneer over
|
|
7204
|
+
* `recording.setDeviceConfig`), notifications to a notification-center
|
|
7205
|
+
* per-device setting, the two camera planes to their own components.
|
|
7206
|
+
*
|
|
7207
|
+
* What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
|
|
7208
|
+
* thing that lets a status surface say DISABLED instead of BROKEN, recomposed
|
|
7209
|
+
* straight from the authorities with no group in the middle. That rule was
|
|
7210
|
+
* never about a control panel.
|
|
7211
|
+
*
|
|
7212
|
+
* Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
|
|
7213
|
+
* {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
|
|
7214
|
+
* `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
|
|
7215
|
+
* viewers (v1.0.305) and the admin UI still call it. It is deleted when they
|
|
7216
|
+
* stop; nothing new may be built on it.
|
|
7194
7217
|
*
|
|
7195
7218
|
* ## This file adds no state
|
|
7196
7219
|
*
|
|
@@ -7541,7 +7564,15 @@ var RecordingConfigSchema = object({
|
|
|
7541
7564
|
* Each completed/failed run also lands one durable ops-log row on its owning
|
|
7542
7565
|
* addon surface.
|
|
7543
7566
|
*/
|
|
7567
|
+
/**
|
|
7568
|
+
* `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
|
|
7569
|
+
* rebalance enqueues one job per (camera, profile). Refusing the second job —
|
|
7570
|
+
* what the engine did before — turned a fifteen-camera rebalance into fifteen
|
|
7571
|
+
* manual retries. Queued jobs run FIFO; a queued job that is cancelled never
|
|
7572
|
+
* runs at all.
|
|
7573
|
+
*/
|
|
7544
7574
|
var RelocateJobStateSchema = _enum([
|
|
7575
|
+
"queued",
|
|
7545
7576
|
"running",
|
|
7546
7577
|
"done",
|
|
7547
7578
|
"failed",
|
|
@@ -7576,6 +7607,15 @@ var RelocateFootageInputSchema = object({
|
|
|
7576
7607
|
/** Limits relocation to the logical profile class. Omit only for the
|
|
7577
7608
|
* pre-orchestration compatibility path. */
|
|
7578
7609
|
footageClass: RelocateFootageClassSchema.optional(),
|
|
7610
|
+
/** Scope the move to ONE camera. Absent = every camera on the source, which
|
|
7611
|
+
* is what a whole-disk drain means. The rebalance path always sets it: its
|
|
7612
|
+
* unit is a (camera, profile) pile, not a disk. */
|
|
7613
|
+
deviceId: number().int().optional(),
|
|
7614
|
+
/** Scope the move to specific segment profiles (`high` / `mid` / `low`).
|
|
7615
|
+
* Finer than `footageClass`, which cannot separate high from mid — and the
|
|
7616
|
+
* placement plan assigns those two independently, so a rebalance that could
|
|
7617
|
+
* only say "recordings" would move footage the plan never asked to move. */
|
|
7618
|
+
profiles: array(string()).optional(),
|
|
7579
7619
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
7580
7620
|
* never allowed to starve live writers. */
|
|
7581
7621
|
throttleMbps: number().min(1).max(1e3).optional()
|
|
@@ -7711,6 +7751,21 @@ var StorageLocationSchema = object({
|
|
|
7711
7751
|
nodeId: string().optional(),
|
|
7712
7752
|
isDefault: boolean().default(false),
|
|
7713
7753
|
isSystem: boolean().default(false),
|
|
7754
|
+
/**
|
|
7755
|
+
* Operator opt-in: whether consumers that BALANCE across several locations
|
|
7756
|
+
* of a type may write here. Recordings reads it today; event media and
|
|
7757
|
+
* backups are the next consumers, which is why the flag lives on the
|
|
7758
|
+
* location rather than in any one addon's store — nothing has to be
|
|
7759
|
+
* extended to add the next consumer.
|
|
7760
|
+
*
|
|
7761
|
+
* OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
|
|
7762
|
+
* flag existed reads back with no flag and keeps working exactly as before;
|
|
7763
|
+
* that is the whole compat story, and it is why no migration ships with it.
|
|
7764
|
+
* A newly CREATED sibling is stamped `false` by the orchestrator (creating a
|
|
7765
|
+
* disk must not silently start writing to it); the default of a type is
|
|
7766
|
+
* always stamped `true`.
|
|
7767
|
+
*/
|
|
7768
|
+
enabled: boolean().optional(),
|
|
7714
7769
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
7715
7770
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
7716
7771
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -12013,7 +12068,8 @@ method(object({
|
|
|
12013
12068
|
}), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
|
|
12014
12069
|
/**
|
|
12015
12070
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
12016
|
-
* filesystem
|
|
12071
|
+
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
12072
|
+
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
12017
12073
|
* admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
|
|
12018
12074
|
* (one provider per node); the hub calls it with `{nodeId}` so the codegen
|
|
12019
12075
|
* routes to that exact node (default `nodeIdMode:'routing'`).
|
|
@@ -13826,6 +13882,13 @@ var MaskGridDimsSchema = object({
|
|
|
13826
13882
|
* `package-event` are pure trigger kinds (no urgency dimension). Extending
|
|
13827
13883
|
* this one field keeps the schema additive — a rule still declares exactly
|
|
13828
13884
|
* one trigger.
|
|
13885
|
+
*
|
|
13886
|
+
* AUDIO rules add no member here, for the reason occupancy added none: the
|
|
13887
|
+
* enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
|
|
13888
|
+
* mirror.ts` fails the build on a member the app cannot render) and every
|
|
13889
|
+
* member costs a release train. A sustained-sound rule is therefore an
|
|
13890
|
+
* `immediate` rule carrying {@link NcConditions.audio} — the condition is the
|
|
13891
|
+
* trigger discriminator, exactly as `occupancy` is on `device-event`.
|
|
13829
13892
|
*/
|
|
13830
13893
|
var NcDeliverySchema = _enum([
|
|
13831
13894
|
"immediate",
|
|
@@ -13840,15 +13903,32 @@ var NcDeliverySchema = _enum([
|
|
|
13840
13903
|
* depend on a provider's raw event name or payload shape.
|
|
13841
13904
|
*/
|
|
13842
13905
|
var NcSystemEventKindSchema = _enum([
|
|
13843
|
-
"
|
|
13844
|
-
"
|
|
13906
|
+
"device-online",
|
|
13907
|
+
"device-offline",
|
|
13908
|
+
"device-disabled",
|
|
13909
|
+
"device-enabled",
|
|
13845
13910
|
"stream-online",
|
|
13846
13911
|
"stream-offline",
|
|
13847
13912
|
"node-online",
|
|
13848
13913
|
"node-offline",
|
|
13849
13914
|
"addon-update-available",
|
|
13850
|
-
"server-update-available"
|
|
13915
|
+
"server-update-available",
|
|
13916
|
+
"alarm-triggered",
|
|
13917
|
+
"alarm-armed",
|
|
13918
|
+
"alarm-disarmed",
|
|
13919
|
+
"camera-online",
|
|
13920
|
+
"camera-offline",
|
|
13921
|
+
"camera-disabled",
|
|
13922
|
+
"camera-enabled"
|
|
13923
|
+
]);
|
|
13924
|
+
/** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
|
|
13925
|
+
var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
|
|
13926
|
+
"camera-online",
|
|
13927
|
+
"camera-offline",
|
|
13928
|
+
"camera-disabled",
|
|
13929
|
+
"camera-enabled"
|
|
13851
13930
|
]);
|
|
13931
|
+
NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
|
|
13852
13932
|
/**
|
|
13853
13933
|
* One coherent system-event condition. `kinds` is the required opt-in safety
|
|
13854
13934
|
* gate; the remaining lists are optional narrowing filters relevant to the
|
|
@@ -13857,6 +13937,18 @@ var NcSystemEventKindSchema = _enum([
|
|
|
13857
13937
|
var NcSystemEventConditionSchema = object({
|
|
13858
13938
|
kinds: array(NcSystemEventKindSchema).min(1),
|
|
13859
13939
|
deviceIds: array(number().int()).min(1).optional(),
|
|
13940
|
+
/**
|
|
13941
|
+
* Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
|
|
13942
|
+
* `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
|
|
13943
|
+
* is what a liveness rule means when nobody said otherwise.
|
|
13944
|
+
*
|
|
13945
|
+
* This is where "only my cameras" is expressed, and it lives on the rule for
|
|
13946
|
+
* one reason: the intake cannot know which devices this household cares
|
|
13947
|
+
* about, and a producer-side filter is one no operator can change. Fails
|
|
13948
|
+
* CLOSED — a subject whose device type is unknown (an id the device mirror
|
|
13949
|
+
* does not carry) matches no `deviceTypes` list.
|
|
13950
|
+
*/
|
|
13951
|
+
deviceTypes: array(string().min(1)).min(1).optional(),
|
|
13860
13952
|
nodeIds: array(string().min(1)).min(1).optional(),
|
|
13861
13953
|
packageNames: array(string().min(1)).min(1).optional()
|
|
13862
13954
|
});
|
|
@@ -13907,6 +13999,47 @@ var NcOccupancyConditionSchema = object({
|
|
|
13907
13999
|
sustainSeconds: number().int().min(0).max(3600).default(15)
|
|
13908
14000
|
});
|
|
13909
14001
|
/**
|
|
14002
|
+
* Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
|
|
14003
|
+
*
|
|
14004
|
+
* Operator-approved vocabulary (2026-08-12, option A — the same one the
|
|
14005
|
+
* reference notifier uses, so an operator moving between them re-uses what
|
|
14006
|
+
* they already know): a rule matches when, over a sampling window of
|
|
14007
|
+
* `samplingSeconds`, at least `hitPercent`% of the audio samples in that
|
|
14008
|
+
* window are HITS. A sample is a hit when it satisfies BOTH present filters:
|
|
14009
|
+
*
|
|
14010
|
+
* - `dbThreshold` — its level is at or above this many dBFS (see
|
|
14011
|
+
* {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
|
|
14012
|
+
* - `labels` — the classifier put at least one of these labels on it.
|
|
14013
|
+
*
|
|
14014
|
+
* Both are OPTIONAL and independent, which is the point of the shape: a
|
|
14015
|
+
* loudness rule ("something loud at 3am") needs no model to be right, and a
|
|
14016
|
+
* label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
|
|
14017
|
+
* is given** — a window in which every sample is trivially a hit would fire on
|
|
14018
|
+
* silence, so the engine refuses such a condition rather than notifying on
|
|
14019
|
+
* nothing (the schema cannot express "at least one of" without becoming a
|
|
14020
|
+
* ZodEffects the cap path would have to special-case).
|
|
14021
|
+
*
|
|
14022
|
+
* `hitPercent` is over the samples the window actually HOLDS, and the window
|
|
14023
|
+
* must be FULL before it can match — a window that has been open for two
|
|
14024
|
+
* seconds of its ten is 100% of nothing, and firing on it would make
|
|
14025
|
+
* `samplingSeconds` decorative.
|
|
14026
|
+
*
|
|
14027
|
+
* Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
|
|
14028
|
+
* `audio-*` ids). Both spellings are accepted — the matcher normalizes the
|
|
14029
|
+
* `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
|
|
14030
|
+
* an operator who typed `dog` mean the same thing.
|
|
14031
|
+
*/
|
|
14032
|
+
var NcAudioConditionSchema = object({
|
|
14033
|
+
/** Audio macro labels; absent = any sound (level-only rule). */
|
|
14034
|
+
labels: array(string().min(1)).min(1).optional(),
|
|
14035
|
+
/** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
|
|
14036
|
+
dbThreshold: number().min(-96).max(0).optional(),
|
|
14037
|
+
/** Percentage of the window's samples that must be hits (1–100). */
|
|
14038
|
+
hitPercent: number().int().min(1).max(100).default(60),
|
|
14039
|
+
/** Length of the sampling window in seconds. */
|
|
14040
|
+
samplingSeconds: number().int().min(1).max(300).default(10)
|
|
14041
|
+
});
|
|
14042
|
+
/**
|
|
13910
14043
|
* Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
|
|
13911
14044
|
*
|
|
13912
14045
|
* The values are not symmetric, and deliberately so — the absent value has to
|
|
@@ -14179,7 +14312,33 @@ var NcConditionsSchema = object({
|
|
|
14179
14312
|
* threshold and holds for `sustainSeconds`. Fail-closed on missing
|
|
14180
14313
|
* substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
|
|
14181
14314
|
*/
|
|
14182
|
-
occupancy: NcOccupancyConditionSchema.optional()
|
|
14315
|
+
occupancy: NcOccupancyConditionSchema.optional(),
|
|
14316
|
+
/**
|
|
14317
|
+
* IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
|
|
14318
|
+
* `samplingSeconds` window clear the optional `dbThreshold` and carry one of
|
|
14319
|
+
* the optional `labels`. Fail-closed on missing substrate (no audio samples,
|
|
14320
|
+
* a window that is not full yet, neither filter given). See
|
|
14321
|
+
* {@link NcAudioCondition}.
|
|
14322
|
+
*
|
|
14323
|
+
* Presence of this key is what makes a rule an AUDIO rule: the engine fires
|
|
14324
|
+
* it ONLY on a confirmed audio window, and a rule carrying it never fires on
|
|
14325
|
+
* a detection, a track or a device event (the same fail-closed pairing
|
|
14326
|
+
* `occupancy` has with the `device-event` trigger). That is how audio labels
|
|
14327
|
+
* leave `classes`: an audio rule names its sounds HERE, and the legacy path
|
|
14328
|
+
* (an `immediate` rule naming an `audio-*` class, one notification per
|
|
14329
|
+
* classified sample) stays exactly as it was for rules that already use it.
|
|
14330
|
+
*
|
|
14331
|
+
* NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
|
|
14332
|
+
* rather than an oversight: the viewer mirrors the descriptor enums BY HAND
|
|
14333
|
+
* (`camstack/src/data/notification-center.ts`, guarded by
|
|
14334
|
+
* `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
|
|
14335
|
+
* condition fields it does not know when a rule is saved from the phone.
|
|
14336
|
+
* Publishing an editor for a condition the app cannot round-trip is how an
|
|
14337
|
+
* operator loses a rule's conditions by opening it — so the descriptor, the
|
|
14338
|
+
* admin widget and the viewer mirror land together (P2 + P3), and only then
|
|
14339
|
+
* does an audio rule become authorable.
|
|
14340
|
+
*/
|
|
14341
|
+
audio: NcAudioConditionSchema.optional()
|
|
14183
14342
|
});
|
|
14184
14343
|
/** One delivery target: a `notification-output` Target ref + passthrough params. */
|
|
14185
14344
|
var NcRuleTargetSchema = object({
|
|
@@ -14293,6 +14452,73 @@ var NcThrottleSchema = object({
|
|
|
14293
14452
|
*/
|
|
14294
14453
|
granularity: NcThrottleGranularitySchema.optional()
|
|
14295
14454
|
});
|
|
14455
|
+
/**
|
|
14456
|
+
* How long the confirm gate may hold ONE notification, and how big the picture
|
|
14457
|
+
* it judges may be.
|
|
14458
|
+
*
|
|
14459
|
+
* The clamp is the product decision, not a coincidence of the model: p50 was
|
|
14460
|
+
* 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
|
|
14461
|
+
* arrives after the visitor has gone is not a notification. 448 px was enough
|
|
14462
|
+
* to score 16/16 on the operator's parking scenario — bigger costs latency and
|
|
14463
|
+
* tokens for pixels the model pools away.
|
|
14464
|
+
*/
|
|
14465
|
+
var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
|
|
14466
|
+
var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
|
|
14467
|
+
var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
|
|
14468
|
+
/** Comparison the model's COUNT must satisfy for the notification to fire. */
|
|
14469
|
+
var NcConfirmExpectSchema = object({
|
|
14470
|
+
op: _enum([
|
|
14471
|
+
">=",
|
|
14472
|
+
">",
|
|
14473
|
+
"<=",
|
|
14474
|
+
"<",
|
|
14475
|
+
"=="
|
|
14476
|
+
]),
|
|
14477
|
+
count: number().int().min(0).max(1e3)
|
|
14478
|
+
});
|
|
14479
|
+
/**
|
|
14480
|
+
* AI CONFIRM — a vision model looks at the picture this notification is about
|
|
14481
|
+
* to ship and says whether it agrees with the rule.
|
|
14482
|
+
*
|
|
14483
|
+
* It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
|
|
14484
|
+
* crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
|
|
14485
|
+
* on the operator's phone is not a verdict about this notification.
|
|
14486
|
+
*
|
|
14487
|
+
* FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
|
|
14488
|
+
* whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
|
|
14489
|
+
* the default and every fail-open is COUNTED, because a gate that always fails
|
|
14490
|
+
* open looks in the log exactly like a gate that works.
|
|
14491
|
+
*
|
|
14492
|
+
* Every field is `.optional()` rather than relied on as a Zod default at the
|
|
14493
|
+
* runtime seam: a Zod default does NOT run on the addon→addon cap path (three
|
|
14494
|
+
* production failures in one day), so the gate reads absent as the constant
|
|
14495
|
+
* above rather than trusting a parse it may never have seen.
|
|
14496
|
+
*/
|
|
14497
|
+
var NcConfirmSchema = object({
|
|
14498
|
+
/** Off unless asked for. An absent `confirm` and `enabled:false` are the
|
|
14499
|
+
* same thing, and both mean "deliver exactly as before". */
|
|
14500
|
+
enabled: boolean().default(false),
|
|
14501
|
+
/** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
|
|
14502
|
+
profileId: string().optional(),
|
|
14503
|
+
/**
|
|
14504
|
+
* The operator's question, in his own words. Absent = a question derived
|
|
14505
|
+
* from the rule (its class and its expectation).
|
|
14506
|
+
*
|
|
14507
|
+
* NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
|
|
14508
|
+
* banners, signage and plates as instructions if you let them reach the
|
|
14509
|
+
* prompt — proven live — so the authoritative contract stays in the system
|
|
14510
|
+
* turn and only rule-authored words land here.
|
|
14511
|
+
*/
|
|
14512
|
+
prompt: string().max(1e3).optional(),
|
|
14513
|
+
/** Fire only when the model's count satisfies this. Absent = the model's
|
|
14514
|
+
* own boolean verdict decides. */
|
|
14515
|
+
expect: NcConfirmExpectSchema.optional(),
|
|
14516
|
+
timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
|
|
14517
|
+
/** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
|
|
14518
|
+
onTimeout: _enum(["fire", "suppress"]).default("fire"),
|
|
14519
|
+
/** Longest edge the judged image is downscaled to before it is sent. */
|
|
14520
|
+
maxImagePx: number().int().min(64).max(2048).default(448)
|
|
14521
|
+
});
|
|
14296
14522
|
/** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
|
|
14297
14523
|
var NcRuleInputSchema = object({
|
|
14298
14524
|
name: string().min(1).max(200),
|
|
@@ -14353,7 +14579,13 @@ var NcRuleInputSchema = object({
|
|
|
14353
14579
|
* `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
|
|
14354
14580
|
* shape as every other actuation.
|
|
14355
14581
|
*/
|
|
14356
|
-
actions: NcRuleActionsSchema.optional()
|
|
14582
|
+
actions: NcRuleActionsSchema.optional(),
|
|
14583
|
+
/**
|
|
14584
|
+
* AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
|
|
14585
|
+
* a rule that predates the gate must keep delivering byte-for-byte as it
|
|
14586
|
+
* did, and absent is the only way to say that without a migration.
|
|
14587
|
+
*/
|
|
14588
|
+
confirm: NcConfirmSchema.optional()
|
|
14357
14589
|
});
|
|
14358
14590
|
/**
|
|
14359
14591
|
* Partial patch for `updateRule` — any subset of the input fields, plus the
|
|
@@ -14364,7 +14596,37 @@ var NcRuleInputSchema = object({
|
|
|
14364
14596
|
* still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
|
|
14365
14597
|
* `updateRule` patch.
|
|
14366
14598
|
*/
|
|
14367
|
-
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
14599
|
+
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
14600
|
+
disabledTargetIds: array(string()).optional(),
|
|
14601
|
+
/**
|
|
14602
|
+
* `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
|
|
14603
|
+
*
|
|
14604
|
+
* It makes the key optional to SUPPLY; the parse still materialises the
|
|
14605
|
+
* default when the key is absent. And `NcRuleStore.update` merges with
|
|
14606
|
+
* `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
|
|
14607
|
+
* one — which made every partial edit destructive:
|
|
14608
|
+
*
|
|
14609
|
+
* nc.updateRule({ throttle }) → conditions reset to `{}`
|
|
14610
|
+
* nc.setRuleTargetEnabled(...) → conditions reset to `{}`
|
|
14611
|
+
* setEnabled(ruleId, false) → conditions reset to `{}`
|
|
14612
|
+
*
|
|
14613
|
+
* A rule scoped to one camera and one zone silently became a rule that
|
|
14614
|
+
* matches EVERY event on EVERY camera, and lost its `media` policy
|
|
14615
|
+
* (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
|
|
14616
|
+
* live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
|
|
14617
|
+
* within a minute of a two-field patch.
|
|
14618
|
+
*
|
|
14619
|
+
* So every defaulted field is re-declared here WITHOUT its default. The
|
|
14620
|
+
* inner defaults still apply when the caller DOES send the key — `{}` for
|
|
14621
|
+
* conditions remains a real instruction ("clear them") — and only the
|
|
14622
|
+
* absent key is now genuinely absent.
|
|
14623
|
+
*/
|
|
14624
|
+
enabled: boolean().optional(),
|
|
14625
|
+
conditions: NcConditionsSchema.optional(),
|
|
14626
|
+
media: NcMediaPolicySchema.optional(),
|
|
14627
|
+
throttle: NcThrottleSchema.optional(),
|
|
14628
|
+
priority: number().int().min(1).max(5).optional()
|
|
14629
|
+
});
|
|
14368
14630
|
/** A persisted rule. */
|
|
14369
14631
|
var NcRuleSchema = NcRuleInputSchema.extend({
|
|
14370
14632
|
id: string(),
|
|
@@ -14665,6 +14927,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
|
|
|
14665
14927
|
* Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
|
|
14666
14928
|
* copy would lie the first time a rule is disabled.
|
|
14667
14929
|
*/
|
|
14930
|
+
/**
|
|
14931
|
+
* Why a device a mode NAMES is nonetheless not armed by it.
|
|
14932
|
+
*
|
|
14933
|
+
* Each value is an existing authority, never a new flag (D62): `muted` is the
|
|
14934
|
+
* per-camera notification switch the Notification Center already owns,
|
|
14935
|
+
* `detection-off` is the device's own detection binding being inactive, and
|
|
14936
|
+
* `offline` is the device manager's liveness. A fourth reason would mean a
|
|
14937
|
+
* fourth authority, and inventing one here is how a panel starts disagreeing
|
|
14938
|
+
* with the switches the operator actually used.
|
|
14939
|
+
*/
|
|
14940
|
+
var NcAlarmSkipReasonSchema = _enum([
|
|
14941
|
+
"muted",
|
|
14942
|
+
"detection-off",
|
|
14943
|
+
"offline"
|
|
14944
|
+
]);
|
|
14945
|
+
var NcAlarmSkippedDeviceSchema = object({
|
|
14946
|
+
deviceId: number().int(),
|
|
14947
|
+
reason: NcAlarmSkipReasonSchema
|
|
14948
|
+
});
|
|
14668
14949
|
var NcAlarmModeCoverageSchema = object({
|
|
14669
14950
|
mode: AlarmArmModeSchema,
|
|
14670
14951
|
/** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
|
|
@@ -14672,7 +14953,18 @@ var NcAlarmModeCoverageSchema = object({
|
|
|
14672
14953
|
/** At least one covering rule has no device scope, so the mode covers all. */
|
|
14673
14954
|
allDevices: boolean(),
|
|
14674
14955
|
/** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
|
|
14675
|
-
deviceIds: array(number().int())
|
|
14956
|
+
deviceIds: array(number().int()),
|
|
14957
|
+
/**
|
|
14958
|
+
* Devices this mode NAMES but cannot actually arm, each with the switch that
|
|
14959
|
+
* excludes it.
|
|
14960
|
+
*
|
|
14961
|
+
* "Away armed — 12 cameras" is a promise, and a muted camera among those
|
|
14962
|
+
* twelve makes it false in exactly the way nobody notices until an incident.
|
|
14963
|
+
* Defaulted to `[]` so a coverage answer computed before this field existed
|
|
14964
|
+
* still parses as "nothing known to be skipped" rather than failing the whole
|
|
14965
|
+
* alarm tab.
|
|
14966
|
+
*/
|
|
14967
|
+
skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
|
|
14676
14968
|
});
|
|
14677
14969
|
var NcAlarmConfigSchema = object({
|
|
14678
14970
|
/**
|
|
@@ -17471,9 +17763,16 @@ var CameraStatusSchema = object({
|
|
|
17471
17763
|
audio: CameraAudioStatusSchema.nullable(),
|
|
17472
17764
|
recording: CameraRecordingStatusSchema.nullable(),
|
|
17473
17765
|
/**
|
|
17474
|
-
* Per-camera
|
|
17766
|
+
* Per-camera functions an OPERATOR has turned off
|
|
17475
17767
|
* ([D61](../../../../docs/decisions/adr-0067.md)).
|
|
17476
17768
|
*
|
|
17769
|
+
* Composed from the AUTHORITIES themselves — the wrapper bindings,
|
|
17770
|
+
* `RecordingConfig.enabled`, the notification mute, the broker's audio
|
|
17771
|
+
* policy, the camera's own microphone — via `composeSwitchedOff`, not from
|
|
17772
|
+
* the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
|
|
17773
|
+
* The badge outlives the control panel: the panel was a convenience, this is
|
|
17774
|
+
* the difference between a camera being off and a camera being dead.
|
|
17775
|
+
*
|
|
17477
17776
|
* This is the difference between DISABLED and BROKEN. A camera whose
|
|
17478
17777
|
* `detection` block reports zero fps and whose `switchedOff` contains
|
|
17479
17778
|
* `'object-detection'` was switched off by a person; the same camera with an
|
|
@@ -23005,7 +23304,19 @@ var RecordingManifestSchema = object({
|
|
|
23005
23304
|
* profiles/subtrees/locations on this node). */
|
|
23006
23305
|
var RecordingDeviceUsageSchema = object({
|
|
23007
23306
|
deviceId: number(),
|
|
23008
|
-
usedBytes: number()
|
|
23307
|
+
usedBytes: number(),
|
|
23308
|
+
/**
|
|
23309
|
+
* Start of this camera's OLDEST indexed segment, across every profile and
|
|
23310
|
+
* location — the "Oldest footage" column in Recordings → Storage, and the
|
|
23311
|
+
* only honest answer to "is retention actually holding?" per camera.
|
|
23312
|
+
*
|
|
23313
|
+
* `null` = the camera has no footage. OPTIONAL because a recorder that
|
|
23314
|
+
* predates this field omits it entirely, and a hub whose types carry the
|
|
23315
|
+
* field must keep validating that older provider's payload: the framework
|
|
23316
|
+
* (types) and the addon ship on different trains, and the addon is usually
|
|
23317
|
+
* the later of the two.
|
|
23318
|
+
*/
|
|
23319
|
+
oldestMs: number().nullable().optional()
|
|
23009
23320
|
});
|
|
23010
23321
|
/** Recording storage usage + capacity for one storage location. */
|
|
23011
23322
|
var RecordingLocationUsageSchema = object({
|
|
@@ -23033,6 +23344,57 @@ var RecordingStorageUsageSchema = object({
|
|
|
23033
23344
|
locations: array(RecordingLocationUsageSchema)
|
|
23034
23345
|
});
|
|
23035
23346
|
/**
|
|
23347
|
+
* The OPERATOR-ARMED half of multi-location recordings (D116).
|
|
23348
|
+
*
|
|
23349
|
+
* The placement plan decides where NEW writes go and moves nothing. A rebalance
|
|
23350
|
+
* is the operator asking for the EXISTING archive to be brought into line with
|
|
23351
|
+
* that plan: one relocate job per (camera, profile) pile that sits on the wrong
|
|
23352
|
+
* location, run FIFO behind the single-flight mover.
|
|
23353
|
+
*
|
|
23354
|
+
* `plan…` and `start…` return the SAME shape deliberately — what the operator
|
|
23355
|
+
* confirms is exactly what gets enqueued, and `jobIds` is the only difference
|
|
23356
|
+
* (empty on the plan).
|
|
23357
|
+
*/
|
|
23358
|
+
var RecordingRebalanceMoveSchema = object({
|
|
23359
|
+
deviceId: number(),
|
|
23360
|
+
profile: string(),
|
|
23361
|
+
fromLocationId: string(),
|
|
23362
|
+
toLocationId: string(),
|
|
23363
|
+
bytes: number(),
|
|
23364
|
+
files: number().int()
|
|
23365
|
+
});
|
|
23366
|
+
/** Why a pile that is out of place is staying there. Every refusal is
|
|
23367
|
+
* reported: a rebalance that silently drops a camera reads exactly like one
|
|
23368
|
+
* that had nothing to do. */
|
|
23369
|
+
var RecordingRebalanceSkipReasonSchema = _enum([
|
|
23370
|
+
"unassigned",
|
|
23371
|
+
"target-not-writable",
|
|
23372
|
+
"below-threshold",
|
|
23373
|
+
"no-headroom"
|
|
23374
|
+
]);
|
|
23375
|
+
var RecordingRebalanceSkipSchema = object({
|
|
23376
|
+
deviceId: number(),
|
|
23377
|
+
profile: string(),
|
|
23378
|
+
fromLocationId: string(),
|
|
23379
|
+
/** The location the plan wants; null when the camera has no assignment. */
|
|
23380
|
+
toLocationId: string().nullable(),
|
|
23381
|
+
bytes: number(),
|
|
23382
|
+
reason: RecordingRebalanceSkipReasonSchema
|
|
23383
|
+
});
|
|
23384
|
+
var RecordingRebalancePlanSchema = object({
|
|
23385
|
+
moves: array(RecordingRebalanceMoveSchema),
|
|
23386
|
+
skipped: array(RecordingRebalanceSkipSchema),
|
|
23387
|
+
bytesToMove: number(),
|
|
23388
|
+
/** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
|
|
23389
|
+
jobIds: array(string())
|
|
23390
|
+
});
|
|
23391
|
+
var RecordingRebalanceInputSchema = object({
|
|
23392
|
+
/** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
|
|
23393
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
23394
|
+
/** Ignore piles smaller than this (default 1 GB). */
|
|
23395
|
+
minMoveGb: number().min(0).optional()
|
|
23396
|
+
});
|
|
23397
|
+
/**
|
|
23036
23398
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
23037
23399
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
23038
23400
|
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
@@ -23195,9 +23557,24 @@ method(object({
|
|
|
23195
23557
|
}), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
23196
23558
|
kind: "mutation",
|
|
23197
23559
|
auth: "admin"
|
|
23560
|
+
}), method(RelocateFootageInputSchema, object({ jobId: string() }), {
|
|
23561
|
+
kind: "mutation",
|
|
23562
|
+
auth: "admin"
|
|
23563
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
23564
|
+
kind: "query",
|
|
23565
|
+
auth: "admin"
|
|
23566
|
+
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
23567
|
+
kind: "mutation",
|
|
23568
|
+
auth: "admin"
|
|
23569
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
23570
|
+
kind: "query",
|
|
23571
|
+
auth: "admin"
|
|
23572
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
23573
|
+
kind: "mutation",
|
|
23574
|
+
auth: "admin"
|
|
23198
23575
|
});
|
|
23199
23576
|
/**
|
|
23200
|
-
* `
|
|
23577
|
+
* `recording-export` cap — render a footage time range into a single downloadable
|
|
23201
23578
|
* MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
|
|
23202
23579
|
* bounded lifetime with a durable history, auto-expiry, and optional
|
|
23203
23580
|
* delete-after-download.
|
|
@@ -23212,10 +23589,53 @@ method(object({
|
|
|
23212
23589
|
*/
|
|
23213
23590
|
/** Playback-speed multiplier for the render (1 = realtime). */
|
|
23214
23591
|
var ExportSpeedSchema = number().min(.25).max(32);
|
|
23592
|
+
/**
|
|
23593
|
+
* One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
|
|
23594
|
+
*
|
|
23595
|
+
* **Wall clock, not ffmpeg's `t`** — and the recorder translates. A caller
|
|
23596
|
+
* derives these bounds from things that happened at a TIME (a track's
|
|
23597
|
+
* `firstSeen`), while `t` runs over the source playlist: the concatenation of
|
|
23598
|
+
* every segment present for the range, with each recording GAP removed. The
|
|
23599
|
+
* two agree only on a window that recorded without one interruption, and only
|
|
23600
|
+
* the render side knows the segments, so the translation lives there
|
|
23601
|
+
* (`export-dense-map.ts`, addon-pipeline).
|
|
23602
|
+
*
|
|
23603
|
+
* It was not always so. These seconds were fed to `between(t,…)` verbatim, and
|
|
23604
|
+
* on a 10 h window holding 29,393 s of footage every range landed late by the
|
|
23605
|
+
* gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
|
|
23606
|
+
* the video was a uniform timelapse, and the log line reported the five ranges
|
|
23607
|
+
* that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
|
|
23608
|
+
*
|
|
23609
|
+
* Relative and not absolute epoch, because an absolute epoch would make every
|
|
23610
|
+
* call site responsible for the same subtraction.
|
|
23611
|
+
*/
|
|
23612
|
+
var ExportDenseRangeSchema = object({
|
|
23613
|
+
fromSec: number().nonnegative(),
|
|
23614
|
+
toSec: number().nonnegative()
|
|
23615
|
+
}).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
|
|
23616
|
+
/**
|
|
23617
|
+
* Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
|
|
23618
|
+
* listed ranges and at the base `everyMs` everywhere else.
|
|
23619
|
+
*
|
|
23620
|
+
* `everyMs` must be strictly smaller than the base cadence — a dense rate that
|
|
23621
|
+
* is not denser renders a uniform timelapse the operator believes is two-rate.
|
|
23622
|
+
*/
|
|
23623
|
+
var ExportDenseSchema = object({
|
|
23624
|
+
everyMs: number().int().positive(),
|
|
23625
|
+
ranges: array(ExportDenseRangeSchema).min(1).max(200)
|
|
23626
|
+
});
|
|
23215
23627
|
/** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
|
|
23216
23628
|
var ExportTimelapseSchema = object({
|
|
23217
23629
|
everyMs: number().int().positive(),
|
|
23218
|
-
outputFps: number().int().min(1).max(60).optional()
|
|
23630
|
+
outputFps: number().int().min(1).max(60).optional(),
|
|
23631
|
+
/** Optional second, FASTER rate over the intervals that matter. */
|
|
23632
|
+
dense: ExportDenseSchema.optional()
|
|
23633
|
+
}).superRefine((v, ctx) => {
|
|
23634
|
+
if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
|
|
23635
|
+
code: ZodIssueCode.custom,
|
|
23636
|
+
message: "dense.everyMs must be strictly smaller than the base everyMs",
|
|
23637
|
+
path: ["dense", "everyMs"]
|
|
23638
|
+
});
|
|
23219
23639
|
});
|
|
23220
23640
|
/**
|
|
23221
23641
|
* Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
|
|
@@ -23273,6 +23693,19 @@ var ExportDownloadSchema = object({
|
|
|
23273
23693
|
url: string(),
|
|
23274
23694
|
endpoints: array(string())
|
|
23275
23695
|
});
|
|
23696
|
+
/**
|
|
23697
|
+
* A finished export's bytes, inline.
|
|
23698
|
+
*
|
|
23699
|
+
* `bytes` is the DECODED length — the number the caller bounds and logs
|
|
23700
|
+
* against, so nobody has to infer it from the base64 length.
|
|
23701
|
+
*/
|
|
23702
|
+
var ExportBytesSchema = object({
|
|
23703
|
+
base64: string(),
|
|
23704
|
+
contentType: string(),
|
|
23705
|
+
/** Suggested filename, extension included. */
|
|
23706
|
+
name: string(),
|
|
23707
|
+
bytes: number().int().nonnegative()
|
|
23708
|
+
});
|
|
23276
23709
|
method(object({
|
|
23277
23710
|
deviceId: number(),
|
|
23278
23711
|
profile: string(),
|
|
@@ -23297,6 +23730,9 @@ method(object({
|
|
|
23297
23730
|
}), method(object({ exportId: string() }), ExportDownloadSchema, {
|
|
23298
23731
|
kind: "query",
|
|
23299
23732
|
auth: "protected"
|
|
23733
|
+
}), method(object({ exportId: string() }), ExportBytesSchema, {
|
|
23734
|
+
kind: "query",
|
|
23735
|
+
auth: "protected"
|
|
23300
23736
|
});
|
|
23301
23737
|
/**
|
|
23302
23738
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
@@ -28490,6 +28926,12 @@ Object.freeze({
|
|
|
28490
28926
|
addonId: null,
|
|
28491
28927
|
access: "create"
|
|
28492
28928
|
},
|
|
28929
|
+
"recording.cancelRelocateJob": {
|
|
28930
|
+
capName: "recording",
|
|
28931
|
+
capScope: "system",
|
|
28932
|
+
addonId: null,
|
|
28933
|
+
access: "create"
|
|
28934
|
+
},
|
|
28493
28935
|
"recording.cancelStorageMigrationMove": {
|
|
28494
28936
|
capName: "recording",
|
|
28495
28937
|
capScope: "system",
|
|
@@ -28544,6 +28986,12 @@ Object.freeze({
|
|
|
28544
28986
|
addonId: null,
|
|
28545
28987
|
access: "view"
|
|
28546
28988
|
},
|
|
28989
|
+
"recording.listRelocateJobs": {
|
|
28990
|
+
capName: "recording",
|
|
28991
|
+
capScope: "system",
|
|
28992
|
+
addonId: null,
|
|
28993
|
+
access: "view"
|
|
28994
|
+
},
|
|
28547
28995
|
"recording.locateSegment": {
|
|
28548
28996
|
capName: "recording",
|
|
28549
28997
|
capScope: "system",
|
|
@@ -28556,6 +29004,12 @@ Object.freeze({
|
|
|
28556
29004
|
addonId: null,
|
|
28557
29005
|
access: "create"
|
|
28558
29006
|
},
|
|
29007
|
+
"recording.planStorageRebalance": {
|
|
29008
|
+
capName: "recording",
|
|
29009
|
+
capScope: "system",
|
|
29010
|
+
addonId: null,
|
|
29011
|
+
access: "view"
|
|
29012
|
+
},
|
|
28559
29013
|
"recording.pruneFootage": {
|
|
28560
29014
|
capName: "recording",
|
|
28561
29015
|
capScope: "system",
|
|
@@ -28580,6 +29034,12 @@ Object.freeze({
|
|
|
28580
29034
|
addonId: null,
|
|
28581
29035
|
access: "create"
|
|
28582
29036
|
},
|
|
29037
|
+
"recording.relocateFootage": {
|
|
29038
|
+
capName: "recording",
|
|
29039
|
+
capScope: "system",
|
|
29040
|
+
addonId: null,
|
|
29041
|
+
access: "create"
|
|
29042
|
+
},
|
|
28583
29043
|
"recording.renderClip": {
|
|
28584
29044
|
capName: "recording",
|
|
28585
29045
|
capScope: "system",
|
|
@@ -28616,38 +29076,50 @@ Object.freeze({
|
|
|
28616
29076
|
addonId: null,
|
|
28617
29077
|
access: "create"
|
|
28618
29078
|
},
|
|
29079
|
+
"recording.startStorageRebalance": {
|
|
29080
|
+
capName: "recording",
|
|
29081
|
+
capScope: "system",
|
|
29082
|
+
addonId: null,
|
|
29083
|
+
access: "create"
|
|
29084
|
+
},
|
|
28619
29085
|
"recordingExport.cancelExport": {
|
|
28620
|
-
capName: "
|
|
29086
|
+
capName: "recording-export",
|
|
28621
29087
|
capScope: "system",
|
|
28622
29088
|
addonId: null,
|
|
28623
29089
|
access: "create"
|
|
28624
29090
|
},
|
|
28625
29091
|
"recordingExport.createExport": {
|
|
28626
|
-
capName: "
|
|
29092
|
+
capName: "recording-export",
|
|
28627
29093
|
capScope: "system",
|
|
28628
29094
|
addonId: null,
|
|
28629
29095
|
access: "create"
|
|
28630
29096
|
},
|
|
28631
29097
|
"recordingExport.deleteExport": {
|
|
28632
|
-
capName: "
|
|
29098
|
+
capName: "recording-export",
|
|
28633
29099
|
capScope: "system",
|
|
28634
29100
|
addonId: null,
|
|
28635
29101
|
access: "delete"
|
|
28636
29102
|
},
|
|
28637
29103
|
"recordingExport.getDownloadUrl": {
|
|
28638
|
-
capName: "
|
|
29104
|
+
capName: "recording-export",
|
|
28639
29105
|
capScope: "system",
|
|
28640
29106
|
addonId: null,
|
|
28641
29107
|
access: "view"
|
|
28642
29108
|
},
|
|
28643
29109
|
"recordingExport.getExport": {
|
|
28644
|
-
capName: "
|
|
29110
|
+
capName: "recording-export",
|
|
28645
29111
|
capScope: "system",
|
|
28646
29112
|
addonId: null,
|
|
28647
29113
|
access: "view"
|
|
28648
29114
|
},
|
|
28649
29115
|
"recordingExport.listExports": {
|
|
28650
|
-
capName: "
|
|
29116
|
+
capName: "recording-export",
|
|
29117
|
+
capScope: "system",
|
|
29118
|
+
addonId: null,
|
|
29119
|
+
access: "view"
|
|
29120
|
+
},
|
|
29121
|
+
"recordingExport.readExportBytes": {
|
|
29122
|
+
capName: "recording-export",
|
|
28651
29123
|
capScope: "system",
|
|
28652
29124
|
addonId: null,
|
|
28653
29125
|
access: "view"
|
|
@@ -30024,6 +30496,104 @@ var FramerateField = number().int().min(1).max(60);
|
|
|
30024
30496
|
var TargetsField = array(NcRuleTargetSchema).min(1);
|
|
30025
30497
|
var PriorityField = number().int().min(1).max(5);
|
|
30026
30498
|
/**
|
|
30499
|
+
* Explicit override of the DENSE sampling cadence, seconds.
|
|
30500
|
+
*
|
|
30501
|
+
* Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
|
|
30502
|
+
* 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
|
|
30503
|
+
* made that same base 3 s and rendered a person pass as two frames.)
|
|
30504
|
+
*
|
|
30505
|
+
* THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
|
|
30506
|
+
* `denseCadenceSec` and played at `framerate` occupies
|
|
30507
|
+
*
|
|
30508
|
+
* outputSeconds = (rangeSec / denseCadenceSec) / framerate
|
|
30509
|
+
*
|
|
30510
|
+
* 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.
|
|
30511
|
+
* Halving this field doubles the frames INSIDE ranges only — the base cadence,
|
|
30512
|
+
* and therefore the length of a quiet night, does not move.
|
|
30513
|
+
*
|
|
30514
|
+
* Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
|
|
30515
|
+
* the recording has them returns the same frames, requested twice. Must be
|
|
30516
|
+
* STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
|
|
30517
|
+
* a uniform video the operator believes is two-rate — and upsert refuses it
|
|
30518
|
+
* rather than letting the export cap reject the render hours after the window.
|
|
30519
|
+
*/
|
|
30520
|
+
var DenseCadenceSecField = number().min(.1).max(3600);
|
|
30521
|
+
/**
|
|
30522
|
+
* Minimum seconds of OUTPUT video each detection range must occupy.
|
|
30523
|
+
*
|
|
30524
|
+
* The operator-facing form of the arithmetic above: instead of solving for a
|
|
30525
|
+
* cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
|
|
30526
|
+
* 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
|
|
30527
|
+
* that range every ~583 ms.
|
|
30528
|
+
*
|
|
30529
|
+
* ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
|
|
30530
|
+
* ranges are terms of a single ffmpeg `select` expression that cannot vary rate
|
|
30531
|
+
* per term — so the MOST DEMANDING (shortest) range sets the rate and longer
|
|
30532
|
+
* ranges are sampled denser than they need. Per-range cadences require a cap
|
|
30533
|
+
* schema change and are the tracked follow-up.
|
|
30534
|
+
*
|
|
30535
|
+
* A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
|
|
30536
|
+
* is rendered with every frame that EXISTS and no more: the guarantee is capped
|
|
30537
|
+
* by real footage, never met by duplicating frames into motion that never
|
|
30538
|
+
* happened.
|
|
30539
|
+
*/
|
|
30540
|
+
var MinDwellSecField = number().min(0).max(60);
|
|
30541
|
+
/**
|
|
30542
|
+
* Caption burned into the notification's preview frame.
|
|
30543
|
+
*
|
|
30544
|
+
* Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
|
|
30545
|
+
* `rule`, `from`, `to`) and rendered by the SAME renderer — a second
|
|
30546
|
+
* templating dialect for one field would be a second thing to explain.
|
|
30547
|
+
*
|
|
30548
|
+
* Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
|
|
30549
|
+
* operator saying "the frame, no caption" — a distinct, reachable answer, and
|
|
30550
|
+
* the reason this is not `.min(1)`.
|
|
30551
|
+
*/
|
|
30552
|
+
var PreviewTextField = string().max(200);
|
|
30553
|
+
/**
|
|
30554
|
+
* Whether the notification's preview is a STILL or a short animation.
|
|
30555
|
+
*
|
|
30556
|
+
* The operator's ask, verbatim: *"inviato come gif o video (come per le altre
|
|
30557
|
+
* rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
|
|
30558
|
+
* night reads better as three seconds of motion than as one frame of it. Both
|
|
30559
|
+
* modes get the SAME treatment (blurred frame, large centred title); `'gif'`
|
|
30560
|
+
* simply applies it to a dozen frames sampled across the render and assembles
|
|
30561
|
+
* them.
|
|
30562
|
+
*
|
|
30563
|
+
* `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
|
|
30564
|
+
* seeks and a palette pass, and no rule that never asked for one should start
|
|
30565
|
+
* paying that on the deploy that shipped it.
|
|
30566
|
+
*
|
|
30567
|
+
* A GIF that cannot be assembled DEGRADES to the still — never to nothing.
|
|
30568
|
+
*/
|
|
30569
|
+
var PreviewModeField = _enum(["image", "gif"]);
|
|
30570
|
+
/**
|
|
30571
|
+
* Which detection classes the notification reports counts for.
|
|
30572
|
+
*
|
|
30573
|
+
* The counts come from the tracks the render ALREADY fetched for its dense-range
|
|
30574
|
+
* plan — no second query — aggregated per class. Absent or empty means "every
|
|
30575
|
+
* class the window actually contained", which is what an operator who never
|
|
30576
|
+
* opened the field wants; a list narrows it (`['person']` on a driveway that
|
|
30577
|
+
* counts cars all night).
|
|
30578
|
+
*
|
|
30579
|
+
* Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
|
|
30580
|
+
* …). An unknown name simply never matches and reports nothing — it is not an
|
|
30581
|
+
* error, because a rule may legitimately name a class this camera's model does
|
|
30582
|
+
* not emit.
|
|
30583
|
+
*
|
|
30584
|
+
* The counts are exposed to {@link TimelapseTemplateSchema} as:
|
|
30585
|
+
* - `{{detections}}` — total over the reported classes
|
|
30586
|
+
* - `{{detectionSummary}}` — `2 persone, 1 veicolo`
|
|
30587
|
+
* - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
|
|
30588
|
+
* one per class, `count_` + the class name
|
|
30589
|
+
*
|
|
30590
|
+
* With NO custom body template the summary is appended to the derived body, and
|
|
30591
|
+
* only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
|
|
30592
|
+
* reads. With a custom template the operator owns every word — nothing is
|
|
30593
|
+
* appended, so `{{detectionSummary}}` is how he asks for it.
|
|
30594
|
+
*/
|
|
30595
|
+
var ReportClassesField = array(string().min(1).max(40)).max(20);
|
|
30596
|
+
/**
|
|
30027
30597
|
* Client-supplied timelapse-rule fields. The server stamps id / createdBy /
|
|
30028
30598
|
* createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
|
|
30029
30599
|
* here (see the ownership note above).
|
|
@@ -30043,9 +30613,30 @@ var TimelapseRuleInputSchema = object({
|
|
|
30043
30613
|
cadenceSec: CadenceSecField.default(15),
|
|
30044
30614
|
/** Output frames per second of the assembled mp4 (predecessor parity). */
|
|
30045
30615
|
framerate: FramerateField.default(10),
|
|
30616
|
+
/**
|
|
30617
|
+
* Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
|
|
30618
|
+
* as `max(1s, cadenceSec / 30)`, which is what every rule written before this
|
|
30619
|
+
* field gets.
|
|
30620
|
+
*/
|
|
30621
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
30622
|
+
/** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
|
|
30623
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
30046
30624
|
/** `notification-output` targets the finished video/thumbnail is sent to. */
|
|
30047
30625
|
targets: TargetsField,
|
|
30048
30626
|
template: TimelapseTemplateSchema.optional(),
|
|
30627
|
+
/**
|
|
30628
|
+
* Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
|
|
30629
|
+
* and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
|
|
30630
|
+
*
|
|
30631
|
+
* Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
|
|
30632
|
+
* the notification's title/body, and clearing it (`template: null`) must not
|
|
30633
|
+
* silently clear the caption too.
|
|
30634
|
+
*/
|
|
30635
|
+
previewText: PreviewTextField.optional(),
|
|
30636
|
+
/** Still or animation — see {@link PreviewModeField}. */
|
|
30637
|
+
previewMode: PreviewModeField.default("image"),
|
|
30638
|
+
/** Classes the notification counts — see {@link ReportClassesField}. */
|
|
30639
|
+
reportClasses: ReportClassesField.optional(),
|
|
30049
30640
|
/** Canonical notification priority ordinal (1..5); per-target overridable. */
|
|
30050
30641
|
priority: PriorityField.default(3)
|
|
30051
30642
|
});
|
|
@@ -30056,8 +30647,13 @@ object({
|
|
|
30056
30647
|
schedule: NcScheduleSchema.optional(),
|
|
30057
30648
|
cadenceSec: CadenceSecField.optional(),
|
|
30058
30649
|
framerate: FramerateField.optional(),
|
|
30650
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
30651
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
30059
30652
|
targets: TargetsField.optional(),
|
|
30060
30653
|
template: TimelapseTemplateSchema.nullable().optional(),
|
|
30654
|
+
previewText: PreviewTextField.optional(),
|
|
30655
|
+
previewMode: PreviewModeField.optional(),
|
|
30656
|
+
reportClasses: ReportClassesField.optional(),
|
|
30061
30657
|
priority: PriorityField.optional()
|
|
30062
30658
|
});
|
|
30063
30659
|
TimelapseRuleInputSchema.extend({
|
|
@@ -30069,10 +30665,28 @@ TimelapseRuleInputSchema.extend({
|
|
|
30069
30665
|
*/
|
|
30070
30666
|
ownerUserId: string().optional(),
|
|
30071
30667
|
/**
|
|
30072
|
-
* Epoch-ms of the
|
|
30073
|
-
*
|
|
30668
|
+
* Epoch-ms of the NEWEST successful generation across every camera of this
|
|
30669
|
+
* rule. What a UI shows, and the compatibility floor for
|
|
30670
|
+
* {@link readTimelapseGeneratedAt}. Absent = never generated.
|
|
30074
30671
|
*/
|
|
30075
30672
|
lastGeneratedAt: number().optional(),
|
|
30673
|
+
/**
|
|
30674
|
+
* PER-CAMERA generation state, keyed by `String(deviceId)` — the
|
|
30675
|
+
* re-generation guard's real durable state.
|
|
30676
|
+
*
|
|
30677
|
+
* One rule covers several cameras and each renders its own video, so a rule
|
|
30678
|
+
* -wide stamp is wrong in the direction that DESTROYS work: camera A
|
|
30679
|
+
* succeeding at 06:05 tells camera B, whose render failed, that it is
|
|
30680
|
+
* already done — and B's night is gone for good, because the window will not
|
|
30681
|
+
* come back.
|
|
30682
|
+
*
|
|
30683
|
+
* ADDITIVE, so the migration is free: a row written before this field simply
|
|
30684
|
+
* has no map, and {@link readTimelapseGeneratedAt} falls back to
|
|
30685
|
+
* {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
|
|
30686
|
+
* "never generated" would re-render and re-notify every camera of every rule
|
|
30687
|
+
* once, on the deploy that shipped the map.
|
|
30688
|
+
*/
|
|
30689
|
+
generatedByDevice: record(string(), number()).optional(),
|
|
30076
30690
|
/** userId of the caller who created the rule (server-stamped). */
|
|
30077
30691
|
createdBy: string(),
|
|
30078
30692
|
createdAt: number(),
|
|
@@ -30123,25 +30737,32 @@ object({
|
|
|
30123
30737
|
var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
|
|
30124
30738
|
object({
|
|
30125
30739
|
/**
|
|
30126
|
-
* How
|
|
30740
|
+
* How many delivered frames the worker HOLDS at once, waiting for each one's
|
|
30741
|
+
* detection result.
|
|
30742
|
+
*
|
|
30743
|
+
* This replaced a TTL on 2026-08-13, and the replacement is the whole point:
|
|
30744
|
+
* a time window was never related to the event the pixels were waiting for.
|
|
30745
|
+
* A held frame now lives from delivery until the runner has its `FrameResult`
|
|
30746
|
+
* — at which moment the runner cuts the subject tiles it actually wanted and
|
|
30747
|
+
* releases the frame. The bound exists only so a runner that stops answering
|
|
30748
|
+
* cannot pin RAM: above it the OLDEST held frame is dropped and counted.
|
|
30127
30749
|
*
|
|
30128
|
-
*
|
|
30129
|
-
*
|
|
30130
|
-
*
|
|
30131
|
-
*
|
|
30132
|
-
*
|
|
30750
|
+
* Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
|
|
30751
|
+
* 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
|
|
30752
|
+
* without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
|
|
30753
|
+
* Raising it does not buy hit rate — it buys tolerance for a slow runner, and
|
|
30754
|
+
* `holdOverflow` on the metrics line is what says you need it.
|
|
30133
30755
|
*/
|
|
30134
|
-
|
|
30756
|
+
holdFrames: number().int().min(1).max(64),
|
|
30135
30757
|
/**
|
|
30136
30758
|
* Hard per-decode-worker RAM ceiling for retained native frames, in MB.
|
|
30137
30759
|
*
|
|
30138
|
-
*
|
|
30139
|
-
*
|
|
30140
|
-
*
|
|
30141
|
-
*
|
|
30142
|
-
*
|
|
30143
|
-
*
|
|
30144
|
-
* rather than giving RAM back — lower this knob if RAM is what you wanted.
|
|
30760
|
+
* Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
|
|
30761
|
+
* is what decides how much is held, and the ceiling is the number above which
|
|
30762
|
+
* something is wrong. Before that it was the effective cap — at 1024 MB with
|
|
30763
|
+
* a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
|
|
30764
|
+
* with the TTL expiring nothing, which is exactly the confusion the hold
|
|
30765
|
+
* removes. `leaseMb` / `leaseFrames` still say what is resident.
|
|
30145
30766
|
* `0` DISABLES the lease entirely and falls the worker back to the tiny
|
|
30146
30767
|
* leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
|
|
30147
30768
|
* to replace).
|
|
@@ -30167,22 +30788,45 @@ object({
|
|
|
30167
30788
|
* there is the signal that some caller names frames outside the inference set
|
|
30168
30789
|
* and that this must go back to `all`.
|
|
30169
30790
|
*/
|
|
30170
|
-
admission: NativeLeaseAdmissionSchema
|
|
30791
|
+
admission: NativeLeaseAdmissionSchema,
|
|
30792
|
+
/**
|
|
30793
|
+
* RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
|
|
30794
|
+
* compressed native crops the worker cuts at the moment a frame's detection
|
|
30795
|
+
* result arrives, and keeps long after the frame itself is freed.
|
|
30796
|
+
*
|
|
30797
|
+
* This is the knob that replaced the old retention window, and it buys about
|
|
30798
|
+
* three orders of magnitude more of it: a tile is one subject at native
|
|
30799
|
+
* resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
|
|
30800
|
+
* the frame it was cut from. A frame on which nothing was detected costs
|
|
30801
|
+
* nothing at all, which is the real change — the old lease paid per FRAME and
|
|
30802
|
+
* was interrogated per SUBJECT.
|
|
30803
|
+
*
|
|
30804
|
+
* `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
|
|
30805
|
+
* fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
|
|
30806
|
+
* reproduce that.
|
|
30807
|
+
*/
|
|
30808
|
+
tileBudgetMb: number().int().min(0).max(1024)
|
|
30171
30809
|
});
|
|
30172
30810
|
/**
|
|
30173
|
-
* The values in force when the operator has set nothing
|
|
30174
|
-
*
|
|
30175
|
-
*
|
|
30811
|
+
* The values in force when the operator has set nothing.
|
|
30812
|
+
*
|
|
30813
|
+
* `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
|
|
30814
|
+
* being the retention window and became the OOM ceiling, and lowering a ceiling
|
|
30815
|
+
* in the same change that redefines it would make a regression and a retune
|
|
30816
|
+
* indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
|
|
30817
|
+
* live traffic.
|
|
30176
30818
|
*/
|
|
30177
30819
|
var DEFAULT_NATIVE_LEASE_SETTINGS = {
|
|
30178
|
-
|
|
30820
|
+
holdFrames: 8,
|
|
30179
30821
|
budgetMb: 1024,
|
|
30180
30822
|
activityMs: 15e3,
|
|
30823
|
+
tileBudgetMb: 64,
|
|
30181
30824
|
admission: "inferred"
|
|
30182
30825
|
};
|
|
30183
|
-
DEFAULT_NATIVE_LEASE_SETTINGS.
|
|
30826
|
+
DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
|
|
30184
30827
|
DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
|
|
30185
30828
|
DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
|
|
30829
|
+
DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
|
|
30186
30830
|
DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
30187
30831
|
//#endregion
|
|
30188
30832
|
//#region src/static-turn.addon.ts
|