@camstack/addon-import-alexa 0.2.12 → 0.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/addon.js +625 -22
- package/dist/addon.mjs +625 -22
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -7377,8 +7377,31 @@ var AdoptionJobSchema = object({
|
|
|
7377
7377
|
error: string().nullable()
|
|
7378
7378
|
});
|
|
7379
7379
|
/**
|
|
7380
|
-
* Per-camera FUNCTION SWITCHES
|
|
7381
|
-
*
|
|
7380
|
+
* Per-camera FUNCTION SWITCHES.
|
|
7381
|
+
*
|
|
7382
|
+
* ## The aggregate group is being withdrawn — the BADGE is not (D113)
|
|
7383
|
+
*
|
|
7384
|
+
* This file shipped as "the one coherent on/off surface over the pipeline
|
|
7385
|
+
* functions an operator thinks in terms of". The operator's verdict on
|
|
7386
|
+
* 2026-08-12 was that the coherent surface bought complexity and no clarity:
|
|
7387
|
+
* every function already had a settings page of its own, and a second place to
|
|
7388
|
+
* turn it off is a second place to look. Each switch is going back to its own
|
|
7389
|
+
* component's original options — detection to the detection-pipeline wrapper
|
|
7390
|
+
* binding, audio analysis to its own, recording to `RecordingConfig.enabled`
|
|
7391
|
+
* (which was always first-class; the switch was a veneer over
|
|
7392
|
+
* `recording.setDeviceConfig`), notifications to a notification-center
|
|
7393
|
+
* per-device setting, the two camera planes to their own components.
|
|
7394
|
+
*
|
|
7395
|
+
* What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
|
|
7396
|
+
* thing that lets a status surface say DISABLED instead of BROKEN, recomposed
|
|
7397
|
+
* straight from the authorities with no group in the middle. That rule was
|
|
7398
|
+
* never about a control panel.
|
|
7399
|
+
*
|
|
7400
|
+
* Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
|
|
7401
|
+
* {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
|
|
7402
|
+
* `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
|
|
7403
|
+
* viewers (v1.0.305) and the admin UI still call it. It is deleted when they
|
|
7404
|
+
* stop; nothing new may be built on it.
|
|
7382
7405
|
*
|
|
7383
7406
|
* ## This file adds no state
|
|
7384
7407
|
*
|
|
@@ -7729,7 +7752,15 @@ var RecordingConfigSchema = object({
|
|
|
7729
7752
|
* Each completed/failed run also lands one durable ops-log row on its owning
|
|
7730
7753
|
* addon surface.
|
|
7731
7754
|
*/
|
|
7755
|
+
/**
|
|
7756
|
+
* `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
|
|
7757
|
+
* rebalance enqueues one job per (camera, profile). Refusing the second job —
|
|
7758
|
+
* what the engine did before — turned a fifteen-camera rebalance into fifteen
|
|
7759
|
+
* manual retries. Queued jobs run FIFO; a queued job that is cancelled never
|
|
7760
|
+
* runs at all.
|
|
7761
|
+
*/
|
|
7732
7762
|
var RelocateJobStateSchema = _enum([
|
|
7763
|
+
"queued",
|
|
7733
7764
|
"running",
|
|
7734
7765
|
"done",
|
|
7735
7766
|
"failed",
|
|
@@ -7764,6 +7795,15 @@ var RelocateFootageInputSchema = object({
|
|
|
7764
7795
|
/** Limits relocation to the logical profile class. Omit only for the
|
|
7765
7796
|
* pre-orchestration compatibility path. */
|
|
7766
7797
|
footageClass: RelocateFootageClassSchema.optional(),
|
|
7798
|
+
/** Scope the move to ONE camera. Absent = every camera on the source, which
|
|
7799
|
+
* is what a whole-disk drain means. The rebalance path always sets it: its
|
|
7800
|
+
* unit is a (camera, profile) pile, not a disk. */
|
|
7801
|
+
deviceId: number().int().optional(),
|
|
7802
|
+
/** Scope the move to specific segment profiles (`high` / `mid` / `low`).
|
|
7803
|
+
* Finer than `footageClass`, which cannot separate high from mid — and the
|
|
7804
|
+
* placement plan assigns those two independently, so a rebalance that could
|
|
7805
|
+
* only say "recordings" would move footage the plan never asked to move. */
|
|
7806
|
+
profiles: array(string()).optional(),
|
|
7767
7807
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
7768
7808
|
* never allowed to starve live writers. */
|
|
7769
7809
|
throttleMbps: number().min(1).max(1e3).optional()
|
|
@@ -7899,6 +7939,21 @@ var StorageLocationSchema = object({
|
|
|
7899
7939
|
nodeId: string().optional(),
|
|
7900
7940
|
isDefault: boolean().default(false),
|
|
7901
7941
|
isSystem: boolean().default(false),
|
|
7942
|
+
/**
|
|
7943
|
+
* Operator opt-in: whether consumers that BALANCE across several locations
|
|
7944
|
+
* of a type may write here. Recordings reads it today; event media and
|
|
7945
|
+
* backups are the next consumers, which is why the flag lives on the
|
|
7946
|
+
* location rather than in any one addon's store — nothing has to be
|
|
7947
|
+
* extended to add the next consumer.
|
|
7948
|
+
*
|
|
7949
|
+
* OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
|
|
7950
|
+
* flag existed reads back with no flag and keeps working exactly as before;
|
|
7951
|
+
* that is the whole compat story, and it is why no migration ships with it.
|
|
7952
|
+
* A newly CREATED sibling is stamped `false` by the orchestrator (creating a
|
|
7953
|
+
* disk must not silently start writing to it); the default of a type is
|
|
7954
|
+
* always stamped `true`.
|
|
7955
|
+
*/
|
|
7956
|
+
enabled: boolean().optional(),
|
|
7902
7957
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
7903
7958
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
7904
7959
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -12536,7 +12591,8 @@ method(object({
|
|
|
12536
12591
|
}), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
|
|
12537
12592
|
/**
|
|
12538
12593
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
12539
|
-
* filesystem
|
|
12594
|
+
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
12595
|
+
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
12540
12596
|
* admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
|
|
12541
12597
|
* (one provider per node); the hub calls it with `{nodeId}` so the codegen
|
|
12542
12598
|
* routes to that exact node (default `nodeIdMode:'routing'`).
|
|
@@ -14377,6 +14433,13 @@ var MaskGridDimsSchema = object({
|
|
|
14377
14433
|
* `package-event` are pure trigger kinds (no urgency dimension). Extending
|
|
14378
14434
|
* this one field keeps the schema additive — a rule still declares exactly
|
|
14379
14435
|
* one trigger.
|
|
14436
|
+
*
|
|
14437
|
+
* AUDIO rules add no member here, for the reason occupancy added none: the
|
|
14438
|
+
* enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
|
|
14439
|
+
* mirror.ts` fails the build on a member the app cannot render) and every
|
|
14440
|
+
* member costs a release train. A sustained-sound rule is therefore an
|
|
14441
|
+
* `immediate` rule carrying {@link NcConditions.audio} — the condition is the
|
|
14442
|
+
* trigger discriminator, exactly as `occupancy` is on `device-event`.
|
|
14380
14443
|
*/
|
|
14381
14444
|
var NcDeliverySchema = _enum([
|
|
14382
14445
|
"immediate",
|
|
@@ -14391,15 +14454,32 @@ var NcDeliverySchema = _enum([
|
|
|
14391
14454
|
* depend on a provider's raw event name or payload shape.
|
|
14392
14455
|
*/
|
|
14393
14456
|
var NcSystemEventKindSchema = _enum([
|
|
14394
|
-
"
|
|
14395
|
-
"
|
|
14457
|
+
"device-online",
|
|
14458
|
+
"device-offline",
|
|
14459
|
+
"device-disabled",
|
|
14460
|
+
"device-enabled",
|
|
14396
14461
|
"stream-online",
|
|
14397
14462
|
"stream-offline",
|
|
14398
14463
|
"node-online",
|
|
14399
14464
|
"node-offline",
|
|
14400
14465
|
"addon-update-available",
|
|
14401
|
-
"server-update-available"
|
|
14466
|
+
"server-update-available",
|
|
14467
|
+
"alarm-triggered",
|
|
14468
|
+
"alarm-armed",
|
|
14469
|
+
"alarm-disarmed",
|
|
14470
|
+
"camera-online",
|
|
14471
|
+
"camera-offline",
|
|
14472
|
+
"camera-disabled",
|
|
14473
|
+
"camera-enabled"
|
|
14474
|
+
]);
|
|
14475
|
+
/** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
|
|
14476
|
+
var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
|
|
14477
|
+
"camera-online",
|
|
14478
|
+
"camera-offline",
|
|
14479
|
+
"camera-disabled",
|
|
14480
|
+
"camera-enabled"
|
|
14402
14481
|
]);
|
|
14482
|
+
NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
|
|
14403
14483
|
/**
|
|
14404
14484
|
* One coherent system-event condition. `kinds` is the required opt-in safety
|
|
14405
14485
|
* gate; the remaining lists are optional narrowing filters relevant to the
|
|
@@ -14408,6 +14488,18 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14408
14488
|
var NcSystemEventConditionSchema = object({
|
|
14409
14489
|
kinds: array(NcSystemEventKindSchema).min(1),
|
|
14410
14490
|
deviceIds: array(number().int()).min(1).optional(),
|
|
14491
|
+
/**
|
|
14492
|
+
* Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
|
|
14493
|
+
* `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
|
|
14494
|
+
* is what a liveness rule means when nobody said otherwise.
|
|
14495
|
+
*
|
|
14496
|
+
* This is where "only my cameras" is expressed, and it lives on the rule for
|
|
14497
|
+
* one reason: the intake cannot know which devices this household cares
|
|
14498
|
+
* about, and a producer-side filter is one no operator can change. Fails
|
|
14499
|
+
* CLOSED — a subject whose device type is unknown (an id the device mirror
|
|
14500
|
+
* does not carry) matches no `deviceTypes` list.
|
|
14501
|
+
*/
|
|
14502
|
+
deviceTypes: array(string().min(1)).min(1).optional(),
|
|
14411
14503
|
nodeIds: array(string().min(1)).min(1).optional(),
|
|
14412
14504
|
packageNames: array(string().min(1)).min(1).optional()
|
|
14413
14505
|
});
|
|
@@ -14458,6 +14550,47 @@ var NcOccupancyConditionSchema = object({
|
|
|
14458
14550
|
sustainSeconds: number().int().min(0).max(3600).default(15)
|
|
14459
14551
|
});
|
|
14460
14552
|
/**
|
|
14553
|
+
* Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
|
|
14554
|
+
*
|
|
14555
|
+
* Operator-approved vocabulary (2026-08-12, option A — the same one the
|
|
14556
|
+
* reference notifier uses, so an operator moving between them re-uses what
|
|
14557
|
+
* they already know): a rule matches when, over a sampling window of
|
|
14558
|
+
* `samplingSeconds`, at least `hitPercent`% of the audio samples in that
|
|
14559
|
+
* window are HITS. A sample is a hit when it satisfies BOTH present filters:
|
|
14560
|
+
*
|
|
14561
|
+
* - `dbThreshold` — its level is at or above this many dBFS (see
|
|
14562
|
+
* {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
|
|
14563
|
+
* - `labels` — the classifier put at least one of these labels on it.
|
|
14564
|
+
*
|
|
14565
|
+
* Both are OPTIONAL and independent, which is the point of the shape: a
|
|
14566
|
+
* loudness rule ("something loud at 3am") needs no model to be right, and a
|
|
14567
|
+
* label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
|
|
14568
|
+
* is given** — a window in which every sample is trivially a hit would fire on
|
|
14569
|
+
* silence, so the engine refuses such a condition rather than notifying on
|
|
14570
|
+
* nothing (the schema cannot express "at least one of" without becoming a
|
|
14571
|
+
* ZodEffects the cap path would have to special-case).
|
|
14572
|
+
*
|
|
14573
|
+
* `hitPercent` is over the samples the window actually HOLDS, and the window
|
|
14574
|
+
* must be FULL before it can match — a window that has been open for two
|
|
14575
|
+
* seconds of its ten is 100% of nothing, and firing on it would make
|
|
14576
|
+
* `samplingSeconds` decorative.
|
|
14577
|
+
*
|
|
14578
|
+
* Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
|
|
14579
|
+
* `audio-*` ids). Both spellings are accepted — the matcher normalizes the
|
|
14580
|
+
* `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
|
|
14581
|
+
* an operator who typed `dog` mean the same thing.
|
|
14582
|
+
*/
|
|
14583
|
+
var NcAudioConditionSchema = object({
|
|
14584
|
+
/** Audio macro labels; absent = any sound (level-only rule). */
|
|
14585
|
+
labels: array(string().min(1)).min(1).optional(),
|
|
14586
|
+
/** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
|
|
14587
|
+
dbThreshold: number().min(-96).max(0).optional(),
|
|
14588
|
+
/** Percentage of the window's samples that must be hits (1–100). */
|
|
14589
|
+
hitPercent: number().int().min(1).max(100).default(60),
|
|
14590
|
+
/** Length of the sampling window in seconds. */
|
|
14591
|
+
samplingSeconds: number().int().min(1).max(300).default(10)
|
|
14592
|
+
});
|
|
14593
|
+
/**
|
|
14461
14594
|
* Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
|
|
14462
14595
|
*
|
|
14463
14596
|
* The values are not symmetric, and deliberately so — the absent value has to
|
|
@@ -14730,7 +14863,33 @@ var NcConditionsSchema = object({
|
|
|
14730
14863
|
* threshold and holds for `sustainSeconds`. Fail-closed on missing
|
|
14731
14864
|
* substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
|
|
14732
14865
|
*/
|
|
14733
|
-
occupancy: NcOccupancyConditionSchema.optional()
|
|
14866
|
+
occupancy: NcOccupancyConditionSchema.optional(),
|
|
14867
|
+
/**
|
|
14868
|
+
* IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
|
|
14869
|
+
* `samplingSeconds` window clear the optional `dbThreshold` and carry one of
|
|
14870
|
+
* the optional `labels`. Fail-closed on missing substrate (no audio samples,
|
|
14871
|
+
* a window that is not full yet, neither filter given). See
|
|
14872
|
+
* {@link NcAudioCondition}.
|
|
14873
|
+
*
|
|
14874
|
+
* Presence of this key is what makes a rule an AUDIO rule: the engine fires
|
|
14875
|
+
* it ONLY on a confirmed audio window, and a rule carrying it never fires on
|
|
14876
|
+
* a detection, a track or a device event (the same fail-closed pairing
|
|
14877
|
+
* `occupancy` has with the `device-event` trigger). That is how audio labels
|
|
14878
|
+
* leave `classes`: an audio rule names its sounds HERE, and the legacy path
|
|
14879
|
+
* (an `immediate` rule naming an `audio-*` class, one notification per
|
|
14880
|
+
* classified sample) stays exactly as it was for rules that already use it.
|
|
14881
|
+
*
|
|
14882
|
+
* NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
|
|
14883
|
+
* rather than an oversight: the viewer mirrors the descriptor enums BY HAND
|
|
14884
|
+
* (`camstack/src/data/notification-center.ts`, guarded by
|
|
14885
|
+
* `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
|
|
14886
|
+
* condition fields it does not know when a rule is saved from the phone.
|
|
14887
|
+
* Publishing an editor for a condition the app cannot round-trip is how an
|
|
14888
|
+
* operator loses a rule's conditions by opening it — so the descriptor, the
|
|
14889
|
+
* admin widget and the viewer mirror land together (P2 + P3), and only then
|
|
14890
|
+
* does an audio rule become authorable.
|
|
14891
|
+
*/
|
|
14892
|
+
audio: NcAudioConditionSchema.optional()
|
|
14734
14893
|
});
|
|
14735
14894
|
/** One delivery target: a `notification-output` Target ref + passthrough params. */
|
|
14736
14895
|
var NcRuleTargetSchema = object({
|
|
@@ -14844,6 +15003,73 @@ var NcThrottleSchema = object({
|
|
|
14844
15003
|
*/
|
|
14845
15004
|
granularity: NcThrottleGranularitySchema.optional()
|
|
14846
15005
|
});
|
|
15006
|
+
/**
|
|
15007
|
+
* How long the confirm gate may hold ONE notification, and how big the picture
|
|
15008
|
+
* it judges may be.
|
|
15009
|
+
*
|
|
15010
|
+
* The clamp is the product decision, not a coincidence of the model: p50 was
|
|
15011
|
+
* 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
|
|
15012
|
+
* arrives after the visitor has gone is not a notification. 448 px was enough
|
|
15013
|
+
* to score 16/16 on the operator's parking scenario — bigger costs latency and
|
|
15014
|
+
* tokens for pixels the model pools away.
|
|
15015
|
+
*/
|
|
15016
|
+
var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
|
|
15017
|
+
var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
|
|
15018
|
+
var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
|
|
15019
|
+
/** Comparison the model's COUNT must satisfy for the notification to fire. */
|
|
15020
|
+
var NcConfirmExpectSchema = object({
|
|
15021
|
+
op: _enum([
|
|
15022
|
+
">=",
|
|
15023
|
+
">",
|
|
15024
|
+
"<=",
|
|
15025
|
+
"<",
|
|
15026
|
+
"=="
|
|
15027
|
+
]),
|
|
15028
|
+
count: number().int().min(0).max(1e3)
|
|
15029
|
+
});
|
|
15030
|
+
/**
|
|
15031
|
+
* AI CONFIRM — a vision model looks at the picture this notification is about
|
|
15032
|
+
* to ship and says whether it agrees with the rule.
|
|
15033
|
+
*
|
|
15034
|
+
* It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
|
|
15035
|
+
* crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
|
|
15036
|
+
* on the operator's phone is not a verdict about this notification.
|
|
15037
|
+
*
|
|
15038
|
+
* FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
|
|
15039
|
+
* whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
|
|
15040
|
+
* the default and every fail-open is COUNTED, because a gate that always fails
|
|
15041
|
+
* open looks in the log exactly like a gate that works.
|
|
15042
|
+
*
|
|
15043
|
+
* Every field is `.optional()` rather than relied on as a Zod default at the
|
|
15044
|
+
* runtime seam: a Zod default does NOT run on the addon→addon cap path (three
|
|
15045
|
+
* production failures in one day), so the gate reads absent as the constant
|
|
15046
|
+
* above rather than trusting a parse it may never have seen.
|
|
15047
|
+
*/
|
|
15048
|
+
var NcConfirmSchema = object({
|
|
15049
|
+
/** Off unless asked for. An absent `confirm` and `enabled:false` are the
|
|
15050
|
+
* same thing, and both mean "deliver exactly as before". */
|
|
15051
|
+
enabled: boolean().default(false),
|
|
15052
|
+
/** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
|
|
15053
|
+
profileId: string().optional(),
|
|
15054
|
+
/**
|
|
15055
|
+
* The operator's question, in his own words. Absent = a question derived
|
|
15056
|
+
* from the rule (its class and its expectation).
|
|
15057
|
+
*
|
|
15058
|
+
* NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
|
|
15059
|
+
* banners, signage and plates as instructions if you let them reach the
|
|
15060
|
+
* prompt — proven live — so the authoritative contract stays in the system
|
|
15061
|
+
* turn and only rule-authored words land here.
|
|
15062
|
+
*/
|
|
15063
|
+
prompt: string().max(1e3).optional(),
|
|
15064
|
+
/** Fire only when the model's count satisfies this. Absent = the model's
|
|
15065
|
+
* own boolean verdict decides. */
|
|
15066
|
+
expect: NcConfirmExpectSchema.optional(),
|
|
15067
|
+
timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
|
|
15068
|
+
/** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
|
|
15069
|
+
onTimeout: _enum(["fire", "suppress"]).default("fire"),
|
|
15070
|
+
/** Longest edge the judged image is downscaled to before it is sent. */
|
|
15071
|
+
maxImagePx: number().int().min(64).max(2048).default(448)
|
|
15072
|
+
});
|
|
14847
15073
|
/** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
|
|
14848
15074
|
var NcRuleInputSchema = object({
|
|
14849
15075
|
name: string().min(1).max(200),
|
|
@@ -14904,7 +15130,13 @@ var NcRuleInputSchema = object({
|
|
|
14904
15130
|
* `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
|
|
14905
15131
|
* shape as every other actuation.
|
|
14906
15132
|
*/
|
|
14907
|
-
actions: NcRuleActionsSchema.optional()
|
|
15133
|
+
actions: NcRuleActionsSchema.optional(),
|
|
15134
|
+
/**
|
|
15135
|
+
* AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
|
|
15136
|
+
* a rule that predates the gate must keep delivering byte-for-byte as it
|
|
15137
|
+
* did, and absent is the only way to say that without a migration.
|
|
15138
|
+
*/
|
|
15139
|
+
confirm: NcConfirmSchema.optional()
|
|
14908
15140
|
});
|
|
14909
15141
|
/**
|
|
14910
15142
|
* Partial patch for `updateRule` — any subset of the input fields, plus the
|
|
@@ -14915,7 +15147,37 @@ var NcRuleInputSchema = object({
|
|
|
14915
15147
|
* still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
|
|
14916
15148
|
* `updateRule` patch.
|
|
14917
15149
|
*/
|
|
14918
|
-
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
15150
|
+
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
15151
|
+
disabledTargetIds: array(string()).optional(),
|
|
15152
|
+
/**
|
|
15153
|
+
* `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
|
|
15154
|
+
*
|
|
15155
|
+
* It makes the key optional to SUPPLY; the parse still materialises the
|
|
15156
|
+
* default when the key is absent. And `NcRuleStore.update` merges with
|
|
15157
|
+
* `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
|
|
15158
|
+
* one — which made every partial edit destructive:
|
|
15159
|
+
*
|
|
15160
|
+
* nc.updateRule({ throttle }) → conditions reset to `{}`
|
|
15161
|
+
* nc.setRuleTargetEnabled(...) → conditions reset to `{}`
|
|
15162
|
+
* setEnabled(ruleId, false) → conditions reset to `{}`
|
|
15163
|
+
*
|
|
15164
|
+
* A rule scoped to one camera and one zone silently became a rule that
|
|
15165
|
+
* matches EVERY event on EVERY camera, and lost its `media` policy
|
|
15166
|
+
* (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
|
|
15167
|
+
* live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
|
|
15168
|
+
* within a minute of a two-field patch.
|
|
15169
|
+
*
|
|
15170
|
+
* So every defaulted field is re-declared here WITHOUT its default. The
|
|
15171
|
+
* inner defaults still apply when the caller DOES send the key — `{}` for
|
|
15172
|
+
* conditions remains a real instruction ("clear them") — and only the
|
|
15173
|
+
* absent key is now genuinely absent.
|
|
15174
|
+
*/
|
|
15175
|
+
enabled: boolean().optional(),
|
|
15176
|
+
conditions: NcConditionsSchema.optional(),
|
|
15177
|
+
media: NcMediaPolicySchema.optional(),
|
|
15178
|
+
throttle: NcThrottleSchema.optional(),
|
|
15179
|
+
priority: number().int().min(1).max(5).optional()
|
|
15180
|
+
});
|
|
14919
15181
|
/** A persisted rule. */
|
|
14920
15182
|
var NcRuleSchema = NcRuleInputSchema.extend({
|
|
14921
15183
|
id: string(),
|
|
@@ -15216,6 +15478,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
|
|
|
15216
15478
|
* Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
|
|
15217
15479
|
* copy would lie the first time a rule is disabled.
|
|
15218
15480
|
*/
|
|
15481
|
+
/**
|
|
15482
|
+
* Why a device a mode NAMES is nonetheless not armed by it.
|
|
15483
|
+
*
|
|
15484
|
+
* Each value is an existing authority, never a new flag (D62): `muted` is the
|
|
15485
|
+
* per-camera notification switch the Notification Center already owns,
|
|
15486
|
+
* `detection-off` is the device's own detection binding being inactive, and
|
|
15487
|
+
* `offline` is the device manager's liveness. A fourth reason would mean a
|
|
15488
|
+
* fourth authority, and inventing one here is how a panel starts disagreeing
|
|
15489
|
+
* with the switches the operator actually used.
|
|
15490
|
+
*/
|
|
15491
|
+
var NcAlarmSkipReasonSchema = _enum([
|
|
15492
|
+
"muted",
|
|
15493
|
+
"detection-off",
|
|
15494
|
+
"offline"
|
|
15495
|
+
]);
|
|
15496
|
+
var NcAlarmSkippedDeviceSchema = object({
|
|
15497
|
+
deviceId: number().int(),
|
|
15498
|
+
reason: NcAlarmSkipReasonSchema
|
|
15499
|
+
});
|
|
15219
15500
|
var NcAlarmModeCoverageSchema = object({
|
|
15220
15501
|
mode: AlarmArmModeSchema,
|
|
15221
15502
|
/** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
|
|
@@ -15223,7 +15504,18 @@ var NcAlarmModeCoverageSchema = object({
|
|
|
15223
15504
|
/** At least one covering rule has no device scope, so the mode covers all. */
|
|
15224
15505
|
allDevices: boolean(),
|
|
15225
15506
|
/** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
|
|
15226
|
-
deviceIds: array(number().int())
|
|
15507
|
+
deviceIds: array(number().int()),
|
|
15508
|
+
/**
|
|
15509
|
+
* Devices this mode NAMES but cannot actually arm, each with the switch that
|
|
15510
|
+
* excludes it.
|
|
15511
|
+
*
|
|
15512
|
+
* "Away armed — 12 cameras" is a promise, and a muted camera among those
|
|
15513
|
+
* twelve makes it false in exactly the way nobody notices until an incident.
|
|
15514
|
+
* Defaulted to `[]` so a coverage answer computed before this field existed
|
|
15515
|
+
* still parses as "nothing known to be skipped" rather than failing the whole
|
|
15516
|
+
* alarm tab.
|
|
15517
|
+
*/
|
|
15518
|
+
skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
|
|
15227
15519
|
});
|
|
15228
15520
|
var NcAlarmConfigSchema = object({
|
|
15229
15521
|
/**
|
|
@@ -18055,9 +18347,16 @@ var CameraStatusSchema = object({
|
|
|
18055
18347
|
audio: CameraAudioStatusSchema.nullable(),
|
|
18056
18348
|
recording: CameraRecordingStatusSchema.nullable(),
|
|
18057
18349
|
/**
|
|
18058
|
-
* Per-camera
|
|
18350
|
+
* Per-camera functions an OPERATOR has turned off
|
|
18059
18351
|
* ([D61](../../../../docs/decisions/adr-0067.md)).
|
|
18060
18352
|
*
|
|
18353
|
+
* Composed from the AUTHORITIES themselves — the wrapper bindings,
|
|
18354
|
+
* `RecordingConfig.enabled`, the notification mute, the broker's audio
|
|
18355
|
+
* policy, the camera's own microphone — via `composeSwitchedOff`, not from
|
|
18356
|
+
* the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
|
|
18357
|
+
* The badge outlives the control panel: the panel was a convenience, this is
|
|
18358
|
+
* the difference between a camera being off and a camera being dead.
|
|
18359
|
+
*
|
|
18061
18360
|
* This is the difference between DISABLED and BROKEN. A camera whose
|
|
18062
18361
|
* `detection` block reports zero fps and whose `switchedOff` contains
|
|
18063
18362
|
* `'object-detection'` was switched off by a person; the same camera with an
|
|
@@ -24816,7 +25115,19 @@ var RecordingManifestSchema = object({
|
|
|
24816
25115
|
* profiles/subtrees/locations on this node). */
|
|
24817
25116
|
var RecordingDeviceUsageSchema = object({
|
|
24818
25117
|
deviceId: number(),
|
|
24819
|
-
usedBytes: number()
|
|
25118
|
+
usedBytes: number(),
|
|
25119
|
+
/**
|
|
25120
|
+
* Start of this camera's OLDEST indexed segment, across every profile and
|
|
25121
|
+
* location — the "Oldest footage" column in Recordings → Storage, and the
|
|
25122
|
+
* only honest answer to "is retention actually holding?" per camera.
|
|
25123
|
+
*
|
|
25124
|
+
* `null` = the camera has no footage. OPTIONAL because a recorder that
|
|
25125
|
+
* predates this field omits it entirely, and a hub whose types carry the
|
|
25126
|
+
* field must keep validating that older provider's payload: the framework
|
|
25127
|
+
* (types) and the addon ship on different trains, and the addon is usually
|
|
25128
|
+
* the later of the two.
|
|
25129
|
+
*/
|
|
25130
|
+
oldestMs: number().nullable().optional()
|
|
24820
25131
|
});
|
|
24821
25132
|
/** Recording storage usage + capacity for one storage location. */
|
|
24822
25133
|
var RecordingLocationUsageSchema = object({
|
|
@@ -24844,6 +25155,57 @@ var RecordingStorageUsageSchema = object({
|
|
|
24844
25155
|
locations: array(RecordingLocationUsageSchema)
|
|
24845
25156
|
});
|
|
24846
25157
|
/**
|
|
25158
|
+
* The OPERATOR-ARMED half of multi-location recordings (D116).
|
|
25159
|
+
*
|
|
25160
|
+
* The placement plan decides where NEW writes go and moves nothing. A rebalance
|
|
25161
|
+
* is the operator asking for the EXISTING archive to be brought into line with
|
|
25162
|
+
* that plan: one relocate job per (camera, profile) pile that sits on the wrong
|
|
25163
|
+
* location, run FIFO behind the single-flight mover.
|
|
25164
|
+
*
|
|
25165
|
+
* `plan…` and `start…` return the SAME shape deliberately — what the operator
|
|
25166
|
+
* confirms is exactly what gets enqueued, and `jobIds` is the only difference
|
|
25167
|
+
* (empty on the plan).
|
|
25168
|
+
*/
|
|
25169
|
+
var RecordingRebalanceMoveSchema = object({
|
|
25170
|
+
deviceId: number(),
|
|
25171
|
+
profile: string(),
|
|
25172
|
+
fromLocationId: string(),
|
|
25173
|
+
toLocationId: string(),
|
|
25174
|
+
bytes: number(),
|
|
25175
|
+
files: number().int()
|
|
25176
|
+
});
|
|
25177
|
+
/** Why a pile that is out of place is staying there. Every refusal is
|
|
25178
|
+
* reported: a rebalance that silently drops a camera reads exactly like one
|
|
25179
|
+
* that had nothing to do. */
|
|
25180
|
+
var RecordingRebalanceSkipReasonSchema = _enum([
|
|
25181
|
+
"unassigned",
|
|
25182
|
+
"target-not-writable",
|
|
25183
|
+
"below-threshold",
|
|
25184
|
+
"no-headroom"
|
|
25185
|
+
]);
|
|
25186
|
+
var RecordingRebalanceSkipSchema = object({
|
|
25187
|
+
deviceId: number(),
|
|
25188
|
+
profile: string(),
|
|
25189
|
+
fromLocationId: string(),
|
|
25190
|
+
/** The location the plan wants; null when the camera has no assignment. */
|
|
25191
|
+
toLocationId: string().nullable(),
|
|
25192
|
+
bytes: number(),
|
|
25193
|
+
reason: RecordingRebalanceSkipReasonSchema
|
|
25194
|
+
});
|
|
25195
|
+
var RecordingRebalancePlanSchema = object({
|
|
25196
|
+
moves: array(RecordingRebalanceMoveSchema),
|
|
25197
|
+
skipped: array(RecordingRebalanceSkipSchema),
|
|
25198
|
+
bytesToMove: number(),
|
|
25199
|
+
/** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
|
|
25200
|
+
jobIds: array(string())
|
|
25201
|
+
});
|
|
25202
|
+
var RecordingRebalanceInputSchema = object({
|
|
25203
|
+
/** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
|
|
25204
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
25205
|
+
/** Ignore piles smaller than this (default 1 GB). */
|
|
25206
|
+
minMoveGb: number().min(0).optional()
|
|
25207
|
+
});
|
|
25208
|
+
/**
|
|
24847
25209
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
24848
25210
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
24849
25211
|
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
@@ -25006,9 +25368,24 @@ method(object({
|
|
|
25006
25368
|
}), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
25007
25369
|
kind: "mutation",
|
|
25008
25370
|
auth: "admin"
|
|
25371
|
+
}), method(RelocateFootageInputSchema, object({ jobId: string() }), {
|
|
25372
|
+
kind: "mutation",
|
|
25373
|
+
auth: "admin"
|
|
25374
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
25375
|
+
kind: "query",
|
|
25376
|
+
auth: "admin"
|
|
25377
|
+
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
25378
|
+
kind: "mutation",
|
|
25379
|
+
auth: "admin"
|
|
25380
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
25381
|
+
kind: "query",
|
|
25382
|
+
auth: "admin"
|
|
25383
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
25384
|
+
kind: "mutation",
|
|
25385
|
+
auth: "admin"
|
|
25009
25386
|
});
|
|
25010
25387
|
/**
|
|
25011
|
-
* `
|
|
25388
|
+
* `recording-export` cap — render a footage time range into a single downloadable
|
|
25012
25389
|
* MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
|
|
25013
25390
|
* bounded lifetime with a durable history, auto-expiry, and optional
|
|
25014
25391
|
* delete-after-download.
|
|
@@ -25023,10 +25400,42 @@ method(object({
|
|
|
25023
25400
|
*/
|
|
25024
25401
|
/** Playback-speed multiplier for the render (1 = realtime). */
|
|
25025
25402
|
var ExportSpeedSchema = number().min(.25).max(32);
|
|
25403
|
+
/**
|
|
25404
|
+
* One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
|
|
25405
|
+
*
|
|
25406
|
+
* Relative and not absolute epoch on purpose: the renderer's frame-select
|
|
25407
|
+
* expression sees ffmpeg's `t`, which starts at 0 for the export's source
|
|
25408
|
+
* playlist. Handing it absolute epochs would make every call site responsible
|
|
25409
|
+
* for the same subtraction, and the one that forgot would emit a filter that
|
|
25410
|
+
* selects nothing — silently, as a uniform timelapse.
|
|
25411
|
+
*/
|
|
25412
|
+
var ExportDenseRangeSchema = object({
|
|
25413
|
+
fromSec: number().nonnegative(),
|
|
25414
|
+
toSec: number().nonnegative()
|
|
25415
|
+
}).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
|
|
25416
|
+
/**
|
|
25417
|
+
* Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
|
|
25418
|
+
* listed ranges and at the base `everyMs` everywhere else.
|
|
25419
|
+
*
|
|
25420
|
+
* `everyMs` must be strictly smaller than the base cadence — a dense rate that
|
|
25421
|
+
* is not denser renders a uniform timelapse the operator believes is two-rate.
|
|
25422
|
+
*/
|
|
25423
|
+
var ExportDenseSchema = object({
|
|
25424
|
+
everyMs: number().int().positive(),
|
|
25425
|
+
ranges: array(ExportDenseRangeSchema).min(1).max(200)
|
|
25426
|
+
});
|
|
25026
25427
|
/** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
|
|
25027
25428
|
var ExportTimelapseSchema = object({
|
|
25028
25429
|
everyMs: number().int().positive(),
|
|
25029
|
-
outputFps: number().int().min(1).max(60).optional()
|
|
25430
|
+
outputFps: number().int().min(1).max(60).optional(),
|
|
25431
|
+
/** Optional second, FASTER rate over the intervals that matter. */
|
|
25432
|
+
dense: ExportDenseSchema.optional()
|
|
25433
|
+
}).superRefine((v, ctx) => {
|
|
25434
|
+
if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
|
|
25435
|
+
code: ZodIssueCode.custom,
|
|
25436
|
+
message: "dense.everyMs must be strictly smaller than the base everyMs",
|
|
25437
|
+
path: ["dense", "everyMs"]
|
|
25438
|
+
});
|
|
25030
25439
|
});
|
|
25031
25440
|
/**
|
|
25032
25441
|
* Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
|
|
@@ -25084,6 +25493,19 @@ var ExportDownloadSchema = object({
|
|
|
25084
25493
|
url: string(),
|
|
25085
25494
|
endpoints: array(string())
|
|
25086
25495
|
});
|
|
25496
|
+
/**
|
|
25497
|
+
* A finished export's bytes, inline.
|
|
25498
|
+
*
|
|
25499
|
+
* `bytes` is the DECODED length — the number the caller bounds and logs
|
|
25500
|
+
* against, so nobody has to infer it from the base64 length.
|
|
25501
|
+
*/
|
|
25502
|
+
var ExportBytesSchema = object({
|
|
25503
|
+
base64: string(),
|
|
25504
|
+
contentType: string(),
|
|
25505
|
+
/** Suggested filename, extension included. */
|
|
25506
|
+
name: string(),
|
|
25507
|
+
bytes: number().int().nonnegative()
|
|
25508
|
+
});
|
|
25087
25509
|
method(object({
|
|
25088
25510
|
deviceId: number(),
|
|
25089
25511
|
profile: string(),
|
|
@@ -25108,6 +25530,9 @@ method(object({
|
|
|
25108
25530
|
}), method(object({ exportId: string() }), ExportDownloadSchema, {
|
|
25109
25531
|
kind: "query",
|
|
25110
25532
|
auth: "protected"
|
|
25533
|
+
}), method(object({ exportId: string() }), ExportBytesSchema, {
|
|
25534
|
+
kind: "query",
|
|
25535
|
+
auth: "protected"
|
|
25111
25536
|
});
|
|
25112
25537
|
/**
|
|
25113
25538
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
@@ -31785,6 +32210,12 @@ Object.freeze({
|
|
|
31785
32210
|
addonId: null,
|
|
31786
32211
|
access: "create"
|
|
31787
32212
|
},
|
|
32213
|
+
"recording.cancelRelocateJob": {
|
|
32214
|
+
capName: "recording",
|
|
32215
|
+
capScope: "system",
|
|
32216
|
+
addonId: null,
|
|
32217
|
+
access: "create"
|
|
32218
|
+
},
|
|
31788
32219
|
"recording.cancelStorageMigrationMove": {
|
|
31789
32220
|
capName: "recording",
|
|
31790
32221
|
capScope: "system",
|
|
@@ -31839,6 +32270,12 @@ Object.freeze({
|
|
|
31839
32270
|
addonId: null,
|
|
31840
32271
|
access: "view"
|
|
31841
32272
|
},
|
|
32273
|
+
"recording.listRelocateJobs": {
|
|
32274
|
+
capName: "recording",
|
|
32275
|
+
capScope: "system",
|
|
32276
|
+
addonId: null,
|
|
32277
|
+
access: "view"
|
|
32278
|
+
},
|
|
31842
32279
|
"recording.locateSegment": {
|
|
31843
32280
|
capName: "recording",
|
|
31844
32281
|
capScope: "system",
|
|
@@ -31851,6 +32288,12 @@ Object.freeze({
|
|
|
31851
32288
|
addonId: null,
|
|
31852
32289
|
access: "create"
|
|
31853
32290
|
},
|
|
32291
|
+
"recording.planStorageRebalance": {
|
|
32292
|
+
capName: "recording",
|
|
32293
|
+
capScope: "system",
|
|
32294
|
+
addonId: null,
|
|
32295
|
+
access: "view"
|
|
32296
|
+
},
|
|
31854
32297
|
"recording.pruneFootage": {
|
|
31855
32298
|
capName: "recording",
|
|
31856
32299
|
capScope: "system",
|
|
@@ -31875,6 +32318,12 @@ Object.freeze({
|
|
|
31875
32318
|
addonId: null,
|
|
31876
32319
|
access: "create"
|
|
31877
32320
|
},
|
|
32321
|
+
"recording.relocateFootage": {
|
|
32322
|
+
capName: "recording",
|
|
32323
|
+
capScope: "system",
|
|
32324
|
+
addonId: null,
|
|
32325
|
+
access: "create"
|
|
32326
|
+
},
|
|
31878
32327
|
"recording.renderClip": {
|
|
31879
32328
|
capName: "recording",
|
|
31880
32329
|
capScope: "system",
|
|
@@ -31911,38 +32360,50 @@ Object.freeze({
|
|
|
31911
32360
|
addonId: null,
|
|
31912
32361
|
access: "create"
|
|
31913
32362
|
},
|
|
32363
|
+
"recording.startStorageRebalance": {
|
|
32364
|
+
capName: "recording",
|
|
32365
|
+
capScope: "system",
|
|
32366
|
+
addonId: null,
|
|
32367
|
+
access: "create"
|
|
32368
|
+
},
|
|
31914
32369
|
"recordingExport.cancelExport": {
|
|
31915
|
-
capName: "
|
|
32370
|
+
capName: "recording-export",
|
|
31916
32371
|
capScope: "system",
|
|
31917
32372
|
addonId: null,
|
|
31918
32373
|
access: "create"
|
|
31919
32374
|
},
|
|
31920
32375
|
"recordingExport.createExport": {
|
|
31921
|
-
capName: "
|
|
32376
|
+
capName: "recording-export",
|
|
31922
32377
|
capScope: "system",
|
|
31923
32378
|
addonId: null,
|
|
31924
32379
|
access: "create"
|
|
31925
32380
|
},
|
|
31926
32381
|
"recordingExport.deleteExport": {
|
|
31927
|
-
capName: "
|
|
32382
|
+
capName: "recording-export",
|
|
31928
32383
|
capScope: "system",
|
|
31929
32384
|
addonId: null,
|
|
31930
32385
|
access: "delete"
|
|
31931
32386
|
},
|
|
31932
32387
|
"recordingExport.getDownloadUrl": {
|
|
31933
|
-
capName: "
|
|
32388
|
+
capName: "recording-export",
|
|
31934
32389
|
capScope: "system",
|
|
31935
32390
|
addonId: null,
|
|
31936
32391
|
access: "view"
|
|
31937
32392
|
},
|
|
31938
32393
|
"recordingExport.getExport": {
|
|
31939
|
-
capName: "
|
|
32394
|
+
capName: "recording-export",
|
|
31940
32395
|
capScope: "system",
|
|
31941
32396
|
addonId: null,
|
|
31942
32397
|
access: "view"
|
|
31943
32398
|
},
|
|
31944
32399
|
"recordingExport.listExports": {
|
|
31945
|
-
capName: "
|
|
32400
|
+
capName: "recording-export",
|
|
32401
|
+
capScope: "system",
|
|
32402
|
+
addonId: null,
|
|
32403
|
+
access: "view"
|
|
32404
|
+
},
|
|
32405
|
+
"recordingExport.readExportBytes": {
|
|
32406
|
+
capName: "recording-export",
|
|
31946
32407
|
capScope: "system",
|
|
31947
32408
|
addonId: null,
|
|
31948
32409
|
access: "view"
|
|
@@ -33319,6 +33780,104 @@ var FramerateField = number().int().min(1).max(60);
|
|
|
33319
33780
|
var TargetsField = array(NcRuleTargetSchema).min(1);
|
|
33320
33781
|
var PriorityField = number().int().min(1).max(5);
|
|
33321
33782
|
/**
|
|
33783
|
+
* Explicit override of the DENSE sampling cadence, seconds.
|
|
33784
|
+
*
|
|
33785
|
+
* Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
|
|
33786
|
+
* 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
|
|
33787
|
+
* made that same base 3 s and rendered a person pass as two frames.)
|
|
33788
|
+
*
|
|
33789
|
+
* THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
|
|
33790
|
+
* `denseCadenceSec` and played at `framerate` occupies
|
|
33791
|
+
*
|
|
33792
|
+
* outputSeconds = (rangeSec / denseCadenceSec) / framerate
|
|
33793
|
+
*
|
|
33794
|
+
* 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.
|
|
33795
|
+
* Halving this field doubles the frames INSIDE ranges only — the base cadence,
|
|
33796
|
+
* and therefore the length of a quiet night, does not move.
|
|
33797
|
+
*
|
|
33798
|
+
* Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
|
|
33799
|
+
* the recording has them returns the same frames, requested twice. Must be
|
|
33800
|
+
* STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
|
|
33801
|
+
* a uniform video the operator believes is two-rate — and upsert refuses it
|
|
33802
|
+
* rather than letting the export cap reject the render hours after the window.
|
|
33803
|
+
*/
|
|
33804
|
+
var DenseCadenceSecField = number().min(.1).max(3600);
|
|
33805
|
+
/**
|
|
33806
|
+
* Minimum seconds of OUTPUT video each detection range must occupy.
|
|
33807
|
+
*
|
|
33808
|
+
* The operator-facing form of the arithmetic above: instead of solving for a
|
|
33809
|
+
* cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
|
|
33810
|
+
* 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
|
|
33811
|
+
* that range every ~583 ms.
|
|
33812
|
+
*
|
|
33813
|
+
* ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
|
|
33814
|
+
* ranges are terms of a single ffmpeg `select` expression that cannot vary rate
|
|
33815
|
+
* per term — so the MOST DEMANDING (shortest) range sets the rate and longer
|
|
33816
|
+
* ranges are sampled denser than they need. Per-range cadences require a cap
|
|
33817
|
+
* schema change and are the tracked follow-up.
|
|
33818
|
+
*
|
|
33819
|
+
* A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
|
|
33820
|
+
* is rendered with every frame that EXISTS and no more: the guarantee is capped
|
|
33821
|
+
* by real footage, never met by duplicating frames into motion that never
|
|
33822
|
+
* happened.
|
|
33823
|
+
*/
|
|
33824
|
+
var MinDwellSecField = number().min(0).max(60);
|
|
33825
|
+
/**
|
|
33826
|
+
* Caption burned into the notification's preview frame.
|
|
33827
|
+
*
|
|
33828
|
+
* Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
|
|
33829
|
+
* `rule`, `from`, `to`) and rendered by the SAME renderer — a second
|
|
33830
|
+
* templating dialect for one field would be a second thing to explain.
|
|
33831
|
+
*
|
|
33832
|
+
* Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
|
|
33833
|
+
* operator saying "the frame, no caption" — a distinct, reachable answer, and
|
|
33834
|
+
* the reason this is not `.min(1)`.
|
|
33835
|
+
*/
|
|
33836
|
+
var PreviewTextField = string().max(200);
|
|
33837
|
+
/**
|
|
33838
|
+
* Whether the notification's preview is a STILL or a short animation.
|
|
33839
|
+
*
|
|
33840
|
+
* The operator's ask, verbatim: *"inviato come gif o video (come per le altre
|
|
33841
|
+
* rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
|
|
33842
|
+
* night reads better as three seconds of motion than as one frame of it. Both
|
|
33843
|
+
* modes get the SAME treatment (blurred frame, large centred title); `'gif'`
|
|
33844
|
+
* simply applies it to a dozen frames sampled across the render and assembles
|
|
33845
|
+
* them.
|
|
33846
|
+
*
|
|
33847
|
+
* `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
|
|
33848
|
+
* seeks and a palette pass, and no rule that never asked for one should start
|
|
33849
|
+
* paying that on the deploy that shipped it.
|
|
33850
|
+
*
|
|
33851
|
+
* A GIF that cannot be assembled DEGRADES to the still — never to nothing.
|
|
33852
|
+
*/
|
|
33853
|
+
var PreviewModeField = _enum(["image", "gif"]);
|
|
33854
|
+
/**
|
|
33855
|
+
* Which detection classes the notification reports counts for.
|
|
33856
|
+
*
|
|
33857
|
+
* The counts come from the tracks the render ALREADY fetched for its dense-range
|
|
33858
|
+
* plan — no second query — aggregated per class. Absent or empty means "every
|
|
33859
|
+
* class the window actually contained", which is what an operator who never
|
|
33860
|
+
* opened the field wants; a list narrows it (`['person']` on a driveway that
|
|
33861
|
+
* counts cars all night).
|
|
33862
|
+
*
|
|
33863
|
+
* Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
|
|
33864
|
+
* …). An unknown name simply never matches and reports nothing — it is not an
|
|
33865
|
+
* error, because a rule may legitimately name a class this camera's model does
|
|
33866
|
+
* not emit.
|
|
33867
|
+
*
|
|
33868
|
+
* The counts are exposed to {@link TimelapseTemplateSchema} as:
|
|
33869
|
+
* - `{{detections}}` — total over the reported classes
|
|
33870
|
+
* - `{{detectionSummary}}` — `2 persone, 1 veicolo`
|
|
33871
|
+
* - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
|
|
33872
|
+
* one per class, `count_` + the class name
|
|
33873
|
+
*
|
|
33874
|
+
* With NO custom body template the summary is appended to the derived body, and
|
|
33875
|
+
* only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
|
|
33876
|
+
* reads. With a custom template the operator owns every word — nothing is
|
|
33877
|
+
* appended, so `{{detectionSummary}}` is how he asks for it.
|
|
33878
|
+
*/
|
|
33879
|
+
var ReportClassesField = array(string().min(1).max(40)).max(20);
|
|
33880
|
+
/**
|
|
33322
33881
|
* Client-supplied timelapse-rule fields. The server stamps id / createdBy /
|
|
33323
33882
|
* createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
|
|
33324
33883
|
* here (see the ownership note above).
|
|
@@ -33338,9 +33897,30 @@ var TimelapseRuleInputSchema = object({
|
|
|
33338
33897
|
cadenceSec: CadenceSecField.default(15),
|
|
33339
33898
|
/** Output frames per second of the assembled mp4 (predecessor parity). */
|
|
33340
33899
|
framerate: FramerateField.default(10),
|
|
33900
|
+
/**
|
|
33901
|
+
* Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
|
|
33902
|
+
* as `max(1s, cadenceSec / 30)`, which is what every rule written before this
|
|
33903
|
+
* field gets.
|
|
33904
|
+
*/
|
|
33905
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
33906
|
+
/** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
|
|
33907
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
33341
33908
|
/** `notification-output` targets the finished video/thumbnail is sent to. */
|
|
33342
33909
|
targets: TargetsField,
|
|
33343
33910
|
template: TimelapseTemplateSchema.optional(),
|
|
33911
|
+
/**
|
|
33912
|
+
* Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
|
|
33913
|
+
* and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
|
|
33914
|
+
*
|
|
33915
|
+
* Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
|
|
33916
|
+
* the notification's title/body, and clearing it (`template: null`) must not
|
|
33917
|
+
* silently clear the caption too.
|
|
33918
|
+
*/
|
|
33919
|
+
previewText: PreviewTextField.optional(),
|
|
33920
|
+
/** Still or animation — see {@link PreviewModeField}. */
|
|
33921
|
+
previewMode: PreviewModeField.default("image"),
|
|
33922
|
+
/** Classes the notification counts — see {@link ReportClassesField}. */
|
|
33923
|
+
reportClasses: ReportClassesField.optional(),
|
|
33344
33924
|
/** Canonical notification priority ordinal (1..5); per-target overridable. */
|
|
33345
33925
|
priority: PriorityField.default(3)
|
|
33346
33926
|
});
|
|
@@ -33351,8 +33931,13 @@ object({
|
|
|
33351
33931
|
schedule: NcScheduleSchema.optional(),
|
|
33352
33932
|
cadenceSec: CadenceSecField.optional(),
|
|
33353
33933
|
framerate: FramerateField.optional(),
|
|
33934
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
33935
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
33354
33936
|
targets: TargetsField.optional(),
|
|
33355
33937
|
template: TimelapseTemplateSchema.nullable().optional(),
|
|
33938
|
+
previewText: PreviewTextField.optional(),
|
|
33939
|
+
previewMode: PreviewModeField.optional(),
|
|
33940
|
+
reportClasses: ReportClassesField.optional(),
|
|
33356
33941
|
priority: PriorityField.optional()
|
|
33357
33942
|
});
|
|
33358
33943
|
TimelapseRuleInputSchema.extend({
|
|
@@ -33364,10 +33949,28 @@ TimelapseRuleInputSchema.extend({
|
|
|
33364
33949
|
*/
|
|
33365
33950
|
ownerUserId: string().optional(),
|
|
33366
33951
|
/**
|
|
33367
|
-
* Epoch-ms of the
|
|
33368
|
-
*
|
|
33952
|
+
* Epoch-ms of the NEWEST successful generation across every camera of this
|
|
33953
|
+
* rule. What a UI shows, and the compatibility floor for
|
|
33954
|
+
* {@link readTimelapseGeneratedAt}. Absent = never generated.
|
|
33369
33955
|
*/
|
|
33370
33956
|
lastGeneratedAt: number().optional(),
|
|
33957
|
+
/**
|
|
33958
|
+
* PER-CAMERA generation state, keyed by `String(deviceId)` — the
|
|
33959
|
+
* re-generation guard's real durable state.
|
|
33960
|
+
*
|
|
33961
|
+
* One rule covers several cameras and each renders its own video, so a rule
|
|
33962
|
+
* -wide stamp is wrong in the direction that DESTROYS work: camera A
|
|
33963
|
+
* succeeding at 06:05 tells camera B, whose render failed, that it is
|
|
33964
|
+
* already done — and B's night is gone for good, because the window will not
|
|
33965
|
+
* come back.
|
|
33966
|
+
*
|
|
33967
|
+
* ADDITIVE, so the migration is free: a row written before this field simply
|
|
33968
|
+
* has no map, and {@link readTimelapseGeneratedAt} falls back to
|
|
33969
|
+
* {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
|
|
33970
|
+
* "never generated" would re-render and re-notify every camera of every rule
|
|
33971
|
+
* once, on the deploy that shipped the map.
|
|
33972
|
+
*/
|
|
33973
|
+
generatedByDevice: record(string(), number()).optional(),
|
|
33371
33974
|
/** userId of the caller who created the rule (server-stamped). */
|
|
33372
33975
|
createdBy: string(),
|
|
33373
33976
|
createdAt: number(),
|