@camstack/addon-provider-homematic 1.2.6 → 1.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.mjs CHANGED
@@ -9,7 +9,7 @@ import { join } from "path";
9
9
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
10
10
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
11
11
  //#endregion
12
- //#region ../types/dist/event-category-BLcNejAE.mjs
12
+ //#region ../types/dist/event-category-Bz24uP1U.mjs
13
13
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
14
14
  EventCategory["SystemBoot"] = "system.boot";
15
15
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -280,6 +280,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
280
280
  */
281
281
  EventCategory["DeviceStateChanged"] = "device.state-changed";
282
282
  /**
283
+ * Frame occupancy for a camera CHANGED — a tracked object was gained or
284
+ * lost. Carries `{ deviceId, totalObjects, byClass, zones }`.
285
+ *
286
+ * Emitted only on a change, so a steady scene is silent. It exists so a
287
+ * client can stop polling `zoneAnalytics.getCurrentSnapshot`: that was the
288
+ * one live badge with no push signal at all, and it cost a request every
289
+ * four seconds per visible camera.
290
+ *
291
+ * Like every event it is telemetry and may be dropped ([D8]) — a consumer
292
+ * keeps a slow reconcile rather than trusting it alone.
293
+ */
294
+ EventCategory["ZoneAnalyticsOccupancyChanged"] = "zone-analytics.occupancy-changed";
295
+ /**
283
296
  * Cap event fired by every device that registers the `battery`
284
297
  * capability. Mirrors the cap definition's `onStatusChanged`. Carries
285
298
  * `{ deviceId, status: BatteryStatus }`. Subscribers (alert center,
@@ -7223,35 +7236,22 @@ var ConvertResultSchema = object({
7223
7236
  */
7224
7237
  var RecordingWeekdaySchema = number().int().min(0).max(6);
7225
7238
  var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
7226
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
7227
- kind: literal("timeOfDay"),
7228
- start: string().regex(HHMM),
7229
- end: string().regex(HHMM),
7230
- /** Restrict to these weekdays; omit = every day. */
7231
- days: array(RecordingWeekdaySchema).optional()
7232
- })]);
7233
- var RecordingModeSchema = _enum([
7234
- "continuous",
7235
- "onMotion",
7236
- "onAudioThreshold"
7237
- ]);
7238
7239
  /**
7239
- * First-class, authoritative per-camera storage mode — the explicit choice the
7240
- * UI reads directly (never inferred from `rules`):
7241
- * - `off` — not recording.
7242
- * - `events` — record only around triggers (motion / audio threshold),
7243
- * with pre/post-buffer.
7244
- * - `continuous` — record 24/7 within the schedule.
7240
+ * DERIVED per-camera storage summary — the single field cheap consumers read
7241
+ * (the viewer's status dot, the camera list) instead of walking `bands`:
7242
+ * - `off` — no band covers the camera (or it is disabled).
7243
+ * - `events` — every band records around triggers only.
7244
+ * - `continuous` — at least one band records continuously.
7245
7245
  *
7246
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
7247
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
7246
+ * NEVER authored: the recorder stamps it from the authoritative `bands` on
7247
+ * every save (`activeModeForConfig`). Writing it has no effect.
7248
7248
  */
7249
7249
  var RecordingStorageModeSchema = _enum([
7250
7250
  "off",
7251
7251
  "events",
7252
7252
  "continuous"
7253
7253
  ]);
7254
- /** Which detectors trigger an `events`-mode recording. */
7254
+ /** Which detectors trigger an `events`-mode band. */
7255
7255
  var RecordingTriggersSchema = object({
7256
7256
  motion: boolean().optional(),
7257
7257
  audioThresholdDbfs: number().optional()
@@ -7287,18 +7287,6 @@ var RecordingBandSchema = object({
7287
7287
  preBufferSec: number().min(0).optional(),
7288
7288
  postBufferSec: number().min(0).optional()
7289
7289
  });
7290
- var RecordingRuleSchema = object({
7291
- schedule: RecordingScheduleSchema,
7292
- mode: RecordingModeSchema,
7293
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
7294
- preBufferSec: number().min(0).default(0),
7295
- /** Keep recording until this many seconds after the last trigger. */
7296
- postBufferSec: number().min(0).default(0),
7297
- /** Each new trigger restarts the post-buffer window. */
7298
- resetTimeoutOnNewEvent: boolean().default(true),
7299
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
7300
- thresholdDbfs: number().optional()
7301
- });
7302
7290
  /**
7303
7291
  * Per-device retention overrides. Every field is optional; an unset or `0`
7304
7292
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7332,40 +7320,28 @@ var ScrubThumbnailPresetSchema = _enum([
7332
7320
  /**
7333
7321
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7334
7322
  *
7335
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
7336
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
7337
- * only for transition + migration (`migrateRulesToMode`); the policy engine
7338
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
7323
+ * `bands` is the ONLY authored recording intent: what to record, when, and on
7324
+ * which trigger. `mode` is a derived summary the recorder stamps on save; every
7325
+ * other field is a storage knob (profiles, segment length, retention, scrub).
7326
+ *
7327
+ * STRICT on purpose: the legacy authoring surface (`schedule`/`schedules`/
7328
+ * `triggers`/`preBufferSec`/`postBufferSec`/`rules`) was retired 2026-07-30.
7329
+ * A stale caller must fail loudly — silently stripping its legacy intent would
7330
+ * persist a band-less config, i.e. silently stop recording the camera.
7339
7331
  */
7340
7332
  var RecordingConfigSchema = object({
7341
7333
  enabled: boolean(),
7342
- /** Authoritative storage mode. Absent on legacy targets → derived once via
7343
- * `migrateRulesToMode`, then persisted. */
7334
+ /** DERIVED summary of `bands`, stamped by the recorder on every save.
7335
+ * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7344
7336
  mode: RecordingStorageModeSchema.optional(),
7345
7337
  profiles: array(CamProfileSchema).optional(),
7346
7338
  segmentSeconds: number().int().positive().optional(),
7347
- /** Shared recording time-bands for `events` & `continuous` — record only when
7348
- * the wall-clock falls inside one of these windows. Omit or empty = always.
7349
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
7350
- schedules: array(RecordingScheduleSchema).optional(),
7351
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
7352
- * normalized into `schedules` on read and never written going forward. (Not
7353
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
7354
- schedule: RecordingScheduleSchema.optional(),
7355
- /** `events`-mode only — which detectors trigger a recording. */
7356
- triggers: RecordingTriggersSchema.optional(),
7357
- /** `events`-mode only — seconds retained before / after a trigger. */
7358
- preBufferSec: number().min(0).optional(),
7359
- postBufferSec: number().min(0).optional(),
7360
- /** DEPRECATED authoring input; retained for migration/transition. */
7361
- rules: array(RecordingRuleSchema).optional(),
7362
7339
  /**
7363
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
7364
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
7365
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
7366
- * derived into bands once via `migrateConfigToBands`.
7340
+ * AUTHORITATIVE mode-per-band recording model — the single source of truth
7341
+ * the recorder's band engine consumes. An empty array = record nothing;
7342
+ * "off" is the absence of a covering band, never a band value.
7367
7343
  */
7368
- bands: array(RecordingBandSchema).optional(),
7344
+ bands: array(RecordingBandSchema).default([]),
7369
7345
  retention: RecordingRetentionSchema.optional(),
7370
7346
  /**
7371
7347
  * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
@@ -7373,8 +7349,15 @@ var RecordingConfigSchema = object({
7373
7349
  * windows only — existing sheets are immutable, and each window's index
7374
7350
  * carries its own tile dims so mixed-preset history renders correctly.
7375
7351
  */
7376
- scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7377
- });
7352
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional(),
7353
+ /**
7354
+ * OPT-IN thumbnail-strip generation for this camera: every keyframe of the
7355
+ * low recording saved as a JPEG (the fast-drag scrub depth), a derived
7356
+ * cache that eviction reclaims with the footage. Absent/false = no strips
7357
+ * are written and scrub reads exact keyframes at every velocity.
7358
+ */
7359
+ stripsEnabled: boolean().optional()
7360
+ }).strict();
7378
7361
  /**
7379
7362
  * Ops-log — the durable, append-only operations audit shared by the
7380
7363
  * recordings and events management surfaces.
@@ -7393,7 +7376,8 @@ var OpsLogOpSchema = _enum([
7393
7376
  "prune",
7394
7377
  "manual-delete",
7395
7378
  "rescan",
7396
- "retention-run"
7379
+ "retention-run",
7380
+ "relocate"
7397
7381
  ]);
7398
7382
  /** Why the operation ran. */
7399
7383
  var OpsLogReasonSchema = _enum([
@@ -7432,6 +7416,55 @@ var OpsLogQueryInputSchema = object({
7432
7416
  limit: number().int().min(1).max(1e3).optional()
7433
7417
  });
7434
7418
  /**
7419
+ * Entity-relocation job state (storage entity-routing spec, Phase 4).
7420
+ *
7421
+ * One shape shared by the recorder's `relocateFootage` (segments + strips) and
7422
+ * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7423
+ * page renders both movers with one component. Jobs are in-RAM (a restart
7424
+ * forgets them — re-running is safe by construction: copy-if-absent, delete
7425
+ * after verify) and each completed/failed run also lands one durable ops-log
7426
+ * row on the owning addon's surface.
7427
+ */
7428
+ var RelocateJobStateSchema = _enum([
7429
+ "running",
7430
+ "done",
7431
+ "failed",
7432
+ "cancelled"
7433
+ ]);
7434
+ var RelocateJobSchema = object({
7435
+ jobId: string(),
7436
+ state: RelocateJobStateSchema,
7437
+ /** Source location — for media relocation this is informational ('*': rows
7438
+ * move from wherever they are to the target). */
7439
+ fromLocationId: string(),
7440
+ toLocationId: string(),
7441
+ /** Scoped device, or null = every device. */
7442
+ deviceId: number().nullable(),
7443
+ /** What the job moves (owner-addon specific: segments/strips or media). */
7444
+ entities: array(string()),
7445
+ filesMoved: number().int(),
7446
+ bytesMoved: number().int(),
7447
+ /** Total files discovered up front; null while (or when) unknown. */
7448
+ filesTotal: number().int().nullable(),
7449
+ startedAt: number(),
7450
+ finishedAt: number().nullable(),
7451
+ error: string().nullable()
7452
+ });
7453
+ var RelocateFootageInputSchema = object({
7454
+ deviceId: number().optional(),
7455
+ fromLocationId: string(),
7456
+ toLocationId: string(),
7457
+ entities: array(_enum(["segments", "strips"])).optional(),
7458
+ /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7459
+ * never allowed to starve live writers. */
7460
+ throttleMbps: number().min(1).max(1e3).optional()
7461
+ });
7462
+ var RelocateMediaInputSchema = object({
7463
+ deviceId: number().optional(),
7464
+ toLocationId: string(),
7465
+ throttleMbps: number().min(1).max(1e3).optional()
7466
+ });
7467
+ /**
7435
7468
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7436
7469
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7437
7470
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -7481,6 +7514,13 @@ var StorageLocationSchema = object({
7481
7514
  nodeId: string().optional(),
7482
7515
  isDefault: boolean().default(false),
7483
7516
  isSystem: boolean().default(false),
7517
+ /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7518
+ * for node-local locations it can reach) — never persisted, absent when the
7519
+ * volume is remote/unreachable. The single capacity truth every UI reads. */
7520
+ capacity: object({
7521
+ totalBytes: number(),
7522
+ availableBytes: number()
7523
+ }).nullable().optional(),
7484
7524
  createdAt: number(),
7485
7525
  updatedAt: number()
7486
7526
  });
@@ -8248,7 +8288,8 @@ var NcTaxonomyEntrySchema = object({
8248
8288
  /** Macro/category parent for grouping ('car' → 'vehicle'); null for a top. */
8249
8289
  parentKind: string().nullable()
8250
8290
  });
8251
- object({
8291
+ /** The complete NC picker taxonomy — three grouped buckets. */
8292
+ var NcTaxonomySchema = object({
8252
8293
  videoClasses: array(NcTaxonomyEntrySchema),
8253
8294
  audioKinds: array(NcTaxonomyEntrySchema),
8254
8295
  labels: array(NcTaxonomyEntrySchema)
@@ -9151,6 +9192,7 @@ function shallowEqual(a, b) {
9151
9192
  for (const k of ak) if (a[k] !== b[k]) return false;
9152
9193
  return true;
9153
9194
  }
9195
+ new Set(["devices", "classes"]);
9154
9196
  /**
9155
9197
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
9156
9198
  * motion-zones, and the detection zones/lines editor all speak this one
@@ -9309,6 +9351,29 @@ var NcOccupancyConditionSchema = object({
9309
9351
  count: number().int().min(0).default(1),
9310
9352
  sustainSeconds: number().int().min(0).max(3600).default(15)
9311
9353
  });
9354
+ /**
9355
+ * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
9356
+ *
9357
+ * The values are not symmetric, and deliberately so — the absent value has to
9358
+ * mean exactly what every rule authored before this condition existed already
9359
+ * does:
9360
+ * - `enter` — entries and every NON-crossing record (movement state,
9361
+ * package, sensor). Exits are rejected. **This is the absent behaviour**:
9362
+ * an operator who never asked for exits must not start receiving them.
9363
+ * - `exit` — ONLY an exit crossing. A record that is not a crossing at all
9364
+ * fails closed, because "the car left the drive" is a question about a
9365
+ * boundary, not about a detection.
9366
+ * - `any` — no direction filter; entries, exits and non-crossings alike.
9367
+ *
9368
+ * A rule asking for a direction should normally also scope `zones`, which the
9369
+ * engine evaluates against the crossed zone as well as the current membership
9370
+ * (an exit's membership no longer contains the zone it just left).
9371
+ */
9372
+ var NcCrossingSchema = _enum([
9373
+ "enter",
9374
+ "exit",
9375
+ "any"
9376
+ ]);
9312
9377
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
9313
9378
  var NcZoneConditionSchema = object({
9314
9379
  ids: array(string().min(1)).min(1),
@@ -9333,6 +9398,13 @@ var NcConditionsSchema = object({
9333
9398
  /** Veto zones — any hit fails the rule. */
9334
9399
  zonesExclude: array(string().min(1)).optional(),
9335
9400
  /**
9401
+ * Zone-crossing direction. IMMEDIATE only — a crossing is a per-event fact
9402
+ * and a closed track carries none, so a `track-end` rule asking for one
9403
+ * fails closed (use `zones`, which tests `zonesVisited`). ABSENT = `enter`,
9404
+ * which is exactly today's behaviour. See {@link NcCrossingSchema}.
9405
+ */
9406
+ crossing: NcCrossingSchema.optional(),
9407
+ /**
9336
9408
  * Exact (case-insensitive) match on the record's collapsed `label`
9337
9409
  * (identity name / plate text / subclass).
9338
9410
  */
@@ -9467,17 +9539,85 @@ var NcRuleTargetSchema = object({
9467
9539
  * - `keyFrame` — the clean scene frame (no subject box).
9468
9540
  * - `none` — no attachment.
9469
9541
  */
9470
- var NcMediaPolicySchema = object({ attach: _enum([
9471
- "best",
9472
- "best-matching",
9473
- "keyFrame",
9474
- "none"
9475
- ]).default("best") });
9542
+ /**
9543
+ * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
9544
+ * conflate it with the selection strategy and betray the request: asking for
9545
+ * the clean scene frame on an object-event owner used to start at
9546
+ * `fullFrameBoxed`, i.e. the annotated frame (2026-07-30).
9547
+ * - `cropped` — the subject, tight. What "who is at the door" wants.
9548
+ * - `full` — the clean scene, no annotation. What "what is going on" wants.
9549
+ * - `boxed` — the scene WITH the detection boxes drawn, for verifying what
9550
+ * the pipeline actually saw.
9551
+ */
9552
+ var NcMediaFrameSchema = _enum([
9553
+ "cropped",
9554
+ "full",
9555
+ "boxed"
9556
+ ]);
9557
+ var NcMediaPolicySchema = object({
9558
+ attach: _enum([
9559
+ "best",
9560
+ "best-matching",
9561
+ "keyFrame",
9562
+ "none"
9563
+ ]).default("best"),
9564
+ /** What the still shows. Absent = `cropped` (the historical `best` shape). */
9565
+ frame: NcMediaFrameSchema.optional(),
9566
+ /** Crop the attached still to the rule's condition-zone bbox (padded) —
9567
+ * "show me the ZONE", not the whole scene or the subject crop. */
9568
+ zoneCrop: boolean().optional(),
9569
+ /**
9570
+ * Also attach a short GIF cut from the stream broker's clip ring around the
9571
+ * event — NOT from the recording, so the camera does not have to be
9572
+ * recording, and the window sits AROUND the moment instead of a segment
9573
+ * behind it. Fail-closed: a window the ring does not cover contributes no
9574
+ * gif, never a failed notification.
9575
+ */
9576
+ gif: boolean().optional(),
9577
+ /**
9578
+ * Also attach a short MP4 CLIP of the same cut. Same source and the same
9579
+ * fail-closed rule as `gif`. Prefer it where the backend takes video
9580
+ * (telegram, discord, zentik, webhook); backends that do not are handled by
9581
+ * the degrade engine, which drops the video and keeps the still.
9582
+ */
9583
+ clip: boolean().optional(),
9584
+ /** Seconds of footage BEFORE / AFTER the event instant. Defaults 3 / 7. */
9585
+ clipPreRollSec: number().int().min(0).max(30).optional(),
9586
+ clipPostRollSec: number().int().min(0).max(30).optional(),
9587
+ /**
9588
+ * Which stream profile the footage is cut from. Absent = the CHEAPEST
9589
+ * assigned profile: a notification is watched on a phone, so the 4K
9590
+ * rendition would burn CPU to produce a file the client downscales anyway.
9591
+ * A profile that is not assigned falls back to the cheapest, and the render
9592
+ * reports which one actually ran.
9593
+ */
9594
+ profile: CamProfileSchema.optional()
9595
+ });
9596
+ /**
9597
+ * Cooldown GRANULARITY over the subject's class — how much a fired
9598
+ * notification suppresses.
9599
+ * - `shared` (default, and the absent value) — one window for the whole
9600
+ * rule/scope: a cat silences the next dog for `cooldownSec`.
9601
+ * - `per-class` — an independent window per detected class, so cat→dog fires
9602
+ * at once and cat→cat still waits.
9603
+ *
9604
+ * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
9605
+ * must not be swallowed by a bark's window (the precedent this generalizes —
9606
+ * see `cooldownKey` in the rule engine).
9607
+ */
9608
+ var NcThrottleGranularitySchema = _enum(["shared", "per-class"]);
9476
9609
  /** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
9477
9610
  var NcThrottleSchema = object({
9478
9611
  cooldownSec: number().int().min(0).max(86400).default(60),
9479
9612
  /** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
9480
- scope: _enum(["rule", "rule-device"]).default("rule-device")
9613
+ scope: _enum(["rule", "rule-device"]).default("rule-device"),
9614
+ /**
9615
+ * Class granularity of the cooldown key. Optional rather than defaulted:
9616
+ * a Zod default does NOT run on the addon→addon cap path, so a persisted
9617
+ * rule authored before this field simply carries none — and the engine
9618
+ * reads absent as `shared`, the pre-existing behaviour.
9619
+ */
9620
+ granularity: NcThrottleGranularitySchema.optional()
9481
9621
  });
9482
9622
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
9483
9623
  var NcRuleInputSchema = object({
@@ -9486,7 +9626,19 @@ var NcRuleInputSchema = object({
9486
9626
  delivery: NcDeliverySchema,
9487
9627
  conditions: NcConditionsSchema.default({}),
9488
9628
  schedule: NcScheduleSchema.optional(),
9489
- targets: array(NcRuleTargetSchema).min(1),
9629
+ /** May be empty when `targetUsers` addresses at least one user — the
9630
+ * "at least one addressee" invariant is enforced by the provider, because
9631
+ * a cross-field refine here would break `NcRulePatchSchema.partial()`. */
9632
+ targets: array(NcRuleTargetSchema),
9633
+ /**
9634
+ * USERS this rule addresses in addition to `targets` (Phase 4). At fire
9635
+ * time each user fans out to the personal targets they own
9636
+ * (`config.ownerUserId`), filtered by that user's `allowedDevices` for the
9637
+ * firing camera — a user is never notified about a device they cannot open.
9638
+ * Per-user opt-outs (`disabledTargetIds`) still apply to the fanned-out
9639
+ * targets.
9640
+ */
9641
+ targetUsers: array(string()).optional(),
9490
9642
  media: NcMediaPolicySchema.default({ attach: "best" }),
9491
9643
  throttle: NcThrottleSchema.default({
9492
9644
  cooldownSec: 60,
@@ -9573,6 +9725,7 @@ var NcConditionDescriptorSchema = object({
9573
9725
  "schedule",
9574
9726
  "plateMatcher",
9575
9727
  "packagePhase",
9728
+ "crossingSelect",
9576
9729
  "polygonDraw",
9577
9730
  "occupancy"
9578
9731
  ]),
@@ -9699,7 +9852,10 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
9699
9852
  }), object({ results: array(NcTestResultSchema) }), {
9700
9853
  kind: "mutation",
9701
9854
  auth: "admin"
9702
- }), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9855
+ }), method(object({}), object({
9856
+ catalog: array(NcConditionDescriptorSchema),
9857
+ taxonomy: NcTaxonomySchema.optional()
9858
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9703
9859
  /**
9704
9860
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
9705
9861
  *
@@ -10708,6 +10864,28 @@ method(object({
10708
10864
  }), object({ success: literal(true) }), {
10709
10865
  kind: "mutation",
10710
10866
  auth: "admin"
10867
+ }), method(object({
10868
+ deviceId: number(),
10869
+ /** Absent = the LOWEST assigned profile — a notification attachment is
10870
+ * watched on a phone, and the cheap rendition is the right default. */
10871
+ profile: CamProfileSchema.optional(),
10872
+ aroundMs: number(),
10873
+ preRollSec: number().min(0).max(20).default(3),
10874
+ postRollSec: number().min(0).max(20).default(5),
10875
+ format: _enum(["gif", "mp4"]).default("gif"),
10876
+ maxWidth: number().int().min(120).max(1920).default(480),
10877
+ /** GIF only — MP4 keeps the source cadence. */
10878
+ fps: number().int().min(1).max(15).default(5)
10879
+ }), object({
10880
+ base64: string(),
10881
+ mime: string(),
10882
+ bytes: number().int(),
10883
+ /** The profile actually rendered (what the default resolved to). */
10884
+ profile: CamProfileSchema,
10885
+ durationMs: number()
10886
+ }), {
10887
+ kind: "mutation",
10888
+ auth: "admin"
10711
10889
  }), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string() }), BrokerStatsSchema), method(object({ brokerId: string() }), object({
10712
10890
  probed: boolean(),
10713
10891
  summary: string()
@@ -13838,6 +14016,18 @@ var motionCapability = {
13838
14016
  name: "motion",
13839
14017
  scope: "device",
13840
14018
  mode: "singleton",
14019
+ /**
14020
+ * Providers register per-device natives via `ctx.registerNativeCap`
14021
+ * (Hikvision/Reolink/Amcrest/Wyze/HA/Homematic/Alexa/Matter) — there is
14022
+ * NO system singleton provider. Without this flag `resolveCapMount`
14023
+ * derived `{ kind: 'singleton' }`, so `motion.getStatus`/`isDetected`
14024
+ * resolved via `registry.getSingleton('motion')` (always null) and every
14025
+ * call 412'd "provider not available" while bindings listed a live
14026
+ * `motion` native (2026-08-02). The flag routes the router through
14027
+ * `requireDeviceScoped` → `getProviderForDevice`, like `motion-trigger`,
14028
+ * `snapshot` and every other per-device native cap.
14029
+ */
14030
+ deviceNative: true,
13841
14031
  deviceTypes: [DeviceType.Camera, DeviceType.Sensor],
13842
14032
  methods: {
13843
14033
  /**
@@ -18836,7 +19026,10 @@ method(object({
18836
19026
  }), method(object({
18837
19027
  deviceId: number(),
18838
19028
  caps: array(string()).readonly().optional()
18839
- }), record(string(), unknown().nullable()));
19029
+ }), record(string(), unknown().nullable())), method(object({
19030
+ deviceIds: array(number()).readonly(),
19031
+ caps: array(string()).readonly().optional()
19032
+ }), record(string(), record(string(), unknown().nullable())));
18840
19033
  method(object({ deviceId: number() }), record(string(), record(string(), unknown()))), method(object({
18841
19034
  deviceId: number(),
18842
19035
  capName: string()
@@ -19767,6 +19960,36 @@ var TargetKindSchema = object({
19767
19960
  icon: string(),
19768
19961
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
19769
19962
  addonId: string(),
19963
+ /**
19964
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
19965
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
19966
+ * when the addon bundles no icon for that kind — the client then falls back
19967
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
19968
+ *
19969
+ * Root-relative on purpose: it resolves against whatever origin serves a web
19970
+ * client, and a native client joins it onto its own hub base.
19971
+ *
19972
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
19973
+ * field that survived only because the runtime cap-router forwards provider
19974
+ * output verbatim — so every consumer had to re-declare it by hand to stop
19975
+ * its own Zod parse from stripping it, and the whole arrangement would have
19976
+ * broken silently the moment output validation was tightened anywhere.
19977
+ */
19978
+ iconUrl: string().optional(),
19979
+ /**
19980
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
19981
+ *
19982
+ * The server knows this and therefore says it, because the client cannot
19983
+ * safely guess: a React-Native client renders SVG and raster through two
19984
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
19985
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
19986
+ * placeholder glyph for every vector icon while the web build looked fine.
19987
+ *
19988
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
19989
+ * not been updated — a client that cannot determine the type should prefer
19990
+ * its raster path, which is the safe default for an unknown image.
19991
+ */
19992
+ iconMediaType: string().optional(),
19770
19993
  configSchema: ConfigSchemaPassthrough,
19771
19994
  supportsDiscovery: boolean(),
19772
19995
  caps: TargetKindCapsSchema
@@ -20214,6 +20437,29 @@ var MotionEventSchema = object({
20214
20437
  * Absent on legacy rows ⇒ treat as `pipeline`.
20215
20438
  */
20216
20439
  var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
20440
+ /**
20441
+ * The confirmed zone crossing that produced an object event. Present ONLY on
20442
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
20443
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
20444
+ * appearance event carry none, so a rule asking for a direction fails closed
20445
+ * on them.
20446
+ *
20447
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
20448
+ * into its own event, so a frame in which a track enters A while leaving B
20449
+ * produces two events with two directions — never one ambiguous row.
20450
+ *
20451
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
20452
+ * membership the box has NOW, and by definition it no longer contains the zone
20453
+ * that was just left. Without the id here, a zone-scoped rule could never match
20454
+ * the exit it asked for.
20455
+ */
20456
+ var ZoneCrossingSchema = object({
20457
+ direction: _enum(["enter", "exit"]),
20458
+ /** Admin zone id crossed. */
20459
+ zoneId: string(),
20460
+ /** Zone display name at crossing time (falls back to the id). */
20461
+ zoneName: string().optional()
20462
+ });
20217
20463
  var ObjectEventSchema = object({
20218
20464
  ...BaseEventFields,
20219
20465
  kind: literal("object"),
@@ -20240,6 +20486,12 @@ var ObjectEventSchema = object({
20240
20486
  zones: array(string()).readonly().optional(),
20241
20487
  /** Omitted in slim projection. */
20242
20488
  state: TrackStateSchema.optional(),
20489
+ /**
20490
+ * The zone crossing this event IS, when it is one. Absent on every other
20491
+ * event kind (movement state, appearance, package) — see
20492
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
20493
+ */
20494
+ zoneCrossing: ZoneCrossingSchema.optional(),
20243
20495
  /** Detection-frame dimensions in pixels — let consumers normalize the
20244
20496
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
20245
20497
  frameWidth: number().optional(),
@@ -20498,6 +20750,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20498
20750
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
20499
20751
  kind: "mutation",
20500
20752
  auth: "admin"
20753
+ }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
20754
+ kind: "mutation",
20755
+ auth: "admin"
20756
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
20757
+ kind: "query",
20758
+ auth: "admin"
20759
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
20760
+ kind: "mutation",
20761
+ auth: "admin"
20501
20762
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
20502
20763
  kind: "query",
20503
20764
  auth: "admin"
@@ -22977,6 +23238,17 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
22977
23238
  */
22978
23239
  priority: number()
22979
23240
  })).readonly() });
23241
+ /**
23242
+ * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
23243
+ * AUTO (resolved from the candidate ranking at send time); `resolved` reports
23244
+ * what AUTO currently picks, so the UI can show the effective value either way.
23245
+ */
23246
+ var NotificationEndpointSchema = object({
23247
+ /** The operator's explicit choice, or null for AUTO. */
23248
+ baseUrl: string().nullable(),
23249
+ /** What the ranking currently resolves to (null when nothing is reachable). */
23250
+ resolved: string().nullable()
23251
+ });
22980
23252
  var AllowedAddressesSchema = object({
22981
23253
  /**
22982
23254
  * Allowlist of interface addresses operators have explicitly opted
@@ -22999,7 +23271,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
22999
23271
  * to avoid mixed-content blocks in the browser. The public
23000
23272
  * tunnel always emits `https://` regardless. */
23001
23273
  scheme: _enum(["http", "https"]).optional()
23002
- }), GetConnectionEndpointsResultSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
23274
+ }), 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" });
23003
23275
  /**
23004
23276
  * mesh-network — collection cap for mesh-VPN providers.
23005
23277
  *
@@ -23798,7 +24070,12 @@ var RecordingDeviceUsageSchema = object({
23798
24070
  var RecordingLocationUsageSchema = object({
23799
24071
  /** StorageLocation id; null for the legacy/degraded single-root fallback. */
23800
24072
  locationId: string().nullable(),
23801
- /** Bytes of recordings stored on this location. */
24073
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
24074
+ * is emitted per physical disk (2026-07-29): two locations on one root
24075
+ * previously rendered as two identical "disks" with a nonsensical used
24076
+ * split — hydrate attribution across aliases is arbitrary by nature. */
24077
+ locationIds: array(string()).optional(),
24078
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). */
23802
24079
  usedBytes: number(),
23803
24080
  /** Free bytes on the location's volume; null when capacity is unknown (remote). */
23804
24081
  availableBytes: number().nullable(),
@@ -23910,6 +24187,44 @@ method(object({
23910
24187
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
23911
24188
  kind: "query",
23912
24189
  auth: "admin"
24190
+ }), method(object({
24191
+ deviceId: number(),
24192
+ aroundMs: number(),
24193
+ preRollSec: number().min(0).max(30).default(2),
24194
+ postRollSec: number().min(0).max(30).default(5),
24195
+ maxWidth: number().int().min(120).max(1280).default(480),
24196
+ fps: number().int().min(1).max(15).default(5)
24197
+ }), object({
24198
+ gifBase64: string(),
24199
+ fromMs: number(),
24200
+ toMs: number()
24201
+ }), {
24202
+ kind: "mutation",
24203
+ auth: "admin"
24204
+ }), method(object({
24205
+ deviceId: number(),
24206
+ aroundMs: number(),
24207
+ preRollSec: number().min(0).max(30).default(3),
24208
+ postRollSec: number().min(0).max(30).default(7),
24209
+ maxWidth: number().int().min(160).max(1920).default(640)
24210
+ }), object({
24211
+ clipBase64: string(),
24212
+ mime: string(),
24213
+ fromMs: number(),
24214
+ toMs: number(),
24215
+ bytes: number().int()
24216
+ }), {
24217
+ kind: "mutation",
24218
+ auth: "admin"
24219
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
24220
+ kind: "mutation",
24221
+ auth: "admin"
24222
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
24223
+ kind: "query",
24224
+ auth: "admin"
24225
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
24226
+ kind: "mutation",
24227
+ auth: "admin"
23913
24228
  });
23914
24229
  /**
23915
24230
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -25501,6 +25816,12 @@ Object.freeze({
25501
25816
  addonId: null,
25502
25817
  access: "view"
25503
25818
  },
25819
+ "deviceManager.getDeviceStatusAggregateBatch": {
25820
+ capName: "device-manager",
25821
+ capScope: "system",
25822
+ addonId: null,
25823
+ access: "view"
25824
+ },
25504
25825
  "deviceManager.getLinkedDevices": {
25505
25826
  capName: "device-manager",
25506
25827
  capScope: "system",
@@ -26395,6 +26716,12 @@ Object.freeze({
26395
26716
  addonId: null,
26396
26717
  access: "view"
26397
26718
  },
26719
+ "localNetwork.getNotificationEndpoint": {
26720
+ capName: "local-network",
26721
+ capScope: "system",
26722
+ addonId: null,
26723
+ access: "view"
26724
+ },
26398
26725
  "localNetwork.getPreferred": {
26399
26726
  capName: "local-network",
26400
26727
  capScope: "system",
@@ -26419,6 +26746,12 @@ Object.freeze({
26419
26746
  addonId: null,
26420
26747
  access: "create"
26421
26748
  },
26749
+ "localNetwork.setNotificationEndpoint": {
26750
+ capName: "local-network",
26751
+ capScope: "system",
26752
+ addonId: null,
26753
+ access: "create"
26754
+ },
26422
26755
  "lockControl.lock": {
26423
26756
  capName: "lock-control",
26424
26757
  capScope: "device",
@@ -27061,6 +27394,12 @@ Object.freeze({
27061
27394
  addonId: null,
27062
27395
  access: "create"
27063
27396
  },
27397
+ "pipelineAnalytics.cancelMediaRelocate": {
27398
+ capName: "pipeline-analytics",
27399
+ capScope: "device",
27400
+ addonId: null,
27401
+ access: "create"
27402
+ },
27064
27403
  "pipelineAnalytics.clearTracks": {
27065
27404
  capName: "pipeline-analytics",
27066
27405
  capScope: "device",
@@ -27115,6 +27454,12 @@ Object.freeze({
27115
27454
  addonId: null,
27116
27455
  access: "view"
27117
27456
  },
27457
+ "pipelineAnalytics.getMediaRelocateStatus": {
27458
+ capName: "pipeline-analytics",
27459
+ capScope: "device",
27460
+ addonId: null,
27461
+ access: "view"
27462
+ },
27118
27463
  "pipelineAnalytics.getMotionEvents": {
27119
27464
  capName: "pipeline-analytics",
27120
27465
  capScope: "device",
@@ -27187,6 +27532,12 @@ Object.freeze({
27187
27532
  addonId: null,
27188
27533
  access: "create"
27189
27534
  },
27535
+ "pipelineAnalytics.relocateMedia": {
27536
+ capName: "pipeline-analytics",
27537
+ capScope: "device",
27538
+ addonId: null,
27539
+ access: "create"
27540
+ },
27190
27541
  "pipelineAnalytics.searchObjectEvents": {
27191
27542
  capName: "pipeline-analytics",
27192
27543
  capScope: "device",
@@ -27949,6 +28300,12 @@ Object.freeze({
27949
28300
  addonId: null,
27950
28301
  access: "create"
27951
28302
  },
28303
+ "recording.cancelRelocate": {
28304
+ capName: "recording",
28305
+ capScope: "system",
28306
+ addonId: null,
28307
+ access: "create"
28308
+ },
27952
28309
  "recording.deleteFootprint": {
27953
28310
  capName: "recording",
27954
28311
  capScope: "system",
@@ -27979,6 +28336,12 @@ Object.freeze({
27979
28336
  addonId: null,
27980
28337
  access: "view"
27981
28338
  },
28339
+ "recording.getRelocateStatus": {
28340
+ capName: "recording",
28341
+ capScope: "system",
28342
+ addonId: null,
28343
+ access: "view"
28344
+ },
27982
28345
  "recording.getStorageUsage": {
27983
28346
  capName: "recording",
27984
28347
  capScope: "system",
@@ -28009,6 +28372,24 @@ Object.freeze({
28009
28372
  addonId: null,
28010
28373
  access: "view"
28011
28374
  },
28375
+ "recording.relocateFootage": {
28376
+ capName: "recording",
28377
+ capScope: "system",
28378
+ addonId: null,
28379
+ access: "create"
28380
+ },
28381
+ "recording.renderClip": {
28382
+ capName: "recording",
28383
+ capScope: "system",
28384
+ addonId: null,
28385
+ access: "create"
28386
+ },
28387
+ "recording.renderGif": {
28388
+ capName: "recording",
28389
+ capScope: "system",
28390
+ addonId: null,
28391
+ access: "create"
28392
+ },
28012
28393
  "recording.rescanStorage": {
28013
28394
  capName: "recording",
28014
28395
  capScope: "system",
@@ -28603,6 +28984,12 @@ Object.freeze({
28603
28984
  addonId: null,
28604
28985
  access: "create"
28605
28986
  },
28987
+ "streamBroker.renderPreBufferClip": {
28988
+ capName: "stream-broker",
28989
+ capScope: "system",
28990
+ addonId: null,
28991
+ access: "create"
28992
+ },
28606
28993
  "streamBroker.restartProfile": {
28607
28994
  capName: "stream-broker",
28608
28995
  capScope: "system",