@camstack/addon-post-analysis 1.2.65 → 1.2.67
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/{dist-DTClXZLm.js → dist-9EkXtpfJ.js} +615 -22
- package/dist/{dist-4dhFDogy.mjs → dist-DJC4JrMD.mjs} +586 -23
- package/dist/embedding-encoder/index.js +1 -1
- package/dist/embedding-encoder/index.mjs +1 -1
- package/dist/pipeline-analytics/_stub.js +1 -1
- package/dist/pipeline-analytics/{_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-Ck9Z2cZR.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-ZFLOdLjS.mjs} +3 -3
- package/dist/pipeline-analytics/{_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-DO3ZGk1V.mjs → _virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-CocFIK-G.mjs} +1 -1
- package/dist/pipeline-analytics/{hostInit-DvCGVFX8.mjs → hostInit-b11Ff_-Y.mjs} +3 -3
- package/dist/pipeline-analytics/index.js +5154 -718
- package/dist/pipeline-analytics/index.mjs +5147 -712
- package/dist/pipeline-analytics/remoteEntry.js +1 -1
- package/package.json +1 -1
|
@@ -7607,6 +7607,13 @@ var CameraSwitchGroupSchema = object({
|
|
|
7607
7607
|
fetchedAt: number()
|
|
7608
7608
|
});
|
|
7609
7609
|
/**
|
|
7610
|
+
* The wrapper capability each wrapper-backed switch controls. Named constants
|
|
7611
|
+
* because the same strings appear in `legacy-migrations.ts`, in
|
|
7612
|
+
* `isCapActiveForDevice` call sites and in the fake harness — a typo in any of
|
|
7613
|
+
* them is a switch that silently writes a binding nobody reads.
|
|
7614
|
+
*/
|
|
7615
|
+
var DETECTION_PIPELINE_CAP_NAME = "detection-pipeline";
|
|
7616
|
+
/**
|
|
7610
7617
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
7611
7618
|
* recordings and events management surfaces.
|
|
7612
7619
|
*
|
|
@@ -7831,7 +7838,15 @@ function deriveRecordingMode(config) {
|
|
|
7831
7838
|
* Each completed/failed run also lands one durable ops-log row on its owning
|
|
7832
7839
|
* addon surface.
|
|
7833
7840
|
*/
|
|
7841
|
+
/**
|
|
7842
|
+
* `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
|
|
7843
|
+
* rebalance enqueues one job per (camera, profile). Refusing the second job —
|
|
7844
|
+
* what the engine did before — turned a fifteen-camera rebalance into fifteen
|
|
7845
|
+
* manual retries. Queued jobs run FIFO; a queued job that is cancelled never
|
|
7846
|
+
* runs at all.
|
|
7847
|
+
*/
|
|
7834
7848
|
var RelocateJobStateSchema = _enum([
|
|
7849
|
+
"queued",
|
|
7835
7850
|
"running",
|
|
7836
7851
|
"done",
|
|
7837
7852
|
"failed",
|
|
@@ -7866,6 +7881,15 @@ var RelocateFootageInputSchema = object({
|
|
|
7866
7881
|
/** Limits relocation to the logical profile class. Omit only for the
|
|
7867
7882
|
* pre-orchestration compatibility path. */
|
|
7868
7883
|
footageClass: RelocateFootageClassSchema.optional(),
|
|
7884
|
+
/** Scope the move to ONE camera. Absent = every camera on the source, which
|
|
7885
|
+
* is what a whole-disk drain means. The rebalance path always sets it: its
|
|
7886
|
+
* unit is a (camera, profile) pile, not a disk. */
|
|
7887
|
+
deviceId: number().int().optional(),
|
|
7888
|
+
/** Scope the move to specific segment profiles (`high` / `mid` / `low`).
|
|
7889
|
+
* Finer than `footageClass`, which cannot separate high from mid — and the
|
|
7890
|
+
* placement plan assigns those two independently, so a rebalance that could
|
|
7891
|
+
* only say "recordings" would move footage the plan never asked to move. */
|
|
7892
|
+
profiles: array(string()).optional(),
|
|
7869
7893
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
7870
7894
|
* never allowed to starve live writers. */
|
|
7871
7895
|
throttleMbps: number().min(1).max(1e3).optional()
|
|
@@ -8001,6 +8025,21 @@ var StorageLocationSchema = object({
|
|
|
8001
8025
|
nodeId: string().optional(),
|
|
8002
8026
|
isDefault: boolean().default(false),
|
|
8003
8027
|
isSystem: boolean().default(false),
|
|
8028
|
+
/**
|
|
8029
|
+
* Operator opt-in: whether consumers that BALANCE across several locations
|
|
8030
|
+
* of a type may write here. Recordings reads it today; event media and
|
|
8031
|
+
* backups are the next consumers, which is why the flag lives on the
|
|
8032
|
+
* location rather than in any one addon's store — nothing has to be
|
|
8033
|
+
* extended to add the next consumer.
|
|
8034
|
+
*
|
|
8035
|
+
* OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
|
|
8036
|
+
* flag existed reads back with no flag and keeps working exactly as before;
|
|
8037
|
+
* that is the whole compat story, and it is why no migration ships with it.
|
|
8038
|
+
* A newly CREATED sibling is stamped `false` by the orchestrator (creating a
|
|
8039
|
+
* disk must not silently start writing to it); the default of a type is
|
|
8040
|
+
* always stamped `true`.
|
|
8041
|
+
*/
|
|
8042
|
+
enabled: boolean().optional(),
|
|
8004
8043
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
8005
8044
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
8006
8045
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -12540,7 +12579,8 @@ var embeddingEncoderCapability = {
|
|
|
12540
12579
|
};
|
|
12541
12580
|
/**
|
|
12542
12581
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
12543
|
-
* filesystem
|
|
12582
|
+
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
12583
|
+
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
12544
12584
|
* admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
|
|
12545
12585
|
* (one provider per node); the hub calls it with `{nodeId}` so the codegen
|
|
12546
12586
|
* routes to that exact node (default `nodeIdMode:'routing'`).
|
|
@@ -14408,6 +14448,13 @@ var MaskGridDimsSchema = object({
|
|
|
14408
14448
|
* `package-event` are pure trigger kinds (no urgency dimension). Extending
|
|
14409
14449
|
* this one field keeps the schema additive — a rule still declares exactly
|
|
14410
14450
|
* one trigger.
|
|
14451
|
+
*
|
|
14452
|
+
* AUDIO rules add no member here, for the reason occupancy added none: the
|
|
14453
|
+
* enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
|
|
14454
|
+
* mirror.ts` fails the build on a member the app cannot render) and every
|
|
14455
|
+
* member costs a release train. A sustained-sound rule is therefore an
|
|
14456
|
+
* `immediate` rule carrying {@link NcConditions.audio} — the condition is the
|
|
14457
|
+
* trigger discriminator, exactly as `occupancy` is on `device-event`.
|
|
14411
14458
|
*/
|
|
14412
14459
|
var NcDeliverySchema = _enum([
|
|
14413
14460
|
"immediate",
|
|
@@ -14422,15 +14469,32 @@ var NcDeliverySchema = _enum([
|
|
|
14422
14469
|
* depend on a provider's raw event name or payload shape.
|
|
14423
14470
|
*/
|
|
14424
14471
|
var NcSystemEventKindSchema = _enum([
|
|
14425
|
-
"
|
|
14426
|
-
"
|
|
14472
|
+
"device-online",
|
|
14473
|
+
"device-offline",
|
|
14474
|
+
"device-disabled",
|
|
14475
|
+
"device-enabled",
|
|
14427
14476
|
"stream-online",
|
|
14428
14477
|
"stream-offline",
|
|
14429
14478
|
"node-online",
|
|
14430
14479
|
"node-offline",
|
|
14431
14480
|
"addon-update-available",
|
|
14432
|
-
"server-update-available"
|
|
14481
|
+
"server-update-available",
|
|
14482
|
+
"alarm-triggered",
|
|
14483
|
+
"alarm-armed",
|
|
14484
|
+
"alarm-disarmed",
|
|
14485
|
+
"camera-online",
|
|
14486
|
+
"camera-offline",
|
|
14487
|
+
"camera-disabled",
|
|
14488
|
+
"camera-enabled"
|
|
14489
|
+
]);
|
|
14490
|
+
/** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
|
|
14491
|
+
var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
|
|
14492
|
+
"camera-online",
|
|
14493
|
+
"camera-offline",
|
|
14494
|
+
"camera-disabled",
|
|
14495
|
+
"camera-enabled"
|
|
14433
14496
|
]);
|
|
14497
|
+
NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
|
|
14434
14498
|
/**
|
|
14435
14499
|
* One coherent system-event condition. `kinds` is the required opt-in safety
|
|
14436
14500
|
* gate; the remaining lists are optional narrowing filters relevant to the
|
|
@@ -14439,6 +14503,18 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14439
14503
|
var NcSystemEventConditionSchema = object({
|
|
14440
14504
|
kinds: array(NcSystemEventKindSchema).min(1),
|
|
14441
14505
|
deviceIds: array(number().int()).min(1).optional(),
|
|
14506
|
+
/**
|
|
14507
|
+
* Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
|
|
14508
|
+
* `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
|
|
14509
|
+
* is what a liveness rule means when nobody said otherwise.
|
|
14510
|
+
*
|
|
14511
|
+
* This is where "only my cameras" is expressed, and it lives on the rule for
|
|
14512
|
+
* one reason: the intake cannot know which devices this household cares
|
|
14513
|
+
* about, and a producer-side filter is one no operator can change. Fails
|
|
14514
|
+
* CLOSED — a subject whose device type is unknown (an id the device mirror
|
|
14515
|
+
* does not carry) matches no `deviceTypes` list.
|
|
14516
|
+
*/
|
|
14517
|
+
deviceTypes: array(string().min(1)).min(1).optional(),
|
|
14442
14518
|
nodeIds: array(string().min(1)).min(1).optional(),
|
|
14443
14519
|
packageNames: array(string().min(1)).min(1).optional()
|
|
14444
14520
|
});
|
|
@@ -14489,6 +14565,47 @@ var NcOccupancyConditionSchema = object({
|
|
|
14489
14565
|
sustainSeconds: number().int().min(0).max(3600).default(15)
|
|
14490
14566
|
});
|
|
14491
14567
|
/**
|
|
14568
|
+
* Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
|
|
14569
|
+
*
|
|
14570
|
+
* Operator-approved vocabulary (2026-08-12, option A — the same one the
|
|
14571
|
+
* reference notifier uses, so an operator moving between them re-uses what
|
|
14572
|
+
* they already know): a rule matches when, over a sampling window of
|
|
14573
|
+
* `samplingSeconds`, at least `hitPercent`% of the audio samples in that
|
|
14574
|
+
* window are HITS. A sample is a hit when it satisfies BOTH present filters:
|
|
14575
|
+
*
|
|
14576
|
+
* - `dbThreshold` — its level is at or above this many dBFS (see
|
|
14577
|
+
* {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
|
|
14578
|
+
* - `labels` — the classifier put at least one of these labels on it.
|
|
14579
|
+
*
|
|
14580
|
+
* Both are OPTIONAL and independent, which is the point of the shape: a
|
|
14581
|
+
* loudness rule ("something loud at 3am") needs no model to be right, and a
|
|
14582
|
+
* label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
|
|
14583
|
+
* is given** — a window in which every sample is trivially a hit would fire on
|
|
14584
|
+
* silence, so the engine refuses such a condition rather than notifying on
|
|
14585
|
+
* nothing (the schema cannot express "at least one of" without becoming a
|
|
14586
|
+
* ZodEffects the cap path would have to special-case).
|
|
14587
|
+
*
|
|
14588
|
+
* `hitPercent` is over the samples the window actually HOLDS, and the window
|
|
14589
|
+
* must be FULL before it can match — a window that has been open for two
|
|
14590
|
+
* seconds of its ten is 100% of nothing, and firing on it would make
|
|
14591
|
+
* `samplingSeconds` decorative.
|
|
14592
|
+
*
|
|
14593
|
+
* Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
|
|
14594
|
+
* `audio-*` ids). Both spellings are accepted — the matcher normalizes the
|
|
14595
|
+
* `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
|
|
14596
|
+
* an operator who typed `dog` mean the same thing.
|
|
14597
|
+
*/
|
|
14598
|
+
var NcAudioConditionSchema = object({
|
|
14599
|
+
/** Audio macro labels; absent = any sound (level-only rule). */
|
|
14600
|
+
labels: array(string().min(1)).min(1).optional(),
|
|
14601
|
+
/** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
|
|
14602
|
+
dbThreshold: number().min(-96).max(0).optional(),
|
|
14603
|
+
/** Percentage of the window's samples that must be hits (1–100). */
|
|
14604
|
+
hitPercent: number().int().min(1).max(100).default(60),
|
|
14605
|
+
/** Length of the sampling window in seconds. */
|
|
14606
|
+
samplingSeconds: number().int().min(1).max(300).default(10)
|
|
14607
|
+
});
|
|
14608
|
+
/**
|
|
14492
14609
|
* Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
|
|
14493
14610
|
*
|
|
14494
14611
|
* The values are not symmetric, and deliberately so — the absent value has to
|
|
@@ -14761,7 +14878,33 @@ var NcConditionsSchema = object({
|
|
|
14761
14878
|
* threshold and holds for `sustainSeconds`. Fail-closed on missing
|
|
14762
14879
|
* substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
|
|
14763
14880
|
*/
|
|
14764
|
-
occupancy: NcOccupancyConditionSchema.optional()
|
|
14881
|
+
occupancy: NcOccupancyConditionSchema.optional(),
|
|
14882
|
+
/**
|
|
14883
|
+
* IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
|
|
14884
|
+
* `samplingSeconds` window clear the optional `dbThreshold` and carry one of
|
|
14885
|
+
* the optional `labels`. Fail-closed on missing substrate (no audio samples,
|
|
14886
|
+
* a window that is not full yet, neither filter given). See
|
|
14887
|
+
* {@link NcAudioCondition}.
|
|
14888
|
+
*
|
|
14889
|
+
* Presence of this key is what makes a rule an AUDIO rule: the engine fires
|
|
14890
|
+
* it ONLY on a confirmed audio window, and a rule carrying it never fires on
|
|
14891
|
+
* a detection, a track or a device event (the same fail-closed pairing
|
|
14892
|
+
* `occupancy` has with the `device-event` trigger). That is how audio labels
|
|
14893
|
+
* leave `classes`: an audio rule names its sounds HERE, and the legacy path
|
|
14894
|
+
* (an `immediate` rule naming an `audio-*` class, one notification per
|
|
14895
|
+
* classified sample) stays exactly as it was for rules that already use it.
|
|
14896
|
+
*
|
|
14897
|
+
* NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
|
|
14898
|
+
* rather than an oversight: the viewer mirrors the descriptor enums BY HAND
|
|
14899
|
+
* (`camstack/src/data/notification-center.ts`, guarded by
|
|
14900
|
+
* `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
|
|
14901
|
+
* condition fields it does not know when a rule is saved from the phone.
|
|
14902
|
+
* Publishing an editor for a condition the app cannot round-trip is how an
|
|
14903
|
+
* operator loses a rule's conditions by opening it — so the descriptor, the
|
|
14904
|
+
* admin widget and the viewer mirror land together (P2 + P3), and only then
|
|
14905
|
+
* does an audio rule become authorable.
|
|
14906
|
+
*/
|
|
14907
|
+
audio: NcAudioConditionSchema.optional()
|
|
14765
14908
|
});
|
|
14766
14909
|
/** One delivery target: a `notification-output` Target ref + passthrough params. */
|
|
14767
14910
|
var NcRuleTargetSchema = object({
|
|
@@ -14875,6 +15018,73 @@ var NcThrottleSchema = object({
|
|
|
14875
15018
|
*/
|
|
14876
15019
|
granularity: NcThrottleGranularitySchema.optional()
|
|
14877
15020
|
});
|
|
15021
|
+
/**
|
|
15022
|
+
* How long the confirm gate may hold ONE notification, and how big the picture
|
|
15023
|
+
* it judges may be.
|
|
15024
|
+
*
|
|
15025
|
+
* The clamp is the product decision, not a coincidence of the model: p50 was
|
|
15026
|
+
* 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
|
|
15027
|
+
* arrives after the visitor has gone is not a notification. 448 px was enough
|
|
15028
|
+
* to score 16/16 on the operator's parking scenario — bigger costs latency and
|
|
15029
|
+
* tokens for pixels the model pools away.
|
|
15030
|
+
*/
|
|
15031
|
+
var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
|
|
15032
|
+
var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
|
|
15033
|
+
var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
|
|
15034
|
+
/** Comparison the model's COUNT must satisfy for the notification to fire. */
|
|
15035
|
+
var NcConfirmExpectSchema = object({
|
|
15036
|
+
op: _enum([
|
|
15037
|
+
">=",
|
|
15038
|
+
">",
|
|
15039
|
+
"<=",
|
|
15040
|
+
"<",
|
|
15041
|
+
"=="
|
|
15042
|
+
]),
|
|
15043
|
+
count: number().int().min(0).max(1e3)
|
|
15044
|
+
});
|
|
15045
|
+
/**
|
|
15046
|
+
* AI CONFIRM — a vision model looks at the picture this notification is about
|
|
15047
|
+
* to ship and says whether it agrees with the rule.
|
|
15048
|
+
*
|
|
15049
|
+
* It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
|
|
15050
|
+
* crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
|
|
15051
|
+
* on the operator's phone is not a verdict about this notification.
|
|
15052
|
+
*
|
|
15053
|
+
* FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
|
|
15054
|
+
* whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
|
|
15055
|
+
* the default and every fail-open is COUNTED, because a gate that always fails
|
|
15056
|
+
* open looks in the log exactly like a gate that works.
|
|
15057
|
+
*
|
|
15058
|
+
* Every field is `.optional()` rather than relied on as a Zod default at the
|
|
15059
|
+
* runtime seam: a Zod default does NOT run on the addon→addon cap path (three
|
|
15060
|
+
* production failures in one day), so the gate reads absent as the constant
|
|
15061
|
+
* above rather than trusting a parse it may never have seen.
|
|
15062
|
+
*/
|
|
15063
|
+
var NcConfirmSchema = object({
|
|
15064
|
+
/** Off unless asked for. An absent `confirm` and `enabled:false` are the
|
|
15065
|
+
* same thing, and both mean "deliver exactly as before". */
|
|
15066
|
+
enabled: boolean().default(false),
|
|
15067
|
+
/** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
|
|
15068
|
+
profileId: string().optional(),
|
|
15069
|
+
/**
|
|
15070
|
+
* The operator's question, in his own words. Absent = a question derived
|
|
15071
|
+
* from the rule (its class and its expectation).
|
|
15072
|
+
*
|
|
15073
|
+
* NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
|
|
15074
|
+
* banners, signage and plates as instructions if you let them reach the
|
|
15075
|
+
* prompt — proven live — so the authoritative contract stays in the system
|
|
15076
|
+
* turn and only rule-authored words land here.
|
|
15077
|
+
*/
|
|
15078
|
+
prompt: string().max(1e3).optional(),
|
|
15079
|
+
/** Fire only when the model's count satisfies this. Absent = the model's
|
|
15080
|
+
* own boolean verdict decides. */
|
|
15081
|
+
expect: NcConfirmExpectSchema.optional(),
|
|
15082
|
+
timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
|
|
15083
|
+
/** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
|
|
15084
|
+
onTimeout: _enum(["fire", "suppress"]).default("fire"),
|
|
15085
|
+
/** Longest edge the judged image is downscaled to before it is sent. */
|
|
15086
|
+
maxImagePx: number().int().min(64).max(2048).default(448)
|
|
15087
|
+
});
|
|
14878
15088
|
/** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
|
|
14879
15089
|
var NcRuleInputSchema = object({
|
|
14880
15090
|
name: string().min(1).max(200),
|
|
@@ -14935,7 +15145,13 @@ var NcRuleInputSchema = object({
|
|
|
14935
15145
|
* `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
|
|
14936
15146
|
* shape as every other actuation.
|
|
14937
15147
|
*/
|
|
14938
|
-
actions: NcRuleActionsSchema.optional()
|
|
15148
|
+
actions: NcRuleActionsSchema.optional(),
|
|
15149
|
+
/**
|
|
15150
|
+
* AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
|
|
15151
|
+
* a rule that predates the gate must keep delivering byte-for-byte as it
|
|
15152
|
+
* did, and absent is the only way to say that without a migration.
|
|
15153
|
+
*/
|
|
15154
|
+
confirm: NcConfirmSchema.optional()
|
|
14939
15155
|
});
|
|
14940
15156
|
/**
|
|
14941
15157
|
* Partial patch for `updateRule` — any subset of the input fields, plus the
|
|
@@ -14946,7 +15162,37 @@ var NcRuleInputSchema = object({
|
|
|
14946
15162
|
* still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
|
|
14947
15163
|
* `updateRule` patch.
|
|
14948
15164
|
*/
|
|
14949
|
-
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
15165
|
+
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
15166
|
+
disabledTargetIds: array(string()).optional(),
|
|
15167
|
+
/**
|
|
15168
|
+
* `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
|
|
15169
|
+
*
|
|
15170
|
+
* It makes the key optional to SUPPLY; the parse still materialises the
|
|
15171
|
+
* default when the key is absent. And `NcRuleStore.update` merges with
|
|
15172
|
+
* `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
|
|
15173
|
+
* one — which made every partial edit destructive:
|
|
15174
|
+
*
|
|
15175
|
+
* nc.updateRule({ throttle }) → conditions reset to `{}`
|
|
15176
|
+
* nc.setRuleTargetEnabled(...) → conditions reset to `{}`
|
|
15177
|
+
* setEnabled(ruleId, false) → conditions reset to `{}`
|
|
15178
|
+
*
|
|
15179
|
+
* A rule scoped to one camera and one zone silently became a rule that
|
|
15180
|
+
* matches EVERY event on EVERY camera, and lost its `media` policy
|
|
15181
|
+
* (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
|
|
15182
|
+
* live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
|
|
15183
|
+
* within a minute of a two-field patch.
|
|
15184
|
+
*
|
|
15185
|
+
* So every defaulted field is re-declared here WITHOUT its default. The
|
|
15186
|
+
* inner defaults still apply when the caller DOES send the key — `{}` for
|
|
15187
|
+
* conditions remains a real instruction ("clear them") — and only the
|
|
15188
|
+
* absent key is now genuinely absent.
|
|
15189
|
+
*/
|
|
15190
|
+
enabled: boolean().optional(),
|
|
15191
|
+
conditions: NcConditionsSchema.optional(),
|
|
15192
|
+
media: NcMediaPolicySchema.optional(),
|
|
15193
|
+
throttle: NcThrottleSchema.optional(),
|
|
15194
|
+
priority: number().int().min(1).max(5).optional()
|
|
15195
|
+
});
|
|
14950
15196
|
/** A persisted rule. */
|
|
14951
15197
|
var NcRuleSchema = NcRuleInputSchema.extend({
|
|
14952
15198
|
id: string(),
|
|
@@ -15059,12 +15305,20 @@ var NC_CONDITION_CATALOG = [
|
|
|
15059
15305
|
valueType: "systemEvent",
|
|
15060
15306
|
options: [
|
|
15061
15307
|
{
|
|
15062
|
-
value: "
|
|
15063
|
-
label: "
|
|
15308
|
+
value: "device-online",
|
|
15309
|
+
label: "Device online"
|
|
15310
|
+
},
|
|
15311
|
+
{
|
|
15312
|
+
value: "device-offline",
|
|
15313
|
+
label: "Device offline"
|
|
15314
|
+
},
|
|
15315
|
+
{
|
|
15316
|
+
value: "device-disabled",
|
|
15317
|
+
label: "Device switched off"
|
|
15064
15318
|
},
|
|
15065
15319
|
{
|
|
15066
|
-
value: "
|
|
15067
|
-
label: "
|
|
15320
|
+
value: "device-enabled",
|
|
15321
|
+
label: "Device switched on"
|
|
15068
15322
|
},
|
|
15069
15323
|
{
|
|
15070
15324
|
value: "stream-online",
|
|
@@ -15089,12 +15343,24 @@ var NC_CONDITION_CATALOG = [
|
|
|
15089
15343
|
{
|
|
15090
15344
|
value: "server-update-available",
|
|
15091
15345
|
label: "Server update available"
|
|
15346
|
+
},
|
|
15347
|
+
{
|
|
15348
|
+
value: "alarm-triggered",
|
|
15349
|
+
label: "Alarm triggered"
|
|
15350
|
+
},
|
|
15351
|
+
{
|
|
15352
|
+
value: "alarm-armed",
|
|
15353
|
+
label: "Alarm armed"
|
|
15354
|
+
},
|
|
15355
|
+
{
|
|
15356
|
+
value: "alarm-disarmed",
|
|
15357
|
+
label: "Alarm disarmed"
|
|
15092
15358
|
}
|
|
15093
15359
|
],
|
|
15094
15360
|
operator: "in",
|
|
15095
15361
|
appliesTo: ["system-event"],
|
|
15096
15362
|
phase: "P1",
|
|
15097
|
-
description: "Infrastructure and update events.
|
|
15363
|
+
description: "Infrastructure and update events. Device liveness covers EVERY device type — narrow it by device type (cameras only, say) and/or by device, node events by node id, and addon updates by package name."
|
|
15098
15364
|
},
|
|
15099
15365
|
{
|
|
15100
15366
|
id: "devices",
|
|
@@ -15618,6 +15884,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
|
|
|
15618
15884
|
* Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
|
|
15619
15885
|
* copy would lie the first time a rule is disabled.
|
|
15620
15886
|
*/
|
|
15887
|
+
/**
|
|
15888
|
+
* Why a device a mode NAMES is nonetheless not armed by it.
|
|
15889
|
+
*
|
|
15890
|
+
* Each value is an existing authority, never a new flag (D62): `muted` is the
|
|
15891
|
+
* per-camera notification switch the Notification Center already owns,
|
|
15892
|
+
* `detection-off` is the device's own detection binding being inactive, and
|
|
15893
|
+
* `offline` is the device manager's liveness. A fourth reason would mean a
|
|
15894
|
+
* fourth authority, and inventing one here is how a panel starts disagreeing
|
|
15895
|
+
* with the switches the operator actually used.
|
|
15896
|
+
*/
|
|
15897
|
+
var NcAlarmSkipReasonSchema = _enum([
|
|
15898
|
+
"muted",
|
|
15899
|
+
"detection-off",
|
|
15900
|
+
"offline"
|
|
15901
|
+
]);
|
|
15902
|
+
var NcAlarmSkippedDeviceSchema = object({
|
|
15903
|
+
deviceId: number().int(),
|
|
15904
|
+
reason: NcAlarmSkipReasonSchema
|
|
15905
|
+
});
|
|
15621
15906
|
var NcAlarmModeCoverageSchema = object({
|
|
15622
15907
|
mode: AlarmArmModeSchema,
|
|
15623
15908
|
/** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
|
|
@@ -15625,7 +15910,18 @@ var NcAlarmModeCoverageSchema = object({
|
|
|
15625
15910
|
/** At least one covering rule has no device scope, so the mode covers all. */
|
|
15626
15911
|
allDevices: boolean(),
|
|
15627
15912
|
/** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
|
|
15628
|
-
deviceIds: array(number().int())
|
|
15913
|
+
deviceIds: array(number().int()),
|
|
15914
|
+
/**
|
|
15915
|
+
* Devices this mode NAMES but cannot actually arm, each with the switch that
|
|
15916
|
+
* excludes it.
|
|
15917
|
+
*
|
|
15918
|
+
* "Away armed — 12 cameras" is a promise, and a muted camera among those
|
|
15919
|
+
* twelve makes it false in exactly the way nobody notices until an incident.
|
|
15920
|
+
* Defaulted to `[]` so a coverage answer computed before this field existed
|
|
15921
|
+
* still parses as "nothing known to be skipped" rather than failing the whole
|
|
15922
|
+
* alarm tab.
|
|
15923
|
+
*/
|
|
15924
|
+
skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
|
|
15629
15925
|
});
|
|
15630
15926
|
var NcAlarmConfigSchema = object({
|
|
15631
15927
|
/**
|
|
@@ -25807,7 +26103,19 @@ var RecordingManifestSchema = object({
|
|
|
25807
26103
|
* profiles/subtrees/locations on this node). */
|
|
25808
26104
|
var RecordingDeviceUsageSchema = object({
|
|
25809
26105
|
deviceId: number(),
|
|
25810
|
-
usedBytes: number()
|
|
26106
|
+
usedBytes: number(),
|
|
26107
|
+
/**
|
|
26108
|
+
* Start of this camera's OLDEST indexed segment, across every profile and
|
|
26109
|
+
* location — the "Oldest footage" column in Recordings → Storage, and the
|
|
26110
|
+
* only honest answer to "is retention actually holding?" per camera.
|
|
26111
|
+
*
|
|
26112
|
+
* `null` = the camera has no footage. OPTIONAL because a recorder that
|
|
26113
|
+
* predates this field omits it entirely, and a hub whose types carry the
|
|
26114
|
+
* field must keep validating that older provider's payload: the framework
|
|
26115
|
+
* (types) and the addon ship on different trains, and the addon is usually
|
|
26116
|
+
* the later of the two.
|
|
26117
|
+
*/
|
|
26118
|
+
oldestMs: number().nullable().optional()
|
|
25811
26119
|
});
|
|
25812
26120
|
/** Recording storage usage + capacity for one storage location. */
|
|
25813
26121
|
var RecordingLocationUsageSchema = object({
|
|
@@ -25835,6 +26143,57 @@ var RecordingStorageUsageSchema = object({
|
|
|
25835
26143
|
locations: array(RecordingLocationUsageSchema)
|
|
25836
26144
|
});
|
|
25837
26145
|
/**
|
|
26146
|
+
* The OPERATOR-ARMED half of multi-location recordings (D116).
|
|
26147
|
+
*
|
|
26148
|
+
* The placement plan decides where NEW writes go and moves nothing. A rebalance
|
|
26149
|
+
* is the operator asking for the EXISTING archive to be brought into line with
|
|
26150
|
+
* that plan: one relocate job per (camera, profile) pile that sits on the wrong
|
|
26151
|
+
* location, run FIFO behind the single-flight mover.
|
|
26152
|
+
*
|
|
26153
|
+
* `plan…` and `start…` return the SAME shape deliberately — what the operator
|
|
26154
|
+
* confirms is exactly what gets enqueued, and `jobIds` is the only difference
|
|
26155
|
+
* (empty on the plan).
|
|
26156
|
+
*/
|
|
26157
|
+
var RecordingRebalanceMoveSchema = object({
|
|
26158
|
+
deviceId: number(),
|
|
26159
|
+
profile: string(),
|
|
26160
|
+
fromLocationId: string(),
|
|
26161
|
+
toLocationId: string(),
|
|
26162
|
+
bytes: number(),
|
|
26163
|
+
files: number().int()
|
|
26164
|
+
});
|
|
26165
|
+
/** Why a pile that is out of place is staying there. Every refusal is
|
|
26166
|
+
* reported: a rebalance that silently drops a camera reads exactly like one
|
|
26167
|
+
* that had nothing to do. */
|
|
26168
|
+
var RecordingRebalanceSkipReasonSchema = _enum([
|
|
26169
|
+
"unassigned",
|
|
26170
|
+
"target-not-writable",
|
|
26171
|
+
"below-threshold",
|
|
26172
|
+
"no-headroom"
|
|
26173
|
+
]);
|
|
26174
|
+
var RecordingRebalanceSkipSchema = object({
|
|
26175
|
+
deviceId: number(),
|
|
26176
|
+
profile: string(),
|
|
26177
|
+
fromLocationId: string(),
|
|
26178
|
+
/** The location the plan wants; null when the camera has no assignment. */
|
|
26179
|
+
toLocationId: string().nullable(),
|
|
26180
|
+
bytes: number(),
|
|
26181
|
+
reason: RecordingRebalanceSkipReasonSchema
|
|
26182
|
+
});
|
|
26183
|
+
var RecordingRebalancePlanSchema = object({
|
|
26184
|
+
moves: array(RecordingRebalanceMoveSchema),
|
|
26185
|
+
skipped: array(RecordingRebalanceSkipSchema),
|
|
26186
|
+
bytesToMove: number(),
|
|
26187
|
+
/** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
|
|
26188
|
+
jobIds: array(string())
|
|
26189
|
+
});
|
|
26190
|
+
var RecordingRebalanceInputSchema = object({
|
|
26191
|
+
/** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
|
|
26192
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
26193
|
+
/** Ignore piles smaller than this (default 1 GB). */
|
|
26194
|
+
minMoveGb: number().min(0).optional()
|
|
26195
|
+
});
|
|
26196
|
+
/**
|
|
25838
26197
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
25839
26198
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
25840
26199
|
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
@@ -25997,9 +26356,24 @@ method(object({
|
|
|
25997
26356
|
}), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
25998
26357
|
kind: "mutation",
|
|
25999
26358
|
auth: "admin"
|
|
26359
|
+
}), method(RelocateFootageInputSchema, object({ jobId: string() }), {
|
|
26360
|
+
kind: "mutation",
|
|
26361
|
+
auth: "admin"
|
|
26362
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
26363
|
+
kind: "query",
|
|
26364
|
+
auth: "admin"
|
|
26365
|
+
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
26366
|
+
kind: "mutation",
|
|
26367
|
+
auth: "admin"
|
|
26368
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
26369
|
+
kind: "query",
|
|
26370
|
+
auth: "admin"
|
|
26371
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
26372
|
+
kind: "mutation",
|
|
26373
|
+
auth: "admin"
|
|
26000
26374
|
});
|
|
26001
26375
|
/**
|
|
26002
|
-
* `
|
|
26376
|
+
* `recording-export` cap — render a footage time range into a single downloadable
|
|
26003
26377
|
* MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
|
|
26004
26378
|
* bounded lifetime with a durable history, auto-expiry, and optional
|
|
26005
26379
|
* delete-after-download.
|
|
@@ -32896,6 +33270,12 @@ Object.freeze({
|
|
|
32896
33270
|
addonId: null,
|
|
32897
33271
|
access: "create"
|
|
32898
33272
|
},
|
|
33273
|
+
"recording.cancelRelocateJob": {
|
|
33274
|
+
capName: "recording",
|
|
33275
|
+
capScope: "system",
|
|
33276
|
+
addonId: null,
|
|
33277
|
+
access: "create"
|
|
33278
|
+
},
|
|
32899
33279
|
"recording.cancelStorageMigrationMove": {
|
|
32900
33280
|
capName: "recording",
|
|
32901
33281
|
capScope: "system",
|
|
@@ -32950,6 +33330,12 @@ Object.freeze({
|
|
|
32950
33330
|
addonId: null,
|
|
32951
33331
|
access: "view"
|
|
32952
33332
|
},
|
|
33333
|
+
"recording.listRelocateJobs": {
|
|
33334
|
+
capName: "recording",
|
|
33335
|
+
capScope: "system",
|
|
33336
|
+
addonId: null,
|
|
33337
|
+
access: "view"
|
|
33338
|
+
},
|
|
32953
33339
|
"recording.locateSegment": {
|
|
32954
33340
|
capName: "recording",
|
|
32955
33341
|
capScope: "system",
|
|
@@ -32962,6 +33348,12 @@ Object.freeze({
|
|
|
32962
33348
|
addonId: null,
|
|
32963
33349
|
access: "create"
|
|
32964
33350
|
},
|
|
33351
|
+
"recording.planStorageRebalance": {
|
|
33352
|
+
capName: "recording",
|
|
33353
|
+
capScope: "system",
|
|
33354
|
+
addonId: null,
|
|
33355
|
+
access: "view"
|
|
33356
|
+
},
|
|
32965
33357
|
"recording.pruneFootage": {
|
|
32966
33358
|
capName: "recording",
|
|
32967
33359
|
capScope: "system",
|
|
@@ -32986,6 +33378,12 @@ Object.freeze({
|
|
|
32986
33378
|
addonId: null,
|
|
32987
33379
|
access: "create"
|
|
32988
33380
|
},
|
|
33381
|
+
"recording.relocateFootage": {
|
|
33382
|
+
capName: "recording",
|
|
33383
|
+
capScope: "system",
|
|
33384
|
+
addonId: null,
|
|
33385
|
+
access: "create"
|
|
33386
|
+
},
|
|
32989
33387
|
"recording.renderClip": {
|
|
32990
33388
|
capName: "recording",
|
|
32991
33389
|
capScope: "system",
|
|
@@ -33022,44 +33420,50 @@ Object.freeze({
|
|
|
33022
33420
|
addonId: null,
|
|
33023
33421
|
access: "create"
|
|
33024
33422
|
},
|
|
33423
|
+
"recording.startStorageRebalance": {
|
|
33424
|
+
capName: "recording",
|
|
33425
|
+
capScope: "system",
|
|
33426
|
+
addonId: null,
|
|
33427
|
+
access: "create"
|
|
33428
|
+
},
|
|
33025
33429
|
"recordingExport.cancelExport": {
|
|
33026
|
-
capName: "
|
|
33430
|
+
capName: "recording-export",
|
|
33027
33431
|
capScope: "system",
|
|
33028
33432
|
addonId: null,
|
|
33029
33433
|
access: "create"
|
|
33030
33434
|
},
|
|
33031
33435
|
"recordingExport.createExport": {
|
|
33032
|
-
capName: "
|
|
33436
|
+
capName: "recording-export",
|
|
33033
33437
|
capScope: "system",
|
|
33034
33438
|
addonId: null,
|
|
33035
33439
|
access: "create"
|
|
33036
33440
|
},
|
|
33037
33441
|
"recordingExport.deleteExport": {
|
|
33038
|
-
capName: "
|
|
33442
|
+
capName: "recording-export",
|
|
33039
33443
|
capScope: "system",
|
|
33040
33444
|
addonId: null,
|
|
33041
33445
|
access: "delete"
|
|
33042
33446
|
},
|
|
33043
33447
|
"recordingExport.getDownloadUrl": {
|
|
33044
|
-
capName: "
|
|
33448
|
+
capName: "recording-export",
|
|
33045
33449
|
capScope: "system",
|
|
33046
33450
|
addonId: null,
|
|
33047
33451
|
access: "view"
|
|
33048
33452
|
},
|
|
33049
33453
|
"recordingExport.getExport": {
|
|
33050
|
-
capName: "
|
|
33454
|
+
capName: "recording-export",
|
|
33051
33455
|
capScope: "system",
|
|
33052
33456
|
addonId: null,
|
|
33053
33457
|
access: "view"
|
|
33054
33458
|
},
|
|
33055
33459
|
"recordingExport.listExports": {
|
|
33056
|
-
capName: "
|
|
33460
|
+
capName: "recording-export",
|
|
33057
33461
|
capScope: "system",
|
|
33058
33462
|
addonId: null,
|
|
33059
33463
|
access: "view"
|
|
33060
33464
|
},
|
|
33061
33465
|
"recordingExport.readExportBytes": {
|
|
33062
|
-
capName: "
|
|
33466
|
+
capName: "recording-export",
|
|
33063
33467
|
capScope: "system",
|
|
33064
33468
|
addonId: null,
|
|
33065
33469
|
access: "view"
|
|
@@ -34496,6 +34900,111 @@ var FramerateField = number().int().min(1).max(60);
|
|
|
34496
34900
|
var TargetsField = array(NcRuleTargetSchema).min(1);
|
|
34497
34901
|
var PriorityField = number().int().min(1).max(5);
|
|
34498
34902
|
/**
|
|
34903
|
+
* Floor on any dense cadence, seconds — the recording's own frame interval.
|
|
34904
|
+
*
|
|
34905
|
+
* Declared here because it bounds BOTH the rule field and the renderer's
|
|
34906
|
+
* derivation, and two copies of a floor are two floors that can drift.
|
|
34907
|
+
*/
|
|
34908
|
+
var TIMELAPSE_DENSE_FLOOR_SEC = .1;
|
|
34909
|
+
/**
|
|
34910
|
+
* Explicit override of the DENSE sampling cadence, seconds.
|
|
34911
|
+
*
|
|
34912
|
+
* Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
|
|
34913
|
+
* 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
|
|
34914
|
+
* made that same base 3 s and rendered a person pass as two frames.)
|
|
34915
|
+
*
|
|
34916
|
+
* THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
|
|
34917
|
+
* `denseCadenceSec` and played at `framerate` occupies
|
|
34918
|
+
*
|
|
34919
|
+
* outputSeconds = (rangeSec / denseCadenceSec) / framerate
|
|
34920
|
+
*
|
|
34921
|
+
* 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.
|
|
34922
|
+
* Halving this field doubles the frames INSIDE ranges only — the base cadence,
|
|
34923
|
+
* and therefore the length of a quiet night, does not move.
|
|
34924
|
+
*
|
|
34925
|
+
* Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
|
|
34926
|
+
* the recording has them returns the same frames, requested twice. Must be
|
|
34927
|
+
* STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
|
|
34928
|
+
* a uniform video the operator believes is two-rate — and upsert refuses it
|
|
34929
|
+
* rather than letting the export cap reject the render hours after the window.
|
|
34930
|
+
*/
|
|
34931
|
+
var DenseCadenceSecField = number().min(TIMELAPSE_DENSE_FLOOR_SEC).max(3600);
|
|
34932
|
+
/**
|
|
34933
|
+
* Minimum seconds of OUTPUT video each detection range must occupy.
|
|
34934
|
+
*
|
|
34935
|
+
* The operator-facing form of the arithmetic above: instead of solving for a
|
|
34936
|
+
* cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
|
|
34937
|
+
* 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
|
|
34938
|
+
* that range every ~583 ms.
|
|
34939
|
+
*
|
|
34940
|
+
* ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
|
|
34941
|
+
* ranges are terms of a single ffmpeg `select` expression that cannot vary rate
|
|
34942
|
+
* per term — so the MOST DEMANDING (shortest) range sets the rate and longer
|
|
34943
|
+
* ranges are sampled denser than they need. Per-range cadences require a cap
|
|
34944
|
+
* schema change and are the tracked follow-up.
|
|
34945
|
+
*
|
|
34946
|
+
* A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
|
|
34947
|
+
* is rendered with every frame that EXISTS and no more: the guarantee is capped
|
|
34948
|
+
* by real footage, never met by duplicating frames into motion that never
|
|
34949
|
+
* happened.
|
|
34950
|
+
*/
|
|
34951
|
+
var MinDwellSecField = number().min(0).max(60);
|
|
34952
|
+
/**
|
|
34953
|
+
* Caption burned into the notification's preview frame.
|
|
34954
|
+
*
|
|
34955
|
+
* Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
|
|
34956
|
+
* `rule`, `from`, `to`) and rendered by the SAME renderer — a second
|
|
34957
|
+
* templating dialect for one field would be a second thing to explain.
|
|
34958
|
+
*
|
|
34959
|
+
* Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
|
|
34960
|
+
* operator saying "the frame, no caption" — a distinct, reachable answer, and
|
|
34961
|
+
* the reason this is not `.min(1)`.
|
|
34962
|
+
*/
|
|
34963
|
+
var PreviewTextField = string().max(200);
|
|
34964
|
+
/**
|
|
34965
|
+
* Whether the notification's preview is a STILL or a short animation.
|
|
34966
|
+
*
|
|
34967
|
+
* The operator's ask, verbatim: *"inviato come gif o video (come per le altre
|
|
34968
|
+
* rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
|
|
34969
|
+
* night reads better as three seconds of motion than as one frame of it. Both
|
|
34970
|
+
* modes get the SAME treatment (blurred frame, large centred title); `'gif'`
|
|
34971
|
+
* simply applies it to a dozen frames sampled across the render and assembles
|
|
34972
|
+
* them.
|
|
34973
|
+
*
|
|
34974
|
+
* `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
|
|
34975
|
+
* seeks and a palette pass, and no rule that never asked for one should start
|
|
34976
|
+
* paying that on the deploy that shipped it.
|
|
34977
|
+
*
|
|
34978
|
+
* A GIF that cannot be assembled DEGRADES to the still — never to nothing.
|
|
34979
|
+
*/
|
|
34980
|
+
var PreviewModeField = _enum(["image", "gif"]);
|
|
34981
|
+
/**
|
|
34982
|
+
* Which detection classes the notification reports counts for.
|
|
34983
|
+
*
|
|
34984
|
+
* The counts come from the tracks the render ALREADY fetched for its dense-range
|
|
34985
|
+
* plan — no second query — aggregated per class. Absent or empty means "every
|
|
34986
|
+
* class the window actually contained", which is what an operator who never
|
|
34987
|
+
* opened the field wants; a list narrows it (`['person']` on a driveway that
|
|
34988
|
+
* counts cars all night).
|
|
34989
|
+
*
|
|
34990
|
+
* Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
|
|
34991
|
+
* …). An unknown name simply never matches and reports nothing — it is not an
|
|
34992
|
+
* error, because a rule may legitimately name a class this camera's model does
|
|
34993
|
+
* not emit.
|
|
34994
|
+
*
|
|
34995
|
+
* The counts are exposed to {@link TimelapseTemplateSchema} as:
|
|
34996
|
+
* - `{{detections}}` — total over the reported classes
|
|
34997
|
+
* - `{{detectionSummary}}` — `2 persone, 1 veicolo`
|
|
34998
|
+
* - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
|
|
34999
|
+
* one per class, `count_` + the class name
|
|
35000
|
+
*
|
|
35001
|
+
* With NO custom body template the summary is appended to the derived body, and
|
|
35002
|
+
* only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
|
|
35003
|
+
* reads. With a custom template the operator owns every word — nothing is
|
|
35004
|
+
* appended, so `{{detectionSummary}}` is how he asks for it.
|
|
35005
|
+
*/
|
|
35006
|
+
var ReportClassesField = array(string().min(1).max(40)).max(20);
|
|
35007
|
+
/**
|
|
34499
35008
|
* Client-supplied timelapse-rule fields. The server stamps id / createdBy /
|
|
34500
35009
|
* createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
|
|
34501
35010
|
* here (see the ownership note above).
|
|
@@ -34515,13 +35024,42 @@ var TimelapseRuleInputSchema = object({
|
|
|
34515
35024
|
cadenceSec: CadenceSecField.default(15),
|
|
34516
35025
|
/** Output frames per second of the assembled mp4 (predecessor parity). */
|
|
34517
35026
|
framerate: FramerateField.default(10),
|
|
35027
|
+
/**
|
|
35028
|
+
* Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
|
|
35029
|
+
* as `max(1s, cadenceSec / 30)`, which is what every rule written before this
|
|
35030
|
+
* field gets.
|
|
35031
|
+
*/
|
|
35032
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
35033
|
+
/** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
|
|
35034
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
34518
35035
|
/** `notification-output` targets the finished video/thumbnail is sent to. */
|
|
34519
35036
|
targets: TargetsField,
|
|
34520
35037
|
template: TimelapseTemplateSchema.optional(),
|
|
35038
|
+
/**
|
|
35039
|
+
* Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
|
|
35040
|
+
* and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
|
|
35041
|
+
*
|
|
35042
|
+
* Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
|
|
35043
|
+
* the notification's title/body, and clearing it (`template: null`) must not
|
|
35044
|
+
* silently clear the caption too.
|
|
35045
|
+
*/
|
|
35046
|
+
previewText: PreviewTextField.optional(),
|
|
35047
|
+
/** Still or animation — see {@link PreviewModeField}. */
|
|
35048
|
+
previewMode: PreviewModeField.default("image"),
|
|
35049
|
+
/** Classes the notification counts — see {@link ReportClassesField}. */
|
|
35050
|
+
reportClasses: ReportClassesField.optional(),
|
|
34521
35051
|
/** Canonical notification priority ordinal (1..5); per-target overridable. */
|
|
34522
35052
|
priority: PriorityField.default(3)
|
|
34523
35053
|
});
|
|
34524
35054
|
/**
|
|
35055
|
+
* The caption a rule that never set one gets.
|
|
35056
|
+
*
|
|
35057
|
+
* Rendered through the ordinary `{{var}}` pass at delivery, so a rule created
|
|
35058
|
+
* before this field existed still reads "Timelapse Videocamera ingresso" and
|
|
35059
|
+
* not the literal braces.
|
|
35060
|
+
*/
|
|
35061
|
+
var DEFAULT_TIMELAPSE_PREVIEW_TEXT = "Timelapse {{camera}}";
|
|
35062
|
+
/**
|
|
34525
35063
|
* Partial patch for an update — any subset of the INPUT fields, with NO
|
|
34526
35064
|
* defaults (an absent key means "leave unchanged", never "reset to default").
|
|
34527
35065
|
* Provenance and ownership are absent by construction: a patch can rename or
|
|
@@ -34544,8 +35082,13 @@ var TimelapseRulePatchSchema = object({
|
|
|
34544
35082
|
schedule: NcScheduleSchema.optional(),
|
|
34545
35083
|
cadenceSec: CadenceSecField.optional(),
|
|
34546
35084
|
framerate: FramerateField.optional(),
|
|
35085
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
35086
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
34547
35087
|
targets: TargetsField.optional(),
|
|
34548
35088
|
template: TimelapseTemplateSchema.nullable().optional(),
|
|
35089
|
+
previewText: PreviewTextField.optional(),
|
|
35090
|
+
previewMode: PreviewModeField.optional(),
|
|
35091
|
+
reportClasses: ReportClassesField.optional(),
|
|
34549
35092
|
priority: PriorityField.optional()
|
|
34550
35093
|
});
|
|
34551
35094
|
/** A persisted timelapse rule. */
|
|
@@ -34586,6 +35129,26 @@ var TimelapseRuleSchema = TimelapseRuleInputSchema.extend({
|
|
|
34586
35129
|
updatedAt: number()
|
|
34587
35130
|
});
|
|
34588
35131
|
/**
|
|
35132
|
+
* Refuse a dense cadence that is not denser than the base.
|
|
35133
|
+
*
|
|
35134
|
+
* Called at UPSERT, on the MERGED rule — a patch that lowers `cadenceSec`
|
|
35135
|
+
* alone can invalidate a `denseCadenceSec` set months earlier, so checking the
|
|
35136
|
+
* patch in isolation would let the bad pair through.
|
|
35137
|
+
*
|
|
35138
|
+
* Refusing here and not at render time is the whole point: `ExportTimelapseSchema`
|
|
35139
|
+
* also rejects the pair, but it does so when the window has already closed and
|
|
35140
|
+
* the footage is being cut — the operator learns at 06:05 that last night was
|
|
35141
|
+
* never going to render, and a closed window does not come back. This turns
|
|
35142
|
+
* that into a failed edit he can see and correct.
|
|
35143
|
+
*
|
|
35144
|
+
* @throws Error naming both numbers, so the message is actionable in a toast.
|
|
35145
|
+
*/
|
|
35146
|
+
function assertTimelapseCadences(pair) {
|
|
35147
|
+
const dense = pair.denseCadenceSec;
|
|
35148
|
+
if (dense === void 0) return;
|
|
35149
|
+
if (dense >= pair.cadenceSec) throw new Error(`denseCadenceSec (${dense}s) must be strictly smaller than cadenceSec (${pair.cadenceSec}s) — a dense cadence that is not denser renders a uniform timelapse`);
|
|
35150
|
+
}
|
|
35151
|
+
/**
|
|
34589
35152
|
* The last successful generation for ONE camera of a rule, epoch-ms.
|
|
34590
35153
|
*
|
|
34591
35154
|
* The per-device map wins; a rule with no map falls back to the rule-wide
|
|
@@ -34772,6 +35335,18 @@ Object.defineProperty(exports, "DEFAULT_EVENT_COLOR", {
|
|
|
34772
35335
|
return DEFAULT_EVENT_COLOR;
|
|
34773
35336
|
}
|
|
34774
35337
|
});
|
|
35338
|
+
Object.defineProperty(exports, "DEFAULT_TIMELAPSE_PREVIEW_TEXT", {
|
|
35339
|
+
enumerable: true,
|
|
35340
|
+
get: function() {
|
|
35341
|
+
return DEFAULT_TIMELAPSE_PREVIEW_TEXT;
|
|
35342
|
+
}
|
|
35343
|
+
});
|
|
35344
|
+
Object.defineProperty(exports, "DETECTION_PIPELINE_CAP_NAME", {
|
|
35345
|
+
enumerable: true,
|
|
35346
|
+
get: function() {
|
|
35347
|
+
return DETECTION_PIPELINE_CAP_NAME;
|
|
35348
|
+
}
|
|
35349
|
+
});
|
|
34775
35350
|
Object.defineProperty(exports, "DeclaredDevices", {
|
|
34776
35351
|
enumerable: true,
|
|
34777
35352
|
get: function() {
|
|
@@ -34892,6 +35467,12 @@ Object.defineProperty(exports, "RetrainStatusSchema", {
|
|
|
34892
35467
|
return RetrainStatusSchema;
|
|
34893
35468
|
}
|
|
34894
35469
|
});
|
|
35470
|
+
Object.defineProperty(exports, "TIMELAPSE_DENSE_FLOOR_SEC", {
|
|
35471
|
+
enumerable: true,
|
|
35472
|
+
get: function() {
|
|
35473
|
+
return TIMELAPSE_DENSE_FLOOR_SEC;
|
|
35474
|
+
}
|
|
35475
|
+
});
|
|
34895
35476
|
Object.defineProperty(exports, "TimelapseRuleInputSchema", {
|
|
34896
35477
|
enumerable: true,
|
|
34897
35478
|
get: function() {
|
|
@@ -34952,6 +35533,12 @@ Object.defineProperty(exports, "array", {
|
|
|
34952
35533
|
return array;
|
|
34953
35534
|
}
|
|
34954
35535
|
});
|
|
35536
|
+
Object.defineProperty(exports, "assertTimelapseCadences", {
|
|
35537
|
+
enumerable: true,
|
|
35538
|
+
get: function() {
|
|
35539
|
+
return assertTimelapseCadences;
|
|
35540
|
+
}
|
|
35541
|
+
});
|
|
34955
35542
|
Object.defineProperty(exports, "audioMetricsCapability", {
|
|
34956
35543
|
enumerable: true,
|
|
34957
35544
|
get: function() {
|
|
@@ -35084,6 +35671,12 @@ Object.defineProperty(exports, "object", {
|
|
|
35084
35671
|
return object;
|
|
35085
35672
|
}
|
|
35086
35673
|
});
|
|
35674
|
+
Object.defineProperty(exports, "partialRecord", {
|
|
35675
|
+
enumerable: true,
|
|
35676
|
+
get: function() {
|
|
35677
|
+
return partialRecord;
|
|
35678
|
+
}
|
|
35679
|
+
});
|
|
35087
35680
|
Object.defineProperty(exports, "pipelineAnalyticsCapability", {
|
|
35088
35681
|
enumerable: true,
|
|
35089
35682
|
get: function() {
|