@camstack/addon-provider-petkit 0.2.13 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addon.js +625 -22
- package/dist/addon.mjs +625 -22
- package/package.json +1 -1
package/dist/addon.mjs
CHANGED
|
@@ -8320,8 +8320,31 @@ var AdoptionJobSchema = object({
|
|
|
8320
8320
|
error: string().nullable()
|
|
8321
8321
|
});
|
|
8322
8322
|
/**
|
|
8323
|
-
* Per-camera FUNCTION SWITCHES
|
|
8324
|
-
*
|
|
8323
|
+
* Per-camera FUNCTION SWITCHES.
|
|
8324
|
+
*
|
|
8325
|
+
* ## The aggregate group is being withdrawn — the BADGE is not (D113)
|
|
8326
|
+
*
|
|
8327
|
+
* This file shipped as "the one coherent on/off surface over the pipeline
|
|
8328
|
+
* functions an operator thinks in terms of". The operator's verdict on
|
|
8329
|
+
* 2026-08-12 was that the coherent surface bought complexity and no clarity:
|
|
8330
|
+
* every function already had a settings page of its own, and a second place to
|
|
8331
|
+
* turn it off is a second place to look. Each switch is going back to its own
|
|
8332
|
+
* component's original options — detection to the detection-pipeline wrapper
|
|
8333
|
+
* binding, audio analysis to its own, recording to `RecordingConfig.enabled`
|
|
8334
|
+
* (which was always first-class; the switch was a veneer over
|
|
8335
|
+
* `recording.setDeviceConfig`), notifications to a notification-center
|
|
8336
|
+
* per-device setting, the two camera planes to their own components.
|
|
8337
|
+
*
|
|
8338
|
+
* What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
|
|
8339
|
+
* thing that lets a status surface say DISABLED instead of BROKEN, recomposed
|
|
8340
|
+
* straight from the authorities with no group in the middle. That rule was
|
|
8341
|
+
* never about a control panel.
|
|
8342
|
+
*
|
|
8343
|
+
* Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
|
|
8344
|
+
* {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
|
|
8345
|
+
* `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
|
|
8346
|
+
* viewers (v1.0.305) and the admin UI still call it. It is deleted when they
|
|
8347
|
+
* stop; nothing new may be built on it.
|
|
8325
8348
|
*
|
|
8326
8349
|
* ## This file adds no state
|
|
8327
8350
|
*
|
|
@@ -8672,7 +8695,15 @@ var RecordingConfigSchema = object({
|
|
|
8672
8695
|
* Each completed/failed run also lands one durable ops-log row on its owning
|
|
8673
8696
|
* addon surface.
|
|
8674
8697
|
*/
|
|
8698
|
+
/**
|
|
8699
|
+
* `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
|
|
8700
|
+
* rebalance enqueues one job per (camera, profile). Refusing the second job —
|
|
8701
|
+
* what the engine did before — turned a fifteen-camera rebalance into fifteen
|
|
8702
|
+
* manual retries. Queued jobs run FIFO; a queued job that is cancelled never
|
|
8703
|
+
* runs at all.
|
|
8704
|
+
*/
|
|
8675
8705
|
var RelocateJobStateSchema = _enum([
|
|
8706
|
+
"queued",
|
|
8676
8707
|
"running",
|
|
8677
8708
|
"done",
|
|
8678
8709
|
"failed",
|
|
@@ -8707,6 +8738,15 @@ var RelocateFootageInputSchema = object({
|
|
|
8707
8738
|
/** Limits relocation to the logical profile class. Omit only for the
|
|
8708
8739
|
* pre-orchestration compatibility path. */
|
|
8709
8740
|
footageClass: RelocateFootageClassSchema.optional(),
|
|
8741
|
+
/** Scope the move to ONE camera. Absent = every camera on the source, which
|
|
8742
|
+
* is what a whole-disk drain means. The rebalance path always sets it: its
|
|
8743
|
+
* unit is a (camera, profile) pile, not a disk. */
|
|
8744
|
+
deviceId: number().int().optional(),
|
|
8745
|
+
/** Scope the move to specific segment profiles (`high` / `mid` / `low`).
|
|
8746
|
+
* Finer than `footageClass`, which cannot separate high from mid — and the
|
|
8747
|
+
* placement plan assigns those two independently, so a rebalance that could
|
|
8748
|
+
* only say "recordings" would move footage the plan never asked to move. */
|
|
8749
|
+
profiles: array(string()).optional(),
|
|
8710
8750
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
8711
8751
|
* never allowed to starve live writers. */
|
|
8712
8752
|
throttleMbps: number().min(1).max(1e3).optional()
|
|
@@ -8842,6 +8882,21 @@ var StorageLocationSchema = object({
|
|
|
8842
8882
|
nodeId: string().optional(),
|
|
8843
8883
|
isDefault: boolean().default(false),
|
|
8844
8884
|
isSystem: boolean().default(false),
|
|
8885
|
+
/**
|
|
8886
|
+
* Operator opt-in: whether consumers that BALANCE across several locations
|
|
8887
|
+
* of a type may write here. Recordings reads it today; event media and
|
|
8888
|
+
* backups are the next consumers, which is why the flag lives on the
|
|
8889
|
+
* location rather than in any one addon's store — nothing has to be
|
|
8890
|
+
* extended to add the next consumer.
|
|
8891
|
+
*
|
|
8892
|
+
* OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
|
|
8893
|
+
* flag existed reads back with no flag and keeps working exactly as before;
|
|
8894
|
+
* that is the whole compat story, and it is why no migration ships with it.
|
|
8895
|
+
* A newly CREATED sibling is stamped `false` by the orchestrator (creating a
|
|
8896
|
+
* disk must not silently start writing to it); the default of a type is
|
|
8897
|
+
* always stamped `true`.
|
|
8898
|
+
*/
|
|
8899
|
+
enabled: boolean().optional(),
|
|
8845
8900
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
8846
8901
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
8847
8902
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -13411,7 +13466,8 @@ method(object({
|
|
|
13411
13466
|
}), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
|
|
13412
13467
|
/**
|
|
13413
13468
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
13414
|
-
* filesystem
|
|
13469
|
+
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
13470
|
+
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
13415
13471
|
* admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
|
|
13416
13472
|
* (one provider per node); the hub calls it with `{nodeId}` so the codegen
|
|
13417
13473
|
* routes to that exact node (default `nodeIdMode:'routing'`).
|
|
@@ -15252,6 +15308,13 @@ var MaskGridDimsSchema = object({
|
|
|
15252
15308
|
* `package-event` are pure trigger kinds (no urgency dimension). Extending
|
|
15253
15309
|
* this one field keeps the schema additive — a rule still declares exactly
|
|
15254
15310
|
* one trigger.
|
|
15311
|
+
*
|
|
15312
|
+
* AUDIO rules add no member here, for the reason occupancy added none: the
|
|
15313
|
+
* enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
|
|
15314
|
+
* mirror.ts` fails the build on a member the app cannot render) and every
|
|
15315
|
+
* member costs a release train. A sustained-sound rule is therefore an
|
|
15316
|
+
* `immediate` rule carrying {@link NcConditions.audio} — the condition is the
|
|
15317
|
+
* trigger discriminator, exactly as `occupancy` is on `device-event`.
|
|
15255
15318
|
*/
|
|
15256
15319
|
var NcDeliverySchema = _enum([
|
|
15257
15320
|
"immediate",
|
|
@@ -15266,15 +15329,32 @@ var NcDeliverySchema = _enum([
|
|
|
15266
15329
|
* depend on a provider's raw event name or payload shape.
|
|
15267
15330
|
*/
|
|
15268
15331
|
var NcSystemEventKindSchema = _enum([
|
|
15269
|
-
"
|
|
15270
|
-
"
|
|
15332
|
+
"device-online",
|
|
15333
|
+
"device-offline",
|
|
15334
|
+
"device-disabled",
|
|
15335
|
+
"device-enabled",
|
|
15271
15336
|
"stream-online",
|
|
15272
15337
|
"stream-offline",
|
|
15273
15338
|
"node-online",
|
|
15274
15339
|
"node-offline",
|
|
15275
15340
|
"addon-update-available",
|
|
15276
|
-
"server-update-available"
|
|
15341
|
+
"server-update-available",
|
|
15342
|
+
"alarm-triggered",
|
|
15343
|
+
"alarm-armed",
|
|
15344
|
+
"alarm-disarmed",
|
|
15345
|
+
"camera-online",
|
|
15346
|
+
"camera-offline",
|
|
15347
|
+
"camera-disabled",
|
|
15348
|
+
"camera-enabled"
|
|
15349
|
+
]);
|
|
15350
|
+
/** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
|
|
15351
|
+
var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
|
|
15352
|
+
"camera-online",
|
|
15353
|
+
"camera-offline",
|
|
15354
|
+
"camera-disabled",
|
|
15355
|
+
"camera-enabled"
|
|
15277
15356
|
]);
|
|
15357
|
+
NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
|
|
15278
15358
|
/**
|
|
15279
15359
|
* One coherent system-event condition. `kinds` is the required opt-in safety
|
|
15280
15360
|
* gate; the remaining lists are optional narrowing filters relevant to the
|
|
@@ -15283,6 +15363,18 @@ var NcSystemEventKindSchema = _enum([
|
|
|
15283
15363
|
var NcSystemEventConditionSchema = object({
|
|
15284
15364
|
kinds: array(NcSystemEventKindSchema).min(1),
|
|
15285
15365
|
deviceIds: array(number().int()).min(1).optional(),
|
|
15366
|
+
/**
|
|
15367
|
+
* Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
|
|
15368
|
+
* `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
|
|
15369
|
+
* is what a liveness rule means when nobody said otherwise.
|
|
15370
|
+
*
|
|
15371
|
+
* This is where "only my cameras" is expressed, and it lives on the rule for
|
|
15372
|
+
* one reason: the intake cannot know which devices this household cares
|
|
15373
|
+
* about, and a producer-side filter is one no operator can change. Fails
|
|
15374
|
+
* CLOSED — a subject whose device type is unknown (an id the device mirror
|
|
15375
|
+
* does not carry) matches no `deviceTypes` list.
|
|
15376
|
+
*/
|
|
15377
|
+
deviceTypes: array(string().min(1)).min(1).optional(),
|
|
15286
15378
|
nodeIds: array(string().min(1)).min(1).optional(),
|
|
15287
15379
|
packageNames: array(string().min(1)).min(1).optional()
|
|
15288
15380
|
});
|
|
@@ -15333,6 +15425,47 @@ var NcOccupancyConditionSchema = object({
|
|
|
15333
15425
|
sustainSeconds: number().int().min(0).max(3600).default(15)
|
|
15334
15426
|
});
|
|
15335
15427
|
/**
|
|
15428
|
+
* Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
|
|
15429
|
+
*
|
|
15430
|
+
* Operator-approved vocabulary (2026-08-12, option A — the same one the
|
|
15431
|
+
* reference notifier uses, so an operator moving between them re-uses what
|
|
15432
|
+
* they already know): a rule matches when, over a sampling window of
|
|
15433
|
+
* `samplingSeconds`, at least `hitPercent`% of the audio samples in that
|
|
15434
|
+
* window are HITS. A sample is a hit when it satisfies BOTH present filters:
|
|
15435
|
+
*
|
|
15436
|
+
* - `dbThreshold` — its level is at or above this many dBFS (see
|
|
15437
|
+
* {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
|
|
15438
|
+
* - `labels` — the classifier put at least one of these labels on it.
|
|
15439
|
+
*
|
|
15440
|
+
* Both are OPTIONAL and independent, which is the point of the shape: a
|
|
15441
|
+
* loudness rule ("something loud at 3am") needs no model to be right, and a
|
|
15442
|
+
* label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
|
|
15443
|
+
* is given** — a window in which every sample is trivially a hit would fire on
|
|
15444
|
+
* silence, so the engine refuses such a condition rather than notifying on
|
|
15445
|
+
* nothing (the schema cannot express "at least one of" without becoming a
|
|
15446
|
+
* ZodEffects the cap path would have to special-case).
|
|
15447
|
+
*
|
|
15448
|
+
* `hitPercent` is over the samples the window actually HOLDS, and the window
|
|
15449
|
+
* must be FULL before it can match — a window that has been open for two
|
|
15450
|
+
* seconds of its ten is 100% of nothing, and firing on it would make
|
|
15451
|
+
* `samplingSeconds` decorative.
|
|
15452
|
+
*
|
|
15453
|
+
* Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
|
|
15454
|
+
* `audio-*` ids). Both spellings are accepted — the matcher normalizes the
|
|
15455
|
+
* `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
|
|
15456
|
+
* an operator who typed `dog` mean the same thing.
|
|
15457
|
+
*/
|
|
15458
|
+
var NcAudioConditionSchema = object({
|
|
15459
|
+
/** Audio macro labels; absent = any sound (level-only rule). */
|
|
15460
|
+
labels: array(string().min(1)).min(1).optional(),
|
|
15461
|
+
/** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
|
|
15462
|
+
dbThreshold: number().min(-96).max(0).optional(),
|
|
15463
|
+
/** Percentage of the window's samples that must be hits (1–100). */
|
|
15464
|
+
hitPercent: number().int().min(1).max(100).default(60),
|
|
15465
|
+
/** Length of the sampling window in seconds. */
|
|
15466
|
+
samplingSeconds: number().int().min(1).max(300).default(10)
|
|
15467
|
+
});
|
|
15468
|
+
/**
|
|
15336
15469
|
* Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
|
|
15337
15470
|
*
|
|
15338
15471
|
* The values are not symmetric, and deliberately so — the absent value has to
|
|
@@ -15605,7 +15738,33 @@ var NcConditionsSchema = object({
|
|
|
15605
15738
|
* threshold and holds for `sustainSeconds`. Fail-closed on missing
|
|
15606
15739
|
* substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
|
|
15607
15740
|
*/
|
|
15608
|
-
occupancy: NcOccupancyConditionSchema.optional()
|
|
15741
|
+
occupancy: NcOccupancyConditionSchema.optional(),
|
|
15742
|
+
/**
|
|
15743
|
+
* IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
|
|
15744
|
+
* `samplingSeconds` window clear the optional `dbThreshold` and carry one of
|
|
15745
|
+
* the optional `labels`. Fail-closed on missing substrate (no audio samples,
|
|
15746
|
+
* a window that is not full yet, neither filter given). See
|
|
15747
|
+
* {@link NcAudioCondition}.
|
|
15748
|
+
*
|
|
15749
|
+
* Presence of this key is what makes a rule an AUDIO rule: the engine fires
|
|
15750
|
+
* it ONLY on a confirmed audio window, and a rule carrying it never fires on
|
|
15751
|
+
* a detection, a track or a device event (the same fail-closed pairing
|
|
15752
|
+
* `occupancy` has with the `device-event` trigger). That is how audio labels
|
|
15753
|
+
* leave `classes`: an audio rule names its sounds HERE, and the legacy path
|
|
15754
|
+
* (an `immediate` rule naming an `audio-*` class, one notification per
|
|
15755
|
+
* classified sample) stays exactly as it was for rules that already use it.
|
|
15756
|
+
*
|
|
15757
|
+
* NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
|
|
15758
|
+
* rather than an oversight: the viewer mirrors the descriptor enums BY HAND
|
|
15759
|
+
* (`camstack/src/data/notification-center.ts`, guarded by
|
|
15760
|
+
* `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
|
|
15761
|
+
* condition fields it does not know when a rule is saved from the phone.
|
|
15762
|
+
* Publishing an editor for a condition the app cannot round-trip is how an
|
|
15763
|
+
* operator loses a rule's conditions by opening it — so the descriptor, the
|
|
15764
|
+
* admin widget and the viewer mirror land together (P2 + P3), and only then
|
|
15765
|
+
* does an audio rule become authorable.
|
|
15766
|
+
*/
|
|
15767
|
+
audio: NcAudioConditionSchema.optional()
|
|
15609
15768
|
});
|
|
15610
15769
|
/** One delivery target: a `notification-output` Target ref + passthrough params. */
|
|
15611
15770
|
var NcRuleTargetSchema = object({
|
|
@@ -15719,6 +15878,73 @@ var NcThrottleSchema = object({
|
|
|
15719
15878
|
*/
|
|
15720
15879
|
granularity: NcThrottleGranularitySchema.optional()
|
|
15721
15880
|
});
|
|
15881
|
+
/**
|
|
15882
|
+
* How long the confirm gate may hold ONE notification, and how big the picture
|
|
15883
|
+
* it judges may be.
|
|
15884
|
+
*
|
|
15885
|
+
* The clamp is the product decision, not a coincidence of the model: p50 was
|
|
15886
|
+
* 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
|
|
15887
|
+
* arrives after the visitor has gone is not a notification. 448 px was enough
|
|
15888
|
+
* to score 16/16 on the operator's parking scenario — bigger costs latency and
|
|
15889
|
+
* tokens for pixels the model pools away.
|
|
15890
|
+
*/
|
|
15891
|
+
var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
|
|
15892
|
+
var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
|
|
15893
|
+
var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
|
|
15894
|
+
/** Comparison the model's COUNT must satisfy for the notification to fire. */
|
|
15895
|
+
var NcConfirmExpectSchema = object({
|
|
15896
|
+
op: _enum([
|
|
15897
|
+
">=",
|
|
15898
|
+
">",
|
|
15899
|
+
"<=",
|
|
15900
|
+
"<",
|
|
15901
|
+
"=="
|
|
15902
|
+
]),
|
|
15903
|
+
count: number().int().min(0).max(1e3)
|
|
15904
|
+
});
|
|
15905
|
+
/**
|
|
15906
|
+
* AI CONFIRM — a vision model looks at the picture this notification is about
|
|
15907
|
+
* to ship and says whether it agrees with the rule.
|
|
15908
|
+
*
|
|
15909
|
+
* It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
|
|
15910
|
+
* crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
|
|
15911
|
+
* on the operator's phone is not a verdict about this notification.
|
|
15912
|
+
*
|
|
15913
|
+
* FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
|
|
15914
|
+
* whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
|
|
15915
|
+
* the default and every fail-open is COUNTED, because a gate that always fails
|
|
15916
|
+
* open looks in the log exactly like a gate that works.
|
|
15917
|
+
*
|
|
15918
|
+
* Every field is `.optional()` rather than relied on as a Zod default at the
|
|
15919
|
+
* runtime seam: a Zod default does NOT run on the addon→addon cap path (three
|
|
15920
|
+
* production failures in one day), so the gate reads absent as the constant
|
|
15921
|
+
* above rather than trusting a parse it may never have seen.
|
|
15922
|
+
*/
|
|
15923
|
+
var NcConfirmSchema = object({
|
|
15924
|
+
/** Off unless asked for. An absent `confirm` and `enabled:false` are the
|
|
15925
|
+
* same thing, and both mean "deliver exactly as before". */
|
|
15926
|
+
enabled: boolean().default(false),
|
|
15927
|
+
/** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
|
|
15928
|
+
profileId: string().optional(),
|
|
15929
|
+
/**
|
|
15930
|
+
* The operator's question, in his own words. Absent = a question derived
|
|
15931
|
+
* from the rule (its class and its expectation).
|
|
15932
|
+
*
|
|
15933
|
+
* NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
|
|
15934
|
+
* banners, signage and plates as instructions if you let them reach the
|
|
15935
|
+
* prompt — proven live — so the authoritative contract stays in the system
|
|
15936
|
+
* turn and only rule-authored words land here.
|
|
15937
|
+
*/
|
|
15938
|
+
prompt: string().max(1e3).optional(),
|
|
15939
|
+
/** Fire only when the model's count satisfies this. Absent = the model's
|
|
15940
|
+
* own boolean verdict decides. */
|
|
15941
|
+
expect: NcConfirmExpectSchema.optional(),
|
|
15942
|
+
timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
|
|
15943
|
+
/** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
|
|
15944
|
+
onTimeout: _enum(["fire", "suppress"]).default("fire"),
|
|
15945
|
+
/** Longest edge the judged image is downscaled to before it is sent. */
|
|
15946
|
+
maxImagePx: number().int().min(64).max(2048).default(448)
|
|
15947
|
+
});
|
|
15722
15948
|
/** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
|
|
15723
15949
|
var NcRuleInputSchema = object({
|
|
15724
15950
|
name: string().min(1).max(200),
|
|
@@ -15779,7 +16005,13 @@ var NcRuleInputSchema = object({
|
|
|
15779
16005
|
* `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
|
|
15780
16006
|
* shape as every other actuation.
|
|
15781
16007
|
*/
|
|
15782
|
-
actions: NcRuleActionsSchema.optional()
|
|
16008
|
+
actions: NcRuleActionsSchema.optional(),
|
|
16009
|
+
/**
|
|
16010
|
+
* AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
|
|
16011
|
+
* a rule that predates the gate must keep delivering byte-for-byte as it
|
|
16012
|
+
* did, and absent is the only way to say that without a migration.
|
|
16013
|
+
*/
|
|
16014
|
+
confirm: NcConfirmSchema.optional()
|
|
15783
16015
|
});
|
|
15784
16016
|
/**
|
|
15785
16017
|
* Partial patch for `updateRule` — any subset of the input fields, plus the
|
|
@@ -15790,7 +16022,37 @@ var NcRuleInputSchema = object({
|
|
|
15790
16022
|
* still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
|
|
15791
16023
|
* `updateRule` patch.
|
|
15792
16024
|
*/
|
|
15793
|
-
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
16025
|
+
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
16026
|
+
disabledTargetIds: array(string()).optional(),
|
|
16027
|
+
/**
|
|
16028
|
+
* `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
|
|
16029
|
+
*
|
|
16030
|
+
* It makes the key optional to SUPPLY; the parse still materialises the
|
|
16031
|
+
* default when the key is absent. And `NcRuleStore.update` merges with
|
|
16032
|
+
* `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
|
|
16033
|
+
* one — which made every partial edit destructive:
|
|
16034
|
+
*
|
|
16035
|
+
* nc.updateRule({ throttle }) → conditions reset to `{}`
|
|
16036
|
+
* nc.setRuleTargetEnabled(...) → conditions reset to `{}`
|
|
16037
|
+
* setEnabled(ruleId, false) → conditions reset to `{}`
|
|
16038
|
+
*
|
|
16039
|
+
* A rule scoped to one camera and one zone silently became a rule that
|
|
16040
|
+
* matches EVERY event on EVERY camera, and lost its `media` policy
|
|
16041
|
+
* (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
|
|
16042
|
+
* live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
|
|
16043
|
+
* within a minute of a two-field patch.
|
|
16044
|
+
*
|
|
16045
|
+
* So every defaulted field is re-declared here WITHOUT its default. The
|
|
16046
|
+
* inner defaults still apply when the caller DOES send the key — `{}` for
|
|
16047
|
+
* conditions remains a real instruction ("clear them") — and only the
|
|
16048
|
+
* absent key is now genuinely absent.
|
|
16049
|
+
*/
|
|
16050
|
+
enabled: boolean().optional(),
|
|
16051
|
+
conditions: NcConditionsSchema.optional(),
|
|
16052
|
+
media: NcMediaPolicySchema.optional(),
|
|
16053
|
+
throttle: NcThrottleSchema.optional(),
|
|
16054
|
+
priority: number().int().min(1).max(5).optional()
|
|
16055
|
+
});
|
|
15794
16056
|
/** A persisted rule. */
|
|
15795
16057
|
var NcRuleSchema = NcRuleInputSchema.extend({
|
|
15796
16058
|
id: string(),
|
|
@@ -16091,6 +16353,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
|
|
|
16091
16353
|
* Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
|
|
16092
16354
|
* copy would lie the first time a rule is disabled.
|
|
16093
16355
|
*/
|
|
16356
|
+
/**
|
|
16357
|
+
* Why a device a mode NAMES is nonetheless not armed by it.
|
|
16358
|
+
*
|
|
16359
|
+
* Each value is an existing authority, never a new flag (D62): `muted` is the
|
|
16360
|
+
* per-camera notification switch the Notification Center already owns,
|
|
16361
|
+
* `detection-off` is the device's own detection binding being inactive, and
|
|
16362
|
+
* `offline` is the device manager's liveness. A fourth reason would mean a
|
|
16363
|
+
* fourth authority, and inventing one here is how a panel starts disagreeing
|
|
16364
|
+
* with the switches the operator actually used.
|
|
16365
|
+
*/
|
|
16366
|
+
var NcAlarmSkipReasonSchema = _enum([
|
|
16367
|
+
"muted",
|
|
16368
|
+
"detection-off",
|
|
16369
|
+
"offline"
|
|
16370
|
+
]);
|
|
16371
|
+
var NcAlarmSkippedDeviceSchema = object({
|
|
16372
|
+
deviceId: number().int(),
|
|
16373
|
+
reason: NcAlarmSkipReasonSchema
|
|
16374
|
+
});
|
|
16094
16375
|
var NcAlarmModeCoverageSchema = object({
|
|
16095
16376
|
mode: AlarmArmModeSchema,
|
|
16096
16377
|
/** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
|
|
@@ -16098,7 +16379,18 @@ var NcAlarmModeCoverageSchema = object({
|
|
|
16098
16379
|
/** At least one covering rule has no device scope, so the mode covers all. */
|
|
16099
16380
|
allDevices: boolean(),
|
|
16100
16381
|
/** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
|
|
16101
|
-
deviceIds: array(number().int())
|
|
16382
|
+
deviceIds: array(number().int()),
|
|
16383
|
+
/**
|
|
16384
|
+
* Devices this mode NAMES but cannot actually arm, each with the switch that
|
|
16385
|
+
* excludes it.
|
|
16386
|
+
*
|
|
16387
|
+
* "Away armed — 12 cameras" is a promise, and a muted camera among those
|
|
16388
|
+
* twelve makes it false in exactly the way nobody notices until an incident.
|
|
16389
|
+
* Defaulted to `[]` so a coverage answer computed before this field existed
|
|
16390
|
+
* still parses as "nothing known to be skipped" rather than failing the whole
|
|
16391
|
+
* alarm tab.
|
|
16392
|
+
*/
|
|
16393
|
+
skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
|
|
16102
16394
|
});
|
|
16103
16395
|
var NcAlarmConfigSchema = object({
|
|
16104
16396
|
/**
|
|
@@ -18930,9 +19222,16 @@ var CameraStatusSchema = object({
|
|
|
18930
19222
|
audio: CameraAudioStatusSchema.nullable(),
|
|
18931
19223
|
recording: CameraRecordingStatusSchema.nullable(),
|
|
18932
19224
|
/**
|
|
18933
|
-
* Per-camera
|
|
19225
|
+
* Per-camera functions an OPERATOR has turned off
|
|
18934
19226
|
* ([D61](../../../../docs/decisions/adr-0067.md)).
|
|
18935
19227
|
*
|
|
19228
|
+
* Composed from the AUTHORITIES themselves — the wrapper bindings,
|
|
19229
|
+
* `RecordingConfig.enabled`, the notification mute, the broker's audio
|
|
19230
|
+
* policy, the camera's own microphone — via `composeSwitchedOff`, not from
|
|
19231
|
+
* the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
|
|
19232
|
+
* The badge outlives the control panel: the panel was a convenience, this is
|
|
19233
|
+
* the difference between a camera being off and a camera being dead.
|
|
19234
|
+
*
|
|
18936
19235
|
* This is the difference between DISABLED and BROKEN. A camera whose
|
|
18937
19236
|
* `detection` block reports zero fps and whose `switchedOff` contains
|
|
18938
19237
|
* `'object-detection'` was switched off by a person; the same camera with an
|
|
@@ -25682,7 +25981,19 @@ var RecordingManifestSchema = object({
|
|
|
25682
25981
|
* profiles/subtrees/locations on this node). */
|
|
25683
25982
|
var RecordingDeviceUsageSchema = object({
|
|
25684
25983
|
deviceId: number(),
|
|
25685
|
-
usedBytes: number()
|
|
25984
|
+
usedBytes: number(),
|
|
25985
|
+
/**
|
|
25986
|
+
* Start of this camera's OLDEST indexed segment, across every profile and
|
|
25987
|
+
* location — the "Oldest footage" column in Recordings → Storage, and the
|
|
25988
|
+
* only honest answer to "is retention actually holding?" per camera.
|
|
25989
|
+
*
|
|
25990
|
+
* `null` = the camera has no footage. OPTIONAL because a recorder that
|
|
25991
|
+
* predates this field omits it entirely, and a hub whose types carry the
|
|
25992
|
+
* field must keep validating that older provider's payload: the framework
|
|
25993
|
+
* (types) and the addon ship on different trains, and the addon is usually
|
|
25994
|
+
* the later of the two.
|
|
25995
|
+
*/
|
|
25996
|
+
oldestMs: number().nullable().optional()
|
|
25686
25997
|
});
|
|
25687
25998
|
/** Recording storage usage + capacity for one storage location. */
|
|
25688
25999
|
var RecordingLocationUsageSchema = object({
|
|
@@ -25710,6 +26021,57 @@ var RecordingStorageUsageSchema = object({
|
|
|
25710
26021
|
locations: array(RecordingLocationUsageSchema)
|
|
25711
26022
|
});
|
|
25712
26023
|
/**
|
|
26024
|
+
* The OPERATOR-ARMED half of multi-location recordings (D116).
|
|
26025
|
+
*
|
|
26026
|
+
* The placement plan decides where NEW writes go and moves nothing. A rebalance
|
|
26027
|
+
* is the operator asking for the EXISTING archive to be brought into line with
|
|
26028
|
+
* that plan: one relocate job per (camera, profile) pile that sits on the wrong
|
|
26029
|
+
* location, run FIFO behind the single-flight mover.
|
|
26030
|
+
*
|
|
26031
|
+
* `plan…` and `start…` return the SAME shape deliberately — what the operator
|
|
26032
|
+
* confirms is exactly what gets enqueued, and `jobIds` is the only difference
|
|
26033
|
+
* (empty on the plan).
|
|
26034
|
+
*/
|
|
26035
|
+
var RecordingRebalanceMoveSchema = object({
|
|
26036
|
+
deviceId: number(),
|
|
26037
|
+
profile: string(),
|
|
26038
|
+
fromLocationId: string(),
|
|
26039
|
+
toLocationId: string(),
|
|
26040
|
+
bytes: number(),
|
|
26041
|
+
files: number().int()
|
|
26042
|
+
});
|
|
26043
|
+
/** Why a pile that is out of place is staying there. Every refusal is
|
|
26044
|
+
* reported: a rebalance that silently drops a camera reads exactly like one
|
|
26045
|
+
* that had nothing to do. */
|
|
26046
|
+
var RecordingRebalanceSkipReasonSchema = _enum([
|
|
26047
|
+
"unassigned",
|
|
26048
|
+
"target-not-writable",
|
|
26049
|
+
"below-threshold",
|
|
26050
|
+
"no-headroom"
|
|
26051
|
+
]);
|
|
26052
|
+
var RecordingRebalanceSkipSchema = object({
|
|
26053
|
+
deviceId: number(),
|
|
26054
|
+
profile: string(),
|
|
26055
|
+
fromLocationId: string(),
|
|
26056
|
+
/** The location the plan wants; null when the camera has no assignment. */
|
|
26057
|
+
toLocationId: string().nullable(),
|
|
26058
|
+
bytes: number(),
|
|
26059
|
+
reason: RecordingRebalanceSkipReasonSchema
|
|
26060
|
+
});
|
|
26061
|
+
var RecordingRebalancePlanSchema = object({
|
|
26062
|
+
moves: array(RecordingRebalanceMoveSchema),
|
|
26063
|
+
skipped: array(RecordingRebalanceSkipSchema),
|
|
26064
|
+
bytesToMove: number(),
|
|
26065
|
+
/** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
|
|
26066
|
+
jobIds: array(string())
|
|
26067
|
+
});
|
|
26068
|
+
var RecordingRebalanceInputSchema = object({
|
|
26069
|
+
/** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
|
|
26070
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
26071
|
+
/** Ignore piles smaller than this (default 1 GB). */
|
|
26072
|
+
minMoveGb: number().min(0).optional()
|
|
26073
|
+
});
|
|
26074
|
+
/**
|
|
25713
26075
|
* Result of locating footage at a wall-clock instant for one device/profile.
|
|
25714
26076
|
* `segment` carries the covering segment's window; `gap` reports the forward
|
|
25715
26077
|
* nearest covered edge (`null` past the end of footage / when none exists)
|
|
@@ -25872,9 +26234,24 @@ method(object({
|
|
|
25872
26234
|
}), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
25873
26235
|
kind: "mutation",
|
|
25874
26236
|
auth: "admin"
|
|
26237
|
+
}), method(RelocateFootageInputSchema, object({ jobId: string() }), {
|
|
26238
|
+
kind: "mutation",
|
|
26239
|
+
auth: "admin"
|
|
26240
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
26241
|
+
kind: "query",
|
|
26242
|
+
auth: "admin"
|
|
26243
|
+
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
26244
|
+
kind: "mutation",
|
|
26245
|
+
auth: "admin"
|
|
26246
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
26247
|
+
kind: "query",
|
|
26248
|
+
auth: "admin"
|
|
26249
|
+
}), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
|
|
26250
|
+
kind: "mutation",
|
|
26251
|
+
auth: "admin"
|
|
25875
26252
|
});
|
|
25876
26253
|
/**
|
|
25877
|
-
* `
|
|
26254
|
+
* `recording-export` cap — render a footage time range into a single downloadable
|
|
25878
26255
|
* MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
|
|
25879
26256
|
* bounded lifetime with a durable history, auto-expiry, and optional
|
|
25880
26257
|
* delete-after-download.
|
|
@@ -25889,10 +26266,42 @@ method(object({
|
|
|
25889
26266
|
*/
|
|
25890
26267
|
/** Playback-speed multiplier for the render (1 = realtime). */
|
|
25891
26268
|
var ExportSpeedSchema = number().min(.25).max(32);
|
|
26269
|
+
/**
|
|
26270
|
+
* One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
|
|
26271
|
+
*
|
|
26272
|
+
* Relative and not absolute epoch on purpose: the renderer's frame-select
|
|
26273
|
+
* expression sees ffmpeg's `t`, which starts at 0 for the export's source
|
|
26274
|
+
* playlist. Handing it absolute epochs would make every call site responsible
|
|
26275
|
+
* for the same subtraction, and the one that forgot would emit a filter that
|
|
26276
|
+
* selects nothing — silently, as a uniform timelapse.
|
|
26277
|
+
*/
|
|
26278
|
+
var ExportDenseRangeSchema = object({
|
|
26279
|
+
fromSec: number().nonnegative(),
|
|
26280
|
+
toSec: number().nonnegative()
|
|
26281
|
+
}).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
|
|
26282
|
+
/**
|
|
26283
|
+
* Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
|
|
26284
|
+
* listed ranges and at the base `everyMs` everywhere else.
|
|
26285
|
+
*
|
|
26286
|
+
* `everyMs` must be strictly smaller than the base cadence — a dense rate that
|
|
26287
|
+
* is not denser renders a uniform timelapse the operator believes is two-rate.
|
|
26288
|
+
*/
|
|
26289
|
+
var ExportDenseSchema = object({
|
|
26290
|
+
everyMs: number().int().positive(),
|
|
26291
|
+
ranges: array(ExportDenseRangeSchema).min(1).max(200)
|
|
26292
|
+
});
|
|
25892
26293
|
/** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
|
|
25893
26294
|
var ExportTimelapseSchema = object({
|
|
25894
26295
|
everyMs: number().int().positive(),
|
|
25895
|
-
outputFps: number().int().min(1).max(60).optional()
|
|
26296
|
+
outputFps: number().int().min(1).max(60).optional(),
|
|
26297
|
+
/** Optional second, FASTER rate over the intervals that matter. */
|
|
26298
|
+
dense: ExportDenseSchema.optional()
|
|
26299
|
+
}).superRefine((v, ctx) => {
|
|
26300
|
+
if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
|
|
26301
|
+
code: ZodIssueCode.custom,
|
|
26302
|
+
message: "dense.everyMs must be strictly smaller than the base everyMs",
|
|
26303
|
+
path: ["dense", "everyMs"]
|
|
26304
|
+
});
|
|
25896
26305
|
});
|
|
25897
26306
|
/**
|
|
25898
26307
|
* Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
|
|
@@ -25950,6 +26359,19 @@ var ExportDownloadSchema = object({
|
|
|
25950
26359
|
url: string(),
|
|
25951
26360
|
endpoints: array(string())
|
|
25952
26361
|
});
|
|
26362
|
+
/**
|
|
26363
|
+
* A finished export's bytes, inline.
|
|
26364
|
+
*
|
|
26365
|
+
* `bytes` is the DECODED length — the number the caller bounds and logs
|
|
26366
|
+
* against, so nobody has to infer it from the base64 length.
|
|
26367
|
+
*/
|
|
26368
|
+
var ExportBytesSchema = object({
|
|
26369
|
+
base64: string(),
|
|
26370
|
+
contentType: string(),
|
|
26371
|
+
/** Suggested filename, extension included. */
|
|
26372
|
+
name: string(),
|
|
26373
|
+
bytes: number().int().nonnegative()
|
|
26374
|
+
});
|
|
25953
26375
|
method(object({
|
|
25954
26376
|
deviceId: number(),
|
|
25955
26377
|
profile: string(),
|
|
@@ -25974,6 +26396,9 @@ method(object({
|
|
|
25974
26396
|
}), method(object({ exportId: string() }), ExportDownloadSchema, {
|
|
25975
26397
|
kind: "query",
|
|
25976
26398
|
auth: "protected"
|
|
26399
|
+
}), method(object({ exportId: string() }), ExportBytesSchema, {
|
|
26400
|
+
kind: "query",
|
|
26401
|
+
auth: "protected"
|
|
25977
26402
|
});
|
|
25978
26403
|
/**
|
|
25979
26404
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
@@ -32651,6 +33076,12 @@ Object.freeze({
|
|
|
32651
33076
|
addonId: null,
|
|
32652
33077
|
access: "create"
|
|
32653
33078
|
},
|
|
33079
|
+
"recording.cancelRelocateJob": {
|
|
33080
|
+
capName: "recording",
|
|
33081
|
+
capScope: "system",
|
|
33082
|
+
addonId: null,
|
|
33083
|
+
access: "create"
|
|
33084
|
+
},
|
|
32654
33085
|
"recording.cancelStorageMigrationMove": {
|
|
32655
33086
|
capName: "recording",
|
|
32656
33087
|
capScope: "system",
|
|
@@ -32705,6 +33136,12 @@ Object.freeze({
|
|
|
32705
33136
|
addonId: null,
|
|
32706
33137
|
access: "view"
|
|
32707
33138
|
},
|
|
33139
|
+
"recording.listRelocateJobs": {
|
|
33140
|
+
capName: "recording",
|
|
33141
|
+
capScope: "system",
|
|
33142
|
+
addonId: null,
|
|
33143
|
+
access: "view"
|
|
33144
|
+
},
|
|
32708
33145
|
"recording.locateSegment": {
|
|
32709
33146
|
capName: "recording",
|
|
32710
33147
|
capScope: "system",
|
|
@@ -32717,6 +33154,12 @@ Object.freeze({
|
|
|
32717
33154
|
addonId: null,
|
|
32718
33155
|
access: "create"
|
|
32719
33156
|
},
|
|
33157
|
+
"recording.planStorageRebalance": {
|
|
33158
|
+
capName: "recording",
|
|
33159
|
+
capScope: "system",
|
|
33160
|
+
addonId: null,
|
|
33161
|
+
access: "view"
|
|
33162
|
+
},
|
|
32720
33163
|
"recording.pruneFootage": {
|
|
32721
33164
|
capName: "recording",
|
|
32722
33165
|
capScope: "system",
|
|
@@ -32741,6 +33184,12 @@ Object.freeze({
|
|
|
32741
33184
|
addonId: null,
|
|
32742
33185
|
access: "create"
|
|
32743
33186
|
},
|
|
33187
|
+
"recording.relocateFootage": {
|
|
33188
|
+
capName: "recording",
|
|
33189
|
+
capScope: "system",
|
|
33190
|
+
addonId: null,
|
|
33191
|
+
access: "create"
|
|
33192
|
+
},
|
|
32744
33193
|
"recording.renderClip": {
|
|
32745
33194
|
capName: "recording",
|
|
32746
33195
|
capScope: "system",
|
|
@@ -32777,38 +33226,50 @@ Object.freeze({
|
|
|
32777
33226
|
addonId: null,
|
|
32778
33227
|
access: "create"
|
|
32779
33228
|
},
|
|
33229
|
+
"recording.startStorageRebalance": {
|
|
33230
|
+
capName: "recording",
|
|
33231
|
+
capScope: "system",
|
|
33232
|
+
addonId: null,
|
|
33233
|
+
access: "create"
|
|
33234
|
+
},
|
|
32780
33235
|
"recordingExport.cancelExport": {
|
|
32781
|
-
capName: "
|
|
33236
|
+
capName: "recording-export",
|
|
32782
33237
|
capScope: "system",
|
|
32783
33238
|
addonId: null,
|
|
32784
33239
|
access: "create"
|
|
32785
33240
|
},
|
|
32786
33241
|
"recordingExport.createExport": {
|
|
32787
|
-
capName: "
|
|
33242
|
+
capName: "recording-export",
|
|
32788
33243
|
capScope: "system",
|
|
32789
33244
|
addonId: null,
|
|
32790
33245
|
access: "create"
|
|
32791
33246
|
},
|
|
32792
33247
|
"recordingExport.deleteExport": {
|
|
32793
|
-
capName: "
|
|
33248
|
+
capName: "recording-export",
|
|
32794
33249
|
capScope: "system",
|
|
32795
33250
|
addonId: null,
|
|
32796
33251
|
access: "delete"
|
|
32797
33252
|
},
|
|
32798
33253
|
"recordingExport.getDownloadUrl": {
|
|
32799
|
-
capName: "
|
|
33254
|
+
capName: "recording-export",
|
|
32800
33255
|
capScope: "system",
|
|
32801
33256
|
addonId: null,
|
|
32802
33257
|
access: "view"
|
|
32803
33258
|
},
|
|
32804
33259
|
"recordingExport.getExport": {
|
|
32805
|
-
capName: "
|
|
33260
|
+
capName: "recording-export",
|
|
32806
33261
|
capScope: "system",
|
|
32807
33262
|
addonId: null,
|
|
32808
33263
|
access: "view"
|
|
32809
33264
|
},
|
|
32810
33265
|
"recordingExport.listExports": {
|
|
32811
|
-
capName: "
|
|
33266
|
+
capName: "recording-export",
|
|
33267
|
+
capScope: "system",
|
|
33268
|
+
addonId: null,
|
|
33269
|
+
access: "view"
|
|
33270
|
+
},
|
|
33271
|
+
"recordingExport.readExportBytes": {
|
|
33272
|
+
capName: "recording-export",
|
|
32812
33273
|
capScope: "system",
|
|
32813
33274
|
addonId: null,
|
|
32814
33275
|
access: "view"
|
|
@@ -34185,6 +34646,104 @@ var FramerateField = number().int().min(1).max(60);
|
|
|
34185
34646
|
var TargetsField = array(NcRuleTargetSchema).min(1);
|
|
34186
34647
|
var PriorityField = number().int().min(1).max(5);
|
|
34187
34648
|
/**
|
|
34649
|
+
* Explicit override of the DENSE sampling cadence, seconds.
|
|
34650
|
+
*
|
|
34651
|
+
* Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
|
|
34652
|
+
* 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
|
|
34653
|
+
* made that same base 3 s and rendered a person pass as two frames.)
|
|
34654
|
+
*
|
|
34655
|
+
* THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
|
|
34656
|
+
* `denseCadenceSec` and played at `framerate` occupies
|
|
34657
|
+
*
|
|
34658
|
+
* outputSeconds = (rangeSec / denseCadenceSec) / framerate
|
|
34659
|
+
*
|
|
34660
|
+
* 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.
|
|
34661
|
+
* Halving this field doubles the frames INSIDE ranges only — the base cadence,
|
|
34662
|
+
* and therefore the length of a quiet night, does not move.
|
|
34663
|
+
*
|
|
34664
|
+
* Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
|
|
34665
|
+
* the recording has them returns the same frames, requested twice. Must be
|
|
34666
|
+
* STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
|
|
34667
|
+
* a uniform video the operator believes is two-rate — and upsert refuses it
|
|
34668
|
+
* rather than letting the export cap reject the render hours after the window.
|
|
34669
|
+
*/
|
|
34670
|
+
var DenseCadenceSecField = number().min(.1).max(3600);
|
|
34671
|
+
/**
|
|
34672
|
+
* Minimum seconds of OUTPUT video each detection range must occupy.
|
|
34673
|
+
*
|
|
34674
|
+
* The operator-facing form of the arithmetic above: instead of solving for a
|
|
34675
|
+
* cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
|
|
34676
|
+
* 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
|
|
34677
|
+
* that range every ~583 ms.
|
|
34678
|
+
*
|
|
34679
|
+
* ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
|
|
34680
|
+
* ranges are terms of a single ffmpeg `select` expression that cannot vary rate
|
|
34681
|
+
* per term — so the MOST DEMANDING (shortest) range sets the rate and longer
|
|
34682
|
+
* ranges are sampled denser than they need. Per-range cadences require a cap
|
|
34683
|
+
* schema change and are the tracked follow-up.
|
|
34684
|
+
*
|
|
34685
|
+
* A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
|
|
34686
|
+
* is rendered with every frame that EXISTS and no more: the guarantee is capped
|
|
34687
|
+
* by real footage, never met by duplicating frames into motion that never
|
|
34688
|
+
* happened.
|
|
34689
|
+
*/
|
|
34690
|
+
var MinDwellSecField = number().min(0).max(60);
|
|
34691
|
+
/**
|
|
34692
|
+
* Caption burned into the notification's preview frame.
|
|
34693
|
+
*
|
|
34694
|
+
* Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
|
|
34695
|
+
* `rule`, `from`, `to`) and rendered by the SAME renderer — a second
|
|
34696
|
+
* templating dialect for one field would be a second thing to explain.
|
|
34697
|
+
*
|
|
34698
|
+
* Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
|
|
34699
|
+
* operator saying "the frame, no caption" — a distinct, reachable answer, and
|
|
34700
|
+
* the reason this is not `.min(1)`.
|
|
34701
|
+
*/
|
|
34702
|
+
var PreviewTextField = string().max(200);
|
|
34703
|
+
/**
|
|
34704
|
+
* Whether the notification's preview is a STILL or a short animation.
|
|
34705
|
+
*
|
|
34706
|
+
* The operator's ask, verbatim: *"inviato come gif o video (come per le altre
|
|
34707
|
+
* rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
|
|
34708
|
+
* night reads better as three seconds of motion than as one frame of it. Both
|
|
34709
|
+
* modes get the SAME treatment (blurred frame, large centred title); `'gif'`
|
|
34710
|
+
* simply applies it to a dozen frames sampled across the render and assembles
|
|
34711
|
+
* them.
|
|
34712
|
+
*
|
|
34713
|
+
* `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
|
|
34714
|
+
* seeks and a palette pass, and no rule that never asked for one should start
|
|
34715
|
+
* paying that on the deploy that shipped it.
|
|
34716
|
+
*
|
|
34717
|
+
* A GIF that cannot be assembled DEGRADES to the still — never to nothing.
|
|
34718
|
+
*/
|
|
34719
|
+
var PreviewModeField = _enum(["image", "gif"]);
|
|
34720
|
+
/**
|
|
34721
|
+
* Which detection classes the notification reports counts for.
|
|
34722
|
+
*
|
|
34723
|
+
* The counts come from the tracks the render ALREADY fetched for its dense-range
|
|
34724
|
+
* plan — no second query — aggregated per class. Absent or empty means "every
|
|
34725
|
+
* class the window actually contained", which is what an operator who never
|
|
34726
|
+
* opened the field wants; a list narrows it (`['person']` on a driveway that
|
|
34727
|
+
* counts cars all night).
|
|
34728
|
+
*
|
|
34729
|
+
* Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
|
|
34730
|
+
* …). An unknown name simply never matches and reports nothing — it is not an
|
|
34731
|
+
* error, because a rule may legitimately name a class this camera's model does
|
|
34732
|
+
* not emit.
|
|
34733
|
+
*
|
|
34734
|
+
* The counts are exposed to {@link TimelapseTemplateSchema} as:
|
|
34735
|
+
* - `{{detections}}` — total over the reported classes
|
|
34736
|
+
* - `{{detectionSummary}}` — `2 persone, 1 veicolo`
|
|
34737
|
+
* - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
|
|
34738
|
+
* one per class, `count_` + the class name
|
|
34739
|
+
*
|
|
34740
|
+
* With NO custom body template the summary is appended to the derived body, and
|
|
34741
|
+
* only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
|
|
34742
|
+
* reads. With a custom template the operator owns every word — nothing is
|
|
34743
|
+
* appended, so `{{detectionSummary}}` is how he asks for it.
|
|
34744
|
+
*/
|
|
34745
|
+
var ReportClassesField = array(string().min(1).max(40)).max(20);
|
|
34746
|
+
/**
|
|
34188
34747
|
* Client-supplied timelapse-rule fields. The server stamps id / createdBy /
|
|
34189
34748
|
* createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
|
|
34190
34749
|
* here (see the ownership note above).
|
|
@@ -34204,9 +34763,30 @@ var TimelapseRuleInputSchema = object({
|
|
|
34204
34763
|
cadenceSec: CadenceSecField.default(15),
|
|
34205
34764
|
/** Output frames per second of the assembled mp4 (predecessor parity). */
|
|
34206
34765
|
framerate: FramerateField.default(10),
|
|
34766
|
+
/**
|
|
34767
|
+
* Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
|
|
34768
|
+
* as `max(1s, cadenceSec / 30)`, which is what every rule written before this
|
|
34769
|
+
* field gets.
|
|
34770
|
+
*/
|
|
34771
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
34772
|
+
/** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
|
|
34773
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
34207
34774
|
/** `notification-output` targets the finished video/thumbnail is sent to. */
|
|
34208
34775
|
targets: TargetsField,
|
|
34209
34776
|
template: TimelapseTemplateSchema.optional(),
|
|
34777
|
+
/**
|
|
34778
|
+
* Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
|
|
34779
|
+
* and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
|
|
34780
|
+
*
|
|
34781
|
+
* Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
|
|
34782
|
+
* the notification's title/body, and clearing it (`template: null`) must not
|
|
34783
|
+
* silently clear the caption too.
|
|
34784
|
+
*/
|
|
34785
|
+
previewText: PreviewTextField.optional(),
|
|
34786
|
+
/** Still or animation — see {@link PreviewModeField}. */
|
|
34787
|
+
previewMode: PreviewModeField.default("image"),
|
|
34788
|
+
/** Classes the notification counts — see {@link ReportClassesField}. */
|
|
34789
|
+
reportClasses: ReportClassesField.optional(),
|
|
34210
34790
|
/** Canonical notification priority ordinal (1..5); per-target overridable. */
|
|
34211
34791
|
priority: PriorityField.default(3)
|
|
34212
34792
|
});
|
|
@@ -34217,8 +34797,13 @@ object({
|
|
|
34217
34797
|
schedule: NcScheduleSchema.optional(),
|
|
34218
34798
|
cadenceSec: CadenceSecField.optional(),
|
|
34219
34799
|
framerate: FramerateField.optional(),
|
|
34800
|
+
denseCadenceSec: DenseCadenceSecField.optional(),
|
|
34801
|
+
minDwellSec: MinDwellSecField.optional(),
|
|
34220
34802
|
targets: TargetsField.optional(),
|
|
34221
34803
|
template: TimelapseTemplateSchema.nullable().optional(),
|
|
34804
|
+
previewText: PreviewTextField.optional(),
|
|
34805
|
+
previewMode: PreviewModeField.optional(),
|
|
34806
|
+
reportClasses: ReportClassesField.optional(),
|
|
34222
34807
|
priority: PriorityField.optional()
|
|
34223
34808
|
});
|
|
34224
34809
|
TimelapseRuleInputSchema.extend({
|
|
@@ -34230,10 +34815,28 @@ TimelapseRuleInputSchema.extend({
|
|
|
34230
34815
|
*/
|
|
34231
34816
|
ownerUserId: string().optional(),
|
|
34232
34817
|
/**
|
|
34233
|
-
* Epoch-ms of the
|
|
34234
|
-
*
|
|
34818
|
+
* Epoch-ms of the NEWEST successful generation across every camera of this
|
|
34819
|
+
* rule. What a UI shows, and the compatibility floor for
|
|
34820
|
+
* {@link readTimelapseGeneratedAt}. Absent = never generated.
|
|
34235
34821
|
*/
|
|
34236
34822
|
lastGeneratedAt: number().optional(),
|
|
34823
|
+
/**
|
|
34824
|
+
* PER-CAMERA generation state, keyed by `String(deviceId)` — the
|
|
34825
|
+
* re-generation guard's real durable state.
|
|
34826
|
+
*
|
|
34827
|
+
* One rule covers several cameras and each renders its own video, so a rule
|
|
34828
|
+
* -wide stamp is wrong in the direction that DESTROYS work: camera A
|
|
34829
|
+
* succeeding at 06:05 tells camera B, whose render failed, that it is
|
|
34830
|
+
* already done — and B's night is gone for good, because the window will not
|
|
34831
|
+
* come back.
|
|
34832
|
+
*
|
|
34833
|
+
* ADDITIVE, so the migration is free: a row written before this field simply
|
|
34834
|
+
* has no map, and {@link readTimelapseGeneratedAt} falls back to
|
|
34835
|
+
* {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
|
|
34836
|
+
* "never generated" would re-render and re-notify every camera of every rule
|
|
34837
|
+
* once, on the deploy that shipped the map.
|
|
34838
|
+
*/
|
|
34839
|
+
generatedByDevice: record(string(), number()).optional(),
|
|
34237
34840
|
/** userId of the caller who created the rule (server-stamped). */
|
|
34238
34841
|
createdBy: string(),
|
|
34239
34842
|
createdAt: number(),
|