@camstack/addon-provider-velux 0.2.6 → 0.2.8

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.
Files changed (3) hide show
  1. package/dist/addon.js +463 -76
  2. package/dist/addon.mjs +463 -76
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region ../types/dist/event-category-BLcNejAE.mjs
2
+ //#region ../types/dist/event-category-Bz24uP1U.mjs
3
3
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4
4
  EventCategory["SystemBoot"] = "system.boot";
5
5
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -270,6 +270,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
270
270
  */
271
271
  EventCategory["DeviceStateChanged"] = "device.state-changed";
272
272
  /**
273
+ * Frame occupancy for a camera CHANGED — a tracked object was gained or
274
+ * lost. Carries `{ deviceId, totalObjects, byClass, zones }`.
275
+ *
276
+ * Emitted only on a change, so a steady scene is silent. It exists so a
277
+ * client can stop polling `zoneAnalytics.getCurrentSnapshot`: that was the
278
+ * one live badge with no push signal at all, and it cost a request every
279
+ * four seconds per visible camera.
280
+ *
281
+ * Like every event it is telemetry and may be dropped ([D8]) — a consumer
282
+ * keeps a slow reconcile rather than trusting it alone.
283
+ */
284
+ EventCategory["ZoneAnalyticsOccupancyChanged"] = "zone-analytics.occupancy-changed";
285
+ /**
273
286
  * Cap event fired by every device that registers the `battery`
274
287
  * capability. Mirrors the cap definition's `onStatusChanged`. Carries
275
288
  * `{ deviceId, status: BatteryStatus }`. Subscribers (alert center,
@@ -7213,35 +7226,22 @@ var ConvertResultSchema = object({
7213
7226
  */
7214
7227
  var RecordingWeekdaySchema = number().int().min(0).max(6);
7215
7228
  var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
7216
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
7217
- kind: literal("timeOfDay"),
7218
- start: string().regex(HHMM),
7219
- end: string().regex(HHMM),
7220
- /** Restrict to these weekdays; omit = every day. */
7221
- days: array(RecordingWeekdaySchema).optional()
7222
- })]);
7223
- var RecordingModeSchema = _enum([
7224
- "continuous",
7225
- "onMotion",
7226
- "onAudioThreshold"
7227
- ]);
7228
7229
  /**
7229
- * First-class, authoritative per-camera storage mode — the explicit choice the
7230
- * UI reads directly (never inferred from `rules`):
7231
- * - `off` — not recording.
7232
- * - `events` — record only around triggers (motion / audio threshold),
7233
- * with pre/post-buffer.
7234
- * - `continuous` — record 24/7 within the schedule.
7230
+ * DERIVED per-camera storage summary — the single field cheap consumers read
7231
+ * (the viewer's status dot, the camera list) instead of walking `bands`:
7232
+ * - `off` — no band covers the camera (or it is disabled).
7233
+ * - `events` — every band records around triggers only.
7234
+ * - `continuous` — at least one band records continuously.
7235
7235
  *
7236
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
7237
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
7236
+ * NEVER authored: the recorder stamps it from the authoritative `bands` on
7237
+ * every save (`activeModeForConfig`). Writing it has no effect.
7238
7238
  */
7239
7239
  var RecordingStorageModeSchema = _enum([
7240
7240
  "off",
7241
7241
  "events",
7242
7242
  "continuous"
7243
7243
  ]);
7244
- /** Which detectors trigger an `events`-mode recording. */
7244
+ /** Which detectors trigger an `events`-mode band. */
7245
7245
  var RecordingTriggersSchema = object({
7246
7246
  motion: boolean().optional(),
7247
7247
  audioThresholdDbfs: number().optional()
@@ -7277,18 +7277,6 @@ var RecordingBandSchema = object({
7277
7277
  preBufferSec: number().min(0).optional(),
7278
7278
  postBufferSec: number().min(0).optional()
7279
7279
  });
7280
- var RecordingRuleSchema = object({
7281
- schedule: RecordingScheduleSchema,
7282
- mode: RecordingModeSchema,
7283
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
7284
- preBufferSec: number().min(0).default(0),
7285
- /** Keep recording until this many seconds after the last trigger. */
7286
- postBufferSec: number().min(0).default(0),
7287
- /** Each new trigger restarts the post-buffer window. */
7288
- resetTimeoutOnNewEvent: boolean().default(true),
7289
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
7290
- thresholdDbfs: number().optional()
7291
- });
7292
7280
  /**
7293
7281
  * Per-device retention overrides. Every field is optional; an unset or `0`
7294
7282
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7322,40 +7310,28 @@ var ScrubThumbnailPresetSchema = _enum([
7322
7310
  /**
7323
7311
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7324
7312
  *
7325
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
7326
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
7327
- * only for transition + migration (`migrateRulesToMode`); the policy engine
7328
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
7313
+ * `bands` is the ONLY authored recording intent: what to record, when, and on
7314
+ * which trigger. `mode` is a derived summary the recorder stamps on save; every
7315
+ * other field is a storage knob (profiles, segment length, retention, scrub).
7316
+ *
7317
+ * STRICT on purpose: the legacy authoring surface (`schedule`/`schedules`/
7318
+ * `triggers`/`preBufferSec`/`postBufferSec`/`rules`) was retired 2026-07-30.
7319
+ * A stale caller must fail loudly — silently stripping its legacy intent would
7320
+ * persist a band-less config, i.e. silently stop recording the camera.
7329
7321
  */
7330
7322
  var RecordingConfigSchema = object({
7331
7323
  enabled: boolean(),
7332
- /** Authoritative storage mode. Absent on legacy targets derived once via
7333
- * `migrateRulesToMode`, then persisted. */
7324
+ /** DERIVED summary of `bands`, stamped by the recorder on every save.
7325
+ * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7334
7326
  mode: RecordingStorageModeSchema.optional(),
7335
7327
  profiles: array(CamProfileSchema).optional(),
7336
7328
  segmentSeconds: number().int().positive().optional(),
7337
- /** Shared recording time-bands for `events` & `continuous` — record only when
7338
- * the wall-clock falls inside one of these windows. Omit or empty = always.
7339
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
7340
- schedules: array(RecordingScheduleSchema).optional(),
7341
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
7342
- * normalized into `schedules` on read and never written going forward. (Not
7343
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
7344
- schedule: RecordingScheduleSchema.optional(),
7345
- /** `events`-mode only — which detectors trigger a recording. */
7346
- triggers: RecordingTriggersSchema.optional(),
7347
- /** `events`-mode only — seconds retained before / after a trigger. */
7348
- preBufferSec: number().min(0).optional(),
7349
- postBufferSec: number().min(0).optional(),
7350
- /** DEPRECATED authoring input; retained for migration/transition. */
7351
- rules: array(RecordingRuleSchema).optional(),
7352
7329
  /**
7353
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
7354
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
7355
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
7356
- * derived into bands once via `migrateConfigToBands`.
7330
+ * AUTHORITATIVE mode-per-band recording model the single source of truth
7331
+ * the recorder's band engine consumes. An empty array = record nothing;
7332
+ * "off" is the absence of a covering band, never a band value.
7357
7333
  */
7358
- bands: array(RecordingBandSchema).optional(),
7334
+ bands: array(RecordingBandSchema).default([]),
7359
7335
  retention: RecordingRetentionSchema.optional(),
7360
7336
  /**
7361
7337
  * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
@@ -7363,8 +7339,15 @@ var RecordingConfigSchema = object({
7363
7339
  * windows only — existing sheets are immutable, and each window's index
7364
7340
  * carries its own tile dims so mixed-preset history renders correctly.
7365
7341
  */
7366
- scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7367
- });
7342
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional(),
7343
+ /**
7344
+ * OPT-IN thumbnail-strip generation for this camera: every keyframe of the
7345
+ * low recording saved as a JPEG (the fast-drag scrub depth), a derived
7346
+ * cache that eviction reclaims with the footage. Absent/false = no strips
7347
+ * are written and scrub reads exact keyframes at every velocity.
7348
+ */
7349
+ stripsEnabled: boolean().optional()
7350
+ }).strict();
7368
7351
  /**
7369
7352
  * Ops-log — the durable, append-only operations audit shared by the
7370
7353
  * recordings and events management surfaces.
@@ -7383,7 +7366,8 @@ var OpsLogOpSchema = _enum([
7383
7366
  "prune",
7384
7367
  "manual-delete",
7385
7368
  "rescan",
7386
- "retention-run"
7369
+ "retention-run",
7370
+ "relocate"
7387
7371
  ]);
7388
7372
  /** Why the operation ran. */
7389
7373
  var OpsLogReasonSchema = _enum([
@@ -7422,6 +7406,55 @@ var OpsLogQueryInputSchema = object({
7422
7406
  limit: number().int().min(1).max(1e3).optional()
7423
7407
  });
7424
7408
  /**
7409
+ * Entity-relocation job state (storage entity-routing spec, Phase 4).
7410
+ *
7411
+ * One shape shared by the recorder's `relocateFootage` (segments + strips) and
7412
+ * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7413
+ * page renders both movers with one component. Jobs are in-RAM (a restart
7414
+ * forgets them — re-running is safe by construction: copy-if-absent, delete
7415
+ * after verify) and each completed/failed run also lands one durable ops-log
7416
+ * row on the owning addon's surface.
7417
+ */
7418
+ var RelocateJobStateSchema = _enum([
7419
+ "running",
7420
+ "done",
7421
+ "failed",
7422
+ "cancelled"
7423
+ ]);
7424
+ var RelocateJobSchema = object({
7425
+ jobId: string(),
7426
+ state: RelocateJobStateSchema,
7427
+ /** Source location — for media relocation this is informational ('*': rows
7428
+ * move from wherever they are to the target). */
7429
+ fromLocationId: string(),
7430
+ toLocationId: string(),
7431
+ /** Scoped device, or null = every device. */
7432
+ deviceId: number().nullable(),
7433
+ /** What the job moves (owner-addon specific: segments/strips or media). */
7434
+ entities: array(string()),
7435
+ filesMoved: number().int(),
7436
+ bytesMoved: number().int(),
7437
+ /** Total files discovered up front; null while (or when) unknown. */
7438
+ filesTotal: number().int().nullable(),
7439
+ startedAt: number(),
7440
+ finishedAt: number().nullable(),
7441
+ error: string().nullable()
7442
+ });
7443
+ var RelocateFootageInputSchema = object({
7444
+ deviceId: number().optional(),
7445
+ fromLocationId: string(),
7446
+ toLocationId: string(),
7447
+ entities: array(_enum(["segments", "strips"])).optional(),
7448
+ /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7449
+ * never allowed to starve live writers. */
7450
+ throttleMbps: number().min(1).max(1e3).optional()
7451
+ });
7452
+ var RelocateMediaInputSchema = object({
7453
+ deviceId: number().optional(),
7454
+ toLocationId: string(),
7455
+ throttleMbps: number().min(1).max(1e3).optional()
7456
+ });
7457
+ /**
7425
7458
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7426
7459
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7427
7460
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -7471,6 +7504,13 @@ var StorageLocationSchema = object({
7471
7504
  nodeId: string().optional(),
7472
7505
  isDefault: boolean().default(false),
7473
7506
  isSystem: boolean().default(false),
7507
+ /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7508
+ * for node-local locations it can reach) — never persisted, absent when the
7509
+ * volume is remote/unreachable. The single capacity truth every UI reads. */
7510
+ capacity: object({
7511
+ totalBytes: number(),
7512
+ availableBytes: number()
7513
+ }).nullable().optional(),
7474
7514
  createdAt: number(),
7475
7515
  updatedAt: number()
7476
7516
  });
@@ -8238,7 +8278,8 @@ var NcTaxonomyEntrySchema = object({
8238
8278
  /** Macro/category parent for grouping ('car' → 'vehicle'); null for a top. */
8239
8279
  parentKind: string().nullable()
8240
8280
  });
8241
- object({
8281
+ /** The complete NC picker taxonomy — three grouped buckets. */
8282
+ var NcTaxonomySchema = object({
8242
8283
  videoClasses: array(NcTaxonomyEntrySchema),
8243
8284
  audioKinds: array(NcTaxonomyEntrySchema),
8244
8285
  labels: array(NcTaxonomyEntrySchema)
@@ -9141,6 +9182,7 @@ function shallowEqual(a, b) {
9141
9182
  for (const k of ak) if (a[k] !== b[k]) return false;
9142
9183
  return true;
9143
9184
  }
9185
+ new Set(["devices", "classes"]);
9144
9186
  /**
9145
9187
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
9146
9188
  * motion-zones, and the detection zones/lines editor all speak this one
@@ -9299,6 +9341,29 @@ var NcOccupancyConditionSchema = object({
9299
9341
  count: number().int().min(0).default(1),
9300
9342
  sustainSeconds: number().int().min(0).max(3600).default(15)
9301
9343
  });
9344
+ /**
9345
+ * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
9346
+ *
9347
+ * The values are not symmetric, and deliberately so — the absent value has to
9348
+ * mean exactly what every rule authored before this condition existed already
9349
+ * does:
9350
+ * - `enter` — entries and every NON-crossing record (movement state,
9351
+ * package, sensor). Exits are rejected. **This is the absent behaviour**:
9352
+ * an operator who never asked for exits must not start receiving them.
9353
+ * - `exit` — ONLY an exit crossing. A record that is not a crossing at all
9354
+ * fails closed, because "the car left the drive" is a question about a
9355
+ * boundary, not about a detection.
9356
+ * - `any` — no direction filter; entries, exits and non-crossings alike.
9357
+ *
9358
+ * A rule asking for a direction should normally also scope `zones`, which the
9359
+ * engine evaluates against the crossed zone as well as the current membership
9360
+ * (an exit's membership no longer contains the zone it just left).
9361
+ */
9362
+ var NcCrossingSchema = _enum([
9363
+ "enter",
9364
+ "exit",
9365
+ "any"
9366
+ ]);
9302
9367
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
9303
9368
  var NcZoneConditionSchema = object({
9304
9369
  ids: array(string().min(1)).min(1),
@@ -9323,6 +9388,13 @@ var NcConditionsSchema = object({
9323
9388
  /** Veto zones — any hit fails the rule. */
9324
9389
  zonesExclude: array(string().min(1)).optional(),
9325
9390
  /**
9391
+ * Zone-crossing direction. IMMEDIATE only — a crossing is a per-event fact
9392
+ * and a closed track carries none, so a `track-end` rule asking for one
9393
+ * fails closed (use `zones`, which tests `zonesVisited`). ABSENT = `enter`,
9394
+ * which is exactly today's behaviour. See {@link NcCrossingSchema}.
9395
+ */
9396
+ crossing: NcCrossingSchema.optional(),
9397
+ /**
9326
9398
  * Exact (case-insensitive) match on the record's collapsed `label`
9327
9399
  * (identity name / plate text / subclass).
9328
9400
  */
@@ -9457,17 +9529,85 @@ var NcRuleTargetSchema = object({
9457
9529
  * - `keyFrame` — the clean scene frame (no subject box).
9458
9530
  * - `none` — no attachment.
9459
9531
  */
9460
- var NcMediaPolicySchema = object({ attach: _enum([
9461
- "best",
9462
- "best-matching",
9463
- "keyFrame",
9464
- "none"
9465
- ]).default("best") });
9532
+ /**
9533
+ * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
9534
+ * conflate it with the selection strategy and betray the request: asking for
9535
+ * the clean scene frame on an object-event owner used to start at
9536
+ * `fullFrameBoxed`, i.e. the annotated frame (2026-07-30).
9537
+ * - `cropped` — the subject, tight. What "who is at the door" wants.
9538
+ * - `full` — the clean scene, no annotation. What "what is going on" wants.
9539
+ * - `boxed` — the scene WITH the detection boxes drawn, for verifying what
9540
+ * the pipeline actually saw.
9541
+ */
9542
+ var NcMediaFrameSchema = _enum([
9543
+ "cropped",
9544
+ "full",
9545
+ "boxed"
9546
+ ]);
9547
+ var NcMediaPolicySchema = object({
9548
+ attach: _enum([
9549
+ "best",
9550
+ "best-matching",
9551
+ "keyFrame",
9552
+ "none"
9553
+ ]).default("best"),
9554
+ /** What the still shows. Absent = `cropped` (the historical `best` shape). */
9555
+ frame: NcMediaFrameSchema.optional(),
9556
+ /** Crop the attached still to the rule's condition-zone bbox (padded) —
9557
+ * "show me the ZONE", not the whole scene or the subject crop. */
9558
+ zoneCrop: boolean().optional(),
9559
+ /**
9560
+ * Also attach a short GIF cut from the stream broker's clip ring around the
9561
+ * event — NOT from the recording, so the camera does not have to be
9562
+ * recording, and the window sits AROUND the moment instead of a segment
9563
+ * behind it. Fail-closed: a window the ring does not cover contributes no
9564
+ * gif, never a failed notification.
9565
+ */
9566
+ gif: boolean().optional(),
9567
+ /**
9568
+ * Also attach a short MP4 CLIP of the same cut. Same source and the same
9569
+ * fail-closed rule as `gif`. Prefer it where the backend takes video
9570
+ * (telegram, discord, zentik, webhook); backends that do not are handled by
9571
+ * the degrade engine, which drops the video and keeps the still.
9572
+ */
9573
+ clip: boolean().optional(),
9574
+ /** Seconds of footage BEFORE / AFTER the event instant. Defaults 3 / 7. */
9575
+ clipPreRollSec: number().int().min(0).max(30).optional(),
9576
+ clipPostRollSec: number().int().min(0).max(30).optional(),
9577
+ /**
9578
+ * Which stream profile the footage is cut from. Absent = the CHEAPEST
9579
+ * assigned profile: a notification is watched on a phone, so the 4K
9580
+ * rendition would burn CPU to produce a file the client downscales anyway.
9581
+ * A profile that is not assigned falls back to the cheapest, and the render
9582
+ * reports which one actually ran.
9583
+ */
9584
+ profile: CamProfileSchema.optional()
9585
+ });
9586
+ /**
9587
+ * Cooldown GRANULARITY over the subject's class — how much a fired
9588
+ * notification suppresses.
9589
+ * - `shared` (default, and the absent value) — one window for the whole
9590
+ * rule/scope: a cat silences the next dog for `cooldownSec`.
9591
+ * - `per-class` — an independent window per detected class, so cat→dog fires
9592
+ * at once and cat→cat still waits.
9593
+ *
9594
+ * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
9595
+ * must not be swallowed by a bark's window (the precedent this generalizes —
9596
+ * see `cooldownKey` in the rule engine).
9597
+ */
9598
+ var NcThrottleGranularitySchema = _enum(["shared", "per-class"]);
9466
9599
  /** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
9467
9600
  var NcThrottleSchema = object({
9468
9601
  cooldownSec: number().int().min(0).max(86400).default(60),
9469
9602
  /** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
9470
- scope: _enum(["rule", "rule-device"]).default("rule-device")
9603
+ scope: _enum(["rule", "rule-device"]).default("rule-device"),
9604
+ /**
9605
+ * Class granularity of the cooldown key. Optional rather than defaulted:
9606
+ * a Zod default does NOT run on the addon→addon cap path, so a persisted
9607
+ * rule authored before this field simply carries none — and the engine
9608
+ * reads absent as `shared`, the pre-existing behaviour.
9609
+ */
9610
+ granularity: NcThrottleGranularitySchema.optional()
9471
9611
  });
9472
9612
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
9473
9613
  var NcRuleInputSchema = object({
@@ -9476,7 +9616,19 @@ var NcRuleInputSchema = object({
9476
9616
  delivery: NcDeliverySchema,
9477
9617
  conditions: NcConditionsSchema.default({}),
9478
9618
  schedule: NcScheduleSchema.optional(),
9479
- targets: array(NcRuleTargetSchema).min(1),
9619
+ /** May be empty when `targetUsers` addresses at least one user — the
9620
+ * "at least one addressee" invariant is enforced by the provider, because
9621
+ * a cross-field refine here would break `NcRulePatchSchema.partial()`. */
9622
+ targets: array(NcRuleTargetSchema),
9623
+ /**
9624
+ * USERS this rule addresses in addition to `targets` (Phase 4). At fire
9625
+ * time each user fans out to the personal targets they own
9626
+ * (`config.ownerUserId`), filtered by that user's `allowedDevices` for the
9627
+ * firing camera — a user is never notified about a device they cannot open.
9628
+ * Per-user opt-outs (`disabledTargetIds`) still apply to the fanned-out
9629
+ * targets.
9630
+ */
9631
+ targetUsers: array(string()).optional(),
9480
9632
  media: NcMediaPolicySchema.default({ attach: "best" }),
9481
9633
  throttle: NcThrottleSchema.default({
9482
9634
  cooldownSec: 60,
@@ -9563,6 +9715,7 @@ var NcConditionDescriptorSchema = object({
9563
9715
  "schedule",
9564
9716
  "plateMatcher",
9565
9717
  "packagePhase",
9718
+ "crossingSelect",
9566
9719
  "polygonDraw",
9567
9720
  "occupancy"
9568
9721
  ]),
@@ -9689,7 +9842,10 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
9689
9842
  }), object({ results: array(NcTestResultSchema) }), {
9690
9843
  kind: "mutation",
9691
9844
  auth: "admin"
9692
- }), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9845
+ }), method(object({}), object({
9846
+ catalog: array(NcConditionDescriptorSchema),
9847
+ taxonomy: NcTaxonomySchema.optional()
9848
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9693
9849
  /**
9694
9850
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
9695
9851
  *
@@ -10698,6 +10854,28 @@ method(object({
10698
10854
  }), object({ success: literal(true) }), {
10699
10855
  kind: "mutation",
10700
10856
  auth: "admin"
10857
+ }), method(object({
10858
+ deviceId: number(),
10859
+ /** Absent = the LOWEST assigned profile — a notification attachment is
10860
+ * watched on a phone, and the cheap rendition is the right default. */
10861
+ profile: CamProfileSchema.optional(),
10862
+ aroundMs: number(),
10863
+ preRollSec: number().min(0).max(20).default(3),
10864
+ postRollSec: number().min(0).max(20).default(5),
10865
+ format: _enum(["gif", "mp4"]).default("gif"),
10866
+ maxWidth: number().int().min(120).max(1920).default(480),
10867
+ /** GIF only — MP4 keeps the source cadence. */
10868
+ fps: number().int().min(1).max(15).default(5)
10869
+ }), object({
10870
+ base64: string(),
10871
+ mime: string(),
10872
+ bytes: number().int(),
10873
+ /** The profile actually rendered (what the default resolved to). */
10874
+ profile: CamProfileSchema,
10875
+ durationMs: number()
10876
+ }), {
10877
+ kind: "mutation",
10878
+ auth: "admin"
10701
10879
  }), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string() }), BrokerStatsSchema), method(object({ brokerId: string() }), object({
10702
10880
  probed: boolean(),
10703
10881
  summary: string()
@@ -13828,6 +14006,18 @@ var motionCapability = {
13828
14006
  name: "motion",
13829
14007
  scope: "device",
13830
14008
  mode: "singleton",
14009
+ /**
14010
+ * Providers register per-device natives via `ctx.registerNativeCap`
14011
+ * (Hikvision/Reolink/Amcrest/Wyze/HA/Homematic/Alexa/Matter) — there is
14012
+ * NO system singleton provider. Without this flag `resolveCapMount`
14013
+ * derived `{ kind: 'singleton' }`, so `motion.getStatus`/`isDetected`
14014
+ * resolved via `registry.getSingleton('motion')` (always null) and every
14015
+ * call 412'd "provider not available" while bindings listed a live
14016
+ * `motion` native (2026-08-02). The flag routes the router through
14017
+ * `requireDeviceScoped` → `getProviderForDevice`, like `motion-trigger`,
14018
+ * `snapshot` and every other per-device native cap.
14019
+ */
14020
+ deviceNative: true,
13831
14021
  deviceTypes: [DeviceType.Camera, DeviceType.Sensor],
13832
14022
  methods: {
13833
14023
  /**
@@ -18760,7 +18950,10 @@ method(object({
18760
18950
  }), method(object({
18761
18951
  deviceId: number(),
18762
18952
  caps: array(string()).readonly().optional()
18763
- }), record(string(), unknown().nullable()));
18953
+ }), record(string(), unknown().nullable())), method(object({
18954
+ deviceIds: array(number()).readonly(),
18955
+ caps: array(string()).readonly().optional()
18956
+ }), record(string(), record(string(), unknown().nullable())));
18764
18957
  method(object({ deviceId: number() }), record(string(), record(string(), unknown()))), method(object({
18765
18958
  deviceId: number(),
18766
18959
  capName: string()
@@ -19691,6 +19884,36 @@ var TargetKindSchema = object({
19691
19884
  icon: string(),
19692
19885
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
19693
19886
  addonId: string(),
19887
+ /**
19888
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
19889
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
19890
+ * when the addon bundles no icon for that kind — the client then falls back
19891
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
19892
+ *
19893
+ * Root-relative on purpose: it resolves against whatever origin serves a web
19894
+ * client, and a native client joins it onto its own hub base.
19895
+ *
19896
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
19897
+ * field that survived only because the runtime cap-router forwards provider
19898
+ * output verbatim — so every consumer had to re-declare it by hand to stop
19899
+ * its own Zod parse from stripping it, and the whole arrangement would have
19900
+ * broken silently the moment output validation was tightened anywhere.
19901
+ */
19902
+ iconUrl: string().optional(),
19903
+ /**
19904
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
19905
+ *
19906
+ * The server knows this and therefore says it, because the client cannot
19907
+ * safely guess: a React-Native client renders SVG and raster through two
19908
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
19909
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
19910
+ * placeholder glyph for every vector icon while the web build looked fine.
19911
+ *
19912
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
19913
+ * not been updated — a client that cannot determine the type should prefer
19914
+ * its raster path, which is the safe default for an unknown image.
19915
+ */
19916
+ iconMediaType: string().optional(),
19694
19917
  configSchema: ConfigSchemaPassthrough,
19695
19918
  supportsDiscovery: boolean(),
19696
19919
  caps: TargetKindCapsSchema
@@ -20138,6 +20361,29 @@ var MotionEventSchema = object({
20138
20361
  * Absent on legacy rows ⇒ treat as `pipeline`.
20139
20362
  */
20140
20363
  var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
20364
+ /**
20365
+ * The confirmed zone crossing that produced an object event. Present ONLY on
20366
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
20367
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
20368
+ * appearance event carry none, so a rule asking for a direction fails closed
20369
+ * on them.
20370
+ *
20371
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
20372
+ * into its own event, so a frame in which a track enters A while leaving B
20373
+ * produces two events with two directions — never one ambiguous row.
20374
+ *
20375
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
20376
+ * membership the box has NOW, and by definition it no longer contains the zone
20377
+ * that was just left. Without the id here, a zone-scoped rule could never match
20378
+ * the exit it asked for.
20379
+ */
20380
+ var ZoneCrossingSchema = object({
20381
+ direction: _enum(["enter", "exit"]),
20382
+ /** Admin zone id crossed. */
20383
+ zoneId: string(),
20384
+ /** Zone display name at crossing time (falls back to the id). */
20385
+ zoneName: string().optional()
20386
+ });
20141
20387
  var ObjectEventSchema = object({
20142
20388
  ...BaseEventFields,
20143
20389
  kind: literal("object"),
@@ -20164,6 +20410,12 @@ var ObjectEventSchema = object({
20164
20410
  zones: array(string()).readonly().optional(),
20165
20411
  /** Omitted in slim projection. */
20166
20412
  state: TrackStateSchema.optional(),
20413
+ /**
20414
+ * The zone crossing this event IS, when it is one. Absent on every other
20415
+ * event kind (movement state, appearance, package) — see
20416
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
20417
+ */
20418
+ zoneCrossing: ZoneCrossingSchema.optional(),
20167
20419
  /** Detection-frame dimensions in pixels — let consumers normalize the
20168
20420
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
20169
20421
  frameWidth: number().optional(),
@@ -20422,6 +20674,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20422
20674
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
20423
20675
  kind: "mutation",
20424
20676
  auth: "admin"
20677
+ }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
20678
+ kind: "mutation",
20679
+ auth: "admin"
20680
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
20681
+ kind: "query",
20682
+ auth: "admin"
20683
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
20684
+ kind: "mutation",
20685
+ auth: "admin"
20425
20686
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
20426
20687
  kind: "query",
20427
20688
  auth: "admin"
@@ -22901,6 +23162,17 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
22901
23162
  */
22902
23163
  priority: number()
22903
23164
  })).readonly() });
23165
+ /**
23166
+ * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
23167
+ * AUTO (resolved from the candidate ranking at send time); `resolved` reports
23168
+ * what AUTO currently picks, so the UI can show the effective value either way.
23169
+ */
23170
+ var NotificationEndpointSchema = object({
23171
+ /** The operator's explicit choice, or null for AUTO. */
23172
+ baseUrl: string().nullable(),
23173
+ /** What the ranking currently resolves to (null when nothing is reachable). */
23174
+ resolved: string().nullable()
23175
+ });
22904
23176
  var AllowedAddressesSchema = object({
22905
23177
  /**
22906
23178
  * Allowlist of interface addresses operators have explicitly opted
@@ -22923,7 +23195,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
22923
23195
  * to avoid mixed-content blocks in the browser. The public
22924
23196
  * tunnel always emits `https://` regardless. */
22925
23197
  scheme: _enum(["http", "https"]).optional()
22926
- }), GetConnectionEndpointsResultSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
23198
+ }), GetConnectionEndpointsResultSchema), method(_void(), NotificationEndpointSchema), method(object({ baseUrl: string().nullable() }), NotificationEndpointSchema, { kind: "mutation" }), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
22927
23199
  /**
22928
23200
  * mesh-network — collection cap for mesh-VPN providers.
22929
23201
  *
@@ -23722,7 +23994,12 @@ var RecordingDeviceUsageSchema = object({
23722
23994
  var RecordingLocationUsageSchema = object({
23723
23995
  /** StorageLocation id; null for the legacy/degraded single-root fallback. */
23724
23996
  locationId: string().nullable(),
23725
- /** Bytes of recordings stored on this location. */
23997
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
23998
+ * is emitted per physical disk (2026-07-29): two locations on one root
23999
+ * previously rendered as two identical "disks" with a nonsensical used
24000
+ * split — hydrate attribution across aliases is arbitrary by nature. */
24001
+ locationIds: array(string()).optional(),
24002
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). */
23726
24003
  usedBytes: number(),
23727
24004
  /** Free bytes on the location's volume; null when capacity is unknown (remote). */
23728
24005
  availableBytes: number().nullable(),
@@ -23834,6 +24111,44 @@ method(object({
23834
24111
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
23835
24112
  kind: "query",
23836
24113
  auth: "admin"
24114
+ }), method(object({
24115
+ deviceId: number(),
24116
+ aroundMs: number(),
24117
+ preRollSec: number().min(0).max(30).default(2),
24118
+ postRollSec: number().min(0).max(30).default(5),
24119
+ maxWidth: number().int().min(120).max(1280).default(480),
24120
+ fps: number().int().min(1).max(15).default(5)
24121
+ }), object({
24122
+ gifBase64: string(),
24123
+ fromMs: number(),
24124
+ toMs: number()
24125
+ }), {
24126
+ kind: "mutation",
24127
+ auth: "admin"
24128
+ }), method(object({
24129
+ deviceId: number(),
24130
+ aroundMs: number(),
24131
+ preRollSec: number().min(0).max(30).default(3),
24132
+ postRollSec: number().min(0).max(30).default(7),
24133
+ maxWidth: number().int().min(160).max(1920).default(640)
24134
+ }), object({
24135
+ clipBase64: string(),
24136
+ mime: string(),
24137
+ fromMs: number(),
24138
+ toMs: number(),
24139
+ bytes: number().int()
24140
+ }), {
24141
+ kind: "mutation",
24142
+ auth: "admin"
24143
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
24144
+ kind: "mutation",
24145
+ auth: "admin"
24146
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
24147
+ kind: "query",
24148
+ auth: "admin"
24149
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
24150
+ kind: "mutation",
24151
+ auth: "admin"
23837
24152
  });
23838
24153
  /**
23839
24154
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -25425,6 +25740,12 @@ Object.freeze({
25425
25740
  addonId: null,
25426
25741
  access: "view"
25427
25742
  },
25743
+ "deviceManager.getDeviceStatusAggregateBatch": {
25744
+ capName: "device-manager",
25745
+ capScope: "system",
25746
+ addonId: null,
25747
+ access: "view"
25748
+ },
25428
25749
  "deviceManager.getLinkedDevices": {
25429
25750
  capName: "device-manager",
25430
25751
  capScope: "system",
@@ -26319,6 +26640,12 @@ Object.freeze({
26319
26640
  addonId: null,
26320
26641
  access: "view"
26321
26642
  },
26643
+ "localNetwork.getNotificationEndpoint": {
26644
+ capName: "local-network",
26645
+ capScope: "system",
26646
+ addonId: null,
26647
+ access: "view"
26648
+ },
26322
26649
  "localNetwork.getPreferred": {
26323
26650
  capName: "local-network",
26324
26651
  capScope: "system",
@@ -26343,6 +26670,12 @@ Object.freeze({
26343
26670
  addonId: null,
26344
26671
  access: "create"
26345
26672
  },
26673
+ "localNetwork.setNotificationEndpoint": {
26674
+ capName: "local-network",
26675
+ capScope: "system",
26676
+ addonId: null,
26677
+ access: "create"
26678
+ },
26346
26679
  "lockControl.lock": {
26347
26680
  capName: "lock-control",
26348
26681
  capScope: "device",
@@ -26985,6 +27318,12 @@ Object.freeze({
26985
27318
  addonId: null,
26986
27319
  access: "create"
26987
27320
  },
27321
+ "pipelineAnalytics.cancelMediaRelocate": {
27322
+ capName: "pipeline-analytics",
27323
+ capScope: "device",
27324
+ addonId: null,
27325
+ access: "create"
27326
+ },
26988
27327
  "pipelineAnalytics.clearTracks": {
26989
27328
  capName: "pipeline-analytics",
26990
27329
  capScope: "device",
@@ -27039,6 +27378,12 @@ Object.freeze({
27039
27378
  addonId: null,
27040
27379
  access: "view"
27041
27380
  },
27381
+ "pipelineAnalytics.getMediaRelocateStatus": {
27382
+ capName: "pipeline-analytics",
27383
+ capScope: "device",
27384
+ addonId: null,
27385
+ access: "view"
27386
+ },
27042
27387
  "pipelineAnalytics.getMotionEvents": {
27043
27388
  capName: "pipeline-analytics",
27044
27389
  capScope: "device",
@@ -27111,6 +27456,12 @@ Object.freeze({
27111
27456
  addonId: null,
27112
27457
  access: "create"
27113
27458
  },
27459
+ "pipelineAnalytics.relocateMedia": {
27460
+ capName: "pipeline-analytics",
27461
+ capScope: "device",
27462
+ addonId: null,
27463
+ access: "create"
27464
+ },
27114
27465
  "pipelineAnalytics.searchObjectEvents": {
27115
27466
  capName: "pipeline-analytics",
27116
27467
  capScope: "device",
@@ -27873,6 +28224,12 @@ Object.freeze({
27873
28224
  addonId: null,
27874
28225
  access: "create"
27875
28226
  },
28227
+ "recording.cancelRelocate": {
28228
+ capName: "recording",
28229
+ capScope: "system",
28230
+ addonId: null,
28231
+ access: "create"
28232
+ },
27876
28233
  "recording.deleteFootprint": {
27877
28234
  capName: "recording",
27878
28235
  capScope: "system",
@@ -27903,6 +28260,12 @@ Object.freeze({
27903
28260
  addonId: null,
27904
28261
  access: "view"
27905
28262
  },
28263
+ "recording.getRelocateStatus": {
28264
+ capName: "recording",
28265
+ capScope: "system",
28266
+ addonId: null,
28267
+ access: "view"
28268
+ },
27906
28269
  "recording.getStorageUsage": {
27907
28270
  capName: "recording",
27908
28271
  capScope: "system",
@@ -27933,6 +28296,24 @@ Object.freeze({
27933
28296
  addonId: null,
27934
28297
  access: "view"
27935
28298
  },
28299
+ "recording.relocateFootage": {
28300
+ capName: "recording",
28301
+ capScope: "system",
28302
+ addonId: null,
28303
+ access: "create"
28304
+ },
28305
+ "recording.renderClip": {
28306
+ capName: "recording",
28307
+ capScope: "system",
28308
+ addonId: null,
28309
+ access: "create"
28310
+ },
28311
+ "recording.renderGif": {
28312
+ capName: "recording",
28313
+ capScope: "system",
28314
+ addonId: null,
28315
+ access: "create"
28316
+ },
27936
28317
  "recording.rescanStorage": {
27937
28318
  capName: "recording",
27938
28319
  capScope: "system",
@@ -28527,6 +28908,12 @@ Object.freeze({
28527
28908
  addonId: null,
28528
28909
  access: "create"
28529
28910
  },
28911
+ "streamBroker.renderPreBufferClip": {
28912
+ capName: "stream-broker",
28913
+ capScope: "system",
28914
+ addonId: null,
28915
+ access: "create"
28916
+ },
28530
28917
  "streamBroker.restartProfile": {
28531
28918
  capName: "stream-broker",
28532
28919
  capScope: "system",