@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
|
@@ -7576,6 +7576,13 @@ var CameraSwitchGroupSchema = object({
|
|
|
7576
7576
|
fetchedAt: number()
|
|
7577
7577
|
});
|
|
7578
7578
|
/**
|
|
7579
|
+
* The wrapper capability each wrapper-backed switch controls. Named constants
|
|
7580
|
+
* because the same strings appear in `legacy-migrations.ts`, in
|
|
7581
|
+
* `isCapActiveForDevice` call sites and in the fake harness — a typo in any of
|
|
7582
|
+
* them is a switch that silently writes a binding nobody reads.
|
|
7583
|
+
*/
|
|
7584
|
+
var DETECTION_PIPELINE_CAP_NAME = "detection-pipeline";
|
|
7585
|
+
/**
|
|
7579
7586
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
7580
7587
|
* recordings and events management surfaces.
|
|
7581
7588
|
*
|
|
@@ -7800,7 +7807,15 @@ function deriveRecordingMode(config) {
|
|
|
7800
7807
|
* Each completed/failed run also lands one durable ops-log row on its owning
|
|
7801
7808
|
* addon surface.
|
|
7802
7809
|
*/
|
|
7810
|
+
/**
|
|
7811
|
+
* `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
|
|
7812
|
+
* rebalance enqueues one job per (camera, profile). Refusing the second job —
|
|
7813
|
+
* what the engine did before — turned a fifteen-camera rebalance into fifteen
|
|
7814
|
+
* manual retries. Queued jobs run FIFO; a queued job that is cancelled never
|
|
7815
|
+
* runs at all.
|
|
7816
|
+
*/
|
|
7803
7817
|
var RelocateJobStateSchema = _enum([
|
|
7818
|
+
"queued",
|
|
7804
7819
|
"running",
|
|
7805
7820
|
"done",
|
|
7806
7821
|
"failed",
|
|
@@ -7835,6 +7850,15 @@ var RelocateFootageInputSchema = object({
|
|
|
7835
7850
|
/** Limits relocation to the logical profile class. Omit only for the
|
|
7836
7851
|
* pre-orchestration compatibility path. */
|
|
7837
7852
|
footageClass: RelocateFootageClassSchema.optional(),
|
|
7853
|
+
/** Scope the move to ONE camera. Absent = every camera on the source, which
|
|
7854
|
+
* is what a whole-disk drain means. The rebalance path always sets it: its
|
|
7855
|
+
* unit is a (camera, profile) pile, not a disk. */
|
|
7856
|
+
deviceId: number().int().optional(),
|
|
7857
|
+
/** Scope the move to specific segment profiles (`high` / `mid` / `low`).
|
|
7858
|
+
* Finer than `footageClass`, which cannot separate high from mid — and the
|
|
7859
|
+
* placement plan assigns those two independently, so a rebalance that could
|
|
7860
|
+
* only say "recordings" would move footage the plan never asked to move. */
|
|
7861
|
+
profiles: array(string()).optional(),
|
|
7838
7862
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
7839
7863
|
* never allowed to starve live writers. */
|
|
7840
7864
|
throttleMbps: number().min(1).max(1e3).optional()
|
|
@@ -7970,6 +7994,21 @@ var StorageLocationSchema = object({
|
|
|
7970
7994
|
nodeId: string().optional(),
|
|
7971
7995
|
isDefault: boolean().default(false),
|
|
7972
7996
|
isSystem: boolean().default(false),
|
|
7997
|
+
/**
|
|
7998
|
+
* Operator opt-in: whether consumers that BALANCE across several locations
|
|
7999
|
+
* of a type may write here. Recordings reads it today; event media and
|
|
8000
|
+
* backups are the next consumers, which is why the flag lives on the
|
|
8001
|
+
* location rather than in any one addon's store — nothing has to be
|
|
8002
|
+
* extended to add the next consumer.
|
|
8003
|
+
*
|
|
8004
|
+
* OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
|
|
8005
|
+
* flag existed reads back with no flag and keeps working exactly as before;
|
|
8006
|
+
* that is the whole compat story, and it is why no migration ships with it.
|
|
8007
|
+
* A newly CREATED sibling is stamped `false` by the orchestrator (creating a
|
|
8008
|
+
* disk must not silently start writing to it); the default of a type is
|
|
8009
|
+
* always stamped `true`.
|
|
8010
|
+
*/
|
|
8011
|
+
enabled: boolean().optional(),
|
|
7973
8012
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
7974
8013
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
7975
8014
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -12509,7 +12548,8 @@ var embeddingEncoderCapability = {
|
|
|
12509
12548
|
};
|
|
12510
12549
|
/**
|
|
12511
12550
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
12512
|
-
* filesystem
|
|
12551
|
+
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
12552
|
+
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
12513
12553
|
* admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
|
|
12514
12554
|
* (one provider per node); the hub calls it with `{nodeId}` so the codegen
|
|
12515
12555
|
* routes to that exact node (default `nodeIdMode:'routing'`).
|
|
@@ -14377,6 +14417,13 @@ var MaskGridDimsSchema = object({
|
|
|
14377
14417
|
* `package-event` are pure trigger kinds (no urgency dimension). Extending
|
|
14378
14418
|
* this one field keeps the schema additive — a rule still declares exactly
|
|
14379
14419
|
* one trigger.
|
|
14420
|
+
*
|
|
14421
|
+
* AUDIO rules add no member here, for the reason occupancy added none: the
|
|
14422
|
+
* enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
|
|
14423
|
+
* mirror.ts` fails the build on a member the app cannot render) and every
|
|
14424
|
+
* member costs a release train. A sustained-sound rule is therefore an
|
|
14425
|
+
* `immediate` rule carrying {@link NcConditions.audio} — the condition is the
|
|
14426
|
+
* trigger discriminator, exactly as `occupancy` is on `device-event`.
|
|
14380
14427
|
*/
|
|
14381
14428
|
var NcDeliverySchema = _enum([
|
|
14382
14429
|
"immediate",
|
|
@@ -14391,15 +14438,32 @@ var NcDeliverySchema = _enum([
|
|
|
14391
14438
|
* depend on a provider's raw event name or payload shape.
|
|
14392
14439
|
*/
|
|
14393
14440
|
var NcSystemEventKindSchema = _enum([
|
|
14394
|
-
"
|
|
14395
|
-
"
|
|
14441
|
+
"device-online",
|
|
14442
|
+
"device-offline",
|
|
14443
|
+
"device-disabled",
|
|
14444
|
+
"device-enabled",
|
|
14396
14445
|
"stream-online",
|
|
14397
14446
|
"stream-offline",
|
|
14398
14447
|
"node-online",
|
|
14399
14448
|
"node-offline",
|
|
14400
14449
|
"addon-update-available",
|
|
14401
|
-
"server-update-available"
|
|
14450
|
+
"server-update-available",
|
|
14451
|
+
"alarm-triggered",
|
|
14452
|
+
"alarm-armed",
|
|
14453
|
+
"alarm-disarmed",
|
|
14454
|
+
"camera-online",
|
|
14455
|
+
"camera-offline",
|
|
14456
|
+
"camera-disabled",
|
|
14457
|
+
"camera-enabled"
|
|
14458
|
+
]);
|
|
14459
|
+
/** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
|
|
14460
|
+
var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
|
|
14461
|
+
"camera-online",
|
|
14462
|
+
"camera-offline",
|
|
14463
|
+
"camera-disabled",
|
|
14464
|
+
"camera-enabled"
|
|
14402
14465
|
]);
|
|
14466
|
+
NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
|
|
14403
14467
|
/**
|
|
14404
14468
|
* One coherent system-event condition. `kinds` is the required opt-in safety
|
|
14405
14469
|
* gate; the remaining lists are optional narrowing filters relevant to the
|
|
@@ -14408,6 +14472,18 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14408
14472
|
var NcSystemEventConditionSchema = object({
|
|
14409
14473
|
kinds: array(NcSystemEventKindSchema).min(1),
|
|
14410
14474
|
deviceIds: array(number().int()).min(1).optional(),
|
|
14475
|
+
/**
|
|
14476
|
+
* Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
|
|
14477
|
+
* `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
|
|
14478
|
+
* is what a liveness rule means when nobody said otherwise.
|
|
14479
|
+
*
|
|
14480
|
+
* This is where "only my cameras" is expressed, and it lives on the rule for
|
|
14481
|
+
* one reason: the intake cannot know which devices this household cares
|
|
14482
|
+
* about, and a producer-side filter is one no operator can change. Fails
|
|
14483
|
+
* CLOSED — a subject whose device type is unknown (an id the device mirror
|
|
14484
|
+
* does not carry) matches no `deviceTypes` list.
|
|
14485
|
+
*/
|
|
14486
|
+
deviceTypes: array(string().min(1)).min(1).optional(),
|
|
14411
14487
|
nodeIds: array(string().min(1)).min(1).optional(),
|
|
14412
14488
|
packageNames: array(string().min(1)).min(1).optional()
|
|
14413
14489
|
});
|
|
@@ -14458,6 +14534,47 @@ var NcOccupancyConditionSchema = object({
|
|
|
14458
14534
|
sustainSeconds: number().int().min(0).max(3600).default(15)
|
|
14459
14535
|
});
|
|
14460
14536
|
/**
|
|
14537
|
+
* Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
|
|
14538
|
+
*
|
|
14539
|
+
* Operator-approved vocabulary (2026-08-12, option A — the same one the
|
|
14540
|
+
* reference notifier uses, so an operator moving between them re-uses what
|
|
14541
|
+
* they already know): a rule matches when, over a sampling window of
|
|
14542
|
+
* `samplingSeconds`, at least `hitPercent`% of the audio samples in that
|
|
14543
|
+
* window are HITS. A sample is a hit when it satisfies BOTH present filters:
|
|
14544
|
+
*
|
|
14545
|
+
* - `dbThreshold` — its level is at or above this many dBFS (see
|
|
14546
|
+
* {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
|
|
14547
|
+
* - `labels` — the classifier put at least one of these labels on it.
|
|
14548
|
+
*
|
|
14549
|
+
* Both are OPTIONAL and independent, which is the point of the shape: a
|
|
14550
|
+
* loudness rule ("something loud at 3am") needs no model to be right, and a
|
|
14551
|
+
* label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
|
|
14552
|
+
* is given** — a window in which every sample is trivially a hit would fire on
|
|
14553
|
+
* silence, so the engine refuses such a condition rather than notifying on
|
|
14554
|
+
* nothing (the schema cannot express "at least one of" without becoming a
|
|
14555
|
+
* ZodEffects the cap path would have to special-case).
|
|
14556
|
+
*
|
|
14557
|
+
* `hitPercent` is over the samples the window actually HOLDS, and the window
|
|
14558
|
+
* must be FULL before it can match — a window that has been open for two
|
|
14559
|
+
* seconds of its ten is 100% of nothing, and firing on it would make
|
|
14560
|
+
* `samplingSeconds` decorative.
|
|
14561
|
+
*
|
|
14562
|
+
* Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
|
|
14563
|
+
* `audio-*` ids). Both spellings are accepted — the matcher normalizes the
|
|
14564
|
+
* `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
|
|
14565
|
+
* an operator who typed `dog` mean the same thing.
|
|
14566
|
+
*/
|
|
14567
|
+
var NcAudioConditionSchema = object({
|
|
14568
|
+
/** Audio macro labels; absent = any sound (level-only rule). */
|
|
14569
|
+
labels: array(string().min(1)).min(1).optional(),
|
|
14570
|
+
/** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
|
|
14571
|
+
dbThreshold: number().min(-96).max(0).optional(),
|
|
14572
|
+
/** Percentage of the window's samples that must be hits (1–100). */
|
|
14573
|
+
hitPercent: number().int().min(1).max(100).default(60),
|
|
14574
|
+
/** Length of the sampling window in seconds. */
|
|
14575
|
+
samplingSeconds: number().int().min(1).max(300).default(10)
|
|
14576
|
+
});
|
|
14577
|
+
/**
|
|
14461
14578
|
* Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
|
|
14462
14579
|
*
|
|
14463
14580
|
* The values are not symmetric, and deliberately so — the absent value has to
|
|
@@ -14730,7 +14847,33 @@ var NcConditionsSchema = object({
|
|
|
14730
14847
|
* threshold and holds for `sustainSeconds`. Fail-closed on missing
|
|
14731
14848
|
* substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
|
|
14732
14849
|
*/
|
|
14733
|
-
occupancy: NcOccupancyConditionSchema.optional()
|
|
14850
|
+
occupancy: NcOccupancyConditionSchema.optional(),
|
|
14851
|
+
/**
|
|
14852
|
+
* IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
|
|
14853
|
+
* `samplingSeconds` window clear the optional `dbThreshold` and carry one of
|
|
14854
|
+
* the optional `labels`. Fail-closed on missing substrate (no audio samples,
|
|
14855
|
+
* a window that is not full yet, neither filter given). See
|
|
14856
|
+
* {@link NcAudioCondition}.
|
|
14857
|
+
*
|
|
14858
|
+
* Presence of this key is what makes a rule an AUDIO rule: the engine fires
|
|
14859
|
+
* it ONLY on a confirmed audio window, and a rule carrying it never fires on
|
|
14860
|
+
* a detection, a track or a device event (the same fail-closed pairing
|
|
14861
|
+
* `occupancy` has with the `device-event` trigger). That is how audio labels
|
|
14862
|
+
* leave `classes`: an audio rule names its sounds HERE, and the legacy path
|
|
14863
|
+
* (an `immediate` rule naming an `audio-*` class, one notification per
|
|
14864
|
+
* classified sample) stays exactly as it was for rules that already use it.
|
|
14865
|
+
*
|
|
14866
|
+
* NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
|
|
14867
|
+
* rather than an oversight: the viewer mirrors the descriptor enums BY HAND
|
|
14868
|
+
* (`camstack/src/data/notification-center.ts`, guarded by
|
|
14869
|
+
* `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
|
|
14870
|
+
* condition fields it does not know when a rule is saved from the phone.
|
|
14871
|
+
* Publishing an editor for a condition the app cannot round-trip is how an
|
|
14872
|
+
* operator loses a rule's conditions by opening it — so the descriptor, the
|
|
14873
|
+
* admin widget and the viewer mirror land together (P2 + P3), and only then
|
|
14874
|
+
* does an audio rule become authorable.
|
|
14875
|
+
*/
|
|
14876
|
+
audio: NcAudioConditionSchema.optional()
|
|
14734
14877
|
});
|
|
14735
14878
|
/** One delivery target: a `notification-output` Target ref + passthrough params. */
|
|
14736
14879
|
var NcRuleTargetSchema = object({
|
|
@@ -14844,6 +14987,73 @@ var NcThrottleSchema = object({
|
|
|
14844
14987
|
*/
|
|
14845
14988
|
granularity: NcThrottleGranularitySchema.optional()
|
|
14846
14989
|
});
|
|
14990
|
+
/**
|
|
14991
|
+
* How long the confirm gate may hold ONE notification, and how big the picture
|
|
14992
|
+
* it judges may be.
|
|
14993
|
+
*
|
|
14994
|
+
* The clamp is the product decision, not a coincidence of the model: p50 was
|
|
14995
|
+
* 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
|
|
14996
|
+
* arrives after the visitor has gone is not a notification. 448 px was enough
|
|
14997
|
+
* to score 16/16 on the operator's parking scenario — bigger costs latency and
|
|
14998
|
+
* tokens for pixels the model pools away.
|
|
14999
|
+
*/
|
|
15000
|
+
var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
|
|
15001
|
+
var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
|
|
15002
|
+
var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
|
|
15003
|
+
/** Comparison the model's COUNT must satisfy for the notification to fire. */
|
|
15004
|
+
var NcConfirmExpectSchema = object({
|
|
15005
|
+
op: _enum([
|
|
15006
|
+
">=",
|
|
15007
|
+
">",
|
|
15008
|
+
"<=",
|
|
15009
|
+
"<",
|
|
15010
|
+
"=="
|
|
15011
|
+
]),
|
|
15012
|
+
count: number().int().min(0).max(1e3)
|
|
15013
|
+
});
|
|
15014
|
+
/**
|
|
15015
|
+
* AI CONFIRM — a vision model looks at the picture this notification is about
|
|
15016
|
+
* to ship and says whether it agrees with the rule.
|
|
15017
|
+
*
|
|
15018
|
+
* It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
|
|
15019
|
+
* crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
|
|
15020
|
+
* on the operator's phone is not a verdict about this notification.
|
|
15021
|
+
*
|
|
15022
|
+
* FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
|
|
15023
|
+
* whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
|
|
15024
|
+
* the default and every fail-open is COUNTED, because a gate that always fails
|
|
15025
|
+
* open looks in the log exactly like a gate that works.
|
|
15026
|
+
*
|
|
15027
|
+
* Every field is `.optional()` rather than relied on as a Zod default at the
|
|
15028
|
+
* runtime seam: a Zod default does NOT run on the addon→addon cap path (three
|
|
15029
|
+
* production failures in one day), so the gate reads absent as the constant
|
|
15030
|
+
* above rather than trusting a parse it may never have seen.
|
|
15031
|
+
*/
|
|
15032
|
+
var NcConfirmSchema = object({
|
|
15033
|
+
/** Off unless asked for. An absent `confirm` and `enabled:false` are the
|
|
15034
|
+
* same thing, and both mean "deliver exactly as before". */
|
|
15035
|
+
enabled: boolean().default(false),
|
|
15036
|
+
/** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
|
|
15037
|
+
profileId: string().optional(),
|
|
15038
|
+
/**
|
|
15039
|
+
* The operator's question, in his own words. Absent = a question derived
|
|
15040
|
+
* from the rule (its class and its expectation).
|
|
15041
|
+
*
|
|
15042
|
+
* NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
|
|
15043
|
+
* banners, signage and plates as instructions if you let them reach the
|
|
15044
|
+
* prompt — proven live — so the authoritative contract stays in the system
|
|
15045
|
+
* turn and only rule-authored words land here.
|
|
15046
|
+
*/
|
|
15047
|
+
prompt: string().max(1e3).optional(),
|
|
15048
|
+
/** Fire only when the model's count satisfies this. Absent = the model's
|
|
15049
|
+
* own boolean verdict decides. */
|
|
15050
|
+
expect: NcConfirmExpectSchema.optional(),
|
|
15051
|
+
timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
|
|
15052
|
+
/** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
|
|
15053
|
+
onTimeout: _enum(["fire", "suppress"]).default("fire"),
|
|
15054
|
+
/** Longest edge the judged image is downscaled to before it is sent. */
|
|
15055
|
+
maxImagePx: number().int().min(64).max(2048).default(448)
|
|
15056
|
+
});
|
|
14847
15057
|
/** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
|
|
14848
15058
|
var NcRuleInputSchema = object({
|
|
14849
15059
|
name: string().min(1).max(200),
|
|
@@ -14904,7 +15114,13 @@ var NcRuleInputSchema = object({
|
|
|
14904
15114
|
* `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
|
|
14905
15115
|
* shape as every other actuation.
|
|
14906
15116
|
*/
|
|
14907
|
-
actions: NcRuleActionsSchema.optional()
|
|
15117
|
+
actions: NcRuleActionsSchema.optional(),
|
|
15118
|
+
/**
|
|
15119
|
+
* AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
|
|
15120
|
+
* a rule that predates the gate must keep delivering byte-for-byte as it
|
|
15121
|
+
* did, and absent is the only way to say that without a migration.
|
|
15122
|
+
*/
|
|
15123
|
+
confirm: NcConfirmSchema.optional()
|
|
14908
15124
|
});
|
|
14909
15125
|
/**
|
|
14910
15126
|
* Partial patch for `updateRule` — any subset of the input fields, plus the
|
|
@@ -14915,7 +15131,37 @@ var NcRuleInputSchema = object({
|
|
|
14915
15131
|
* still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
|
|
14916
15132
|
* `updateRule` patch.
|
|
14917
15133
|
*/
|
|
14918
|
-
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
15134
|
+
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
15135
|
+
disabledTargetIds: array(string()).optional(),
|
|
15136
|
+
/**
|
|
15137
|
+
* `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
|
|
15138
|
+
*
|
|
15139
|
+
* It makes the key optional to SUPPLY; the parse still materialises the
|
|
15140
|
+
* default when the key is absent. And `NcRuleStore.update` merges with
|
|
15141
|
+
* `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
|
|
15142
|
+
* one — which made every partial edit destructive:
|
|
15143
|
+
*
|
|
15144
|
+
* nc.updateRule({ throttle }) → conditions reset to `{}`
|
|
15145
|
+
* nc.setRuleTargetEnabled(...) → conditions reset to `{}`
|
|
15146
|
+
* setEnabled(ruleId, false) → conditions reset to `{}`
|
|
15147
|
+
*
|
|
15148
|
+
* A rule scoped to one camera and one zone silently became a rule that
|
|
15149
|
+
* matches EVERY event on EVERY camera, and lost its `media` policy
|
|
15150
|
+
* (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
|
|
15151
|
+
* live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
|
|
15152
|
+
* within a minute of a two-field patch.
|
|
15153
|
+
*
|
|
15154
|
+
* So every defaulted field is re-declared here WITHOUT its default. The
|
|
15155
|
+
* inner defaults still apply when the caller DOES send the key — `{}` for
|
|
15156
|
+
* conditions remains a real instruction ("clear them") — and only the
|
|
15157
|
+
* absent key is now genuinely absent.
|
|
15158
|
+
*/
|
|
15159
|
+
enabled: boolean().optional(),
|
|
15160
|
+
conditions: NcConditionsSchema.optional(),
|
|
15161
|
+
media: NcMediaPolicySchema.optional(),
|
|
15162
|
+
throttle: NcThrottleSchema.optional(),
|
|
15163
|
+
priority: number().int().min(1).max(5).optional()
|
|
15164
|
+
});
|
|
14919
15165
|
/** A persisted rule. */
|
|
14920
15166
|
var NcRuleSchema = NcRuleInputSchema.extend({
|
|
14921
15167
|
id: string(),
|
|
@@ -15028,12 +15274,20 @@ var NC_CONDITION_CATALOG = [
|
|
|
15028
15274
|
valueType: "systemEvent",
|
|
15029
15275
|
options: [
|
|
15030
15276
|
{
|
|
15031
|
-
value: "
|
|
15032
|
-
label: "
|
|
15277
|
+
value: "device-online",
|
|
15278
|
+
label: "Device online"
|
|
15279
|
+
},
|
|
15280
|
+
{
|
|
15281
|
+
value: "device-offline",
|
|
15282
|
+
label: "Device offline"
|
|
15283
|
+
},
|
|
15284
|
+
{
|
|
15285
|
+
value: "device-disabled",
|
|
15286
|
+
label: "Device switched off"
|
|
15033
15287
|
},
|
|
15034
15288
|
{
|
|
15035
|
-
value: "
|
|
15036
|
-
label: "
|
|
15289
|
+
value: "device-enabled",
|
|
15290
|
+
label: "Device switched on"
|
|
15037
15291
|
},
|
|
15038
15292
|
{
|
|
15039
15293
|
value: "stream-online",
|
|
@@ -15058,12 +15312,24 @@ var NC_CONDITION_CATALOG = [
|
|
|
15058
15312
|
{
|
|
15059
15313
|
value: "server-update-available",
|
|
15060
15314
|
label: "Server update available"
|
|
15315
|
+
},
|
|
15316
|
+
{
|
|
15317
|
+
value: "alarm-triggered",
|
|
15318
|
+
label: "Alarm triggered"
|
|
15319
|
+
},
|
|
15320
|
+
{
|
|
15321
|
+
value: "alarm-armed",
|
|
15322
|
+
label: "Alarm armed"
|
|
15323
|
+
},
|
|
15324
|
+
{
|
|
15325
|
+
value: "alarm-disarmed",
|
|
15326
|
+
label: "Alarm disarmed"
|
|
15061
15327
|
}
|
|
15062
15328
|
],
|
|
15063
15329
|
operator: "in",
|
|
15064
15330
|
appliesTo: ["system-event"],
|
|
15065
15331
|
phase: "P1",
|
|
15066
|
-
description: "Infrastructure and update events.
|
|
15332
|
+
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."
|
|
15067
15333
|
},
|
|
15068
15334
|
{
|
|
15069
15335
|
id: "devices",
|
|
@@ -15587,6 +15853,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
|
|
|
15587
15853
|
* Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
|
|
15588
15854
|
* copy would lie the first time a rule is disabled.
|
|
15589
15855
|
*/
|
|
15856
|
+
/**
|
|
15857
|
+
* Why a device a mode NAMES is nonetheless not armed by it.
|
|
15858
|
+
*
|
|
15859
|
+
* Each value is an existing authority, never a new flag (D62): `muted` is the
|
|
15860
|
+
* per-camera notification switch the Notification Center already owns,
|
|
15861
|
+
* `detection-off` is the device's own detection binding being inactive, and
|
|
15862
|
+
* `offline` is the device manager's liveness. A fourth reason would mean a
|
|
15863
|
+
* fourth authority, and inventing one here is how a panel starts disagreeing
|
|
15864
|
+
* with the switches the operator actually used.
|
|
15865
|
+
*/
|
|
15866
|
+
var NcAlarmSkipReasonSchema = _enum([
|
|
15867
|
+
"muted",
|
|
15868
|
+
"detection-off",
|
|
15869
|
+
"offline"
|
|
15870
|
+
]);
|
|
15871
|
+
var NcAlarmSkippedDeviceSchema = object({
|
|
15872
|
+
deviceId: number().int(),
|
|
15873
|
+
reason: NcAlarmSkipReasonSchema
|
|
15874
|
+
});
|
|
15590
15875
|
var NcAlarmModeCoverageSchema = object({
|
|
15591
15876
|
mode: AlarmArmModeSchema,
|
|
15592
15877
|
/** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
|
|
@@ -15594,7 +15879,18 @@ var NcAlarmModeCoverageSchema = object({
|
|
|
15594
15879
|
/** At least one covering rule has no device scope, so the mode covers all. */
|
|
15595
15880
|
allDevices: boolean(),
|
|
15596
15881
|
/** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
|
|
15597
|
-
deviceIds: array(number().int())
|
|
15882
|
+
deviceIds: array(number().int()),
|
|
15883
|
+
/**
|
|
15884
|
+
* Devices this mode NAMES but cannot actually arm, each with the switch that
|
|
15885
|
+
* excludes it.
|
|
15886
|
+
*
|
|
15887
|
+
* "Away armed — 12 cameras" is a promise, and a muted camera among those
|
|
15888
|
+
* twelve makes it false in exactly the way nobody notices until an incident.
|
|
15889
|
+
* Defaulted to `[]` so a coverage answer computed before this field existed
|
|
15890
|
+
* still parses as "nothing known to be skipped" rather than failing the whole
|
|
15891
|
+
* alarm tab.
|
|
15892
|
+
*/
|
|
15893
|
+
skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
|
|
15598
15894
|
});
|
|
15599
15895
|
var NcAlarmConfigSchema = object({
|
|
15600
15896
|
/**
|
|
@@ -25776,7 +26072,19 @@ var RecordingManifestSchema = object({
|
|
|
25776
26072
|
* profiles/subtrees/locations on this node). */
|
|
25777
26073
|
var RecordingDeviceUsageSchema = object({
|
|
25778
26074
|
deviceId: number(),
|
|
25779
|
-
usedBytes: number()
|
|
26075
|
+
usedBytes: number(),
|
|
26076
|
+
/**
|
|
26077
|
+
* Start of this camera's OLDEST indexed segment, across every profile and
|
|
26078
|
+
* location — the "Oldest footage" column in Recordings → Storage, and the
|
|
26079
|
+
* only honest answer to "is retention actually holding?" per camera.
|
|
26080
|
+
*
|
|
26081
|
+
* `null` = the camera has no footage. OPTIONAL because a recorder that
|
|
26082
|
+
* predates this field omits it entirely, and a hub whose types carry the
|
|
26083
|
+
* field must keep validating that older provider's payload: the framework
|
|
26084
|
+
* (types) and the addon ship on different trains, and the addon is usually
|
|
26085
|
+
* the later of the two.
|
|
26086
|
+
*/
|
|
26087
|
+
oldestMs: number().nullable().optional()
|
|
25780
26088
|
});
|
|
25781
26089
|
/** Recording storage usage + capacity for one storage location. */
|
|
25782
26090
|
var RecordingLocationUsageSchema = object({
|
|
@@ -25804,6 +26112,57 @@ var RecordingStorageUsageSchema = object({
|
|
|
25804
26112
|
locations: array(RecordingLocationUsageSchema)
|
|
25805
26113
|
});
|
|
25806
26114
|
/**
|
|
26115
|
+
* The OPERATOR-ARMED half of multi-location recordings (D116).
|
|
26116
|
+
*
|
|
26117
|
+
* The placement plan decides where NEW writes go and moves nothing. A rebalance
|
|
26118
|
+
* is the operator asking for the EXISTING archive to be brought into line with
|
|
26119
|
+
* that plan: one relocate job per (camera, profile) pile that sits on the wrong
|
|
26120
|
+
* location, run FIFO behind the single-flight mover.
|
|
26121
|
+
*
|
|
26122
|
+
* `plan…` and `start…` return the SAME shape deliberately — what the operator
|
|
26123
|
+
* confirms is exactly what gets enqueued, and `jobIds` is the only difference
|
|
26124
|
+
* (empty on the plan).
|
|
26125
|
+
*/
|
|
26126
|
+
var RecordingRebalanceMoveSchema = object({
|
|
26127
|
+
deviceId: number(),
|
|
26128
|
+
profile: string(),
|
|
26129
|
+
fromLocationId: string(),
|
|
26130
|
+
toLocationId: string(),
|
|
26131
|
+
bytes: number(),
|
|
26132
|
+
files: number().int()
|
|
26133
|
+
});
|
|
26134
|
+
/** Why a pile that is out of place is staying there. Every refusal is
|
|
26135
|
+
* reported: a rebalance that silently drops a camera reads exactly like one
|
|
26136
|
+
* that had nothing to do. */
|
|
26137
|
+
var RecordingRebalanceSkipReasonSchema = _enum([
|
|
26138
|
+
"unassigned",
|
|
26139
|
+
"target-not-writable",
|
|
26140
|
+
"below-threshold",
|
|
26141
|
+
"no-headroom"
|
|
26142
|
+
]);
|
|
26143
|
+
var RecordingRebalanceSkipSchema = object({
|
|
26144
|
+
deviceId: number(),
|
|
26145
|
+
profile: string(),
|
|
26146
|
+
fromLocationId: string(),
|
|
26147
|
+
/** The location the plan wants; null when the camera has no assignment. */
|
|
26148
|
+
toLocationId: string().nullable(),
|
|
26149
|
+
bytes: number(),
|
|
26150
|
+
reason: RecordingRebalanceSkipReasonSchema
|
|
26151
|
+
});
|
|
26152
|
+
var RecordingRebalancePlanSchema = object({
|
|
26153
|
+
moves: array(RecordingRebalanceMoveSchema),
|
|
26154
|
+
skipped: array(RecordingRebalanceSkipSchema),
|
|
26155
|
+
bytesToMove: number(),
|
|
26156
|
+
/** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
|
|
26157
|
+
jobIds: array(string())
|
|
26158
|
+
});
|
|
26159
|
+
var RecordingRebalanceInputSchema = object({
|
|
26160
|
+
/** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
|
|
26161
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
26162
|
+
/** Ignore piles smaller than this (default 1 GB). */
|
|
26163
|
+
minMoveGb: number().min(0).optional()
|
|
26164
|
+
});
|
|
26165
|
+
/**
|
|
25807
26166
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
25808
26167
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
25809
26168
|
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
@@ -25966,9 +26325,24 @@ method(object({
|
|
|
25966
26325
|
}), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
25967
26326
|
kind: "mutation",
|
|
25968
26327
|
auth: "admin"
|
|
26328
|
+
}), method(RelocateFootageInputSchema, object({ jobId: string() }), {
|
|
26329
|
+
kind: "mutation",
|
|
26330
|
+
auth: "admin"
|
|
26331
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
26332
|
+
kind: "query",
|
|
26333
|
+
auth: "admin"
|
|
26334
|
+
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
26335
|
+
kind: "mutation",
|
|
26336
|
+
auth: "admin"
|
|
26337
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
26338
|
+
kind: "query",
|
|
26339
|
+
auth: "admin"
|
|
26340
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
26341
|
+
kind: "mutation",
|
|
26342
|
+
auth: "admin"
|
|
25969
26343
|
});
|
|
25970
26344
|
/**
|
|
25971
|
-
* `
|
|
26345
|
+
* `recording-export` cap — render a footage time range into a single downloadable
|
|
25972
26346
|
* MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
|
|
25973
26347
|
* bounded lifetime with a durable history, auto-expiry, and optional
|
|
25974
26348
|
* delete-after-download.
|
|
@@ -32865,6 +33239,12 @@ Object.freeze({
|
|
|
32865
33239
|
addonId: null,
|
|
32866
33240
|
access: "create"
|
|
32867
33241
|
},
|
|
33242
|
+
"recording.cancelRelocateJob": {
|
|
33243
|
+
capName: "recording",
|
|
33244
|
+
capScope: "system",
|
|
33245
|
+
addonId: null,
|
|
33246
|
+
access: "create"
|
|
33247
|
+
},
|
|
32868
33248
|
"recording.cancelStorageMigrationMove": {
|
|
32869
33249
|
capName: "recording",
|
|
32870
33250
|
capScope: "system",
|
|
@@ -32919,6 +33299,12 @@ Object.freeze({
|
|
|
32919
33299
|
addonId: null,
|
|
32920
33300
|
access: "view"
|
|
32921
33301
|
},
|
|
33302
|
+
"recording.listRelocateJobs": {
|
|
33303
|
+
capName: "recording",
|
|
33304
|
+
capScope: "system",
|
|
33305
|
+
addonId: null,
|
|
33306
|
+
access: "view"
|
|
33307
|
+
},
|
|
32922
33308
|
"recording.locateSegment": {
|
|
32923
33309
|
capName: "recording",
|
|
32924
33310
|
capScope: "system",
|
|
@@ -32931,6 +33317,12 @@ Object.freeze({
|
|
|
32931
33317
|
addonId: null,
|
|
32932
33318
|
access: "create"
|
|
32933
33319
|
},
|
|
33320
|
+
"recording.planStorageRebalance": {
|
|
33321
|
+
capName: "recording",
|
|
33322
|
+
capScope: "system",
|
|
33323
|
+
addonId: null,
|
|
33324
|
+
access: "view"
|
|
33325
|
+
},
|
|
32934
33326
|
"recording.pruneFootage": {
|
|
32935
33327
|
capName: "recording",
|
|
32936
33328
|
capScope: "system",
|
|
@@ -32955,6 +33347,12 @@ Object.freeze({
|
|
|
32955
33347
|
addonId: null,
|
|
32956
33348
|
access: "create"
|
|
32957
33349
|
},
|
|
33350
|
+
"recording.relocateFootage": {
|
|
33351
|
+
capName: "recording",
|
|
33352
|
+
capScope: "system",
|
|
33353
|
+
addonId: null,
|
|
33354
|
+
access: "create"
|
|
33355
|
+
},
|
|
32958
33356
|
"recording.renderClip": {
|
|
32959
33357
|
capName: "recording",
|
|
32960
33358
|
capScope: "system",
|
|
@@ -32991,44 +33389,50 @@ Object.freeze({
|
|
|
32991
33389
|
addonId: null,
|
|
32992
33390
|
access: "create"
|
|
32993
33391
|
},
|
|
33392
|
+
"recording.startStorageRebalance": {
|
|
33393
|
+
capName: "recording",
|
|
33394
|
+
capScope: "system",
|
|
33395
|
+
addonId: null,
|
|
33396
|
+
access: "create"
|
|
33397
|
+
},
|
|
32994
33398
|
"recordingExport.cancelExport": {
|
|
32995
|
-
capName: "
|
|
33399
|
+
capName: "recording-export",
|
|
32996
33400
|
capScope: "system",
|
|
32997
33401
|
addonId: null,
|
|
32998
33402
|
access: "create"
|
|
32999
33403
|
},
|
|
33000
33404
|
"recordingExport.createExport": {
|
|
33001
|
-
capName: "
|
|
33405
|
+
capName: "recording-export",
|
|
33002
33406
|
capScope: "system",
|
|
33003
33407
|
addonId: null,
|
|
33004
33408
|
access: "create"
|
|
33005
33409
|
},
|
|
33006
33410
|
"recordingExport.deleteExport": {
|
|
33007
|
-
capName: "
|
|
33411
|
+
capName: "recording-export",
|
|
33008
33412
|
capScope: "system",
|
|
33009
33413
|
addonId: null,
|
|
33010
33414
|
access: "delete"
|
|
33011
33415
|
},
|
|
33012
33416
|
"recordingExport.getDownloadUrl": {
|
|
33013
|
-
capName: "
|
|
33417
|
+
capName: "recording-export",
|
|
33014
33418
|
capScope: "system",
|
|
33015
33419
|
addonId: null,
|
|
33016
33420
|
access: "view"
|
|
33017
33421
|
},
|
|
33018
33422
|
"recordingExport.getExport": {
|
|
33019
|
-
capName: "
|
|
33423
|
+
capName: "recording-export",
|
|
33020
33424
|
capScope: "system",
|
|
33021
33425
|
addonId: null,
|
|
33022
33426
|
access: "view"
|
|
33023
33427
|
},
|
|
33024
33428
|
"recordingExport.listExports": {
|
|
33025
|
-
capName: "
|
|
33429
|
+
capName: "recording-export",
|
|
33026
33430
|
capScope: "system",
|
|
33027
33431
|
addonId: null,
|
|
33028
33432
|
access: "view"
|
|
33029
33433
|
},
|
|
33030
33434
|
"recordingExport.readExportBytes": {
|
|
33031
|
-
capName: "
|
|
33435
|
+
capName: "recording-export",
|
|
33032
33436
|
capScope: "system",
|
|
33033
33437
|
addonId: null,
|
|
33034
33438
|
access: "view"
|
|
@@ -34465,6 +34869,111 @@ var FramerateField = number().int().min(1).max(60);
|
|
|
34465
34869
|
var TargetsField = array(NcRuleTargetSchema).min(1);
|
|
34466
34870
|
var PriorityField = number().int().min(1).max(5);
|
|
34467
34871
|
/**
|
|
34872
|
+
* Floor on any dense cadence, seconds — the recording's own frame interval.
|
|
34873
|
+
*
|
|
34874
|
+
* Declared here because it bounds BOTH the rule field and the renderer's
|
|
34875
|
+
* derivation, and two copies of a floor are two floors that can drift.
|
|
34876
|
+
*/
|
|
34877
|
+
var TIMELAPSE_DENSE_FLOOR_SEC = .1;
|
|
34878
|
+
/**
|
|
34879
|
+
* Explicit override of the DENSE sampling cadence, seconds.
|
|
34880
|
+
*
|
|
34881
|
+
* Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
|
|
34882
|
+
* 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
|
|
34883
|
+
* made that same base 3 s and rendered a person pass as two frames.)
|
|
34884
|
+
*
|
|
34885
|
+
* THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
|
|
34886
|
+
* `denseCadenceSec` and played at `framerate` occupies
|
|
34887
|
+
*
|
|
34888
|
+
* outputSeconds = (rangeSec / denseCadenceSec) / framerate
|
|
34889
|
+
*
|
|
34890
|
+
* 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.
|
|
34891
|
+
* Halving this field doubles the frames INSIDE ranges only — the base cadence,
|
|
34892
|
+
* and therefore the length of a quiet night, does not move.
|
|
34893
|
+
*
|
|
34894
|
+
* Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
|
|
34895
|
+
* the recording has them returns the same frames, requested twice. Must be
|
|
34896
|
+
* STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
|
|
34897
|
+
* a uniform video the operator believes is two-rate — and upsert refuses it
|
|
34898
|
+
* rather than letting the export cap reject the render hours after the window.
|
|
34899
|
+
*/
|
|
34900
|
+
var DenseCadenceSecField = number().min(TIMELAPSE_DENSE_FLOOR_SEC).max(3600);
|
|
34901
|
+
/**
|
|
34902
|
+
* Minimum seconds of OUTPUT video each detection range must occupy.
|
|
34903
|
+
*
|
|
34904
|
+
* The operator-facing form of the arithmetic above: instead of solving for a
|
|
34905
|
+
* cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
|
|
34906
|
+
* 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
|
|
34907
|
+
* that range every ~583 ms.
|
|
34908
|
+
*
|
|
34909
|
+
* ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
|
|
34910
|
+
* ranges are terms of a single ffmpeg `select` expression that cannot vary rate
|
|
34911
|
+
* per term — so the MOST DEMANDING (shortest) range sets the rate and longer
|
|
34912
|
+
* ranges are sampled denser than they need. Per-range cadences require a cap
|
|
34913
|
+
* schema change and are the tracked follow-up.
|
|
34914
|
+
*
|
|
34915
|
+
* A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
|
|
34916
|
+
* is rendered with every frame that EXISTS and no more: the guarantee is capped
|
|
34917
|
+
* by real footage, never met by duplicating frames into motion that never
|
|
34918
|
+
* happened.
|
|
34919
|
+
*/
|
|
34920
|
+
var MinDwellSecField = number().min(0).max(60);
|
|
34921
|
+
/**
|
|
34922
|
+
* Caption burned into the notification's preview frame.
|
|
34923
|
+
*
|
|
34924
|
+
* Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
|
|
34925
|
+
* `rule`, `from`, `to`) and rendered by the SAME renderer — a second
|
|
34926
|
+
* templating dialect for one field would be a second thing to explain.
|
|
34927
|
+
*
|
|
34928
|
+
* Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
|
|
34929
|
+
* operator saying "the frame, no caption" — a distinct, reachable answer, and
|
|
34930
|
+
* the reason this is not `.min(1)`.
|
|
34931
|
+
*/
|
|
34932
|
+
var PreviewTextField = string().max(200);
|
|
34933
|
+
/**
|
|
34934
|
+
* Whether the notification's preview is a STILL or a short animation.
|
|
34935
|
+
*
|
|
34936
|
+
* The operator's ask, verbatim: *"inviato come gif o video (come per le altre
|
|
34937
|
+
* rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
|
|
34938
|
+
* night reads better as three seconds of motion than as one frame of it. Both
|
|
34939
|
+
* modes get the SAME treatment (blurred frame, large centred title); `'gif'`
|
|
34940
|
+
* simply applies it to a dozen frames sampled across the render and assembles
|
|
34941
|
+
* them.
|
|
34942
|
+
*
|
|
34943
|
+
* `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
|
|
34944
|
+
* seeks and a palette pass, and no rule that never asked for one should start
|
|
34945
|
+
* paying that on the deploy that shipped it.
|
|
34946
|
+
*
|
|
34947
|
+
* A GIF that cannot be assembled DEGRADES to the still — never to nothing.
|
|
34948
|
+
*/
|
|
34949
|
+
var PreviewModeField = _enum(["image", "gif"]);
|
|
34950
|
+
/**
|
|
34951
|
+
* Which detection classes the notification reports counts for.
|
|
34952
|
+
*
|
|
34953
|
+
* The counts come from the tracks the render ALREADY fetched for its dense-range
|
|
34954
|
+
* plan — no second query — aggregated per class. Absent or empty means "every
|
|
34955
|
+
* class the window actually contained", which is what an operator who never
|
|
34956
|
+
* opened the field wants; a list narrows it (`['person']` on a driveway that
|
|
34957
|
+
* counts cars all night).
|
|
34958
|
+
*
|
|
34959
|
+
* Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
|
|
34960
|
+
* …). An unknown name simply never matches and reports nothing — it is not an
|
|
34961
|
+
* error, because a rule may legitimately name a class this camera's model does
|
|
34962
|
+
* not emit.
|
|
34963
|
+
*
|
|
34964
|
+
* The counts are exposed to {@link TimelapseTemplateSchema} as:
|
|
34965
|
+
* - `{{detections}}` — total over the reported classes
|
|
34966
|
+
* - `{{detectionSummary}}` — `2 persone, 1 veicolo`
|
|
34967
|
+
* - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
|
|
34968
|
+
* one per class, `count_` + the class name
|
|
34969
|
+
*
|
|
34970
|
+
* With NO custom body template the summary is appended to the derived body, and
|
|
34971
|
+
* only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
|
|
34972
|
+
* reads. With a custom template the operator owns every word — nothing is
|
|
34973
|
+
* appended, so `{{detectionSummary}}` is how he asks for it.
|
|
34974
|
+
*/
|
|
34975
|
+
var ReportClassesField = array(string().min(1).max(40)).max(20);
|
|
34976
|
+
/**
|
|
34468
34977
|
* Client-supplied timelapse-rule fields. The server stamps id / createdBy /
|
|
34469
34978
|
* createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
|
|
34470
34979
|
* here (see the ownership note above).
|
|
@@ -34484,13 +34993,42 @@ var TimelapseRuleInputSchema = object({
|
|
|
34484
34993
|
cadenceSec: CadenceSecField.default(15),
|
|
34485
34994
|
/** Output frames per second of the assembled mp4 (predecessor parity). */
|
|
34486
34995
|
framerate: FramerateField.default(10),
|
|
34996
|
+
/**
|
|
34997
|
+
* Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
|
|
34998
|
+
* as `max(1s, cadenceSec / 30)`, which is what every rule written before this
|
|
34999
|
+
* field gets.
|
|
35000
|
+
*/
|
|
35001
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
35002
|
+
/** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
|
|
35003
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
34487
35004
|
/** `notification-output` targets the finished video/thumbnail is sent to. */
|
|
34488
35005
|
targets: TargetsField,
|
|
34489
35006
|
template: TimelapseTemplateSchema.optional(),
|
|
35007
|
+
/**
|
|
35008
|
+
* Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
|
|
35009
|
+
* and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
|
|
35010
|
+
*
|
|
35011
|
+
* Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
|
|
35012
|
+
* the notification's title/body, and clearing it (`template: null`) must not
|
|
35013
|
+
* silently clear the caption too.
|
|
35014
|
+
*/
|
|
35015
|
+
previewText: PreviewTextField.optional(),
|
|
35016
|
+
/** Still or animation — see {@link PreviewModeField}. */
|
|
35017
|
+
previewMode: PreviewModeField.default("image"),
|
|
35018
|
+
/** Classes the notification counts — see {@link ReportClassesField}. */
|
|
35019
|
+
reportClasses: ReportClassesField.optional(),
|
|
34490
35020
|
/** Canonical notification priority ordinal (1..5); per-target overridable. */
|
|
34491
35021
|
priority: PriorityField.default(3)
|
|
34492
35022
|
});
|
|
34493
35023
|
/**
|
|
35024
|
+
* The caption a rule that never set one gets.
|
|
35025
|
+
*
|
|
35026
|
+
* Rendered through the ordinary `{{var}}` pass at delivery, so a rule created
|
|
35027
|
+
* before this field existed still reads "Timelapse Videocamera ingresso" and
|
|
35028
|
+
* not the literal braces.
|
|
35029
|
+
*/
|
|
35030
|
+
var DEFAULT_TIMELAPSE_PREVIEW_TEXT = "Timelapse {{camera}}";
|
|
35031
|
+
/**
|
|
34494
35032
|
* Partial patch for an update — any subset of the INPUT fields, with NO
|
|
34495
35033
|
* defaults (an absent key means "leave unchanged", never "reset to default").
|
|
34496
35034
|
* Provenance and ownership are absent by construction: a patch can rename or
|
|
@@ -34513,8 +35051,13 @@ var TimelapseRulePatchSchema = object({
|
|
|
34513
35051
|
schedule: NcScheduleSchema.optional(),
|
|
34514
35052
|
cadenceSec: CadenceSecField.optional(),
|
|
34515
35053
|
framerate: FramerateField.optional(),
|
|
35054
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
35055
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
34516
35056
|
targets: TargetsField.optional(),
|
|
34517
35057
|
template: TimelapseTemplateSchema.nullable().optional(),
|
|
35058
|
+
previewText: PreviewTextField.optional(),
|
|
35059
|
+
previewMode: PreviewModeField.optional(),
|
|
35060
|
+
reportClasses: ReportClassesField.optional(),
|
|
34518
35061
|
priority: PriorityField.optional()
|
|
34519
35062
|
});
|
|
34520
35063
|
/** A persisted timelapse rule. */
|
|
@@ -34555,6 +35098,26 @@ var TimelapseRuleSchema = TimelapseRuleInputSchema.extend({
|
|
|
34555
35098
|
updatedAt: number()
|
|
34556
35099
|
});
|
|
34557
35100
|
/**
|
|
35101
|
+
* Refuse a dense cadence that is not denser than the base.
|
|
35102
|
+
*
|
|
35103
|
+
* Called at UPSERT, on the MERGED rule — a patch that lowers `cadenceSec`
|
|
35104
|
+
* alone can invalidate a `denseCadenceSec` set months earlier, so checking the
|
|
35105
|
+
* patch in isolation would let the bad pair through.
|
|
35106
|
+
*
|
|
35107
|
+
* Refusing here and not at render time is the whole point: `ExportTimelapseSchema`
|
|
35108
|
+
* also rejects the pair, but it does so when the window has already closed and
|
|
35109
|
+
* the footage is being cut — the operator learns at 06:05 that last night was
|
|
35110
|
+
* never going to render, and a closed window does not come back. This turns
|
|
35111
|
+
* that into a failed edit he can see and correct.
|
|
35112
|
+
*
|
|
35113
|
+
* @throws Error naming both numbers, so the message is actionable in a toast.
|
|
35114
|
+
*/
|
|
35115
|
+
function assertTimelapseCadences(pair) {
|
|
35116
|
+
const dense = pair.denseCadenceSec;
|
|
35117
|
+
if (dense === void 0) return;
|
|
35118
|
+
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`);
|
|
35119
|
+
}
|
|
35120
|
+
/**
|
|
34558
35121
|
* The last successful generation for ONE camera of a rule, epoch-ms.
|
|
34559
35122
|
*
|
|
34560
35123
|
* The per-device map wins; a rule with no map falls back to the rule-wide
|
|
@@ -34723,4 +35286,4 @@ function vectorDimFromBase64(encoded) {
|
|
|
34723
35286
|
return Math.floor(Buffer.from(encoded, "base64").byteLength / 4);
|
|
34724
35287
|
}
|
|
34725
35288
|
//#endregion
|
|
34726
|
-
export {
|
|
35289
|
+
export { BaseAddon as $, assertTimelapseCadences as A, hfModelUrl as B, TIMELAPSE_DENSE_FLOOR_SEC as C, TrackSourceSchema as D, TimelapseRuleSchema as E, defineCustomActions as F, plateGalleryCapability as G, kebabToCamel as H, deriveRecordingMode as I, subKindsOf as J, readDeviceStateFrom as K, embeddingEncoderCapability as L, buildEventKindDescriptor as M, cosineSimilarity as N, addonWidgetsSourceCapability as O, customAction as P, errMsg as Q, encodeVectorBase64 as R, RetrainStatusSchema as S, TimelapseRulePatchSchema as T, notificationRulesCapability as U, isScheduleActive as V, pipelineAnalyticsCapability as W, videoclipsCapability as X, vectorDimFromBase64 as Y, zoneAnalyticsCapability as Z, NcSnoozeSchema as _, DeclaredDevices as a, sleep as at, OpsLogEntrySchema as b, LabelAttributionSchema as c, boolean as ct, NC_TAXONOMY as d, object as dt, DeviceType as et, NcConditionDescriptorSchema as f, partialRecord as ft, NcSnoozeInputSchema as g, EventCategory as gt, NcRuleSchema as h, unknown as ht, DETECTION_PIPELINE_CAP_NAME as i, nodePin as it, audioMetricsCapability as j, alarmPanelCapability as k, MACRO_LABELS as l, literal as lt, NcRulePatchSchema as m, string as mt, DEFAULT_EVENT_COLOR as n, hydrateSchema as nt, EVENT_KIND_BY_CAP as o, _enum as ot, NcRuleInputSchema as p, record as pt, readTimelapseGeneratedAt as q, DEFAULT_TIMELAPSE_PREVIEW_TEXT as r, isDeviceScopedCap as rt, EVENT_PAD_MS as s, array as st, BaseDevice as t, createEvent as tt, NC_CONDITION_CATALOG as u, number as ut, NcSnoozeSuppressedSchema as v, TimelapseRuleInputSchema as w, RECORDING_EXPORT_MAX_READ_BYTES as x, NcTaxonomySchema as y, faceGalleryCapability as z };
|