@camstack/types 1.2.63 → 1.2.64
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/capabilities/index.d.ts +3 -3
- package/dist/capabilities/notification-rules.cap.d.ts +791 -164
- package/dist/capabilities/osd-manager.cap.d.ts +108 -12
- package/dist/capabilities/pipeline-analytics.cap.d.ts +1 -0
- package/dist/capabilities/recording.cap.d.ts +189 -0
- package/dist/capabilities/storage-migration.cap.d.ts +1 -0
- package/dist/generated/addon-api.d.ts +35 -0
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +639 -14
- package/dist/index.mjs +619 -15
- package/dist/interfaces/addon.d.ts +32 -0
- package/dist/interfaces/event-bus.d.ts +29 -3
- package/dist/interfaces/relocate.d.ts +15 -0
- package/dist/interfaces/stream-broker.d.ts +14 -0
- package/dist/notification/timelapse-rule.d.ts +83 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -584,6 +584,19 @@ function resolveRunnerId(decl, addonId) {
|
|
|
584
584
|
function resolveAddonPlacement(decl) {
|
|
585
585
|
return resolveAddonExecution(decl).placement;
|
|
586
586
|
}
|
|
587
|
+
/**
|
|
588
|
+
* True when a `@camstack/system` builtin opted out of the in-process rule and
|
|
589
|
+
* must be planned as a forked runner (`execution.isolate`).
|
|
590
|
+
*
|
|
591
|
+
* ONE predicate, because the hub asks this question in three places that must
|
|
592
|
+
* agree: the runner plan (`buildAddonGroupPlan`), the "does this boot
|
|
593
|
+
* in-process" filter, and `isForkedAddonEntry` (which decides route mounts,
|
|
594
|
+
* data-plane mounts, restart and uninstall). They diverged once before for
|
|
595
|
+
* `auth-oidc` and the addon's routes were mounted against an async UDS proxy.
|
|
596
|
+
*/
|
|
597
|
+
function isIsolatedBuiltin(decl) {
|
|
598
|
+
return decl.execution?.isolate === true;
|
|
599
|
+
}
|
|
587
600
|
//#endregion
|
|
588
601
|
//#region src/interfaces/adoption-job.ts
|
|
589
602
|
/**
|
|
@@ -1675,7 +1688,15 @@ function deriveRecordingMode(config) {
|
|
|
1675
1688
|
* Each completed/failed run also lands one durable ops-log row on its owning
|
|
1676
1689
|
* addon surface.
|
|
1677
1690
|
*/
|
|
1691
|
+
/**
|
|
1692
|
+
* `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
|
|
1693
|
+
* rebalance enqueues one job per (camera, profile). Refusing the second job —
|
|
1694
|
+
* what the engine did before — turned a fifteen-camera rebalance into fifteen
|
|
1695
|
+
* manual retries. Queued jobs run FIFO; a queued job that is cancelled never
|
|
1696
|
+
* runs at all.
|
|
1697
|
+
*/
|
|
1678
1698
|
var RelocateJobStateSchema = zod.z.enum([
|
|
1699
|
+
"queued",
|
|
1679
1700
|
"running",
|
|
1680
1701
|
"done",
|
|
1681
1702
|
"failed",
|
|
@@ -1710,6 +1731,15 @@ var RelocateFootageInputSchema = zod.z.object({
|
|
|
1710
1731
|
/** Limits relocation to the logical profile class. Omit only for the
|
|
1711
1732
|
* pre-orchestration compatibility path. */
|
|
1712
1733
|
footageClass: RelocateFootageClassSchema.optional(),
|
|
1734
|
+
/** Scope the move to ONE camera. Absent = every camera on the source, which
|
|
1735
|
+
* is what a whole-disk drain means. The rebalance path always sets it: its
|
|
1736
|
+
* unit is a (camera, profile) pile, not a disk. */
|
|
1737
|
+
deviceId: zod.z.number().int().optional(),
|
|
1738
|
+
/** Scope the move to specific segment profiles (`high` / `mid` / `low`).
|
|
1739
|
+
* Finer than `footageClass`, which cannot separate high from mid — and the
|
|
1740
|
+
* placement plan assigns those two independently, so a rebalance that could
|
|
1741
|
+
* only say "recordings" would move footage the plan never asked to move. */
|
|
1742
|
+
profiles: zod.z.array(zod.z.string()).optional(),
|
|
1713
1743
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
1714
1744
|
* never allowed to starve live writers. */
|
|
1715
1745
|
throttleMbps: zod.z.number().min(1).max(1e3).optional()
|
|
@@ -11810,6 +11840,13 @@ var MaskGridDimsSchema = zod.z.object({
|
|
|
11810
11840
|
* `package-event` are pure trigger kinds (no urgency dimension). Extending
|
|
11811
11841
|
* this one field keeps the schema additive — a rule still declares exactly
|
|
11812
11842
|
* one trigger.
|
|
11843
|
+
*
|
|
11844
|
+
* AUDIO rules add no member here, for the reason occupancy added none: the
|
|
11845
|
+
* enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
|
|
11846
|
+
* mirror.ts` fails the build on a member the app cannot render) and every
|
|
11847
|
+
* member costs a release train. A sustained-sound rule is therefore an
|
|
11848
|
+
* `immediate` rule carrying {@link NcConditions.audio} — the condition is the
|
|
11849
|
+
* trigger discriminator, exactly as `occupancy` is on `device-event`.
|
|
11813
11850
|
*/
|
|
11814
11851
|
var NcDeliverySchema = zod.z.enum([
|
|
11815
11852
|
"immediate",
|
|
@@ -11824,15 +11861,50 @@ var NcDeliverySchema = zod.z.enum([
|
|
|
11824
11861
|
* depend on a provider's raw event name or payload shape.
|
|
11825
11862
|
*/
|
|
11826
11863
|
var NcSystemEventKindSchema = zod.z.enum([
|
|
11827
|
-
"
|
|
11828
|
-
"
|
|
11864
|
+
"device-online",
|
|
11865
|
+
"device-offline",
|
|
11866
|
+
"device-disabled",
|
|
11867
|
+
"device-enabled",
|
|
11829
11868
|
"stream-online",
|
|
11830
11869
|
"stream-offline",
|
|
11831
11870
|
"node-online",
|
|
11832
11871
|
"node-offline",
|
|
11833
11872
|
"addon-update-available",
|
|
11834
|
-
"server-update-available"
|
|
11873
|
+
"server-update-available",
|
|
11874
|
+
"alarm-triggered",
|
|
11875
|
+
"alarm-armed",
|
|
11876
|
+
"alarm-disarmed",
|
|
11877
|
+
"camera-online",
|
|
11878
|
+
"camera-offline",
|
|
11879
|
+
"camera-disabled",
|
|
11880
|
+
"camera-enabled"
|
|
11835
11881
|
]);
|
|
11882
|
+
/** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
|
|
11883
|
+
var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
|
|
11884
|
+
"camera-online",
|
|
11885
|
+
"camera-offline",
|
|
11886
|
+
"camera-disabled",
|
|
11887
|
+
"camera-enabled"
|
|
11888
|
+
]);
|
|
11889
|
+
/**
|
|
11890
|
+
* The kinds a rule may be AUTHORED with — every schema member except the
|
|
11891
|
+
* legacy tail. Editors render THIS list; the schema still parses the tail so a
|
|
11892
|
+
* durable row (and an unmigrated rule) survives being read.
|
|
11893
|
+
*/
|
|
11894
|
+
var NC_AUTHORABLE_SYSTEM_EVENT_KINDS = NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
|
|
11895
|
+
/**
|
|
11896
|
+
* The panel's three transitions, as ONE list.
|
|
11897
|
+
*
|
|
11898
|
+
* Named here rather than spelled out at each of the four sites that need them
|
|
11899
|
+
* (the emitter, the intake, the editor group, the combined-notification gate),
|
|
11900
|
+
* because a fourth transition added to the enum and forgotten at one of them is
|
|
11901
|
+
* an alarm state nobody can be notified about.
|
|
11902
|
+
*/
|
|
11903
|
+
var NC_ALARM_SYSTEM_EVENT_KINDS = [
|
|
11904
|
+
"alarm-triggered",
|
|
11905
|
+
"alarm-armed",
|
|
11906
|
+
"alarm-disarmed"
|
|
11907
|
+
];
|
|
11836
11908
|
/**
|
|
11837
11909
|
* One coherent system-event condition. `kinds` is the required opt-in safety
|
|
11838
11910
|
* gate; the remaining lists are optional narrowing filters relevant to the
|
|
@@ -11841,6 +11913,18 @@ var NcSystemEventKindSchema = zod.z.enum([
|
|
|
11841
11913
|
var NcSystemEventConditionSchema = zod.z.object({
|
|
11842
11914
|
kinds: zod.z.array(NcSystemEventKindSchema).min(1),
|
|
11843
11915
|
deviceIds: zod.z.array(zod.z.number().int()).min(1).optional(),
|
|
11916
|
+
/**
|
|
11917
|
+
* Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
|
|
11918
|
+
* `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
|
|
11919
|
+
* is what a liveness rule means when nobody said otherwise.
|
|
11920
|
+
*
|
|
11921
|
+
* This is where "only my cameras" is expressed, and it lives on the rule for
|
|
11922
|
+
* one reason: the intake cannot know which devices this household cares
|
|
11923
|
+
* about, and a producer-side filter is one no operator can change. Fails
|
|
11924
|
+
* CLOSED — a subject whose device type is unknown (an id the device mirror
|
|
11925
|
+
* does not carry) matches no `deviceTypes` list.
|
|
11926
|
+
*/
|
|
11927
|
+
deviceTypes: zod.z.array(zod.z.string().min(1)).min(1).optional(),
|
|
11844
11928
|
nodeIds: zod.z.array(zod.z.string().min(1)).min(1).optional(),
|
|
11845
11929
|
packageNames: zod.z.array(zod.z.string().min(1)).min(1).optional()
|
|
11846
11930
|
});
|
|
@@ -11899,6 +11983,59 @@ var NcOccupancyConditionSchema = zod.z.object({
|
|
|
11899
11983
|
sustainSeconds: zod.z.number().int().min(0).max(3600).default(15)
|
|
11900
11984
|
});
|
|
11901
11985
|
/**
|
|
11986
|
+
* The dBFS floor the analyzer reports on digital silence
|
|
11987
|
+
* (`audio-analyzer-provider.ts`: `dbfs = rms > 0 ? 20*log10(rms) : -96`).
|
|
11988
|
+
*
|
|
11989
|
+
* It is the lower bound of {@link NcAudioConditionSchema.shape.dbThreshold} for
|
|
11990
|
+
* one reason worth stating out loud: **the scale is dBFS and it is
|
|
11991
|
+
* NEGATIVE-GOING** — `0` is full scale and silence reads as a large negative
|
|
11992
|
+
* number. An operator (or a UI) that writes `60` meaning "60 decibels, quite
|
|
11993
|
+
* loud" would author a threshold NO sample can ever reach, and the rule would
|
|
11994
|
+
* look broken rather than mis-configured. The schema range rejects it instead.
|
|
11995
|
+
*/
|
|
11996
|
+
var NC_AUDIO_DBFS_FLOOR = -96;
|
|
11997
|
+
/**
|
|
11998
|
+
* Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
|
|
11999
|
+
*
|
|
12000
|
+
* Operator-approved vocabulary (2026-08-12, option A — the same one the
|
|
12001
|
+
* reference notifier uses, so an operator moving between them re-uses what
|
|
12002
|
+
* they already know): a rule matches when, over a sampling window of
|
|
12003
|
+
* `samplingSeconds`, at least `hitPercent`% of the audio samples in that
|
|
12004
|
+
* window are HITS. A sample is a hit when it satisfies BOTH present filters:
|
|
12005
|
+
*
|
|
12006
|
+
* - `dbThreshold` — its level is at or above this many dBFS (see
|
|
12007
|
+
* {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
|
|
12008
|
+
* - `labels` — the classifier put at least one of these labels on it.
|
|
12009
|
+
*
|
|
12010
|
+
* Both are OPTIONAL and independent, which is the point of the shape: a
|
|
12011
|
+
* loudness rule ("something loud at 3am") needs no model to be right, and a
|
|
12012
|
+
* label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
|
|
12013
|
+
* is given** — a window in which every sample is trivially a hit would fire on
|
|
12014
|
+
* silence, so the engine refuses such a condition rather than notifying on
|
|
12015
|
+
* nothing (the schema cannot express "at least one of" without becoming a
|
|
12016
|
+
* ZodEffects the cap path would have to special-case).
|
|
12017
|
+
*
|
|
12018
|
+
* `hitPercent` is over the samples the window actually HOLDS, and the window
|
|
12019
|
+
* must be FULL before it can match — a window that has been open for two
|
|
12020
|
+
* seconds of its ten is 100% of nothing, and firing on it would make
|
|
12021
|
+
* `samplingSeconds` decorative.
|
|
12022
|
+
*
|
|
12023
|
+
* Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
|
|
12024
|
+
* `audio-*` ids). Both spellings are accepted — the matcher normalizes the
|
|
12025
|
+
* `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
|
|
12026
|
+
* an operator who typed `dog` mean the same thing.
|
|
12027
|
+
*/
|
|
12028
|
+
var NcAudioConditionSchema = zod.z.object({
|
|
12029
|
+
/** Audio macro labels; absent = any sound (level-only rule). */
|
|
12030
|
+
labels: zod.z.array(zod.z.string().min(1)).min(1).optional(),
|
|
12031
|
+
/** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
|
|
12032
|
+
dbThreshold: zod.z.number().min(-96).max(0).optional(),
|
|
12033
|
+
/** Percentage of the window's samples that must be hits (1–100). */
|
|
12034
|
+
hitPercent: zod.z.number().int().min(1).max(100).default(60),
|
|
12035
|
+
/** Length of the sampling window in seconds. */
|
|
12036
|
+
samplingSeconds: zod.z.number().int().min(1).max(300).default(10)
|
|
12037
|
+
});
|
|
12038
|
+
/**
|
|
11902
12039
|
* Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
|
|
11903
12040
|
*
|
|
11904
12041
|
* The values are not symmetric, and deliberately so — the absent value has to
|
|
@@ -12182,7 +12319,33 @@ var NcConditionsSchema = zod.z.object({
|
|
|
12182
12319
|
* threshold and holds for `sustainSeconds`. Fail-closed on missing
|
|
12183
12320
|
* substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
|
|
12184
12321
|
*/
|
|
12185
|
-
occupancy: NcOccupancyConditionSchema.optional()
|
|
12322
|
+
occupancy: NcOccupancyConditionSchema.optional(),
|
|
12323
|
+
/**
|
|
12324
|
+
* IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
|
|
12325
|
+
* `samplingSeconds` window clear the optional `dbThreshold` and carry one of
|
|
12326
|
+
* the optional `labels`. Fail-closed on missing substrate (no audio samples,
|
|
12327
|
+
* a window that is not full yet, neither filter given). See
|
|
12328
|
+
* {@link NcAudioCondition}.
|
|
12329
|
+
*
|
|
12330
|
+
* Presence of this key is what makes a rule an AUDIO rule: the engine fires
|
|
12331
|
+
* it ONLY on a confirmed audio window, and a rule carrying it never fires on
|
|
12332
|
+
* a detection, a track or a device event (the same fail-closed pairing
|
|
12333
|
+
* `occupancy` has with the `device-event` trigger). That is how audio labels
|
|
12334
|
+
* leave `classes`: an audio rule names its sounds HERE, and the legacy path
|
|
12335
|
+
* (an `immediate` rule naming an `audio-*` class, one notification per
|
|
12336
|
+
* classified sample) stays exactly as it was for rules that already use it.
|
|
12337
|
+
*
|
|
12338
|
+
* NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
|
|
12339
|
+
* rather than an oversight: the viewer mirrors the descriptor enums BY HAND
|
|
12340
|
+
* (`camstack/src/data/notification-center.ts`, guarded by
|
|
12341
|
+
* `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
|
|
12342
|
+
* condition fields it does not know when a rule is saved from the phone.
|
|
12343
|
+
* Publishing an editor for a condition the app cannot round-trip is how an
|
|
12344
|
+
* operator loses a rule's conditions by opening it — so the descriptor, the
|
|
12345
|
+
* admin widget and the viewer mirror land together (P2 + P3), and only then
|
|
12346
|
+
* does an audio rule become authorable.
|
|
12347
|
+
*/
|
|
12348
|
+
audio: NcAudioConditionSchema.optional()
|
|
12186
12349
|
});
|
|
12187
12350
|
/** One delivery target: a `notification-output` Target ref + passthrough params. */
|
|
12188
12351
|
var NcRuleTargetSchema = zod.z.object({
|
|
@@ -12296,6 +12459,74 @@ var NcThrottleSchema = zod.z.object({
|
|
|
12296
12459
|
*/
|
|
12297
12460
|
granularity: NcThrottleGranularitySchema.optional()
|
|
12298
12461
|
});
|
|
12462
|
+
/**
|
|
12463
|
+
* How long the confirm gate may hold ONE notification, and how big the picture
|
|
12464
|
+
* it judges may be.
|
|
12465
|
+
*
|
|
12466
|
+
* The clamp is the product decision, not a coincidence of the model: p50 was
|
|
12467
|
+
* 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
|
|
12468
|
+
* arrives after the visitor has gone is not a notification. 448 px was enough
|
|
12469
|
+
* to score 16/16 on the operator's parking scenario — bigger costs latency and
|
|
12470
|
+
* tokens for pixels the model pools away.
|
|
12471
|
+
*/
|
|
12472
|
+
var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
|
|
12473
|
+
var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
|
|
12474
|
+
var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
|
|
12475
|
+
var NC_CONFIRM_DEFAULT_MAX_IMAGE_PX = 448;
|
|
12476
|
+
/** Comparison the model's COUNT must satisfy for the notification to fire. */
|
|
12477
|
+
var NcConfirmExpectSchema = zod.z.object({
|
|
12478
|
+
op: zod.z.enum([
|
|
12479
|
+
">=",
|
|
12480
|
+
">",
|
|
12481
|
+
"<=",
|
|
12482
|
+
"<",
|
|
12483
|
+
"=="
|
|
12484
|
+
]),
|
|
12485
|
+
count: zod.z.number().int().min(0).max(1e3)
|
|
12486
|
+
});
|
|
12487
|
+
/**
|
|
12488
|
+
* AI CONFIRM — a vision model looks at the picture this notification is about
|
|
12489
|
+
* to ship and says whether it agrees with the rule.
|
|
12490
|
+
*
|
|
12491
|
+
* It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
|
|
12492
|
+
* crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
|
|
12493
|
+
* on the operator's phone is not a verdict about this notification.
|
|
12494
|
+
*
|
|
12495
|
+
* FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
|
|
12496
|
+
* whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
|
|
12497
|
+
* the default and every fail-open is COUNTED, because a gate that always fails
|
|
12498
|
+
* open looks in the log exactly like a gate that works.
|
|
12499
|
+
*
|
|
12500
|
+
* Every field is `.optional()` rather than relied on as a Zod default at the
|
|
12501
|
+
* runtime seam: a Zod default does NOT run on the addon→addon cap path (three
|
|
12502
|
+
* production failures in one day), so the gate reads absent as the constant
|
|
12503
|
+
* above rather than trusting a parse it may never have seen.
|
|
12504
|
+
*/
|
|
12505
|
+
var NcConfirmSchema = zod.z.object({
|
|
12506
|
+
/** Off unless asked for. An absent `confirm` and `enabled:false` are the
|
|
12507
|
+
* same thing, and both mean "deliver exactly as before". */
|
|
12508
|
+
enabled: zod.z.boolean().default(false),
|
|
12509
|
+
/** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
|
|
12510
|
+
profileId: zod.z.string().optional(),
|
|
12511
|
+
/**
|
|
12512
|
+
* The operator's question, in his own words. Absent = a question derived
|
|
12513
|
+
* from the rule (its class and its expectation).
|
|
12514
|
+
*
|
|
12515
|
+
* NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
|
|
12516
|
+
* banners, signage and plates as instructions if you let them reach the
|
|
12517
|
+
* prompt — proven live — so the authoritative contract stays in the system
|
|
12518
|
+
* turn and only rule-authored words land here.
|
|
12519
|
+
*/
|
|
12520
|
+
prompt: zod.z.string().max(1e3).optional(),
|
|
12521
|
+
/** Fire only when the model's count satisfies this. Absent = the model's
|
|
12522
|
+
* own boolean verdict decides. */
|
|
12523
|
+
expect: NcConfirmExpectSchema.optional(),
|
|
12524
|
+
timeoutMs: zod.z.number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
|
|
12525
|
+
/** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
|
|
12526
|
+
onTimeout: zod.z.enum(["fire", "suppress"]).default("fire"),
|
|
12527
|
+
/** Longest edge the judged image is downscaled to before it is sent. */
|
|
12528
|
+
maxImagePx: zod.z.number().int().min(64).max(2048).default(448)
|
|
12529
|
+
});
|
|
12299
12530
|
/** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
|
|
12300
12531
|
var NcRuleInputSchema = zod.z.object({
|
|
12301
12532
|
name: zod.z.string().min(1).max(200),
|
|
@@ -12356,7 +12587,13 @@ var NcRuleInputSchema = zod.z.object({
|
|
|
12356
12587
|
* `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
|
|
12357
12588
|
* shape as every other actuation.
|
|
12358
12589
|
*/
|
|
12359
|
-
actions: NcRuleActionsSchema.optional()
|
|
12590
|
+
actions: NcRuleActionsSchema.optional(),
|
|
12591
|
+
/**
|
|
12592
|
+
* AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
|
|
12593
|
+
* a rule that predates the gate must keep delivering byte-for-byte as it
|
|
12594
|
+
* did, and absent is the only way to say that without a migration.
|
|
12595
|
+
*/
|
|
12596
|
+
confirm: NcConfirmSchema.optional()
|
|
12360
12597
|
});
|
|
12361
12598
|
/**
|
|
12362
12599
|
* Partial patch for `updateRule` — any subset of the input fields, plus the
|
|
@@ -12367,7 +12604,37 @@ var NcRuleInputSchema = zod.z.object({
|
|
|
12367
12604
|
* still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
|
|
12368
12605
|
* `updateRule` patch.
|
|
12369
12606
|
*/
|
|
12370
|
-
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
12607
|
+
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
12608
|
+
disabledTargetIds: zod.z.array(zod.z.string()).optional(),
|
|
12609
|
+
/**
|
|
12610
|
+
* `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
|
|
12611
|
+
*
|
|
12612
|
+
* It makes the key optional to SUPPLY; the parse still materialises the
|
|
12613
|
+
* default when the key is absent. And `NcRuleStore.update` merges with
|
|
12614
|
+
* `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
|
|
12615
|
+
* one — which made every partial edit destructive:
|
|
12616
|
+
*
|
|
12617
|
+
* nc.updateRule({ throttle }) → conditions reset to `{}`
|
|
12618
|
+
* nc.setRuleTargetEnabled(...) → conditions reset to `{}`
|
|
12619
|
+
* setEnabled(ruleId, false) → conditions reset to `{}`
|
|
12620
|
+
*
|
|
12621
|
+
* A rule scoped to one camera and one zone silently became a rule that
|
|
12622
|
+
* matches EVERY event on EVERY camera, and lost its `media` policy
|
|
12623
|
+
* (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
|
|
12624
|
+
* live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
|
|
12625
|
+
* within a minute of a two-field patch.
|
|
12626
|
+
*
|
|
12627
|
+
* So every defaulted field is re-declared here WITHOUT its default. The
|
|
12628
|
+
* inner defaults still apply when the caller DOES send the key — `{}` for
|
|
12629
|
+
* conditions remains a real instruction ("clear them") — and only the
|
|
12630
|
+
* absent key is now genuinely absent.
|
|
12631
|
+
*/
|
|
12632
|
+
enabled: zod.z.boolean().optional(),
|
|
12633
|
+
conditions: NcConditionsSchema.optional(),
|
|
12634
|
+
media: NcMediaPolicySchema.optional(),
|
|
12635
|
+
throttle: NcThrottleSchema.optional(),
|
|
12636
|
+
priority: zod.z.number().int().min(1).max(5).optional()
|
|
12637
|
+
});
|
|
12371
12638
|
/** A persisted rule. */
|
|
12372
12639
|
var NcRuleSchema = NcRuleInputSchema.extend({
|
|
12373
12640
|
id: zod.z.string(),
|
|
@@ -12480,12 +12747,20 @@ var NC_CONDITION_CATALOG = [
|
|
|
12480
12747
|
valueType: "systemEvent",
|
|
12481
12748
|
options: [
|
|
12482
12749
|
{
|
|
12483
|
-
value: "
|
|
12484
|
-
label: "
|
|
12750
|
+
value: "device-online",
|
|
12751
|
+
label: "Device online"
|
|
12752
|
+
},
|
|
12753
|
+
{
|
|
12754
|
+
value: "device-offline",
|
|
12755
|
+
label: "Device offline"
|
|
12756
|
+
},
|
|
12757
|
+
{
|
|
12758
|
+
value: "device-disabled",
|
|
12759
|
+
label: "Device switched off"
|
|
12485
12760
|
},
|
|
12486
12761
|
{
|
|
12487
|
-
value: "
|
|
12488
|
-
label: "
|
|
12762
|
+
value: "device-enabled",
|
|
12763
|
+
label: "Device switched on"
|
|
12489
12764
|
},
|
|
12490
12765
|
{
|
|
12491
12766
|
value: "stream-online",
|
|
@@ -12510,12 +12785,24 @@ var NC_CONDITION_CATALOG = [
|
|
|
12510
12785
|
{
|
|
12511
12786
|
value: "server-update-available",
|
|
12512
12787
|
label: "Server update available"
|
|
12788
|
+
},
|
|
12789
|
+
{
|
|
12790
|
+
value: "alarm-triggered",
|
|
12791
|
+
label: "Alarm triggered"
|
|
12792
|
+
},
|
|
12793
|
+
{
|
|
12794
|
+
value: "alarm-armed",
|
|
12795
|
+
label: "Alarm armed"
|
|
12796
|
+
},
|
|
12797
|
+
{
|
|
12798
|
+
value: "alarm-disarmed",
|
|
12799
|
+
label: "Alarm disarmed"
|
|
12513
12800
|
}
|
|
12514
12801
|
],
|
|
12515
12802
|
operator: "in",
|
|
12516
12803
|
appliesTo: ["system-event"],
|
|
12517
12804
|
phase: "P1",
|
|
12518
|
-
description: "Infrastructure and update events.
|
|
12805
|
+
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."
|
|
12519
12806
|
},
|
|
12520
12807
|
{
|
|
12521
12808
|
id: "devices",
|
|
@@ -13045,6 +13332,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
|
|
|
13045
13332
|
* Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
|
|
13046
13333
|
* copy would lie the first time a rule is disabled.
|
|
13047
13334
|
*/
|
|
13335
|
+
/**
|
|
13336
|
+
* Why a device a mode NAMES is nonetheless not armed by it.
|
|
13337
|
+
*
|
|
13338
|
+
* Each value is an existing authority, never a new flag (D62): `muted` is the
|
|
13339
|
+
* per-camera notification switch the Notification Center already owns,
|
|
13340
|
+
* `detection-off` is the device's own detection binding being inactive, and
|
|
13341
|
+
* `offline` is the device manager's liveness. A fourth reason would mean a
|
|
13342
|
+
* fourth authority, and inventing one here is how a panel starts disagreeing
|
|
13343
|
+
* with the switches the operator actually used.
|
|
13344
|
+
*/
|
|
13345
|
+
var NcAlarmSkipReasonSchema = zod.z.enum([
|
|
13346
|
+
"muted",
|
|
13347
|
+
"detection-off",
|
|
13348
|
+
"offline"
|
|
13349
|
+
]);
|
|
13350
|
+
var NcAlarmSkippedDeviceSchema = zod.z.object({
|
|
13351
|
+
deviceId: zod.z.number().int(),
|
|
13352
|
+
reason: NcAlarmSkipReasonSchema
|
|
13353
|
+
});
|
|
13048
13354
|
var NcAlarmModeCoverageSchema = zod.z.object({
|
|
13049
13355
|
mode: AlarmArmModeSchema,
|
|
13050
13356
|
/** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
|
|
@@ -13052,7 +13358,18 @@ var NcAlarmModeCoverageSchema = zod.z.object({
|
|
|
13052
13358
|
/** At least one covering rule has no device scope, so the mode covers all. */
|
|
13053
13359
|
allDevices: zod.z.boolean(),
|
|
13054
13360
|
/** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
|
|
13055
|
-
deviceIds: zod.z.array(zod.z.number().int())
|
|
13361
|
+
deviceIds: zod.z.array(zod.z.number().int()),
|
|
13362
|
+
/**
|
|
13363
|
+
* Devices this mode NAMES but cannot actually arm, each with the switch that
|
|
13364
|
+
* excludes it.
|
|
13365
|
+
*
|
|
13366
|
+
* "Away armed — 12 cameras" is a promise, and a muted camera among those
|
|
13367
|
+
* twelve makes it false in exactly the way nobody notices until an incident.
|
|
13368
|
+
* Defaulted to `[]` so a coverage answer computed before this field existed
|
|
13369
|
+
* still parses as "nothing known to be skipped" rather than failing the whole
|
|
13370
|
+
* alarm tab.
|
|
13371
|
+
*/
|
|
13372
|
+
skippedDevices: zod.z.array(NcAlarmSkippedDeviceSchema).default([])
|
|
13056
13373
|
});
|
|
13057
13374
|
var NcAlarmConfigSchema = zod.z.object({
|
|
13058
13375
|
/**
|
|
@@ -25621,7 +25938,19 @@ var RecordingManifestSchema = zod.z.object({
|
|
|
25621
25938
|
* profiles/subtrees/locations on this node). */
|
|
25622
25939
|
var RecordingDeviceUsageSchema = zod.z.object({
|
|
25623
25940
|
deviceId: zod.z.number(),
|
|
25624
|
-
usedBytes: zod.z.number()
|
|
25941
|
+
usedBytes: zod.z.number(),
|
|
25942
|
+
/**
|
|
25943
|
+
* Start of this camera's OLDEST indexed segment, across every profile and
|
|
25944
|
+
* location — the "Oldest footage" column in Recordings → Storage, and the
|
|
25945
|
+
* only honest answer to "is retention actually holding?" per camera.
|
|
25946
|
+
*
|
|
25947
|
+
* `null` = the camera has no footage. OPTIONAL because a recorder that
|
|
25948
|
+
* predates this field omits it entirely, and a hub whose types carry the
|
|
25949
|
+
* field must keep validating that older provider's payload: the framework
|
|
25950
|
+
* (types) and the addon ship on different trains, and the addon is usually
|
|
25951
|
+
* the later of the two.
|
|
25952
|
+
*/
|
|
25953
|
+
oldestMs: zod.z.number().nullable().optional()
|
|
25625
25954
|
});
|
|
25626
25955
|
/** Recording storage usage + capacity for one storage location. */
|
|
25627
25956
|
var RecordingLocationUsageSchema = zod.z.object({
|
|
@@ -25649,6 +25978,57 @@ var RecordingStorageUsageSchema = zod.z.object({
|
|
|
25649
25978
|
locations: zod.z.array(RecordingLocationUsageSchema)
|
|
25650
25979
|
});
|
|
25651
25980
|
/**
|
|
25981
|
+
* The OPERATOR-ARMED half of multi-location recordings (D116).
|
|
25982
|
+
*
|
|
25983
|
+
* The placement plan decides where NEW writes go and moves nothing. A rebalance
|
|
25984
|
+
* is the operator asking for the EXISTING archive to be brought into line with
|
|
25985
|
+
* that plan: one relocate job per (camera, profile) pile that sits on the wrong
|
|
25986
|
+
* location, run FIFO behind the single-flight mover.
|
|
25987
|
+
*
|
|
25988
|
+
* `plan…` and `start…` return the SAME shape deliberately — what the operator
|
|
25989
|
+
* confirms is exactly what gets enqueued, and `jobIds` is the only difference
|
|
25990
|
+
* (empty on the plan).
|
|
25991
|
+
*/
|
|
25992
|
+
var RecordingRebalanceMoveSchema = zod.z.object({
|
|
25993
|
+
deviceId: zod.z.number(),
|
|
25994
|
+
profile: zod.z.string(),
|
|
25995
|
+
fromLocationId: zod.z.string(),
|
|
25996
|
+
toLocationId: zod.z.string(),
|
|
25997
|
+
bytes: zod.z.number(),
|
|
25998
|
+
files: zod.z.number().int()
|
|
25999
|
+
});
|
|
26000
|
+
/** Why a pile that is out of place is staying there. Every refusal is
|
|
26001
|
+
* reported: a rebalance that silently drops a camera reads exactly like one
|
|
26002
|
+
* that had nothing to do. */
|
|
26003
|
+
var RecordingRebalanceSkipReasonSchema = zod.z.enum([
|
|
26004
|
+
"unassigned",
|
|
26005
|
+
"target-not-writable",
|
|
26006
|
+
"below-threshold",
|
|
26007
|
+
"no-headroom"
|
|
26008
|
+
]);
|
|
26009
|
+
var RecordingRebalanceSkipSchema = zod.z.object({
|
|
26010
|
+
deviceId: zod.z.number(),
|
|
26011
|
+
profile: zod.z.string(),
|
|
26012
|
+
fromLocationId: zod.z.string(),
|
|
26013
|
+
/** The location the plan wants; null when the camera has no assignment. */
|
|
26014
|
+
toLocationId: zod.z.string().nullable(),
|
|
26015
|
+
bytes: zod.z.number(),
|
|
26016
|
+
reason: RecordingRebalanceSkipReasonSchema
|
|
26017
|
+
});
|
|
26018
|
+
var RecordingRebalancePlanSchema = zod.z.object({
|
|
26019
|
+
moves: zod.z.array(RecordingRebalanceMoveSchema),
|
|
26020
|
+
skipped: zod.z.array(RecordingRebalanceSkipSchema),
|
|
26021
|
+
bytesToMove: zod.z.number(),
|
|
26022
|
+
/** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
|
|
26023
|
+
jobIds: zod.z.array(zod.z.string())
|
|
26024
|
+
});
|
|
26025
|
+
var RecordingRebalanceInputSchema = zod.z.object({
|
|
26026
|
+
/** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
|
|
26027
|
+
throttleMbps: zod.z.number().min(1).max(1e3).optional(),
|
|
26028
|
+
/** Ignore piles smaller than this (default 1 GB). */
|
|
26029
|
+
minMoveGb: zod.z.number().min(0).optional()
|
|
26030
|
+
});
|
|
26031
|
+
/**
|
|
25652
26032
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
25653
26033
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
25654
26034
|
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
@@ -25892,6 +26272,36 @@ var recordingCapability = {
|
|
|
25892
26272
|
cancelStorageMigrationMove: require_sleep.method(zod.z.object({ jobId: zod.z.string() }), zod.z.object({ cancelled: zod.z.boolean() }), {
|
|
25893
26273
|
kind: "mutation",
|
|
25894
26274
|
auth: "admin"
|
|
26275
|
+
}),
|
|
26276
|
+
/**
|
|
26277
|
+
* Move footage between locations — the OPERATOR's mover, scoped to one
|
|
26278
|
+
* camera (and optionally to specific profiles) rather than a whole disk.
|
|
26279
|
+
* Queued FIFO behind the single-flight engine, so arming several is safe.
|
|
26280
|
+
*/
|
|
26281
|
+
relocateFootage: require_sleep.method(RelocateFootageInputSchema, zod.z.object({ jobId: zod.z.string() }), {
|
|
26282
|
+
kind: "mutation",
|
|
26283
|
+
auth: "admin"
|
|
26284
|
+
}),
|
|
26285
|
+
/** Every relocate job this recorder knows about, newest first (in RAM: the
|
|
26286
|
+
* move is resumable, so a lost list costs nothing but the display). */
|
|
26287
|
+
listRelocateJobs: require_sleep.method(zod.z.object({}), zod.z.array(RelocateJobSchema).readonly(), {
|
|
26288
|
+
kind: "query",
|
|
26289
|
+
auth: "admin"
|
|
26290
|
+
}),
|
|
26291
|
+
/** Cancel a running or queued relocate job. A queued job never runs. */
|
|
26292
|
+
cancelRelocateJob: require_sleep.method(zod.z.object({ jobId: zod.z.string() }), zod.z.object({ cancelled: zod.z.boolean() }), {
|
|
26293
|
+
kind: "mutation",
|
|
26294
|
+
auth: "admin"
|
|
26295
|
+
}),
|
|
26296
|
+
/** What a rebalance WOULD move, and what it would refuse. Moves nothing. */
|
|
26297
|
+
planStorageRebalance: require_sleep.method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
26298
|
+
kind: "query",
|
|
26299
|
+
auth: "admin"
|
|
26300
|
+
}),
|
|
26301
|
+
/** Arm the rebalance: enqueue one relocate job per planned move. */
|
|
26302
|
+
startStorageRebalance: require_sleep.method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
26303
|
+
kind: "mutation",
|
|
26304
|
+
auth: "admin"
|
|
25895
26305
|
})
|
|
25896
26306
|
}
|
|
25897
26307
|
};
|
|
@@ -35839,6 +36249,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
35839
36249
|
addonId: null,
|
|
35840
36250
|
access: "create"
|
|
35841
36251
|
},
|
|
36252
|
+
"recording.cancelRelocateJob": {
|
|
36253
|
+
capName: "recording",
|
|
36254
|
+
capScope: "system",
|
|
36255
|
+
addonId: null,
|
|
36256
|
+
access: "create"
|
|
36257
|
+
},
|
|
35842
36258
|
"recording.cancelStorageMigrationMove": {
|
|
35843
36259
|
capName: "recording",
|
|
35844
36260
|
capScope: "system",
|
|
@@ -35893,6 +36309,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
35893
36309
|
addonId: null,
|
|
35894
36310
|
access: "view"
|
|
35895
36311
|
},
|
|
36312
|
+
"recording.listRelocateJobs": {
|
|
36313
|
+
capName: "recording",
|
|
36314
|
+
capScope: "system",
|
|
36315
|
+
addonId: null,
|
|
36316
|
+
access: "view"
|
|
36317
|
+
},
|
|
35896
36318
|
"recording.locateSegment": {
|
|
35897
36319
|
capName: "recording",
|
|
35898
36320
|
capScope: "system",
|
|
@@ -35905,6 +36327,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
35905
36327
|
addonId: null,
|
|
35906
36328
|
access: "create"
|
|
35907
36329
|
},
|
|
36330
|
+
"recording.planStorageRebalance": {
|
|
36331
|
+
capName: "recording",
|
|
36332
|
+
capScope: "system",
|
|
36333
|
+
addonId: null,
|
|
36334
|
+
access: "view"
|
|
36335
|
+
},
|
|
35908
36336
|
"recording.pruneFootage": {
|
|
35909
36337
|
capName: "recording",
|
|
35910
36338
|
capScope: "system",
|
|
@@ -35929,6 +36357,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
35929
36357
|
addonId: null,
|
|
35930
36358
|
access: "create"
|
|
35931
36359
|
},
|
|
36360
|
+
"recording.relocateFootage": {
|
|
36361
|
+
capName: "recording",
|
|
36362
|
+
capScope: "system",
|
|
36363
|
+
addonId: null,
|
|
36364
|
+
access: "create"
|
|
36365
|
+
},
|
|
35932
36366
|
"recording.renderClip": {
|
|
35933
36367
|
capName: "recording",
|
|
35934
36368
|
capScope: "system",
|
|
@@ -35965,6 +36399,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
35965
36399
|
addonId: null,
|
|
35966
36400
|
access: "create"
|
|
35967
36401
|
},
|
|
36402
|
+
"recording.startStorageRebalance": {
|
|
36403
|
+
capName: "recording",
|
|
36404
|
+
capScope: "system",
|
|
36405
|
+
addonId: null,
|
|
36406
|
+
access: "create"
|
|
36407
|
+
},
|
|
35968
36408
|
"recordingExport.cancelExport": {
|
|
35969
36409
|
capName: "recording-export",
|
|
35970
36410
|
capScope: "system",
|
|
@@ -38132,7 +38572,12 @@ function createSystemProxy(api) {
|
|
|
38132
38572
|
refreshStorageLocationsForMigration: (input) => dispatch("recording", "refreshStorageLocationsForMigration", "mutation", input),
|
|
38133
38573
|
startStorageMigrationMove: (input) => dispatch("recording", "startStorageMigrationMove", "mutation", input),
|
|
38134
38574
|
getStorageMigrationMoveStatus: (input) => dispatch("recording", "getStorageMigrationMoveStatus", "query", input),
|
|
38135
|
-
cancelStorageMigrationMove: (input) => dispatch("recording", "cancelStorageMigrationMove", "mutation", input)
|
|
38575
|
+
cancelStorageMigrationMove: (input) => dispatch("recording", "cancelStorageMigrationMove", "mutation", input),
|
|
38576
|
+
relocateFootage: (input) => dispatch("recording", "relocateFootage", "mutation", input),
|
|
38577
|
+
listRelocateJobs: (input) => dispatch("recording", "listRelocateJobs", "query", input),
|
|
38578
|
+
cancelRelocateJob: (input) => dispatch("recording", "cancelRelocateJob", "mutation", input),
|
|
38579
|
+
planStorageRebalance: (input) => dispatch("recording", "planStorageRebalance", "query", input),
|
|
38580
|
+
startStorageRebalance: (input) => dispatch("recording", "startStorageRebalance", "mutation", input)
|
|
38136
38581
|
},
|
|
38137
38582
|
recordingExport: {
|
|
38138
38583
|
getExport: (input) => dispatch("recordingExport", "getExport", "query", input),
|
|
@@ -38694,6 +39139,111 @@ var FramerateField = zod.z.number().int().min(1).max(60);
|
|
|
38694
39139
|
var TargetsField = zod.z.array(NcRuleTargetSchema).min(1);
|
|
38695
39140
|
var PriorityField = zod.z.number().int().min(1).max(5);
|
|
38696
39141
|
/**
|
|
39142
|
+
* Floor on any dense cadence, seconds — the recording's own frame interval.
|
|
39143
|
+
*
|
|
39144
|
+
* Declared here because it bounds BOTH the rule field and the renderer's
|
|
39145
|
+
* derivation, and two copies of a floor are two floors that can drift.
|
|
39146
|
+
*/
|
|
39147
|
+
var TIMELAPSE_DENSE_FLOOR_SEC = .1;
|
|
39148
|
+
/**
|
|
39149
|
+
* Explicit override of the DENSE sampling cadence, seconds.
|
|
39150
|
+
*
|
|
39151
|
+
* Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
|
|
39152
|
+
* 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
|
|
39153
|
+
* made that same base 3 s and rendered a person pass as two frames.)
|
|
39154
|
+
*
|
|
39155
|
+
* THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
|
|
39156
|
+
* `denseCadenceSec` and played at `framerate` occupies
|
|
39157
|
+
*
|
|
39158
|
+
* outputSeconds = (rangeSec / denseCadenceSec) / framerate
|
|
39159
|
+
*
|
|
39160
|
+
* 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.
|
|
39161
|
+
* Halving this field doubles the frames INSIDE ranges only — the base cadence,
|
|
39162
|
+
* and therefore the length of a quiet night, does not move.
|
|
39163
|
+
*
|
|
39164
|
+
* Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
|
|
39165
|
+
* the recording has them returns the same frames, requested twice. Must be
|
|
39166
|
+
* STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
|
|
39167
|
+
* a uniform video the operator believes is two-rate — and upsert refuses it
|
|
39168
|
+
* rather than letting the export cap reject the render hours after the window.
|
|
39169
|
+
*/
|
|
39170
|
+
var DenseCadenceSecField = zod.z.number().min(TIMELAPSE_DENSE_FLOOR_SEC).max(3600);
|
|
39171
|
+
/**
|
|
39172
|
+
* Minimum seconds of OUTPUT video each detection range must occupy.
|
|
39173
|
+
*
|
|
39174
|
+
* The operator-facing form of the arithmetic above: instead of solving for a
|
|
39175
|
+
* cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
|
|
39176
|
+
* 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
|
|
39177
|
+
* that range every ~583 ms.
|
|
39178
|
+
*
|
|
39179
|
+
* ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
|
|
39180
|
+
* ranges are terms of a single ffmpeg `select` expression that cannot vary rate
|
|
39181
|
+
* per term — so the MOST DEMANDING (shortest) range sets the rate and longer
|
|
39182
|
+
* ranges are sampled denser than they need. Per-range cadences require a cap
|
|
39183
|
+
* schema change and are the tracked follow-up.
|
|
39184
|
+
*
|
|
39185
|
+
* A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
|
|
39186
|
+
* is rendered with every frame that EXISTS and no more: the guarantee is capped
|
|
39187
|
+
* by real footage, never met by duplicating frames into motion that never
|
|
39188
|
+
* happened.
|
|
39189
|
+
*/
|
|
39190
|
+
var MinDwellSecField = zod.z.number().min(0).max(60);
|
|
39191
|
+
/**
|
|
39192
|
+
* Caption burned into the notification's preview frame.
|
|
39193
|
+
*
|
|
39194
|
+
* Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
|
|
39195
|
+
* `rule`, `from`, `to`) and rendered by the SAME renderer — a second
|
|
39196
|
+
* templating dialect for one field would be a second thing to explain.
|
|
39197
|
+
*
|
|
39198
|
+
* Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
|
|
39199
|
+
* operator saying "the frame, no caption" — a distinct, reachable answer, and
|
|
39200
|
+
* the reason this is not `.min(1)`.
|
|
39201
|
+
*/
|
|
39202
|
+
var PreviewTextField = zod.z.string().max(200);
|
|
39203
|
+
/**
|
|
39204
|
+
* Whether the notification's preview is a STILL or a short animation.
|
|
39205
|
+
*
|
|
39206
|
+
* The operator's ask, verbatim: *"inviato come gif o video (come per le altre
|
|
39207
|
+
* rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
|
|
39208
|
+
* night reads better as three seconds of motion than as one frame of it. Both
|
|
39209
|
+
* modes get the SAME treatment (blurred frame, large centred title); `'gif'`
|
|
39210
|
+
* simply applies it to a dozen frames sampled across the render and assembles
|
|
39211
|
+
* them.
|
|
39212
|
+
*
|
|
39213
|
+
* `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
|
|
39214
|
+
* seeks and a palette pass, and no rule that never asked for one should start
|
|
39215
|
+
* paying that on the deploy that shipped it.
|
|
39216
|
+
*
|
|
39217
|
+
* A GIF that cannot be assembled DEGRADES to the still — never to nothing.
|
|
39218
|
+
*/
|
|
39219
|
+
var PreviewModeField = zod.z.enum(["image", "gif"]);
|
|
39220
|
+
/**
|
|
39221
|
+
* Which detection classes the notification reports counts for.
|
|
39222
|
+
*
|
|
39223
|
+
* The counts come from the tracks the render ALREADY fetched for its dense-range
|
|
39224
|
+
* plan — no second query — aggregated per class. Absent or empty means "every
|
|
39225
|
+
* class the window actually contained", which is what an operator who never
|
|
39226
|
+
* opened the field wants; a list narrows it (`['person']` on a driveway that
|
|
39227
|
+
* counts cars all night).
|
|
39228
|
+
*
|
|
39229
|
+
* Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
|
|
39230
|
+
* …). An unknown name simply never matches and reports nothing — it is not an
|
|
39231
|
+
* error, because a rule may legitimately name a class this camera's model does
|
|
39232
|
+
* not emit.
|
|
39233
|
+
*
|
|
39234
|
+
* The counts are exposed to {@link TimelapseTemplateSchema} as:
|
|
39235
|
+
* - `{{detections}}` — total over the reported classes
|
|
39236
|
+
* - `{{detectionSummary}}` — `2 persone, 1 veicolo`
|
|
39237
|
+
* - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
|
|
39238
|
+
* one per class, `count_` + the class name
|
|
39239
|
+
*
|
|
39240
|
+
* With NO custom body template the summary is appended to the derived body, and
|
|
39241
|
+
* only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
|
|
39242
|
+
* reads. With a custom template the operator owns every word — nothing is
|
|
39243
|
+
* appended, so `{{detectionSummary}}` is how he asks for it.
|
|
39244
|
+
*/
|
|
39245
|
+
var ReportClassesField = zod.z.array(zod.z.string().min(1).max(40)).max(20);
|
|
39246
|
+
/**
|
|
38697
39247
|
* Client-supplied timelapse-rule fields. The server stamps id / createdBy /
|
|
38698
39248
|
* createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
|
|
38699
39249
|
* here (see the ownership note above).
|
|
@@ -38713,13 +39263,42 @@ var TimelapseRuleInputSchema = zod.z.object({
|
|
|
38713
39263
|
cadenceSec: CadenceSecField.default(15),
|
|
38714
39264
|
/** Output frames per second of the assembled mp4 (predecessor parity). */
|
|
38715
39265
|
framerate: FramerateField.default(10),
|
|
39266
|
+
/**
|
|
39267
|
+
* Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
|
|
39268
|
+
* as `max(1s, cadenceSec / 30)`, which is what every rule written before this
|
|
39269
|
+
* field gets.
|
|
39270
|
+
*/
|
|
39271
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
39272
|
+
/** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
|
|
39273
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
38716
39274
|
/** `notification-output` targets the finished video/thumbnail is sent to. */
|
|
38717
39275
|
targets: TargetsField,
|
|
38718
39276
|
template: TimelapseTemplateSchema.optional(),
|
|
39277
|
+
/**
|
|
39278
|
+
* Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
|
|
39279
|
+
* and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
|
|
39280
|
+
*
|
|
39281
|
+
* Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
|
|
39282
|
+
* the notification's title/body, and clearing it (`template: null`) must not
|
|
39283
|
+
* silently clear the caption too.
|
|
39284
|
+
*/
|
|
39285
|
+
previewText: PreviewTextField.optional(),
|
|
39286
|
+
/** Still or animation — see {@link PreviewModeField}. */
|
|
39287
|
+
previewMode: PreviewModeField.default("image"),
|
|
39288
|
+
/** Classes the notification counts — see {@link ReportClassesField}. */
|
|
39289
|
+
reportClasses: ReportClassesField.optional(),
|
|
38719
39290
|
/** Canonical notification priority ordinal (1..5); per-target overridable. */
|
|
38720
39291
|
priority: PriorityField.default(3)
|
|
38721
39292
|
});
|
|
38722
39293
|
/**
|
|
39294
|
+
* The caption a rule that never set one gets.
|
|
39295
|
+
*
|
|
39296
|
+
* Rendered through the ordinary `{{var}}` pass at delivery, so a rule created
|
|
39297
|
+
* before this field existed still reads "Timelapse Videocamera ingresso" and
|
|
39298
|
+
* not the literal braces.
|
|
39299
|
+
*/
|
|
39300
|
+
var DEFAULT_TIMELAPSE_PREVIEW_TEXT = "Timelapse {{camera}}";
|
|
39301
|
+
/**
|
|
38723
39302
|
* Partial patch for an update — any subset of the INPUT fields, with NO
|
|
38724
39303
|
* defaults (an absent key means "leave unchanged", never "reset to default").
|
|
38725
39304
|
* Provenance and ownership are absent by construction: a patch can rename or
|
|
@@ -38742,8 +39321,13 @@ var TimelapseRulePatchSchema = zod.z.object({
|
|
|
38742
39321
|
schedule: NcScheduleSchema.optional(),
|
|
38743
39322
|
cadenceSec: CadenceSecField.optional(),
|
|
38744
39323
|
framerate: FramerateField.optional(),
|
|
39324
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
39325
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
38745
39326
|
targets: TargetsField.optional(),
|
|
38746
39327
|
template: TimelapseTemplateSchema.nullable().optional(),
|
|
39328
|
+
previewText: PreviewTextField.optional(),
|
|
39329
|
+
previewMode: PreviewModeField.optional(),
|
|
39330
|
+
reportClasses: ReportClassesField.optional(),
|
|
38747
39331
|
priority: PriorityField.optional()
|
|
38748
39332
|
});
|
|
38749
39333
|
/** A persisted timelapse rule. */
|
|
@@ -38784,6 +39368,26 @@ var TimelapseRuleSchema = TimelapseRuleInputSchema.extend({
|
|
|
38784
39368
|
updatedAt: zod.z.number()
|
|
38785
39369
|
});
|
|
38786
39370
|
/**
|
|
39371
|
+
* Refuse a dense cadence that is not denser than the base.
|
|
39372
|
+
*
|
|
39373
|
+
* Called at UPSERT, on the MERGED rule — a patch that lowers `cadenceSec`
|
|
39374
|
+
* alone can invalidate a `denseCadenceSec` set months earlier, so checking the
|
|
39375
|
+
* patch in isolation would let the bad pair through.
|
|
39376
|
+
*
|
|
39377
|
+
* Refusing here and not at render time is the whole point: `ExportTimelapseSchema`
|
|
39378
|
+
* also rejects the pair, but it does so when the window has already closed and
|
|
39379
|
+
* the footage is being cut — the operator learns at 06:05 that last night was
|
|
39380
|
+
* never going to render, and a closed window does not come back. This turns
|
|
39381
|
+
* that into a failed edit he can see and correct.
|
|
39382
|
+
*
|
|
39383
|
+
* @throws Error naming both numbers, so the message is actionable in a toast.
|
|
39384
|
+
*/
|
|
39385
|
+
function assertTimelapseCadences(pair) {
|
|
39386
|
+
const dense = pair.denseCadenceSec;
|
|
39387
|
+
if (dense === void 0) return;
|
|
39388
|
+
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`);
|
|
39389
|
+
}
|
|
39390
|
+
/**
|
|
38787
39391
|
* The last successful generation for ONE camera of a rule, epoch-ms.
|
|
38788
39392
|
*
|
|
38789
39393
|
* The per-device map wins; a rule with no map falls back to the rule-wide
|
|
@@ -40752,6 +41356,7 @@ exports.DEFAULT_FEATURES = DEFAULT_FEATURES;
|
|
|
40752
41356
|
exports.DEFAULT_NATIVE_LEASE_SETTINGS = DEFAULT_NATIVE_LEASE_SETTINGS;
|
|
40753
41357
|
exports.DEFAULT_RETENTION = DEFAULT_RETENTION;
|
|
40754
41358
|
exports.DEFAULT_SCRUB_THUMBNAIL_PRESET = DEFAULT_SCRUB_THUMBNAIL_PRESET;
|
|
41359
|
+
exports.DEFAULT_TIMELAPSE_PREVIEW_TEXT = DEFAULT_TIMELAPSE_PREVIEW_TEXT;
|
|
40755
41360
|
exports.DETAIL_CROP_PADDING_FIELD = DETAIL_CROP_PADDING_FIELD;
|
|
40756
41361
|
exports.DETAIL_CROP_PADDING_KEY = DETAIL_CROP_PADDING_KEY;
|
|
40757
41362
|
exports.DETAIL_CROP_SECTION_ID = DETAIL_CROP_SECTION_ID;
|
|
@@ -40995,8 +41600,15 @@ exports.NATIVE_LEASE_BUDGET_KEY = NATIVE_LEASE_BUDGET_KEY;
|
|
|
40995
41600
|
exports.NATIVE_LEASE_SECTION_ID = NATIVE_LEASE_SECTION_ID;
|
|
40996
41601
|
exports.NATIVE_LEASE_TTL_FIELD = NATIVE_LEASE_TTL_FIELD;
|
|
40997
41602
|
exports.NATIVE_LEASE_TTL_KEY = NATIVE_LEASE_TTL_KEY;
|
|
41603
|
+
exports.NC_ALARM_SYSTEM_EVENT_KINDS = NC_ALARM_SYSTEM_EVENT_KINDS;
|
|
41604
|
+
exports.NC_AUDIO_DBFS_FLOOR = NC_AUDIO_DBFS_FLOOR;
|
|
41605
|
+
exports.NC_AUTHORABLE_SYSTEM_EVENT_KINDS = NC_AUTHORABLE_SYSTEM_EVENT_KINDS;
|
|
40998
41606
|
exports.NC_BASE_CONDITION_KEYS = NC_BASE_CONDITION_KEYS;
|
|
40999
41607
|
exports.NC_CONDITION_CATALOG = NC_CONDITION_CATALOG;
|
|
41608
|
+
exports.NC_CONFIRM_DEFAULT_MAX_IMAGE_PX = NC_CONFIRM_DEFAULT_MAX_IMAGE_PX;
|
|
41609
|
+
exports.NC_CONFIRM_DEFAULT_TIMEOUT_MS = NC_CONFIRM_DEFAULT_TIMEOUT_MS;
|
|
41610
|
+
exports.NC_CONFIRM_MAX_TIMEOUT_MS = NC_CONFIRM_MAX_TIMEOUT_MS;
|
|
41611
|
+
exports.NC_CONFIRM_MIN_TIMEOUT_MS = NC_CONFIRM_MIN_TIMEOUT_MS;
|
|
41000
41612
|
exports.NC_HISTORY_LIMIT_DEFAULT = NC_HISTORY_LIMIT_DEFAULT;
|
|
41001
41613
|
exports.NC_HISTORY_LIMIT_MAX = NC_HISTORY_LIMIT_MAX;
|
|
41002
41614
|
exports.NC_MAX_PER_TRACK_IMMEDIATE = NC_MAX_PER_TRACK_IMMEDIATE;
|
|
@@ -41015,8 +41627,13 @@ exports.NcAlarmConfigSchema = NcAlarmConfigSchema;
|
|
|
41015
41627
|
exports.NcAlarmModeCoverageSchema = NcAlarmModeCoverageSchema;
|
|
41016
41628
|
exports.NcAlarmSettingsPatchSchema = NcAlarmSettingsPatchSchema;
|
|
41017
41629
|
exports.NcAlarmSettingsSchema = NcAlarmSettingsSchema;
|
|
41630
|
+
exports.NcAlarmSkipReasonSchema = NcAlarmSkipReasonSchema;
|
|
41631
|
+
exports.NcAlarmSkippedDeviceSchema = NcAlarmSkippedDeviceSchema;
|
|
41632
|
+
exports.NcAudioConditionSchema = NcAudioConditionSchema;
|
|
41018
41633
|
exports.NcConditionDescriptorSchema = NcConditionDescriptorSchema;
|
|
41019
41634
|
exports.NcConditionsSchema = NcConditionsSchema;
|
|
41635
|
+
exports.NcConfirmExpectSchema = NcConfirmExpectSchema;
|
|
41636
|
+
exports.NcConfirmSchema = NcConfirmSchema;
|
|
41020
41637
|
exports.NcCrossingSchema = NcCrossingSchema;
|
|
41021
41638
|
exports.NcDeliverySchema = NcDeliverySchema;
|
|
41022
41639
|
exports.NcDeviceStateConditionSchema = NcDeviceStateConditionSchema;
|
|
@@ -41157,6 +41774,11 @@ exports.RecordingDeviceUsageSchema = RecordingDeviceUsageSchema;
|
|
|
41157
41774
|
exports.RecordingLocationUsageSchema = RecordingLocationUsageSchema;
|
|
41158
41775
|
exports.RecordingManifestSchema = RecordingManifestSchema;
|
|
41159
41776
|
exports.RecordingRangeSchema = RecordingRangeSchema;
|
|
41777
|
+
exports.RecordingRebalanceInputSchema = RecordingRebalanceInputSchema;
|
|
41778
|
+
exports.RecordingRebalanceMoveSchema = RecordingRebalanceMoveSchema;
|
|
41779
|
+
exports.RecordingRebalancePlanSchema = RecordingRebalancePlanSchema;
|
|
41780
|
+
exports.RecordingRebalanceSkipReasonSchema = RecordingRebalanceSkipReasonSchema;
|
|
41781
|
+
exports.RecordingRebalanceSkipSchema = RecordingRebalanceSkipSchema;
|
|
41160
41782
|
exports.RecordingRetentionSchema = RecordingRetentionSchema;
|
|
41161
41783
|
exports.RecordingStatusSchema = RecordingStatusSchema;
|
|
41162
41784
|
exports.RecordingStorageModeSchema = RecordingStorageModeSchema;
|
|
@@ -41286,6 +41908,7 @@ exports.SwitchStatusSchema = SwitchStatusSchema;
|
|
|
41286
41908
|
exports.SystemMetricsSchema = SystemMetricsSchema;
|
|
41287
41909
|
exports.SystemMirror = SystemMirror;
|
|
41288
41910
|
exports.TAXONOMY_COLORS = TAXONOMY_COLORS;
|
|
41911
|
+
exports.TIMELAPSE_DENSE_FLOOR_SEC = TIMELAPSE_DENSE_FLOOR_SEC;
|
|
41289
41912
|
exports.TIMEZONES = TIMEZONES;
|
|
41290
41913
|
exports.TRANSCODE_DOWN_MAX_BITRATE_KBPS = TRANSCODE_DOWN_MAX_BITRATE_KBPS;
|
|
41291
41914
|
exports.TRANSCODE_DOWN_MAX_HEIGHT = TRANSCODE_DOWN_MAX_HEIGHT;
|
|
@@ -41400,6 +42023,7 @@ exports.asJsonArray = require_sleep.asJsonArray;
|
|
|
41400
42023
|
exports.asJsonObject = require_sleep.asJsonObject;
|
|
41401
42024
|
exports.asNumber = require_sleep.asNumber;
|
|
41402
42025
|
exports.asString = require_sleep.asString;
|
|
42026
|
+
exports.assertTimelapseCadences = assertTimelapseCadences;
|
|
41403
42027
|
exports.audioAnalysisCapability = audioAnalysisCapability;
|
|
41404
42028
|
exports.audioAnalyzerCapability = audioAnalyzerCapability;
|
|
41405
42029
|
exports.audioCodecCapability = audioCodecCapability;
|
|
@@ -41547,6 +42171,7 @@ exports.isDeployableToAgent = isDeployableToAgent;
|
|
|
41547
42171
|
exports.isDeviceConfigCap = require_sleep.isDeviceConfigCap;
|
|
41548
42172
|
exports.isDeviceScopedCap = require_sleep.isDeviceScopedCap;
|
|
41549
42173
|
exports.isEvent = require_sleep.isEvent;
|
|
42174
|
+
exports.isIsolatedBuiltin = isIsolatedBuiltin;
|
|
41550
42175
|
exports.isNode = isNode;
|
|
41551
42176
|
exports.isObjectInput = isObjectInput;
|
|
41552
42177
|
exports.isSameAddonId = isSameAddonId;
|