@camstack/addon-post-analysis 1.2.66 → 1.2.68
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-DKsqvmSl.js → dist-Dl1kEFqi.js} +675 -39
- package/dist/{dist-DPzTTt9R.mjs → dist-rpHe5qpB.mjs} +628 -40
- 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-BdNH8u64.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-DgDC53Dh.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-B57Jy4_o.mjs +26 -0
- package/dist/pipeline-analytics/{hostInit-D8a3hjwW.mjs → hostInit-GicJZVng.mjs} +3 -3
- package/dist/pipeline-analytics/index.js +7505 -898
- package/dist/pipeline-analytics/index.mjs +7498 -892
- package/dist/pipeline-analytics/remoteEntry.js +1 -1
- package/package.json +1 -1
- 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 +0 -26
|
@@ -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()
|
|
@@ -14424,6 +14448,13 @@ var MaskGridDimsSchema = object({
|
|
|
14424
14448
|
* `package-event` are pure trigger kinds (no urgency dimension). Extending
|
|
14425
14449
|
* this one field keeps the schema additive — a rule still declares exactly
|
|
14426
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`.
|
|
14427
14458
|
*/
|
|
14428
14459
|
var NcDeliverySchema = _enum([
|
|
14429
14460
|
"immediate",
|
|
@@ -14438,15 +14469,32 @@ var NcDeliverySchema = _enum([
|
|
|
14438
14469
|
* depend on a provider's raw event name or payload shape.
|
|
14439
14470
|
*/
|
|
14440
14471
|
var NcSystemEventKindSchema = _enum([
|
|
14441
|
-
"
|
|
14442
|
-
"
|
|
14472
|
+
"device-online",
|
|
14473
|
+
"device-offline",
|
|
14474
|
+
"device-disabled",
|
|
14475
|
+
"device-enabled",
|
|
14443
14476
|
"stream-online",
|
|
14444
14477
|
"stream-offline",
|
|
14445
14478
|
"node-online",
|
|
14446
14479
|
"node-offline",
|
|
14447
14480
|
"addon-update-available",
|
|
14448
|
-
"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"
|
|
14449
14496
|
]);
|
|
14497
|
+
NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
|
|
14450
14498
|
/**
|
|
14451
14499
|
* One coherent system-event condition. `kinds` is the required opt-in safety
|
|
14452
14500
|
* gate; the remaining lists are optional narrowing filters relevant to the
|
|
@@ -14455,6 +14503,18 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14455
14503
|
var NcSystemEventConditionSchema = object({
|
|
14456
14504
|
kinds: array(NcSystemEventKindSchema).min(1),
|
|
14457
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(),
|
|
14458
14518
|
nodeIds: array(string().min(1)).min(1).optional(),
|
|
14459
14519
|
packageNames: array(string().min(1)).min(1).optional()
|
|
14460
14520
|
});
|
|
@@ -14505,6 +14565,47 @@ var NcOccupancyConditionSchema = object({
|
|
|
14505
14565
|
sustainSeconds: number().int().min(0).max(3600).default(15)
|
|
14506
14566
|
});
|
|
14507
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
|
+
/**
|
|
14508
14609
|
* Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
|
|
14509
14610
|
*
|
|
14510
14611
|
* The values are not symmetric, and deliberately so — the absent value has to
|
|
@@ -14777,7 +14878,33 @@ var NcConditionsSchema = object({
|
|
|
14777
14878
|
* threshold and holds for `sustainSeconds`. Fail-closed on missing
|
|
14778
14879
|
* substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
|
|
14779
14880
|
*/
|
|
14780
|
-
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()
|
|
14781
14908
|
});
|
|
14782
14909
|
/** One delivery target: a `notification-output` Target ref + passthrough params. */
|
|
14783
14910
|
var NcRuleTargetSchema = object({
|
|
@@ -14891,6 +15018,73 @@ var NcThrottleSchema = object({
|
|
|
14891
15018
|
*/
|
|
14892
15019
|
granularity: NcThrottleGranularitySchema.optional()
|
|
14893
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
|
+
});
|
|
14894
15088
|
/** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
|
|
14895
15089
|
var NcRuleInputSchema = object({
|
|
14896
15090
|
name: string().min(1).max(200),
|
|
@@ -14951,7 +15145,13 @@ var NcRuleInputSchema = object({
|
|
|
14951
15145
|
* `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
|
|
14952
15146
|
* shape as every other actuation.
|
|
14953
15147
|
*/
|
|
14954
|
-
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()
|
|
14955
15155
|
});
|
|
14956
15156
|
/**
|
|
14957
15157
|
* Partial patch for `updateRule` — any subset of the input fields, plus the
|
|
@@ -14962,7 +15162,37 @@ var NcRuleInputSchema = object({
|
|
|
14962
15162
|
* still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
|
|
14963
15163
|
* `updateRule` patch.
|
|
14964
15164
|
*/
|
|
14965
|
-
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
|
+
});
|
|
14966
15196
|
/** A persisted rule. */
|
|
14967
15197
|
var NcRuleSchema = NcRuleInputSchema.extend({
|
|
14968
15198
|
id: string(),
|
|
@@ -15075,12 +15305,20 @@ var NC_CONDITION_CATALOG = [
|
|
|
15075
15305
|
valueType: "systemEvent",
|
|
15076
15306
|
options: [
|
|
15077
15307
|
{
|
|
15078
|
-
value: "
|
|
15079
|
-
label: "
|
|
15308
|
+
value: "device-online",
|
|
15309
|
+
label: "Device online"
|
|
15310
|
+
},
|
|
15311
|
+
{
|
|
15312
|
+
value: "device-offline",
|
|
15313
|
+
label: "Device offline"
|
|
15080
15314
|
},
|
|
15081
15315
|
{
|
|
15082
|
-
value: "
|
|
15083
|
-
label: "
|
|
15316
|
+
value: "device-disabled",
|
|
15317
|
+
label: "Device switched off"
|
|
15318
|
+
},
|
|
15319
|
+
{
|
|
15320
|
+
value: "device-enabled",
|
|
15321
|
+
label: "Device switched on"
|
|
15084
15322
|
},
|
|
15085
15323
|
{
|
|
15086
15324
|
value: "stream-online",
|
|
@@ -15105,12 +15343,24 @@ var NC_CONDITION_CATALOG = [
|
|
|
15105
15343
|
{
|
|
15106
15344
|
value: "server-update-available",
|
|
15107
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"
|
|
15108
15358
|
}
|
|
15109
15359
|
],
|
|
15110
15360
|
operator: "in",
|
|
15111
15361
|
appliesTo: ["system-event"],
|
|
15112
15362
|
phase: "P1",
|
|
15113
|
-
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."
|
|
15114
15364
|
},
|
|
15115
15365
|
{
|
|
15116
15366
|
id: "devices",
|
|
@@ -15634,6 +15884,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
|
|
|
15634
15884
|
* Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
|
|
15635
15885
|
* copy would lie the first time a rule is disabled.
|
|
15636
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
|
+
});
|
|
15637
15906
|
var NcAlarmModeCoverageSchema = object({
|
|
15638
15907
|
mode: AlarmArmModeSchema,
|
|
15639
15908
|
/** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
|
|
@@ -15641,7 +15910,18 @@ var NcAlarmModeCoverageSchema = object({
|
|
|
15641
15910
|
/** At least one covering rule has no device scope, so the mode covers all. */
|
|
15642
15911
|
allDevices: boolean(),
|
|
15643
15912
|
/** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
|
|
15644
|
-
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([])
|
|
15645
15925
|
});
|
|
15646
15926
|
var NcAlarmConfigSchema = object({
|
|
15647
15927
|
/**
|
|
@@ -25823,7 +26103,19 @@ var RecordingManifestSchema = object({
|
|
|
25823
26103
|
* profiles/subtrees/locations on this node). */
|
|
25824
26104
|
var RecordingDeviceUsageSchema = object({
|
|
25825
26105
|
deviceId: number(),
|
|
25826
|
-
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()
|
|
25827
26119
|
});
|
|
25828
26120
|
/** Recording storage usage + capacity for one storage location. */
|
|
25829
26121
|
var RecordingLocationUsageSchema = object({
|
|
@@ -25851,6 +26143,57 @@ var RecordingStorageUsageSchema = object({
|
|
|
25851
26143
|
locations: array(RecordingLocationUsageSchema)
|
|
25852
26144
|
});
|
|
25853
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
|
+
/**
|
|
25854
26197
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
25855
26198
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
25856
26199
|
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
@@ -26013,6 +26356,21 @@ method(object({
|
|
|
26013
26356
|
}), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
26014
26357
|
kind: "mutation",
|
|
26015
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"
|
|
26016
26374
|
});
|
|
26017
26375
|
/**
|
|
26018
26376
|
* `recording-export` cap — render a footage time range into a single downloadable
|
|
@@ -26031,13 +26389,24 @@ method(object({
|
|
|
26031
26389
|
/** Playback-speed multiplier for the render (1 = realtime). */
|
|
26032
26390
|
var ExportSpeedSchema = number().min(.25).max(32);
|
|
26033
26391
|
/**
|
|
26034
|
-
* One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
|
|
26392
|
+
* One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
|
|
26393
|
+
*
|
|
26394
|
+
* **Wall clock, not ffmpeg's `t`** — and the recorder translates. A caller
|
|
26395
|
+
* derives these bounds from things that happened at a TIME (a track's
|
|
26396
|
+
* `firstSeen`), while `t` runs over the source playlist: the concatenation of
|
|
26397
|
+
* every segment present for the range, with each recording GAP removed. The
|
|
26398
|
+
* two agree only on a window that recorded without one interruption, and only
|
|
26399
|
+
* the render side knows the segments, so the translation lives there
|
|
26400
|
+
* (`export-dense-map.ts`, addon-pipeline).
|
|
26035
26401
|
*
|
|
26036
|
-
*
|
|
26037
|
-
*
|
|
26038
|
-
*
|
|
26039
|
-
*
|
|
26040
|
-
*
|
|
26402
|
+
* It was not always so. These seconds were fed to `between(t,…)` verbatim, and
|
|
26403
|
+
* on a 10 h window holding 29,393 s of footage every range landed late by the
|
|
26404
|
+
* gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
|
|
26405
|
+
* the video was a uniform timelapse, and the log line reported the five ranges
|
|
26406
|
+
* that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
|
|
26407
|
+
*
|
|
26408
|
+
* Relative and not absolute epoch, because an absolute epoch would make every
|
|
26409
|
+
* call site responsible for the same subtraction.
|
|
26041
26410
|
*/
|
|
26042
26411
|
var ExportDenseRangeSchema = object({
|
|
26043
26412
|
fromSec: number().nonnegative(),
|
|
@@ -32912,6 +33281,12 @@ Object.freeze({
|
|
|
32912
33281
|
addonId: null,
|
|
32913
33282
|
access: "create"
|
|
32914
33283
|
},
|
|
33284
|
+
"recording.cancelRelocateJob": {
|
|
33285
|
+
capName: "recording",
|
|
33286
|
+
capScope: "system",
|
|
33287
|
+
addonId: null,
|
|
33288
|
+
access: "create"
|
|
33289
|
+
},
|
|
32915
33290
|
"recording.cancelStorageMigrationMove": {
|
|
32916
33291
|
capName: "recording",
|
|
32917
33292
|
capScope: "system",
|
|
@@ -32966,6 +33341,12 @@ Object.freeze({
|
|
|
32966
33341
|
addonId: null,
|
|
32967
33342
|
access: "view"
|
|
32968
33343
|
},
|
|
33344
|
+
"recording.listRelocateJobs": {
|
|
33345
|
+
capName: "recording",
|
|
33346
|
+
capScope: "system",
|
|
33347
|
+
addonId: null,
|
|
33348
|
+
access: "view"
|
|
33349
|
+
},
|
|
32969
33350
|
"recording.locateSegment": {
|
|
32970
33351
|
capName: "recording",
|
|
32971
33352
|
capScope: "system",
|
|
@@ -32978,6 +33359,12 @@ Object.freeze({
|
|
|
32978
33359
|
addonId: null,
|
|
32979
33360
|
access: "create"
|
|
32980
33361
|
},
|
|
33362
|
+
"recording.planStorageRebalance": {
|
|
33363
|
+
capName: "recording",
|
|
33364
|
+
capScope: "system",
|
|
33365
|
+
addonId: null,
|
|
33366
|
+
access: "view"
|
|
33367
|
+
},
|
|
32981
33368
|
"recording.pruneFootage": {
|
|
32982
33369
|
capName: "recording",
|
|
32983
33370
|
capScope: "system",
|
|
@@ -33002,6 +33389,12 @@ Object.freeze({
|
|
|
33002
33389
|
addonId: null,
|
|
33003
33390
|
access: "create"
|
|
33004
33391
|
},
|
|
33392
|
+
"recording.relocateFootage": {
|
|
33393
|
+
capName: "recording",
|
|
33394
|
+
capScope: "system",
|
|
33395
|
+
addonId: null,
|
|
33396
|
+
access: "create"
|
|
33397
|
+
},
|
|
33005
33398
|
"recording.renderClip": {
|
|
33006
33399
|
capName: "recording",
|
|
33007
33400
|
capScope: "system",
|
|
@@ -33038,6 +33431,12 @@ Object.freeze({
|
|
|
33038
33431
|
addonId: null,
|
|
33039
33432
|
access: "create"
|
|
33040
33433
|
},
|
|
33434
|
+
"recording.startStorageRebalance": {
|
|
33435
|
+
capName: "recording",
|
|
33436
|
+
capScope: "system",
|
|
33437
|
+
addonId: null,
|
|
33438
|
+
access: "create"
|
|
33439
|
+
},
|
|
33041
33440
|
"recordingExport.cancelExport": {
|
|
33042
33441
|
capName: "recording-export",
|
|
33043
33442
|
capScope: "system",
|
|
@@ -34512,6 +34911,111 @@ var FramerateField = number().int().min(1).max(60);
|
|
|
34512
34911
|
var TargetsField = array(NcRuleTargetSchema).min(1);
|
|
34513
34912
|
var PriorityField = number().int().min(1).max(5);
|
|
34514
34913
|
/**
|
|
34914
|
+
* Floor on any dense cadence, seconds — the recording's own frame interval.
|
|
34915
|
+
*
|
|
34916
|
+
* Declared here because it bounds BOTH the rule field and the renderer's
|
|
34917
|
+
* derivation, and two copies of a floor are two floors that can drift.
|
|
34918
|
+
*/
|
|
34919
|
+
var TIMELAPSE_DENSE_FLOOR_SEC = .1;
|
|
34920
|
+
/**
|
|
34921
|
+
* Explicit override of the DENSE sampling cadence, seconds.
|
|
34922
|
+
*
|
|
34923
|
+
* Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
|
|
34924
|
+
* 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
|
|
34925
|
+
* made that same base 3 s and rendered a person pass as two frames.)
|
|
34926
|
+
*
|
|
34927
|
+
* THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
|
|
34928
|
+
* `denseCadenceSec` and played at `framerate` occupies
|
|
34929
|
+
*
|
|
34930
|
+
* outputSeconds = (rangeSec / denseCadenceSec) / framerate
|
|
34931
|
+
*
|
|
34932
|
+
* 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.
|
|
34933
|
+
* Halving this field doubles the frames INSIDE ranges only — the base cadence,
|
|
34934
|
+
* and therefore the length of a quiet night, does not move.
|
|
34935
|
+
*
|
|
34936
|
+
* Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
|
|
34937
|
+
* the recording has them returns the same frames, requested twice. Must be
|
|
34938
|
+
* STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
|
|
34939
|
+
* a uniform video the operator believes is two-rate — and upsert refuses it
|
|
34940
|
+
* rather than letting the export cap reject the render hours after the window.
|
|
34941
|
+
*/
|
|
34942
|
+
var DenseCadenceSecField = number().min(TIMELAPSE_DENSE_FLOOR_SEC).max(3600);
|
|
34943
|
+
/**
|
|
34944
|
+
* Minimum seconds of OUTPUT video each detection range must occupy.
|
|
34945
|
+
*
|
|
34946
|
+
* The operator-facing form of the arithmetic above: instead of solving for a
|
|
34947
|
+
* cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
|
|
34948
|
+
* 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
|
|
34949
|
+
* that range every ~583 ms.
|
|
34950
|
+
*
|
|
34951
|
+
* ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
|
|
34952
|
+
* ranges are terms of a single ffmpeg `select` expression that cannot vary rate
|
|
34953
|
+
* per term — so the MOST DEMANDING (shortest) range sets the rate and longer
|
|
34954
|
+
* ranges are sampled denser than they need. Per-range cadences require a cap
|
|
34955
|
+
* schema change and are the tracked follow-up.
|
|
34956
|
+
*
|
|
34957
|
+
* A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
|
|
34958
|
+
* is rendered with every frame that EXISTS and no more: the guarantee is capped
|
|
34959
|
+
* by real footage, never met by duplicating frames into motion that never
|
|
34960
|
+
* happened.
|
|
34961
|
+
*/
|
|
34962
|
+
var MinDwellSecField = number().min(0).max(60);
|
|
34963
|
+
/**
|
|
34964
|
+
* Caption burned into the notification's preview frame.
|
|
34965
|
+
*
|
|
34966
|
+
* Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
|
|
34967
|
+
* `rule`, `from`, `to`) and rendered by the SAME renderer — a second
|
|
34968
|
+
* templating dialect for one field would be a second thing to explain.
|
|
34969
|
+
*
|
|
34970
|
+
* Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
|
|
34971
|
+
* operator saying "the frame, no caption" — a distinct, reachable answer, and
|
|
34972
|
+
* the reason this is not `.min(1)`.
|
|
34973
|
+
*/
|
|
34974
|
+
var PreviewTextField = string().max(200);
|
|
34975
|
+
/**
|
|
34976
|
+
* Whether the notification's preview is a STILL or a short animation.
|
|
34977
|
+
*
|
|
34978
|
+
* The operator's ask, verbatim: *"inviato come gif o video (come per le altre
|
|
34979
|
+
* rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
|
|
34980
|
+
* night reads better as three seconds of motion than as one frame of it. Both
|
|
34981
|
+
* modes get the SAME treatment (blurred frame, large centred title); `'gif'`
|
|
34982
|
+
* simply applies it to a dozen frames sampled across the render and assembles
|
|
34983
|
+
* them.
|
|
34984
|
+
*
|
|
34985
|
+
* `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
|
|
34986
|
+
* seeks and a palette pass, and no rule that never asked for one should start
|
|
34987
|
+
* paying that on the deploy that shipped it.
|
|
34988
|
+
*
|
|
34989
|
+
* A GIF that cannot be assembled DEGRADES to the still — never to nothing.
|
|
34990
|
+
*/
|
|
34991
|
+
var PreviewModeField = _enum(["image", "gif"]);
|
|
34992
|
+
/**
|
|
34993
|
+
* Which detection classes the notification reports counts for.
|
|
34994
|
+
*
|
|
34995
|
+
* The counts come from the tracks the render ALREADY fetched for its dense-range
|
|
34996
|
+
* plan — no second query — aggregated per class. Absent or empty means "every
|
|
34997
|
+
* class the window actually contained", which is what an operator who never
|
|
34998
|
+
* opened the field wants; a list narrows it (`['person']` on a driveway that
|
|
34999
|
+
* counts cars all night).
|
|
35000
|
+
*
|
|
35001
|
+
* Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
|
|
35002
|
+
* …). An unknown name simply never matches and reports nothing — it is not an
|
|
35003
|
+
* error, because a rule may legitimately name a class this camera's model does
|
|
35004
|
+
* not emit.
|
|
35005
|
+
*
|
|
35006
|
+
* The counts are exposed to {@link TimelapseTemplateSchema} as:
|
|
35007
|
+
* - `{{detections}}` — total over the reported classes
|
|
35008
|
+
* - `{{detectionSummary}}` — `2 persone, 1 veicolo`
|
|
35009
|
+
* - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
|
|
35010
|
+
* one per class, `count_` + the class name
|
|
35011
|
+
*
|
|
35012
|
+
* With NO custom body template the summary is appended to the derived body, and
|
|
35013
|
+
* only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
|
|
35014
|
+
* reads. With a custom template the operator owns every word — nothing is
|
|
35015
|
+
* appended, so `{{detectionSummary}}` is how he asks for it.
|
|
35016
|
+
*/
|
|
35017
|
+
var ReportClassesField = array(string().min(1).max(40)).max(20);
|
|
35018
|
+
/**
|
|
34515
35019
|
* Client-supplied timelapse-rule fields. The server stamps id / createdBy /
|
|
34516
35020
|
* createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
|
|
34517
35021
|
* here (see the ownership note above).
|
|
@@ -34531,13 +35035,42 @@ var TimelapseRuleInputSchema = object({
|
|
|
34531
35035
|
cadenceSec: CadenceSecField.default(15),
|
|
34532
35036
|
/** Output frames per second of the assembled mp4 (predecessor parity). */
|
|
34533
35037
|
framerate: FramerateField.default(10),
|
|
35038
|
+
/**
|
|
35039
|
+
* Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
|
|
35040
|
+
* as `max(1s, cadenceSec / 30)`, which is what every rule written before this
|
|
35041
|
+
* field gets.
|
|
35042
|
+
*/
|
|
35043
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
35044
|
+
/** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
|
|
35045
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
34534
35046
|
/** `notification-output` targets the finished video/thumbnail is sent to. */
|
|
34535
35047
|
targets: TargetsField,
|
|
34536
35048
|
template: TimelapseTemplateSchema.optional(),
|
|
35049
|
+
/**
|
|
35050
|
+
* Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
|
|
35051
|
+
* and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
|
|
35052
|
+
*
|
|
35053
|
+
* Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
|
|
35054
|
+
* the notification's title/body, and clearing it (`template: null`) must not
|
|
35055
|
+
* silently clear the caption too.
|
|
35056
|
+
*/
|
|
35057
|
+
previewText: PreviewTextField.optional(),
|
|
35058
|
+
/** Still or animation — see {@link PreviewModeField}. */
|
|
35059
|
+
previewMode: PreviewModeField.default("image"),
|
|
35060
|
+
/** Classes the notification counts — see {@link ReportClassesField}. */
|
|
35061
|
+
reportClasses: ReportClassesField.optional(),
|
|
34537
35062
|
/** Canonical notification priority ordinal (1..5); per-target overridable. */
|
|
34538
35063
|
priority: PriorityField.default(3)
|
|
34539
35064
|
});
|
|
34540
35065
|
/**
|
|
35066
|
+
* The caption a rule that never set one gets.
|
|
35067
|
+
*
|
|
35068
|
+
* Rendered through the ordinary `{{var}}` pass at delivery, so a rule created
|
|
35069
|
+
* before this field existed still reads "Timelapse Videocamera ingresso" and
|
|
35070
|
+
* not the literal braces.
|
|
35071
|
+
*/
|
|
35072
|
+
var DEFAULT_TIMELAPSE_PREVIEW_TEXT = "Timelapse {{camera}}";
|
|
35073
|
+
/**
|
|
34541
35074
|
* Partial patch for an update — any subset of the INPUT fields, with NO
|
|
34542
35075
|
* defaults (an absent key means "leave unchanged", never "reset to default").
|
|
34543
35076
|
* Provenance and ownership are absent by construction: a patch can rename or
|
|
@@ -34560,8 +35093,13 @@ var TimelapseRulePatchSchema = object({
|
|
|
34560
35093
|
schedule: NcScheduleSchema.optional(),
|
|
34561
35094
|
cadenceSec: CadenceSecField.optional(),
|
|
34562
35095
|
framerate: FramerateField.optional(),
|
|
35096
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
35097
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
34563
35098
|
targets: TargetsField.optional(),
|
|
34564
35099
|
template: TimelapseTemplateSchema.nullable().optional(),
|
|
35100
|
+
previewText: PreviewTextField.optional(),
|
|
35101
|
+
previewMode: PreviewModeField.optional(),
|
|
35102
|
+
reportClasses: ReportClassesField.optional(),
|
|
34565
35103
|
priority: PriorityField.optional()
|
|
34566
35104
|
});
|
|
34567
35105
|
/** A persisted timelapse rule. */
|
|
@@ -34602,6 +35140,26 @@ var TimelapseRuleSchema = TimelapseRuleInputSchema.extend({
|
|
|
34602
35140
|
updatedAt: number()
|
|
34603
35141
|
});
|
|
34604
35142
|
/**
|
|
35143
|
+
* Refuse a dense cadence that is not denser than the base.
|
|
35144
|
+
*
|
|
35145
|
+
* Called at UPSERT, on the MERGED rule — a patch that lowers `cadenceSec`
|
|
35146
|
+
* alone can invalidate a `denseCadenceSec` set months earlier, so checking the
|
|
35147
|
+
* patch in isolation would let the bad pair through.
|
|
35148
|
+
*
|
|
35149
|
+
* Refusing here and not at render time is the whole point: `ExportTimelapseSchema`
|
|
35150
|
+
* also rejects the pair, but it does so when the window has already closed and
|
|
35151
|
+
* the footage is being cut — the operator learns at 06:05 that last night was
|
|
35152
|
+
* never going to render, and a closed window does not come back. This turns
|
|
35153
|
+
* that into a failed edit he can see and correct.
|
|
35154
|
+
*
|
|
35155
|
+
* @throws Error naming both numbers, so the message is actionable in a toast.
|
|
35156
|
+
*/
|
|
35157
|
+
function assertTimelapseCadences(pair) {
|
|
35158
|
+
const dense = pair.denseCadenceSec;
|
|
35159
|
+
if (dense === void 0) return;
|
|
35160
|
+
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`);
|
|
35161
|
+
}
|
|
35162
|
+
/**
|
|
34605
35163
|
* The last successful generation for ONE camera of a rule, epoch-ms.
|
|
34606
35164
|
*
|
|
34607
35165
|
* The per-device map wins; a rule with no map falls back to the rule-wide
|
|
@@ -34663,25 +35221,32 @@ object({
|
|
|
34663
35221
|
var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
|
|
34664
35222
|
object({
|
|
34665
35223
|
/**
|
|
34666
|
-
* How
|
|
35224
|
+
* How many delivered frames the worker HOLDS at once, waiting for each one's
|
|
35225
|
+
* detection result.
|
|
35226
|
+
*
|
|
35227
|
+
* This replaced a TTL on 2026-08-13, and the replacement is the whole point:
|
|
35228
|
+
* a time window was never related to the event the pixels were waiting for.
|
|
35229
|
+
* A held frame now lives from delivery until the runner has its `FrameResult`
|
|
35230
|
+
* — at which moment the runner cuts the subject tiles it actually wanted and
|
|
35231
|
+
* releases the frame. The bound exists only so a runner that stops answering
|
|
35232
|
+
* cannot pin RAM: above it the OLDEST held frame is dropped and counted.
|
|
34667
35233
|
*
|
|
34668
|
-
*
|
|
34669
|
-
*
|
|
34670
|
-
*
|
|
34671
|
-
*
|
|
34672
|
-
*
|
|
35234
|
+
* Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
|
|
35235
|
+
* 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
|
|
35236
|
+
* without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
|
|
35237
|
+
* Raising it does not buy hit rate — it buys tolerance for a slow runner, and
|
|
35238
|
+
* `holdOverflow` on the metrics line is what says you need it.
|
|
34673
35239
|
*/
|
|
34674
|
-
|
|
35240
|
+
holdFrames: number().int().min(1).max(64),
|
|
34675
35241
|
/**
|
|
34676
35242
|
* Hard per-decode-worker RAM ceiling for retained native frames, in MB.
|
|
34677
35243
|
*
|
|
34678
|
-
*
|
|
34679
|
-
*
|
|
34680
|
-
*
|
|
34681
|
-
*
|
|
34682
|
-
*
|
|
34683
|
-
*
|
|
34684
|
-
* rather than giving RAM back — lower this knob if RAM is what you wanted.
|
|
35244
|
+
* Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
|
|
35245
|
+
* is what decides how much is held, and the ceiling is the number above which
|
|
35246
|
+
* something is wrong. Before that it was the effective cap — at 1024 MB with
|
|
35247
|
+
* a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
|
|
35248
|
+
* with the TTL expiring nothing, which is exactly the confusion the hold
|
|
35249
|
+
* removes. `leaseMb` / `leaseFrames` still say what is resident.
|
|
34685
35250
|
* `0` DISABLES the lease entirely and falls the worker back to the tiny
|
|
34686
35251
|
* leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
|
|
34687
35252
|
* to replace).
|
|
@@ -34707,22 +35272,45 @@ object({
|
|
|
34707
35272
|
* there is the signal that some caller names frames outside the inference set
|
|
34708
35273
|
* and that this must go back to `all`.
|
|
34709
35274
|
*/
|
|
34710
|
-
admission: NativeLeaseAdmissionSchema
|
|
35275
|
+
admission: NativeLeaseAdmissionSchema,
|
|
35276
|
+
/**
|
|
35277
|
+
* RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
|
|
35278
|
+
* compressed native crops the worker cuts at the moment a frame's detection
|
|
35279
|
+
* result arrives, and keeps long after the frame itself is freed.
|
|
35280
|
+
*
|
|
35281
|
+
* This is the knob that replaced the old retention window, and it buys about
|
|
35282
|
+
* three orders of magnitude more of it: a tile is one subject at native
|
|
35283
|
+
* resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
|
|
35284
|
+
* the frame it was cut from. A frame on which nothing was detected costs
|
|
35285
|
+
* nothing at all, which is the real change — the old lease paid per FRAME and
|
|
35286
|
+
* was interrogated per SUBJECT.
|
|
35287
|
+
*
|
|
35288
|
+
* `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
|
|
35289
|
+
* fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
|
|
35290
|
+
* reproduce that.
|
|
35291
|
+
*/
|
|
35292
|
+
tileBudgetMb: number().int().min(0).max(1024)
|
|
34711
35293
|
});
|
|
34712
35294
|
/**
|
|
34713
|
-
* The values in force when the operator has set nothing
|
|
34714
|
-
*
|
|
34715
|
-
*
|
|
35295
|
+
* The values in force when the operator has set nothing.
|
|
35296
|
+
*
|
|
35297
|
+
* `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
|
|
35298
|
+
* being the retention window and became the OOM ceiling, and lowering a ceiling
|
|
35299
|
+
* in the same change that redefines it would make a regression and a retune
|
|
35300
|
+
* indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
|
|
35301
|
+
* live traffic.
|
|
34716
35302
|
*/
|
|
34717
35303
|
var DEFAULT_NATIVE_LEASE_SETTINGS = {
|
|
34718
|
-
|
|
35304
|
+
holdFrames: 8,
|
|
34719
35305
|
budgetMb: 1024,
|
|
34720
35306
|
activityMs: 15e3,
|
|
35307
|
+
tileBudgetMb: 64,
|
|
34721
35308
|
admission: "inferred"
|
|
34722
35309
|
};
|
|
34723
|
-
DEFAULT_NATIVE_LEASE_SETTINGS.
|
|
35310
|
+
DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
|
|
34724
35311
|
DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
|
|
34725
35312
|
DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
|
|
35313
|
+
DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
|
|
34726
35314
|
DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
34727
35315
|
/** Cosine similarity between two embedding vectors */
|
|
34728
35316
|
function cosineSimilarity(a, b) {
|
|
@@ -34788,6 +35376,18 @@ Object.defineProperty(exports, "DEFAULT_EVENT_COLOR", {
|
|
|
34788
35376
|
return DEFAULT_EVENT_COLOR;
|
|
34789
35377
|
}
|
|
34790
35378
|
});
|
|
35379
|
+
Object.defineProperty(exports, "DEFAULT_TIMELAPSE_PREVIEW_TEXT", {
|
|
35380
|
+
enumerable: true,
|
|
35381
|
+
get: function() {
|
|
35382
|
+
return DEFAULT_TIMELAPSE_PREVIEW_TEXT;
|
|
35383
|
+
}
|
|
35384
|
+
});
|
|
35385
|
+
Object.defineProperty(exports, "DETECTION_PIPELINE_CAP_NAME", {
|
|
35386
|
+
enumerable: true,
|
|
35387
|
+
get: function() {
|
|
35388
|
+
return DETECTION_PIPELINE_CAP_NAME;
|
|
35389
|
+
}
|
|
35390
|
+
});
|
|
34791
35391
|
Object.defineProperty(exports, "DeclaredDevices", {
|
|
34792
35392
|
enumerable: true,
|
|
34793
35393
|
get: function() {
|
|
@@ -34866,6 +35466,18 @@ Object.defineProperty(exports, "NcRuleSchema", {
|
|
|
34866
35466
|
return NcRuleSchema;
|
|
34867
35467
|
}
|
|
34868
35468
|
});
|
|
35469
|
+
Object.defineProperty(exports, "NcRuleTargetSchema", {
|
|
35470
|
+
enumerable: true,
|
|
35471
|
+
get: function() {
|
|
35472
|
+
return NcRuleTargetSchema;
|
|
35473
|
+
}
|
|
35474
|
+
});
|
|
35475
|
+
Object.defineProperty(exports, "NcScheduleSchema", {
|
|
35476
|
+
enumerable: true,
|
|
35477
|
+
get: function() {
|
|
35478
|
+
return NcScheduleSchema;
|
|
35479
|
+
}
|
|
35480
|
+
});
|
|
34869
35481
|
Object.defineProperty(exports, "NcSnoozeInputSchema", {
|
|
34870
35482
|
enumerable: true,
|
|
34871
35483
|
get: function() {
|
|
@@ -34908,6 +35520,12 @@ Object.defineProperty(exports, "RetrainStatusSchema", {
|
|
|
34908
35520
|
return RetrainStatusSchema;
|
|
34909
35521
|
}
|
|
34910
35522
|
});
|
|
35523
|
+
Object.defineProperty(exports, "TIMELAPSE_DENSE_FLOOR_SEC", {
|
|
35524
|
+
enumerable: true,
|
|
35525
|
+
get: function() {
|
|
35526
|
+
return TIMELAPSE_DENSE_FLOOR_SEC;
|
|
35527
|
+
}
|
|
35528
|
+
});
|
|
34911
35529
|
Object.defineProperty(exports, "TimelapseRuleInputSchema", {
|
|
34912
35530
|
enumerable: true,
|
|
34913
35531
|
get: function() {
|
|
@@ -34968,6 +35586,12 @@ Object.defineProperty(exports, "array", {
|
|
|
34968
35586
|
return array;
|
|
34969
35587
|
}
|
|
34970
35588
|
});
|
|
35589
|
+
Object.defineProperty(exports, "assertTimelapseCadences", {
|
|
35590
|
+
enumerable: true,
|
|
35591
|
+
get: function() {
|
|
35592
|
+
return assertTimelapseCadences;
|
|
35593
|
+
}
|
|
35594
|
+
});
|
|
34971
35595
|
Object.defineProperty(exports, "audioMetricsCapability", {
|
|
34972
35596
|
enumerable: true,
|
|
34973
35597
|
get: function() {
|
|
@@ -35016,6 +35640,12 @@ Object.defineProperty(exports, "deriveRecordingMode", {
|
|
|
35016
35640
|
return deriveRecordingMode;
|
|
35017
35641
|
}
|
|
35018
35642
|
});
|
|
35643
|
+
Object.defineProperty(exports, "discriminatedUnion", {
|
|
35644
|
+
enumerable: true,
|
|
35645
|
+
get: function() {
|
|
35646
|
+
return discriminatedUnion;
|
|
35647
|
+
}
|
|
35648
|
+
});
|
|
35019
35649
|
Object.defineProperty(exports, "embeddingEncoderCapability", {
|
|
35020
35650
|
enumerable: true,
|
|
35021
35651
|
get: function() {
|
|
@@ -35100,6 +35730,12 @@ Object.defineProperty(exports, "object", {
|
|
|
35100
35730
|
return object;
|
|
35101
35731
|
}
|
|
35102
35732
|
});
|
|
35733
|
+
Object.defineProperty(exports, "partialRecord", {
|
|
35734
|
+
enumerable: true,
|
|
35735
|
+
get: function() {
|
|
35736
|
+
return partialRecord;
|
|
35737
|
+
}
|
|
35738
|
+
});
|
|
35103
35739
|
Object.defineProperty(exports, "pipelineAnalyticsCapability", {
|
|
35104
35740
|
enumerable: true,
|
|
35105
35741
|
get: function() {
|