@camstack/addon-remote-storage 1.2.12 → 1.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/s3.addon.js +1 -1
- package/dist/s3.addon.mjs +1 -1
- package/dist/sftp.addon.js +1 -1
- package/dist/sftp.addon.mjs +1 -1
- package/dist/{shared-1q5AVmdq.js → shared-CgYcIB-Z.js} +625 -22
- package/dist/{shared-SriyOObK.mjs → shared-saei9-aP.mjs} +625 -22
- package/dist/webdav.addon.js +1 -1
- package/dist/webdav.addon.mjs +1 -1
- package/package.json +1 -1
|
@@ -7213,8 +7213,31 @@ var AdoptionJobSchema = object({
|
|
|
7213
7213
|
error: string().nullable()
|
|
7214
7214
|
});
|
|
7215
7215
|
/**
|
|
7216
|
-
* Per-camera FUNCTION SWITCHES
|
|
7217
|
-
*
|
|
7216
|
+
* Per-camera FUNCTION SWITCHES.
|
|
7217
|
+
*
|
|
7218
|
+
* ## The aggregate group is being withdrawn — the BADGE is not (D113)
|
|
7219
|
+
*
|
|
7220
|
+
* This file shipped as "the one coherent on/off surface over the pipeline
|
|
7221
|
+
* functions an operator thinks in terms of". The operator's verdict on
|
|
7222
|
+
* 2026-08-12 was that the coherent surface bought complexity and no clarity:
|
|
7223
|
+
* every function already had a settings page of its own, and a second place to
|
|
7224
|
+
* turn it off is a second place to look. Each switch is going back to its own
|
|
7225
|
+
* component's original options — detection to the detection-pipeline wrapper
|
|
7226
|
+
* binding, audio analysis to its own, recording to `RecordingConfig.enabled`
|
|
7227
|
+
* (which was always first-class; the switch was a veneer over
|
|
7228
|
+
* `recording.setDeviceConfig`), notifications to a notification-center
|
|
7229
|
+
* per-device setting, the two camera planes to their own components.
|
|
7230
|
+
*
|
|
7231
|
+
* What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
|
|
7232
|
+
* thing that lets a status surface say DISABLED instead of BROKEN, recomposed
|
|
7233
|
+
* straight from the authorities with no group in the middle. That rule was
|
|
7234
|
+
* never about a control panel.
|
|
7235
|
+
*
|
|
7236
|
+
* Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
|
|
7237
|
+
* {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
|
|
7238
|
+
* `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
|
|
7239
|
+
* viewers (v1.0.305) and the admin UI still call it. It is deleted when they
|
|
7240
|
+
* stop; nothing new may be built on it.
|
|
7218
7241
|
*
|
|
7219
7242
|
* ## This file adds no state
|
|
7220
7243
|
*
|
|
@@ -7565,7 +7588,15 @@ var RecordingConfigSchema = object({
|
|
|
7565
7588
|
* Each completed/failed run also lands one durable ops-log row on its owning
|
|
7566
7589
|
* addon surface.
|
|
7567
7590
|
*/
|
|
7591
|
+
/**
|
|
7592
|
+
* `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
|
|
7593
|
+
* rebalance enqueues one job per (camera, profile). Refusing the second job —
|
|
7594
|
+
* what the engine did before — turned a fifteen-camera rebalance into fifteen
|
|
7595
|
+
* manual retries. Queued jobs run FIFO; a queued job that is cancelled never
|
|
7596
|
+
* runs at all.
|
|
7597
|
+
*/
|
|
7568
7598
|
var RelocateJobStateSchema = _enum([
|
|
7599
|
+
"queued",
|
|
7569
7600
|
"running",
|
|
7570
7601
|
"done",
|
|
7571
7602
|
"failed",
|
|
@@ -7600,6 +7631,15 @@ var RelocateFootageInputSchema = object({
|
|
|
7600
7631
|
/** Limits relocation to the logical profile class. Omit only for the
|
|
7601
7632
|
* pre-orchestration compatibility path. */
|
|
7602
7633
|
footageClass: RelocateFootageClassSchema.optional(),
|
|
7634
|
+
/** Scope the move to ONE camera. Absent = every camera on the source, which
|
|
7635
|
+
* is what a whole-disk drain means. The rebalance path always sets it: its
|
|
7636
|
+
* unit is a (camera, profile) pile, not a disk. */
|
|
7637
|
+
deviceId: number().int().optional(),
|
|
7638
|
+
/** Scope the move to specific segment profiles (`high` / `mid` / `low`).
|
|
7639
|
+
* Finer than `footageClass`, which cannot separate high from mid — and the
|
|
7640
|
+
* placement plan assigns those two independently, so a rebalance that could
|
|
7641
|
+
* only say "recordings" would move footage the plan never asked to move. */
|
|
7642
|
+
profiles: array(string()).optional(),
|
|
7603
7643
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
7604
7644
|
* never allowed to starve live writers. */
|
|
7605
7645
|
throttleMbps: number().min(1).max(1e3).optional()
|
|
@@ -7735,6 +7775,21 @@ var StorageLocationSchema = object({
|
|
|
7735
7775
|
nodeId: string().optional(),
|
|
7736
7776
|
isDefault: boolean().default(false),
|
|
7737
7777
|
isSystem: boolean().default(false),
|
|
7778
|
+
/**
|
|
7779
|
+
* Operator opt-in: whether consumers that BALANCE across several locations
|
|
7780
|
+
* of a type may write here. Recordings reads it today; event media and
|
|
7781
|
+
* backups are the next consumers, which is why the flag lives on the
|
|
7782
|
+
* location rather than in any one addon's store — nothing has to be
|
|
7783
|
+
* extended to add the next consumer.
|
|
7784
|
+
*
|
|
7785
|
+
* OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
|
|
7786
|
+
* flag existed reads back with no flag and keeps working exactly as before;
|
|
7787
|
+
* that is the whole compat story, and it is why no migration ships with it.
|
|
7788
|
+
* A newly CREATED sibling is stamped `false` by the orchestrator (creating a
|
|
7789
|
+
* disk must not silently start writing to it); the default of a type is
|
|
7790
|
+
* always stamped `true`.
|
|
7791
|
+
*/
|
|
7792
|
+
enabled: boolean().optional(),
|
|
7738
7793
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
7739
7794
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
7740
7795
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -12037,7 +12092,8 @@ method(object({
|
|
|
12037
12092
|
}), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
|
|
12038
12093
|
/**
|
|
12039
12094
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
12040
|
-
* filesystem
|
|
12095
|
+
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
12096
|
+
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
12041
12097
|
* admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
|
|
12042
12098
|
* (one provider per node); the hub calls it with `{nodeId}` so the codegen
|
|
12043
12099
|
* routes to that exact node (default `nodeIdMode:'routing'`).
|
|
@@ -13850,6 +13906,13 @@ var MaskGridDimsSchema = object({
|
|
|
13850
13906
|
* `package-event` are pure trigger kinds (no urgency dimension). Extending
|
|
13851
13907
|
* this one field keeps the schema additive — a rule still declares exactly
|
|
13852
13908
|
* one trigger.
|
|
13909
|
+
*
|
|
13910
|
+
* AUDIO rules add no member here, for the reason occupancy added none: the
|
|
13911
|
+
* enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
|
|
13912
|
+
* mirror.ts` fails the build on a member the app cannot render) and every
|
|
13913
|
+
* member costs a release train. A sustained-sound rule is therefore an
|
|
13914
|
+
* `immediate` rule carrying {@link NcConditions.audio} — the condition is the
|
|
13915
|
+
* trigger discriminator, exactly as `occupancy` is on `device-event`.
|
|
13853
13916
|
*/
|
|
13854
13917
|
var NcDeliverySchema = _enum([
|
|
13855
13918
|
"immediate",
|
|
@@ -13864,15 +13927,32 @@ var NcDeliverySchema = _enum([
|
|
|
13864
13927
|
* depend on a provider's raw event name or payload shape.
|
|
13865
13928
|
*/
|
|
13866
13929
|
var NcSystemEventKindSchema = _enum([
|
|
13867
|
-
"
|
|
13868
|
-
"
|
|
13930
|
+
"device-online",
|
|
13931
|
+
"device-offline",
|
|
13932
|
+
"device-disabled",
|
|
13933
|
+
"device-enabled",
|
|
13869
13934
|
"stream-online",
|
|
13870
13935
|
"stream-offline",
|
|
13871
13936
|
"node-online",
|
|
13872
13937
|
"node-offline",
|
|
13873
13938
|
"addon-update-available",
|
|
13874
|
-
"server-update-available"
|
|
13939
|
+
"server-update-available",
|
|
13940
|
+
"alarm-triggered",
|
|
13941
|
+
"alarm-armed",
|
|
13942
|
+
"alarm-disarmed",
|
|
13943
|
+
"camera-online",
|
|
13944
|
+
"camera-offline",
|
|
13945
|
+
"camera-disabled",
|
|
13946
|
+
"camera-enabled"
|
|
13947
|
+
]);
|
|
13948
|
+
/** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
|
|
13949
|
+
var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
|
|
13950
|
+
"camera-online",
|
|
13951
|
+
"camera-offline",
|
|
13952
|
+
"camera-disabled",
|
|
13953
|
+
"camera-enabled"
|
|
13875
13954
|
]);
|
|
13955
|
+
NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
|
|
13876
13956
|
/**
|
|
13877
13957
|
* One coherent system-event condition. `kinds` is the required opt-in safety
|
|
13878
13958
|
* gate; the remaining lists are optional narrowing filters relevant to the
|
|
@@ -13881,6 +13961,18 @@ var NcSystemEventKindSchema = _enum([
|
|
|
13881
13961
|
var NcSystemEventConditionSchema = object({
|
|
13882
13962
|
kinds: array(NcSystemEventKindSchema).min(1),
|
|
13883
13963
|
deviceIds: array(number().int()).min(1).optional(),
|
|
13964
|
+
/**
|
|
13965
|
+
* Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
|
|
13966
|
+
* `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
|
|
13967
|
+
* is what a liveness rule means when nobody said otherwise.
|
|
13968
|
+
*
|
|
13969
|
+
* This is where "only my cameras" is expressed, and it lives on the rule for
|
|
13970
|
+
* one reason: the intake cannot know which devices this household cares
|
|
13971
|
+
* about, and a producer-side filter is one no operator can change. Fails
|
|
13972
|
+
* CLOSED — a subject whose device type is unknown (an id the device mirror
|
|
13973
|
+
* does not carry) matches no `deviceTypes` list.
|
|
13974
|
+
*/
|
|
13975
|
+
deviceTypes: array(string().min(1)).min(1).optional(),
|
|
13884
13976
|
nodeIds: array(string().min(1)).min(1).optional(),
|
|
13885
13977
|
packageNames: array(string().min(1)).min(1).optional()
|
|
13886
13978
|
});
|
|
@@ -13931,6 +14023,47 @@ var NcOccupancyConditionSchema = object({
|
|
|
13931
14023
|
sustainSeconds: number().int().min(0).max(3600).default(15)
|
|
13932
14024
|
});
|
|
13933
14025
|
/**
|
|
14026
|
+
* Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
|
|
14027
|
+
*
|
|
14028
|
+
* Operator-approved vocabulary (2026-08-12, option A — the same one the
|
|
14029
|
+
* reference notifier uses, so an operator moving between them re-uses what
|
|
14030
|
+
* they already know): a rule matches when, over a sampling window of
|
|
14031
|
+
* `samplingSeconds`, at least `hitPercent`% of the audio samples in that
|
|
14032
|
+
* window are HITS. A sample is a hit when it satisfies BOTH present filters:
|
|
14033
|
+
*
|
|
14034
|
+
* - `dbThreshold` — its level is at or above this many dBFS (see
|
|
14035
|
+
* {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
|
|
14036
|
+
* - `labels` — the classifier put at least one of these labels on it.
|
|
14037
|
+
*
|
|
14038
|
+
* Both are OPTIONAL and independent, which is the point of the shape: a
|
|
14039
|
+
* loudness rule ("something loud at 3am") needs no model to be right, and a
|
|
14040
|
+
* label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
|
|
14041
|
+
* is given** — a window in which every sample is trivially a hit would fire on
|
|
14042
|
+
* silence, so the engine refuses such a condition rather than notifying on
|
|
14043
|
+
* nothing (the schema cannot express "at least one of" without becoming a
|
|
14044
|
+
* ZodEffects the cap path would have to special-case).
|
|
14045
|
+
*
|
|
14046
|
+
* `hitPercent` is over the samples the window actually HOLDS, and the window
|
|
14047
|
+
* must be FULL before it can match — a window that has been open for two
|
|
14048
|
+
* seconds of its ten is 100% of nothing, and firing on it would make
|
|
14049
|
+
* `samplingSeconds` decorative.
|
|
14050
|
+
*
|
|
14051
|
+
* Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
|
|
14052
|
+
* `audio-*` ids). Both spellings are accepted — the matcher normalizes the
|
|
14053
|
+
* `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
|
|
14054
|
+
* an operator who typed `dog` mean the same thing.
|
|
14055
|
+
*/
|
|
14056
|
+
var NcAudioConditionSchema = object({
|
|
14057
|
+
/** Audio macro labels; absent = any sound (level-only rule). */
|
|
14058
|
+
labels: array(string().min(1)).min(1).optional(),
|
|
14059
|
+
/** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
|
|
14060
|
+
dbThreshold: number().min(-96).max(0).optional(),
|
|
14061
|
+
/** Percentage of the window's samples that must be hits (1–100). */
|
|
14062
|
+
hitPercent: number().int().min(1).max(100).default(60),
|
|
14063
|
+
/** Length of the sampling window in seconds. */
|
|
14064
|
+
samplingSeconds: number().int().min(1).max(300).default(10)
|
|
14065
|
+
});
|
|
14066
|
+
/**
|
|
13934
14067
|
* Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
|
|
13935
14068
|
*
|
|
13936
14069
|
* The values are not symmetric, and deliberately so — the absent value has to
|
|
@@ -14203,7 +14336,33 @@ var NcConditionsSchema = object({
|
|
|
14203
14336
|
* threshold and holds for `sustainSeconds`. Fail-closed on missing
|
|
14204
14337
|
* substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
|
|
14205
14338
|
*/
|
|
14206
|
-
occupancy: NcOccupancyConditionSchema.optional()
|
|
14339
|
+
occupancy: NcOccupancyConditionSchema.optional(),
|
|
14340
|
+
/**
|
|
14341
|
+
* IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
|
|
14342
|
+
* `samplingSeconds` window clear the optional `dbThreshold` and carry one of
|
|
14343
|
+
* the optional `labels`. Fail-closed on missing substrate (no audio samples,
|
|
14344
|
+
* a window that is not full yet, neither filter given). See
|
|
14345
|
+
* {@link NcAudioCondition}.
|
|
14346
|
+
*
|
|
14347
|
+
* Presence of this key is what makes a rule an AUDIO rule: the engine fires
|
|
14348
|
+
* it ONLY on a confirmed audio window, and a rule carrying it never fires on
|
|
14349
|
+
* a detection, a track or a device event (the same fail-closed pairing
|
|
14350
|
+
* `occupancy` has with the `device-event` trigger). That is how audio labels
|
|
14351
|
+
* leave `classes`: an audio rule names its sounds HERE, and the legacy path
|
|
14352
|
+
* (an `immediate` rule naming an `audio-*` class, one notification per
|
|
14353
|
+
* classified sample) stays exactly as it was for rules that already use it.
|
|
14354
|
+
*
|
|
14355
|
+
* NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
|
|
14356
|
+
* rather than an oversight: the viewer mirrors the descriptor enums BY HAND
|
|
14357
|
+
* (`camstack/src/data/notification-center.ts`, guarded by
|
|
14358
|
+
* `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
|
|
14359
|
+
* condition fields it does not know when a rule is saved from the phone.
|
|
14360
|
+
* Publishing an editor for a condition the app cannot round-trip is how an
|
|
14361
|
+
* operator loses a rule's conditions by opening it — so the descriptor, the
|
|
14362
|
+
* admin widget and the viewer mirror land together (P2 + P3), and only then
|
|
14363
|
+
* does an audio rule become authorable.
|
|
14364
|
+
*/
|
|
14365
|
+
audio: NcAudioConditionSchema.optional()
|
|
14207
14366
|
});
|
|
14208
14367
|
/** One delivery target: a `notification-output` Target ref + passthrough params. */
|
|
14209
14368
|
var NcRuleTargetSchema = object({
|
|
@@ -14317,6 +14476,73 @@ var NcThrottleSchema = object({
|
|
|
14317
14476
|
*/
|
|
14318
14477
|
granularity: NcThrottleGranularitySchema.optional()
|
|
14319
14478
|
});
|
|
14479
|
+
/**
|
|
14480
|
+
* How long the confirm gate may hold ONE notification, and how big the picture
|
|
14481
|
+
* it judges may be.
|
|
14482
|
+
*
|
|
14483
|
+
* The clamp is the product decision, not a coincidence of the model: p50 was
|
|
14484
|
+
* 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
|
|
14485
|
+
* arrives after the visitor has gone is not a notification. 448 px was enough
|
|
14486
|
+
* to score 16/16 on the operator's parking scenario — bigger costs latency and
|
|
14487
|
+
* tokens for pixels the model pools away.
|
|
14488
|
+
*/
|
|
14489
|
+
var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
|
|
14490
|
+
var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
|
|
14491
|
+
var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
|
|
14492
|
+
/** Comparison the model's COUNT must satisfy for the notification to fire. */
|
|
14493
|
+
var NcConfirmExpectSchema = object({
|
|
14494
|
+
op: _enum([
|
|
14495
|
+
">=",
|
|
14496
|
+
">",
|
|
14497
|
+
"<=",
|
|
14498
|
+
"<",
|
|
14499
|
+
"=="
|
|
14500
|
+
]),
|
|
14501
|
+
count: number().int().min(0).max(1e3)
|
|
14502
|
+
});
|
|
14503
|
+
/**
|
|
14504
|
+
* AI CONFIRM — a vision model looks at the picture this notification is about
|
|
14505
|
+
* to ship and says whether it agrees with the rule.
|
|
14506
|
+
*
|
|
14507
|
+
* It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
|
|
14508
|
+
* crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
|
|
14509
|
+
* on the operator's phone is not a verdict about this notification.
|
|
14510
|
+
*
|
|
14511
|
+
* FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
|
|
14512
|
+
* whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
|
|
14513
|
+
* the default and every fail-open is COUNTED, because a gate that always fails
|
|
14514
|
+
* open looks in the log exactly like a gate that works.
|
|
14515
|
+
*
|
|
14516
|
+
* Every field is `.optional()` rather than relied on as a Zod default at the
|
|
14517
|
+
* runtime seam: a Zod default does NOT run on the addon→addon cap path (three
|
|
14518
|
+
* production failures in one day), so the gate reads absent as the constant
|
|
14519
|
+
* above rather than trusting a parse it may never have seen.
|
|
14520
|
+
*/
|
|
14521
|
+
var NcConfirmSchema = object({
|
|
14522
|
+
/** Off unless asked for. An absent `confirm` and `enabled:false` are the
|
|
14523
|
+
* same thing, and both mean "deliver exactly as before". */
|
|
14524
|
+
enabled: boolean().default(false),
|
|
14525
|
+
/** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
|
|
14526
|
+
profileId: string().optional(),
|
|
14527
|
+
/**
|
|
14528
|
+
* The operator's question, in his own words. Absent = a question derived
|
|
14529
|
+
* from the rule (its class and its expectation).
|
|
14530
|
+
*
|
|
14531
|
+
* NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
|
|
14532
|
+
* banners, signage and plates as instructions if you let them reach the
|
|
14533
|
+
* prompt — proven live — so the authoritative contract stays in the system
|
|
14534
|
+
* turn and only rule-authored words land here.
|
|
14535
|
+
*/
|
|
14536
|
+
prompt: string().max(1e3).optional(),
|
|
14537
|
+
/** Fire only when the model's count satisfies this. Absent = the model's
|
|
14538
|
+
* own boolean verdict decides. */
|
|
14539
|
+
expect: NcConfirmExpectSchema.optional(),
|
|
14540
|
+
timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
|
|
14541
|
+
/** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
|
|
14542
|
+
onTimeout: _enum(["fire", "suppress"]).default("fire"),
|
|
14543
|
+
/** Longest edge the judged image is downscaled to before it is sent. */
|
|
14544
|
+
maxImagePx: number().int().min(64).max(2048).default(448)
|
|
14545
|
+
});
|
|
14320
14546
|
/** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
|
|
14321
14547
|
var NcRuleInputSchema = object({
|
|
14322
14548
|
name: string().min(1).max(200),
|
|
@@ -14377,7 +14603,13 @@ var NcRuleInputSchema = object({
|
|
|
14377
14603
|
* `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
|
|
14378
14604
|
* shape as every other actuation.
|
|
14379
14605
|
*/
|
|
14380
|
-
actions: NcRuleActionsSchema.optional()
|
|
14606
|
+
actions: NcRuleActionsSchema.optional(),
|
|
14607
|
+
/**
|
|
14608
|
+
* AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
|
|
14609
|
+
* a rule that predates the gate must keep delivering byte-for-byte as it
|
|
14610
|
+
* did, and absent is the only way to say that without a migration.
|
|
14611
|
+
*/
|
|
14612
|
+
confirm: NcConfirmSchema.optional()
|
|
14381
14613
|
});
|
|
14382
14614
|
/**
|
|
14383
14615
|
* Partial patch for `updateRule` — any subset of the input fields, plus the
|
|
@@ -14388,7 +14620,37 @@ var NcRuleInputSchema = object({
|
|
|
14388
14620
|
* still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
|
|
14389
14621
|
* `updateRule` patch.
|
|
14390
14622
|
*/
|
|
14391
|
-
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
14623
|
+
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
14624
|
+
disabledTargetIds: array(string()).optional(),
|
|
14625
|
+
/**
|
|
14626
|
+
* `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
|
|
14627
|
+
*
|
|
14628
|
+
* It makes the key optional to SUPPLY; the parse still materialises the
|
|
14629
|
+
* default when the key is absent. And `NcRuleStore.update` merges with
|
|
14630
|
+
* `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
|
|
14631
|
+
* one — which made every partial edit destructive:
|
|
14632
|
+
*
|
|
14633
|
+
* nc.updateRule({ throttle }) → conditions reset to `{}`
|
|
14634
|
+
* nc.setRuleTargetEnabled(...) → conditions reset to `{}`
|
|
14635
|
+
* setEnabled(ruleId, false) → conditions reset to `{}`
|
|
14636
|
+
*
|
|
14637
|
+
* A rule scoped to one camera and one zone silently became a rule that
|
|
14638
|
+
* matches EVERY event on EVERY camera, and lost its `media` policy
|
|
14639
|
+
* (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
|
|
14640
|
+
* live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
|
|
14641
|
+
* within a minute of a two-field patch.
|
|
14642
|
+
*
|
|
14643
|
+
* So every defaulted field is re-declared here WITHOUT its default. The
|
|
14644
|
+
* inner defaults still apply when the caller DOES send the key — `{}` for
|
|
14645
|
+
* conditions remains a real instruction ("clear them") — and only the
|
|
14646
|
+
* absent key is now genuinely absent.
|
|
14647
|
+
*/
|
|
14648
|
+
enabled: boolean().optional(),
|
|
14649
|
+
conditions: NcConditionsSchema.optional(),
|
|
14650
|
+
media: NcMediaPolicySchema.optional(),
|
|
14651
|
+
throttle: NcThrottleSchema.optional(),
|
|
14652
|
+
priority: number().int().min(1).max(5).optional()
|
|
14653
|
+
});
|
|
14392
14654
|
/** A persisted rule. */
|
|
14393
14655
|
var NcRuleSchema = NcRuleInputSchema.extend({
|
|
14394
14656
|
id: string(),
|
|
@@ -14689,6 +14951,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
|
|
|
14689
14951
|
* Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
|
|
14690
14952
|
* copy would lie the first time a rule is disabled.
|
|
14691
14953
|
*/
|
|
14954
|
+
/**
|
|
14955
|
+
* Why a device a mode NAMES is nonetheless not armed by it.
|
|
14956
|
+
*
|
|
14957
|
+
* Each value is an existing authority, never a new flag (D62): `muted` is the
|
|
14958
|
+
* per-camera notification switch the Notification Center already owns,
|
|
14959
|
+
* `detection-off` is the device's own detection binding being inactive, and
|
|
14960
|
+
* `offline` is the device manager's liveness. A fourth reason would mean a
|
|
14961
|
+
* fourth authority, and inventing one here is how a panel starts disagreeing
|
|
14962
|
+
* with the switches the operator actually used.
|
|
14963
|
+
*/
|
|
14964
|
+
var NcAlarmSkipReasonSchema = _enum([
|
|
14965
|
+
"muted",
|
|
14966
|
+
"detection-off",
|
|
14967
|
+
"offline"
|
|
14968
|
+
]);
|
|
14969
|
+
var NcAlarmSkippedDeviceSchema = object({
|
|
14970
|
+
deviceId: number().int(),
|
|
14971
|
+
reason: NcAlarmSkipReasonSchema
|
|
14972
|
+
});
|
|
14692
14973
|
var NcAlarmModeCoverageSchema = object({
|
|
14693
14974
|
mode: AlarmArmModeSchema,
|
|
14694
14975
|
/** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
|
|
@@ -14696,7 +14977,18 @@ var NcAlarmModeCoverageSchema = object({
|
|
|
14696
14977
|
/** At least one covering rule has no device scope, so the mode covers all. */
|
|
14697
14978
|
allDevices: boolean(),
|
|
14698
14979
|
/** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
|
|
14699
|
-
deviceIds: array(number().int())
|
|
14980
|
+
deviceIds: array(number().int()),
|
|
14981
|
+
/**
|
|
14982
|
+
* Devices this mode NAMES but cannot actually arm, each with the switch that
|
|
14983
|
+
* excludes it.
|
|
14984
|
+
*
|
|
14985
|
+
* "Away armed — 12 cameras" is a promise, and a muted camera among those
|
|
14986
|
+
* twelve makes it false in exactly the way nobody notices until an incident.
|
|
14987
|
+
* Defaulted to `[]` so a coverage answer computed before this field existed
|
|
14988
|
+
* still parses as "nothing known to be skipped" rather than failing the whole
|
|
14989
|
+
* alarm tab.
|
|
14990
|
+
*/
|
|
14991
|
+
skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
|
|
14700
14992
|
});
|
|
14701
14993
|
var NcAlarmConfigSchema = object({
|
|
14702
14994
|
/**
|
|
@@ -17495,9 +17787,16 @@ var CameraStatusSchema = object({
|
|
|
17495
17787
|
audio: CameraAudioStatusSchema.nullable(),
|
|
17496
17788
|
recording: CameraRecordingStatusSchema.nullable(),
|
|
17497
17789
|
/**
|
|
17498
|
-
* Per-camera
|
|
17790
|
+
* Per-camera functions an OPERATOR has turned off
|
|
17499
17791
|
* ([D61](../../../../docs/decisions/adr-0067.md)).
|
|
17500
17792
|
*
|
|
17793
|
+
* Composed from the AUTHORITIES themselves — the wrapper bindings,
|
|
17794
|
+
* `RecordingConfig.enabled`, the notification mute, the broker's audio
|
|
17795
|
+
* policy, the camera's own microphone — via `composeSwitchedOff`, not from
|
|
17796
|
+
* the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
|
|
17797
|
+
* The badge outlives the control panel: the panel was a convenience, this is
|
|
17798
|
+
* the difference between a camera being off and a camera being dead.
|
|
17799
|
+
*
|
|
17501
17800
|
* This is the difference between DISABLED and BROKEN. A camera whose
|
|
17502
17801
|
* `detection` block reports zero fps and whose `switchedOff` contains
|
|
17503
17802
|
* `'object-detection'` was switched off by a person; the same camera with an
|
|
@@ -23051,7 +23350,19 @@ var RecordingManifestSchema = object({
|
|
|
23051
23350
|
* profiles/subtrees/locations on this node). */
|
|
23052
23351
|
var RecordingDeviceUsageSchema = object({
|
|
23053
23352
|
deviceId: number(),
|
|
23054
|
-
usedBytes: number()
|
|
23353
|
+
usedBytes: number(),
|
|
23354
|
+
/**
|
|
23355
|
+
* Start of this camera's OLDEST indexed segment, across every profile and
|
|
23356
|
+
* location — the "Oldest footage" column in Recordings → Storage, and the
|
|
23357
|
+
* only honest answer to "is retention actually holding?" per camera.
|
|
23358
|
+
*
|
|
23359
|
+
* `null` = the camera has no footage. OPTIONAL because a recorder that
|
|
23360
|
+
* predates this field omits it entirely, and a hub whose types carry the
|
|
23361
|
+
* field must keep validating that older provider's payload: the framework
|
|
23362
|
+
* (types) and the addon ship on different trains, and the addon is usually
|
|
23363
|
+
* the later of the two.
|
|
23364
|
+
*/
|
|
23365
|
+
oldestMs: number().nullable().optional()
|
|
23055
23366
|
});
|
|
23056
23367
|
/** Recording storage usage + capacity for one storage location. */
|
|
23057
23368
|
var RecordingLocationUsageSchema = object({
|
|
@@ -23079,6 +23390,57 @@ var RecordingStorageUsageSchema = object({
|
|
|
23079
23390
|
locations: array(RecordingLocationUsageSchema)
|
|
23080
23391
|
});
|
|
23081
23392
|
/**
|
|
23393
|
+
* The OPERATOR-ARMED half of multi-location recordings (D116).
|
|
23394
|
+
*
|
|
23395
|
+
* The placement plan decides where NEW writes go and moves nothing. A rebalance
|
|
23396
|
+
* is the operator asking for the EXISTING archive to be brought into line with
|
|
23397
|
+
* that plan: one relocate job per (camera, profile) pile that sits on the wrong
|
|
23398
|
+
* location, run FIFO behind the single-flight mover.
|
|
23399
|
+
*
|
|
23400
|
+
* `plan…` and `start…` return the SAME shape deliberately — what the operator
|
|
23401
|
+
* confirms is exactly what gets enqueued, and `jobIds` is the only difference
|
|
23402
|
+
* (empty on the plan).
|
|
23403
|
+
*/
|
|
23404
|
+
var RecordingRebalanceMoveSchema = object({
|
|
23405
|
+
deviceId: number(),
|
|
23406
|
+
profile: string(),
|
|
23407
|
+
fromLocationId: string(),
|
|
23408
|
+
toLocationId: string(),
|
|
23409
|
+
bytes: number(),
|
|
23410
|
+
files: number().int()
|
|
23411
|
+
});
|
|
23412
|
+
/** Why a pile that is out of place is staying there. Every refusal is
|
|
23413
|
+
* reported: a rebalance that silently drops a camera reads exactly like one
|
|
23414
|
+
* that had nothing to do. */
|
|
23415
|
+
var RecordingRebalanceSkipReasonSchema = _enum([
|
|
23416
|
+
"unassigned",
|
|
23417
|
+
"target-not-writable",
|
|
23418
|
+
"below-threshold",
|
|
23419
|
+
"no-headroom"
|
|
23420
|
+
]);
|
|
23421
|
+
var RecordingRebalanceSkipSchema = object({
|
|
23422
|
+
deviceId: number(),
|
|
23423
|
+
profile: string(),
|
|
23424
|
+
fromLocationId: string(),
|
|
23425
|
+
/** The location the plan wants; null when the camera has no assignment. */
|
|
23426
|
+
toLocationId: string().nullable(),
|
|
23427
|
+
bytes: number(),
|
|
23428
|
+
reason: RecordingRebalanceSkipReasonSchema
|
|
23429
|
+
});
|
|
23430
|
+
var RecordingRebalancePlanSchema = object({
|
|
23431
|
+
moves: array(RecordingRebalanceMoveSchema),
|
|
23432
|
+
skipped: array(RecordingRebalanceSkipSchema),
|
|
23433
|
+
bytesToMove: number(),
|
|
23434
|
+
/** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
|
|
23435
|
+
jobIds: array(string())
|
|
23436
|
+
});
|
|
23437
|
+
var RecordingRebalanceInputSchema = object({
|
|
23438
|
+
/** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
|
|
23439
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
23440
|
+
/** Ignore piles smaller than this (default 1 GB). */
|
|
23441
|
+
minMoveGb: number().min(0).optional()
|
|
23442
|
+
});
|
|
23443
|
+
/**
|
|
23082
23444
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
23083
23445
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
23084
23446
|
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
@@ -23241,9 +23603,24 @@ method(object({
|
|
|
23241
23603
|
}), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
23242
23604
|
kind: "mutation",
|
|
23243
23605
|
auth: "admin"
|
|
23606
|
+
}), method(RelocateFootageInputSchema, object({ jobId: string() }), {
|
|
23607
|
+
kind: "mutation",
|
|
23608
|
+
auth: "admin"
|
|
23609
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
23610
|
+
kind: "query",
|
|
23611
|
+
auth: "admin"
|
|
23612
|
+
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
23613
|
+
kind: "mutation",
|
|
23614
|
+
auth: "admin"
|
|
23615
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
23616
|
+
kind: "query",
|
|
23617
|
+
auth: "admin"
|
|
23618
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
23619
|
+
kind: "mutation",
|
|
23620
|
+
auth: "admin"
|
|
23244
23621
|
});
|
|
23245
23622
|
/**
|
|
23246
|
-
* `
|
|
23623
|
+
* `recording-export` cap — render a footage time range into a single downloadable
|
|
23247
23624
|
* MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
|
|
23248
23625
|
* bounded lifetime with a durable history, auto-expiry, and optional
|
|
23249
23626
|
* delete-after-download.
|
|
@@ -23258,10 +23635,42 @@ method(object({
|
|
|
23258
23635
|
*/
|
|
23259
23636
|
/** Playback-speed multiplier for the render (1 = realtime). */
|
|
23260
23637
|
var ExportSpeedSchema = number().min(.25).max(32);
|
|
23638
|
+
/**
|
|
23639
|
+
* One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
|
|
23640
|
+
*
|
|
23641
|
+
* Relative and not absolute epoch on purpose: the renderer's frame-select
|
|
23642
|
+
* expression sees ffmpeg's `t`, which starts at 0 for the export's source
|
|
23643
|
+
* playlist. Handing it absolute epochs would make every call site responsible
|
|
23644
|
+
* for the same subtraction, and the one that forgot would emit a filter that
|
|
23645
|
+
* selects nothing — silently, as a uniform timelapse.
|
|
23646
|
+
*/
|
|
23647
|
+
var ExportDenseRangeSchema = object({
|
|
23648
|
+
fromSec: number().nonnegative(),
|
|
23649
|
+
toSec: number().nonnegative()
|
|
23650
|
+
}).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
|
|
23651
|
+
/**
|
|
23652
|
+
* Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
|
|
23653
|
+
* listed ranges and at the base `everyMs` everywhere else.
|
|
23654
|
+
*
|
|
23655
|
+
* `everyMs` must be strictly smaller than the base cadence — a dense rate that
|
|
23656
|
+
* is not denser renders a uniform timelapse the operator believes is two-rate.
|
|
23657
|
+
*/
|
|
23658
|
+
var ExportDenseSchema = object({
|
|
23659
|
+
everyMs: number().int().positive(),
|
|
23660
|
+
ranges: array(ExportDenseRangeSchema).min(1).max(200)
|
|
23661
|
+
});
|
|
23261
23662
|
/** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
|
|
23262
23663
|
var ExportTimelapseSchema = object({
|
|
23263
23664
|
everyMs: number().int().positive(),
|
|
23264
|
-
outputFps: number().int().min(1).max(60).optional()
|
|
23665
|
+
outputFps: number().int().min(1).max(60).optional(),
|
|
23666
|
+
/** Optional second, FASTER rate over the intervals that matter. */
|
|
23667
|
+
dense: ExportDenseSchema.optional()
|
|
23668
|
+
}).superRefine((v, ctx) => {
|
|
23669
|
+
if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
|
|
23670
|
+
code: ZodIssueCode.custom,
|
|
23671
|
+
message: "dense.everyMs must be strictly smaller than the base everyMs",
|
|
23672
|
+
path: ["dense", "everyMs"]
|
|
23673
|
+
});
|
|
23265
23674
|
});
|
|
23266
23675
|
/**
|
|
23267
23676
|
* Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
|
|
@@ -23319,6 +23728,19 @@ var ExportDownloadSchema = object({
|
|
|
23319
23728
|
url: string(),
|
|
23320
23729
|
endpoints: array(string())
|
|
23321
23730
|
});
|
|
23731
|
+
/**
|
|
23732
|
+
* A finished export's bytes, inline.
|
|
23733
|
+
*
|
|
23734
|
+
* `bytes` is the DECODED length — the number the caller bounds and logs
|
|
23735
|
+
* against, so nobody has to infer it from the base64 length.
|
|
23736
|
+
*/
|
|
23737
|
+
var ExportBytesSchema = object({
|
|
23738
|
+
base64: string(),
|
|
23739
|
+
contentType: string(),
|
|
23740
|
+
/** Suggested filename, extension included. */
|
|
23741
|
+
name: string(),
|
|
23742
|
+
bytes: number().int().nonnegative()
|
|
23743
|
+
});
|
|
23322
23744
|
method(object({
|
|
23323
23745
|
deviceId: number(),
|
|
23324
23746
|
profile: string(),
|
|
@@ -23343,6 +23765,9 @@ method(object({
|
|
|
23343
23765
|
}), method(object({ exportId: string() }), ExportDownloadSchema, {
|
|
23344
23766
|
kind: "query",
|
|
23345
23767
|
auth: "protected"
|
|
23768
|
+
}), method(object({ exportId: string() }), ExportBytesSchema, {
|
|
23769
|
+
kind: "query",
|
|
23770
|
+
auth: "protected"
|
|
23346
23771
|
});
|
|
23347
23772
|
/**
|
|
23348
23773
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
@@ -28536,6 +28961,12 @@ Object.freeze({
|
|
|
28536
28961
|
addonId: null,
|
|
28537
28962
|
access: "create"
|
|
28538
28963
|
},
|
|
28964
|
+
"recording.cancelRelocateJob": {
|
|
28965
|
+
capName: "recording",
|
|
28966
|
+
capScope: "system",
|
|
28967
|
+
addonId: null,
|
|
28968
|
+
access: "create"
|
|
28969
|
+
},
|
|
28539
28970
|
"recording.cancelStorageMigrationMove": {
|
|
28540
28971
|
capName: "recording",
|
|
28541
28972
|
capScope: "system",
|
|
@@ -28590,6 +29021,12 @@ Object.freeze({
|
|
|
28590
29021
|
addonId: null,
|
|
28591
29022
|
access: "view"
|
|
28592
29023
|
},
|
|
29024
|
+
"recording.listRelocateJobs": {
|
|
29025
|
+
capName: "recording",
|
|
29026
|
+
capScope: "system",
|
|
29027
|
+
addonId: null,
|
|
29028
|
+
access: "view"
|
|
29029
|
+
},
|
|
28593
29030
|
"recording.locateSegment": {
|
|
28594
29031
|
capName: "recording",
|
|
28595
29032
|
capScope: "system",
|
|
@@ -28602,6 +29039,12 @@ Object.freeze({
|
|
|
28602
29039
|
addonId: null,
|
|
28603
29040
|
access: "create"
|
|
28604
29041
|
},
|
|
29042
|
+
"recording.planStorageRebalance": {
|
|
29043
|
+
capName: "recording",
|
|
29044
|
+
capScope: "system",
|
|
29045
|
+
addonId: null,
|
|
29046
|
+
access: "view"
|
|
29047
|
+
},
|
|
28605
29048
|
"recording.pruneFootage": {
|
|
28606
29049
|
capName: "recording",
|
|
28607
29050
|
capScope: "system",
|
|
@@ -28626,6 +29069,12 @@ Object.freeze({
|
|
|
28626
29069
|
addonId: null,
|
|
28627
29070
|
access: "create"
|
|
28628
29071
|
},
|
|
29072
|
+
"recording.relocateFootage": {
|
|
29073
|
+
capName: "recording",
|
|
29074
|
+
capScope: "system",
|
|
29075
|
+
addonId: null,
|
|
29076
|
+
access: "create"
|
|
29077
|
+
},
|
|
28629
29078
|
"recording.renderClip": {
|
|
28630
29079
|
capName: "recording",
|
|
28631
29080
|
capScope: "system",
|
|
@@ -28662,38 +29111,50 @@ Object.freeze({
|
|
|
28662
29111
|
addonId: null,
|
|
28663
29112
|
access: "create"
|
|
28664
29113
|
},
|
|
29114
|
+
"recording.startStorageRebalance": {
|
|
29115
|
+
capName: "recording",
|
|
29116
|
+
capScope: "system",
|
|
29117
|
+
addonId: null,
|
|
29118
|
+
access: "create"
|
|
29119
|
+
},
|
|
28665
29120
|
"recordingExport.cancelExport": {
|
|
28666
|
-
capName: "
|
|
29121
|
+
capName: "recording-export",
|
|
28667
29122
|
capScope: "system",
|
|
28668
29123
|
addonId: null,
|
|
28669
29124
|
access: "create"
|
|
28670
29125
|
},
|
|
28671
29126
|
"recordingExport.createExport": {
|
|
28672
|
-
capName: "
|
|
29127
|
+
capName: "recording-export",
|
|
28673
29128
|
capScope: "system",
|
|
28674
29129
|
addonId: null,
|
|
28675
29130
|
access: "create"
|
|
28676
29131
|
},
|
|
28677
29132
|
"recordingExport.deleteExport": {
|
|
28678
|
-
capName: "
|
|
29133
|
+
capName: "recording-export",
|
|
28679
29134
|
capScope: "system",
|
|
28680
29135
|
addonId: null,
|
|
28681
29136
|
access: "delete"
|
|
28682
29137
|
},
|
|
28683
29138
|
"recordingExport.getDownloadUrl": {
|
|
28684
|
-
capName: "
|
|
29139
|
+
capName: "recording-export",
|
|
28685
29140
|
capScope: "system",
|
|
28686
29141
|
addonId: null,
|
|
28687
29142
|
access: "view"
|
|
28688
29143
|
},
|
|
28689
29144
|
"recordingExport.getExport": {
|
|
28690
|
-
capName: "
|
|
29145
|
+
capName: "recording-export",
|
|
28691
29146
|
capScope: "system",
|
|
28692
29147
|
addonId: null,
|
|
28693
29148
|
access: "view"
|
|
28694
29149
|
},
|
|
28695
29150
|
"recordingExport.listExports": {
|
|
28696
|
-
capName: "
|
|
29151
|
+
capName: "recording-export",
|
|
29152
|
+
capScope: "system",
|
|
29153
|
+
addonId: null,
|
|
29154
|
+
access: "view"
|
|
29155
|
+
},
|
|
29156
|
+
"recordingExport.readExportBytes": {
|
|
29157
|
+
capName: "recording-export",
|
|
28697
29158
|
capScope: "system",
|
|
28698
29159
|
addonId: null,
|
|
28699
29160
|
access: "view"
|
|
@@ -30070,6 +30531,104 @@ var FramerateField = number().int().min(1).max(60);
|
|
|
30070
30531
|
var TargetsField = array(NcRuleTargetSchema).min(1);
|
|
30071
30532
|
var PriorityField = number().int().min(1).max(5);
|
|
30072
30533
|
/**
|
|
30534
|
+
* Explicit override of the DENSE sampling cadence, seconds.
|
|
30535
|
+
*
|
|
30536
|
+
* Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
|
|
30537
|
+
* 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
|
|
30538
|
+
* made that same base 3 s and rendered a person pass as two frames.)
|
|
30539
|
+
*
|
|
30540
|
+
* THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
|
|
30541
|
+
* `denseCadenceSec` and played at `framerate` occupies
|
|
30542
|
+
*
|
|
30543
|
+
* outputSeconds = (rangeSec / denseCadenceSec) / framerate
|
|
30544
|
+
*
|
|
30545
|
+
* 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.
|
|
30546
|
+
* Halving this field doubles the frames INSIDE ranges only — the base cadence,
|
|
30547
|
+
* and therefore the length of a quiet night, does not move.
|
|
30548
|
+
*
|
|
30549
|
+
* Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
|
|
30550
|
+
* the recording has them returns the same frames, requested twice. Must be
|
|
30551
|
+
* STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
|
|
30552
|
+
* a uniform video the operator believes is two-rate — and upsert refuses it
|
|
30553
|
+
* rather than letting the export cap reject the render hours after the window.
|
|
30554
|
+
*/
|
|
30555
|
+
var DenseCadenceSecField = number().min(.1).max(3600);
|
|
30556
|
+
/**
|
|
30557
|
+
* Minimum seconds of OUTPUT video each detection range must occupy.
|
|
30558
|
+
*
|
|
30559
|
+
* The operator-facing form of the arithmetic above: instead of solving for a
|
|
30560
|
+
* cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
|
|
30561
|
+
* 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
|
|
30562
|
+
* that range every ~583 ms.
|
|
30563
|
+
*
|
|
30564
|
+
* ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
|
|
30565
|
+
* ranges are terms of a single ffmpeg `select` expression that cannot vary rate
|
|
30566
|
+
* per term — so the MOST DEMANDING (shortest) range sets the rate and longer
|
|
30567
|
+
* ranges are sampled denser than they need. Per-range cadences require a cap
|
|
30568
|
+
* schema change and are the tracked follow-up.
|
|
30569
|
+
*
|
|
30570
|
+
* A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
|
|
30571
|
+
* is rendered with every frame that EXISTS and no more: the guarantee is capped
|
|
30572
|
+
* by real footage, never met by duplicating frames into motion that never
|
|
30573
|
+
* happened.
|
|
30574
|
+
*/
|
|
30575
|
+
var MinDwellSecField = number().min(0).max(60);
|
|
30576
|
+
/**
|
|
30577
|
+
* Caption burned into the notification's preview frame.
|
|
30578
|
+
*
|
|
30579
|
+
* Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
|
|
30580
|
+
* `rule`, `from`, `to`) and rendered by the SAME renderer — a second
|
|
30581
|
+
* templating dialect for one field would be a second thing to explain.
|
|
30582
|
+
*
|
|
30583
|
+
* Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
|
|
30584
|
+
* operator saying "the frame, no caption" — a distinct, reachable answer, and
|
|
30585
|
+
* the reason this is not `.min(1)`.
|
|
30586
|
+
*/
|
|
30587
|
+
var PreviewTextField = string().max(200);
|
|
30588
|
+
/**
|
|
30589
|
+
* Whether the notification's preview is a STILL or a short animation.
|
|
30590
|
+
*
|
|
30591
|
+
* The operator's ask, verbatim: *"inviato come gif o video (come per le altre
|
|
30592
|
+
* rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
|
|
30593
|
+
* night reads better as three seconds of motion than as one frame of it. Both
|
|
30594
|
+
* modes get the SAME treatment (blurred frame, large centred title); `'gif'`
|
|
30595
|
+
* simply applies it to a dozen frames sampled across the render and assembles
|
|
30596
|
+
* them.
|
|
30597
|
+
*
|
|
30598
|
+
* `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
|
|
30599
|
+
* seeks and a palette pass, and no rule that never asked for one should start
|
|
30600
|
+
* paying that on the deploy that shipped it.
|
|
30601
|
+
*
|
|
30602
|
+
* A GIF that cannot be assembled DEGRADES to the still — never to nothing.
|
|
30603
|
+
*/
|
|
30604
|
+
var PreviewModeField = _enum(["image", "gif"]);
|
|
30605
|
+
/**
|
|
30606
|
+
* Which detection classes the notification reports counts for.
|
|
30607
|
+
*
|
|
30608
|
+
* The counts come from the tracks the render ALREADY fetched for its dense-range
|
|
30609
|
+
* plan — no second query — aggregated per class. Absent or empty means "every
|
|
30610
|
+
* class the window actually contained", which is what an operator who never
|
|
30611
|
+
* opened the field wants; a list narrows it (`['person']` on a driveway that
|
|
30612
|
+
* counts cars all night).
|
|
30613
|
+
*
|
|
30614
|
+
* Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
|
|
30615
|
+
* …). An unknown name simply never matches and reports nothing — it is not an
|
|
30616
|
+
* error, because a rule may legitimately name a class this camera's model does
|
|
30617
|
+
* not emit.
|
|
30618
|
+
*
|
|
30619
|
+
* The counts are exposed to {@link TimelapseTemplateSchema} as:
|
|
30620
|
+
* - `{{detections}}` — total over the reported classes
|
|
30621
|
+
* - `{{detectionSummary}}` — `2 persone, 1 veicolo`
|
|
30622
|
+
* - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
|
|
30623
|
+
* one per class, `count_` + the class name
|
|
30624
|
+
*
|
|
30625
|
+
* With NO custom body template the summary is appended to the derived body, and
|
|
30626
|
+
* only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
|
|
30627
|
+
* reads. With a custom template the operator owns every word — nothing is
|
|
30628
|
+
* appended, so `{{detectionSummary}}` is how he asks for it.
|
|
30629
|
+
*/
|
|
30630
|
+
var ReportClassesField = array(string().min(1).max(40)).max(20);
|
|
30631
|
+
/**
|
|
30073
30632
|
* Client-supplied timelapse-rule fields. The server stamps id / createdBy /
|
|
30074
30633
|
* createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
|
|
30075
30634
|
* here (see the ownership note above).
|
|
@@ -30089,9 +30648,30 @@ var TimelapseRuleInputSchema = object({
|
|
|
30089
30648
|
cadenceSec: CadenceSecField.default(15),
|
|
30090
30649
|
/** Output frames per second of the assembled mp4 (predecessor parity). */
|
|
30091
30650
|
framerate: FramerateField.default(10),
|
|
30651
|
+
/**
|
|
30652
|
+
* Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
|
|
30653
|
+
* as `max(1s, cadenceSec / 30)`, which is what every rule written before this
|
|
30654
|
+
* field gets.
|
|
30655
|
+
*/
|
|
30656
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
30657
|
+
/** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
|
|
30658
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
30092
30659
|
/** `notification-output` targets the finished video/thumbnail is sent to. */
|
|
30093
30660
|
targets: TargetsField,
|
|
30094
30661
|
template: TimelapseTemplateSchema.optional(),
|
|
30662
|
+
/**
|
|
30663
|
+
* Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
|
|
30664
|
+
* and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
|
|
30665
|
+
*
|
|
30666
|
+
* Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
|
|
30667
|
+
* the notification's title/body, and clearing it (`template: null`) must not
|
|
30668
|
+
* silently clear the caption too.
|
|
30669
|
+
*/
|
|
30670
|
+
previewText: PreviewTextField.optional(),
|
|
30671
|
+
/** Still or animation — see {@link PreviewModeField}. */
|
|
30672
|
+
previewMode: PreviewModeField.default("image"),
|
|
30673
|
+
/** Classes the notification counts — see {@link ReportClassesField}. */
|
|
30674
|
+
reportClasses: ReportClassesField.optional(),
|
|
30095
30675
|
/** Canonical notification priority ordinal (1..5); per-target overridable. */
|
|
30096
30676
|
priority: PriorityField.default(3)
|
|
30097
30677
|
});
|
|
@@ -30102,8 +30682,13 @@ object({
|
|
|
30102
30682
|
schedule: NcScheduleSchema.optional(),
|
|
30103
30683
|
cadenceSec: CadenceSecField.optional(),
|
|
30104
30684
|
framerate: FramerateField.optional(),
|
|
30685
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
30686
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
30105
30687
|
targets: TargetsField.optional(),
|
|
30106
30688
|
template: TimelapseTemplateSchema.nullable().optional(),
|
|
30689
|
+
previewText: PreviewTextField.optional(),
|
|
30690
|
+
previewMode: PreviewModeField.optional(),
|
|
30691
|
+
reportClasses: ReportClassesField.optional(),
|
|
30107
30692
|
priority: PriorityField.optional()
|
|
30108
30693
|
});
|
|
30109
30694
|
TimelapseRuleInputSchema.extend({
|
|
@@ -30115,10 +30700,28 @@ TimelapseRuleInputSchema.extend({
|
|
|
30115
30700
|
*/
|
|
30116
30701
|
ownerUserId: string().optional(),
|
|
30117
30702
|
/**
|
|
30118
|
-
* Epoch-ms of the
|
|
30119
|
-
*
|
|
30703
|
+
* Epoch-ms of the NEWEST successful generation across every camera of this
|
|
30704
|
+
* rule. What a UI shows, and the compatibility floor for
|
|
30705
|
+
* {@link readTimelapseGeneratedAt}. Absent = never generated.
|
|
30120
30706
|
*/
|
|
30121
30707
|
lastGeneratedAt: number().optional(),
|
|
30708
|
+
/**
|
|
30709
|
+
* PER-CAMERA generation state, keyed by `String(deviceId)` — the
|
|
30710
|
+
* re-generation guard's real durable state.
|
|
30711
|
+
*
|
|
30712
|
+
* One rule covers several cameras and each renders its own video, so a rule
|
|
30713
|
+
* -wide stamp is wrong in the direction that DESTROYS work: camera A
|
|
30714
|
+
* succeeding at 06:05 tells camera B, whose render failed, that it is
|
|
30715
|
+
* already done — and B's night is gone for good, because the window will not
|
|
30716
|
+
* come back.
|
|
30717
|
+
*
|
|
30718
|
+
* ADDITIVE, so the migration is free: a row written before this field simply
|
|
30719
|
+
* has no map, and {@link readTimelapseGeneratedAt} falls back to
|
|
30720
|
+
* {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
|
|
30721
|
+
* "never generated" would re-render and re-notify every camera of every rule
|
|
30722
|
+
* once, on the deploy that shipped the map.
|
|
30723
|
+
*/
|
|
30724
|
+
generatedByDevice: record(string(), number()).optional(),
|
|
30122
30725
|
/** userId of the caller who created the rule (server-stamped). */
|
|
30123
30726
|
createdBy: string(),
|
|
30124
30727
|
createdAt: number(),
|