@camstack/addon-matter-broker 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.mjs CHANGED
@@ -11,7 +11,7 @@ import { networkInterfaces, tmpdir, uptime } from "node:os";
11
11
  import { finished } from "node:stream/promises";
12
12
  import { createConnection, createServer as createServer$2 } from "node:net";
13
13
  import * as dgram from "node:dgram";
14
- //#region ../types/dist/event-category-BLcNejAE.mjs
14
+ //#region ../types/dist/event-category-Bz24uP1U.mjs
15
15
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
16
16
  EventCategory["SystemBoot"] = "system.boot";
17
17
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -282,6 +282,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
282
282
  */
283
283
  EventCategory["DeviceStateChanged"] = "device.state-changed";
284
284
  /**
285
+ * Frame occupancy for a camera CHANGED — a tracked object was gained or
286
+ * lost. Carries `{ deviceId, totalObjects, byClass, zones }`.
287
+ *
288
+ * Emitted only on a change, so a steady scene is silent. It exists so a
289
+ * client can stop polling `zoneAnalytics.getCurrentSnapshot`: that was the
290
+ * one live badge with no push signal at all, and it cost a request every
291
+ * four seconds per visible camera.
292
+ *
293
+ * Like every event it is telemetry and may be dropped ([D8]) — a consumer
294
+ * keeps a slow reconcile rather than trusting it alone.
295
+ */
296
+ EventCategory["ZoneAnalyticsOccupancyChanged"] = "zone-analytics.occupancy-changed";
297
+ /**
285
298
  * Cap event fired by every device that registers the `battery`
286
299
  * capability. Mirrors the cap definition's `onStatusChanged`. Carries
287
300
  * `{ deviceId, status: BatteryStatus }`. Subscribers (alert center,
@@ -7225,35 +7238,22 @@ var ConvertResultSchema = object({
7225
7238
  */
7226
7239
  var RecordingWeekdaySchema = number().int().min(0).max(6);
7227
7240
  var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
7228
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
7229
- kind: literal("timeOfDay"),
7230
- start: string$2().regex(HHMM),
7231
- end: string$2().regex(HHMM),
7232
- /** Restrict to these weekdays; omit = every day. */
7233
- days: array(RecordingWeekdaySchema).optional()
7234
- })]);
7235
- var RecordingModeSchema = _enum([
7236
- "continuous",
7237
- "onMotion",
7238
- "onAudioThreshold"
7239
- ]);
7240
7241
  /**
7241
- * First-class, authoritative per-camera storage mode — the explicit choice the
7242
- * UI reads directly (never inferred from `rules`):
7243
- * - `off` — not recording.
7244
- * - `events` — record only around triggers (motion / audio threshold),
7245
- * with pre/post-buffer.
7246
- * - `continuous` — record 24/7 within the schedule.
7242
+ * DERIVED per-camera storage summary — the single field cheap consumers read
7243
+ * (the viewer's status dot, the camera list) instead of walking `bands`:
7244
+ * - `off` — no band covers the camera (or it is disabled).
7245
+ * - `events` — every band records around triggers only.
7246
+ * - `continuous` — at least one band records continuously.
7247
7247
  *
7248
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
7249
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
7248
+ * NEVER authored: the recorder stamps it from the authoritative `bands` on
7249
+ * every save (`activeModeForConfig`). Writing it has no effect.
7250
7250
  */
7251
7251
  var RecordingStorageModeSchema = _enum([
7252
7252
  "off",
7253
7253
  "events",
7254
7254
  "continuous"
7255
7255
  ]);
7256
- /** Which detectors trigger an `events`-mode recording. */
7256
+ /** Which detectors trigger an `events`-mode band. */
7257
7257
  var RecordingTriggersSchema = object({
7258
7258
  motion: boolean().optional(),
7259
7259
  audioThresholdDbfs: number().optional()
@@ -7289,18 +7289,6 @@ var RecordingBandSchema = object({
7289
7289
  preBufferSec: number().min(0).optional(),
7290
7290
  postBufferSec: number().min(0).optional()
7291
7291
  });
7292
- var RecordingRuleSchema = object({
7293
- schedule: RecordingScheduleSchema,
7294
- mode: RecordingModeSchema,
7295
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
7296
- preBufferSec: number().min(0).default(0),
7297
- /** Keep recording until this many seconds after the last trigger. */
7298
- postBufferSec: number().min(0).default(0),
7299
- /** Each new trigger restarts the post-buffer window. */
7300
- resetTimeoutOnNewEvent: boolean().default(true),
7301
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
7302
- thresholdDbfs: number().optional()
7303
- });
7304
7292
  /**
7305
7293
  * Per-device retention overrides. Every field is optional; an unset or `0`
7306
7294
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7334,40 +7322,28 @@ var ScrubThumbnailPresetSchema = _enum([
7334
7322
  /**
7335
7323
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7336
7324
  *
7337
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
7338
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
7339
- * only for transition + migration (`migrateRulesToMode`); the policy engine
7340
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
7325
+ * `bands` is the ONLY authored recording intent: what to record, when, and on
7326
+ * which trigger. `mode` is a derived summary the recorder stamps on save; every
7327
+ * other field is a storage knob (profiles, segment length, retention, scrub).
7328
+ *
7329
+ * STRICT on purpose: the legacy authoring surface (`schedule`/`schedules`/
7330
+ * `triggers`/`preBufferSec`/`postBufferSec`/`rules`) was retired 2026-07-30.
7331
+ * A stale caller must fail loudly — silently stripping its legacy intent would
7332
+ * persist a band-less config, i.e. silently stop recording the camera.
7341
7333
  */
7342
7334
  var RecordingConfigSchema = object({
7343
7335
  enabled: boolean(),
7344
- /** Authoritative storage mode. Absent on legacy targets derived once via
7345
- * `migrateRulesToMode`, then persisted. */
7336
+ /** DERIVED summary of `bands`, stamped by the recorder on every save.
7337
+ * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7346
7338
  mode: RecordingStorageModeSchema.optional(),
7347
7339
  profiles: array(CamProfileSchema).optional(),
7348
7340
  segmentSeconds: number().int().positive().optional(),
7349
- /** Shared recording time-bands for `events` & `continuous` — record only when
7350
- * the wall-clock falls inside one of these windows. Omit or empty = always.
7351
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
7352
- schedules: array(RecordingScheduleSchema).optional(),
7353
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
7354
- * normalized into `schedules` on read and never written going forward. (Not
7355
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
7356
- schedule: RecordingScheduleSchema.optional(),
7357
- /** `events`-mode only — which detectors trigger a recording. */
7358
- triggers: RecordingTriggersSchema.optional(),
7359
- /** `events`-mode only — seconds retained before / after a trigger. */
7360
- preBufferSec: number().min(0).optional(),
7361
- postBufferSec: number().min(0).optional(),
7362
- /** DEPRECATED authoring input; retained for migration/transition. */
7363
- rules: array(RecordingRuleSchema).optional(),
7364
7341
  /**
7365
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
7366
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
7367
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
7368
- * derived into bands once via `migrateConfigToBands`.
7342
+ * AUTHORITATIVE mode-per-band recording model the single source of truth
7343
+ * the recorder's band engine consumes. An empty array = record nothing;
7344
+ * "off" is the absence of a covering band, never a band value.
7369
7345
  */
7370
- bands: array(RecordingBandSchema).optional(),
7346
+ bands: array(RecordingBandSchema).default([]),
7371
7347
  retention: RecordingRetentionSchema.optional(),
7372
7348
  /**
7373
7349
  * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
@@ -7375,8 +7351,15 @@ var RecordingConfigSchema = object({
7375
7351
  * windows only — existing sheets are immutable, and each window's index
7376
7352
  * carries its own tile dims so mixed-preset history renders correctly.
7377
7353
  */
7378
- scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7379
- });
7354
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional(),
7355
+ /**
7356
+ * OPT-IN thumbnail-strip generation for this camera: every keyframe of the
7357
+ * low recording saved as a JPEG (the fast-drag scrub depth), a derived
7358
+ * cache that eviction reclaims with the footage. Absent/false = no strips
7359
+ * are written and scrub reads exact keyframes at every velocity.
7360
+ */
7361
+ stripsEnabled: boolean().optional()
7362
+ }).strict();
7380
7363
  /**
7381
7364
  * Ops-log — the durable, append-only operations audit shared by the
7382
7365
  * recordings and events management surfaces.
@@ -7395,7 +7378,8 @@ var OpsLogOpSchema = _enum([
7395
7378
  "prune",
7396
7379
  "manual-delete",
7397
7380
  "rescan",
7398
- "retention-run"
7381
+ "retention-run",
7382
+ "relocate"
7399
7383
  ]);
7400
7384
  /** Why the operation ran. */
7401
7385
  var OpsLogReasonSchema = _enum([
@@ -7434,6 +7418,55 @@ var OpsLogQueryInputSchema = object({
7434
7418
  limit: number().int().min(1).max(1e3).optional()
7435
7419
  });
7436
7420
  /**
7421
+ * Entity-relocation job state (storage entity-routing spec, Phase 4).
7422
+ *
7423
+ * One shape shared by the recorder's `relocateFootage` (segments + strips) and
7424
+ * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7425
+ * page renders both movers with one component. Jobs are in-RAM (a restart
7426
+ * forgets them — re-running is safe by construction: copy-if-absent, delete
7427
+ * after verify) and each completed/failed run also lands one durable ops-log
7428
+ * row on the owning addon's surface.
7429
+ */
7430
+ var RelocateJobStateSchema = _enum([
7431
+ "running",
7432
+ "done",
7433
+ "failed",
7434
+ "cancelled"
7435
+ ]);
7436
+ var RelocateJobSchema = object({
7437
+ jobId: string$2(),
7438
+ state: RelocateJobStateSchema,
7439
+ /** Source location — for media relocation this is informational ('*': rows
7440
+ * move from wherever they are to the target). */
7441
+ fromLocationId: string$2(),
7442
+ toLocationId: string$2(),
7443
+ /** Scoped device, or null = every device. */
7444
+ deviceId: number().nullable(),
7445
+ /** What the job moves (owner-addon specific: segments/strips or media). */
7446
+ entities: array(string$2()),
7447
+ filesMoved: number().int(),
7448
+ bytesMoved: number().int(),
7449
+ /** Total files discovered up front; null while (or when) unknown. */
7450
+ filesTotal: number().int().nullable(),
7451
+ startedAt: number(),
7452
+ finishedAt: number().nullable(),
7453
+ error: string$2().nullable()
7454
+ });
7455
+ var RelocateFootageInputSchema = object({
7456
+ deviceId: number().optional(),
7457
+ fromLocationId: string$2(),
7458
+ toLocationId: string$2(),
7459
+ entities: array(_enum(["segments", "strips"])).optional(),
7460
+ /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7461
+ * never allowed to starve live writers. */
7462
+ throttleMbps: number().min(1).max(1e3).optional()
7463
+ });
7464
+ var RelocateMediaInputSchema = object({
7465
+ deviceId: number().optional(),
7466
+ toLocationId: string$2(),
7467
+ throttleMbps: number().min(1).max(1e3).optional()
7468
+ });
7469
+ /**
7437
7470
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7438
7471
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7439
7472
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -7483,6 +7516,13 @@ var StorageLocationSchema = object({
7483
7516
  nodeId: string$2().optional(),
7484
7517
  isDefault: boolean().default(false),
7485
7518
  isSystem: boolean().default(false),
7519
+ /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7520
+ * for node-local locations it can reach) — never persisted, absent when the
7521
+ * volume is remote/unreachable. The single capacity truth every UI reads. */
7522
+ capacity: object({
7523
+ totalBytes: number(),
7524
+ availableBytes: number()
7525
+ }).nullable().optional(),
7486
7526
  createdAt: number(),
7487
7527
  updatedAt: number()
7488
7528
  });
@@ -8250,7 +8290,8 @@ var NcTaxonomyEntrySchema = object({
8250
8290
  /** Macro/category parent for grouping ('car' → 'vehicle'); null for a top. */
8251
8291
  parentKind: string$2().nullable()
8252
8292
  });
8253
- object({
8293
+ /** The complete NC picker taxonomy — three grouped buckets. */
8294
+ var NcTaxonomySchema = object({
8254
8295
  videoClasses: array(NcTaxonomyEntrySchema),
8255
8296
  audioKinds: array(NcTaxonomyEntrySchema),
8256
8297
  labels: array(NcTaxonomyEntrySchema)
@@ -9153,6 +9194,7 @@ function shallowEqual$1(a, b) {
9153
9194
  for (const k of ak) if (a[k] !== b[k]) return false;
9154
9195
  return true;
9155
9196
  }
9197
+ new Set(["devices", "classes"]);
9156
9198
  /**
9157
9199
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
9158
9200
  * motion-zones, and the detection zones/lines editor all speak this one
@@ -9311,6 +9353,29 @@ var NcOccupancyConditionSchema = object({
9311
9353
  count: number().int().min(0).default(1),
9312
9354
  sustainSeconds: number().int().min(0).max(3600).default(15)
9313
9355
  });
9356
+ /**
9357
+ * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
9358
+ *
9359
+ * The values are not symmetric, and deliberately so — the absent value has to
9360
+ * mean exactly what every rule authored before this condition existed already
9361
+ * does:
9362
+ * - `enter` — entries and every NON-crossing record (movement state,
9363
+ * package, sensor). Exits are rejected. **This is the absent behaviour**:
9364
+ * an operator who never asked for exits must not start receiving them.
9365
+ * - `exit` — ONLY an exit crossing. A record that is not a crossing at all
9366
+ * fails closed, because "the car left the drive" is a question about a
9367
+ * boundary, not about a detection.
9368
+ * - `any` — no direction filter; entries, exits and non-crossings alike.
9369
+ *
9370
+ * A rule asking for a direction should normally also scope `zones`, which the
9371
+ * engine evaluates against the crossed zone as well as the current membership
9372
+ * (an exit's membership no longer contains the zone it just left).
9373
+ */
9374
+ var NcCrossingSchema = _enum([
9375
+ "enter",
9376
+ "exit",
9377
+ "any"
9378
+ ]);
9314
9379
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
9315
9380
  var NcZoneConditionSchema = object({
9316
9381
  ids: array(string$2().min(1)).min(1),
@@ -9335,6 +9400,13 @@ var NcConditionsSchema = object({
9335
9400
  /** Veto zones — any hit fails the rule. */
9336
9401
  zonesExclude: array(string$2().min(1)).optional(),
9337
9402
  /**
9403
+ * Zone-crossing direction. IMMEDIATE only — a crossing is a per-event fact
9404
+ * and a closed track carries none, so a `track-end` rule asking for one
9405
+ * fails closed (use `zones`, which tests `zonesVisited`). ABSENT = `enter`,
9406
+ * which is exactly today's behaviour. See {@link NcCrossingSchema}.
9407
+ */
9408
+ crossing: NcCrossingSchema.optional(),
9409
+ /**
9338
9410
  * Exact (case-insensitive) match on the record's collapsed `label`
9339
9411
  * (identity name / plate text / subclass).
9340
9412
  */
@@ -9469,17 +9541,85 @@ var NcRuleTargetSchema = object({
9469
9541
  * - `keyFrame` — the clean scene frame (no subject box).
9470
9542
  * - `none` — no attachment.
9471
9543
  */
9472
- var NcMediaPolicySchema = object({ attach: _enum([
9473
- "best",
9474
- "best-matching",
9475
- "keyFrame",
9476
- "none"
9477
- ]).default("best") });
9544
+ /**
9545
+ * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
9546
+ * conflate it with the selection strategy and betray the request: asking for
9547
+ * the clean scene frame on an object-event owner used to start at
9548
+ * `fullFrameBoxed`, i.e. the annotated frame (2026-07-30).
9549
+ * - `cropped` — the subject, tight. What "who is at the door" wants.
9550
+ * - `full` — the clean scene, no annotation. What "what is going on" wants.
9551
+ * - `boxed` — the scene WITH the detection boxes drawn, for verifying what
9552
+ * the pipeline actually saw.
9553
+ */
9554
+ var NcMediaFrameSchema = _enum([
9555
+ "cropped",
9556
+ "full",
9557
+ "boxed"
9558
+ ]);
9559
+ var NcMediaPolicySchema = object({
9560
+ attach: _enum([
9561
+ "best",
9562
+ "best-matching",
9563
+ "keyFrame",
9564
+ "none"
9565
+ ]).default("best"),
9566
+ /** What the still shows. Absent = `cropped` (the historical `best` shape). */
9567
+ frame: NcMediaFrameSchema.optional(),
9568
+ /** Crop the attached still to the rule's condition-zone bbox (padded) —
9569
+ * "show me the ZONE", not the whole scene or the subject crop. */
9570
+ zoneCrop: boolean().optional(),
9571
+ /**
9572
+ * Also attach a short GIF cut from the stream broker's clip ring around the
9573
+ * event — NOT from the recording, so the camera does not have to be
9574
+ * recording, and the window sits AROUND the moment instead of a segment
9575
+ * behind it. Fail-closed: a window the ring does not cover contributes no
9576
+ * gif, never a failed notification.
9577
+ */
9578
+ gif: boolean().optional(),
9579
+ /**
9580
+ * Also attach a short MP4 CLIP of the same cut. Same source and the same
9581
+ * fail-closed rule as `gif`. Prefer it where the backend takes video
9582
+ * (telegram, discord, zentik, webhook); backends that do not are handled by
9583
+ * the degrade engine, which drops the video and keeps the still.
9584
+ */
9585
+ clip: boolean().optional(),
9586
+ /** Seconds of footage BEFORE / AFTER the event instant. Defaults 3 / 7. */
9587
+ clipPreRollSec: number().int().min(0).max(30).optional(),
9588
+ clipPostRollSec: number().int().min(0).max(30).optional(),
9589
+ /**
9590
+ * Which stream profile the footage is cut from. Absent = the CHEAPEST
9591
+ * assigned profile: a notification is watched on a phone, so the 4K
9592
+ * rendition would burn CPU to produce a file the client downscales anyway.
9593
+ * A profile that is not assigned falls back to the cheapest, and the render
9594
+ * reports which one actually ran.
9595
+ */
9596
+ profile: CamProfileSchema.optional()
9597
+ });
9598
+ /**
9599
+ * Cooldown GRANULARITY over the subject's class — how much a fired
9600
+ * notification suppresses.
9601
+ * - `shared` (default, and the absent value) — one window for the whole
9602
+ * rule/scope: a cat silences the next dog for `cooldownSec`.
9603
+ * - `per-class` — an independent window per detected class, so cat→dog fires
9604
+ * at once and cat→cat still waits.
9605
+ *
9606
+ * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
9607
+ * must not be swallowed by a bark's window (the precedent this generalizes —
9608
+ * see `cooldownKey` in the rule engine).
9609
+ */
9610
+ var NcThrottleGranularitySchema = _enum(["shared", "per-class"]);
9478
9611
  /** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
9479
9612
  var NcThrottleSchema = object({
9480
9613
  cooldownSec: number().int().min(0).max(86400).default(60),
9481
9614
  /** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
9482
- scope: _enum(["rule", "rule-device"]).default("rule-device")
9615
+ scope: _enum(["rule", "rule-device"]).default("rule-device"),
9616
+ /**
9617
+ * Class granularity of the cooldown key. Optional rather than defaulted:
9618
+ * a Zod default does NOT run on the addon→addon cap path, so a persisted
9619
+ * rule authored before this field simply carries none — and the engine
9620
+ * reads absent as `shared`, the pre-existing behaviour.
9621
+ */
9622
+ granularity: NcThrottleGranularitySchema.optional()
9483
9623
  });
9484
9624
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
9485
9625
  var NcRuleInputSchema = object({
@@ -9488,7 +9628,19 @@ var NcRuleInputSchema = object({
9488
9628
  delivery: NcDeliverySchema,
9489
9629
  conditions: NcConditionsSchema.default({}),
9490
9630
  schedule: NcScheduleSchema.optional(),
9491
- targets: array(NcRuleTargetSchema).min(1),
9631
+ /** May be empty when `targetUsers` addresses at least one user — the
9632
+ * "at least one addressee" invariant is enforced by the provider, because
9633
+ * a cross-field refine here would break `NcRulePatchSchema.partial()`. */
9634
+ targets: array(NcRuleTargetSchema),
9635
+ /**
9636
+ * USERS this rule addresses in addition to `targets` (Phase 4). At fire
9637
+ * time each user fans out to the personal targets they own
9638
+ * (`config.ownerUserId`), filtered by that user's `allowedDevices` for the
9639
+ * firing camera — a user is never notified about a device they cannot open.
9640
+ * Per-user opt-outs (`disabledTargetIds`) still apply to the fanned-out
9641
+ * targets.
9642
+ */
9643
+ targetUsers: array(string$2()).optional(),
9492
9644
  media: NcMediaPolicySchema.default({ attach: "best" }),
9493
9645
  throttle: NcThrottleSchema.default({
9494
9646
  cooldownSec: 60,
@@ -9575,6 +9727,7 @@ var NcConditionDescriptorSchema = object({
9575
9727
  "schedule",
9576
9728
  "plateMatcher",
9577
9729
  "packagePhase",
9730
+ "crossingSelect",
9578
9731
  "polygonDraw",
9579
9732
  "occupancy"
9580
9733
  ]),
@@ -9701,7 +9854,10 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
9701
9854
  }), object({ results: array(NcTestResultSchema) }), {
9702
9855
  kind: "mutation",
9703
9856
  auth: "admin"
9704
- }), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9857
+ }), method(object({}), object({
9858
+ catalog: array(NcConditionDescriptorSchema),
9859
+ taxonomy: NcTaxonomySchema.optional()
9860
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9705
9861
  /**
9706
9862
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
9707
9863
  *
@@ -10710,6 +10866,28 @@ method(object({
10710
10866
  }), object({ success: literal(true) }), {
10711
10867
  kind: "mutation",
10712
10868
  auth: "admin"
10869
+ }), method(object({
10870
+ deviceId: number(),
10871
+ /** Absent = the LOWEST assigned profile — a notification attachment is
10872
+ * watched on a phone, and the cheap rendition is the right default. */
10873
+ profile: CamProfileSchema.optional(),
10874
+ aroundMs: number(),
10875
+ preRollSec: number().min(0).max(20).default(3),
10876
+ postRollSec: number().min(0).max(20).default(5),
10877
+ format: _enum(["gif", "mp4"]).default("gif"),
10878
+ maxWidth: number().int().min(120).max(1920).default(480),
10879
+ /** GIF only — MP4 keeps the source cadence. */
10880
+ fps: number().int().min(1).max(15).default(5)
10881
+ }), object({
10882
+ base64: string$2(),
10883
+ mime: string$2(),
10884
+ bytes: number().int(),
10885
+ /** The profile actually rendered (what the default resolved to). */
10886
+ profile: CamProfileSchema,
10887
+ durationMs: number()
10888
+ }), {
10889
+ kind: "mutation",
10890
+ auth: "admin"
10713
10891
  }), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string$2() }), BrokerStatsSchema), method(object({ brokerId: string$2() }), object({
10714
10892
  probed: boolean(),
10715
10893
  summary: string$2()
@@ -13840,6 +14018,18 @@ var motionCapability = {
13840
14018
  name: "motion",
13841
14019
  scope: "device",
13842
14020
  mode: "singleton",
14021
+ /**
14022
+ * Providers register per-device natives via `ctx.registerNativeCap`
14023
+ * (Hikvision/Reolink/Amcrest/Wyze/HA/Homematic/Alexa/Matter) — there is
14024
+ * NO system singleton provider. Without this flag `resolveCapMount`
14025
+ * derived `{ kind: 'singleton' }`, so `motion.getStatus`/`isDetected`
14026
+ * resolved via `registry.getSingleton('motion')` (always null) and every
14027
+ * call 412'd "provider not available" while bindings listed a live
14028
+ * `motion` native (2026-08-02). The flag routes the router through
14029
+ * `requireDeviceScoped` → `getProviderForDevice`, like `motion-trigger`,
14030
+ * `snapshot` and every other per-device native cap.
14031
+ */
14032
+ deviceNative: true,
13843
14033
  deviceTypes: [DeviceType.Camera, DeviceType.Sensor],
13844
14034
  methods: {
13845
14035
  /**
@@ -18838,7 +19028,10 @@ method(object({
18838
19028
  }), method(object({
18839
19029
  deviceId: number(),
18840
19030
  caps: array(string$2()).readonly().optional()
18841
- }), record(string$2(), unknown().nullable()));
19031
+ }), record(string$2(), unknown().nullable())), method(object({
19032
+ deviceIds: array(number()).readonly(),
19033
+ caps: array(string$2()).readonly().optional()
19034
+ }), record(string$2(), record(string$2(), unknown().nullable())));
18842
19035
  method(object({ deviceId: number() }), record(string$2(), record(string$2(), unknown()))), method(object({
18843
19036
  deviceId: number(),
18844
19037
  capName: string$2()
@@ -19769,6 +19962,36 @@ var TargetKindSchema = object({
19769
19962
  icon: string$2(),
19770
19963
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
19771
19964
  addonId: string$2(),
19965
+ /**
19966
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
19967
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
19968
+ * when the addon bundles no icon for that kind — the client then falls back
19969
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
19970
+ *
19971
+ * Root-relative on purpose: it resolves against whatever origin serves a web
19972
+ * client, and a native client joins it onto its own hub base.
19973
+ *
19974
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
19975
+ * field that survived only because the runtime cap-router forwards provider
19976
+ * output verbatim — so every consumer had to re-declare it by hand to stop
19977
+ * its own Zod parse from stripping it, and the whole arrangement would have
19978
+ * broken silently the moment output validation was tightened anywhere.
19979
+ */
19980
+ iconUrl: string$2().optional(),
19981
+ /**
19982
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
19983
+ *
19984
+ * The server knows this and therefore says it, because the client cannot
19985
+ * safely guess: a React-Native client renders SVG and raster through two
19986
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
19987
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
19988
+ * placeholder glyph for every vector icon while the web build looked fine.
19989
+ *
19990
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
19991
+ * not been updated — a client that cannot determine the type should prefer
19992
+ * its raster path, which is the safe default for an unknown image.
19993
+ */
19994
+ iconMediaType: string$2().optional(),
19772
19995
  configSchema: ConfigSchemaPassthrough,
19773
19996
  supportsDiscovery: boolean(),
19774
19997
  caps: TargetKindCapsSchema
@@ -20216,6 +20439,29 @@ var MotionEventSchema = object({
20216
20439
  * Absent on legacy rows ⇒ treat as `pipeline`.
20217
20440
  */
20218
20441
  var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
20442
+ /**
20443
+ * The confirmed zone crossing that produced an object event. Present ONLY on
20444
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
20445
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
20446
+ * appearance event carry none, so a rule asking for a direction fails closed
20447
+ * on them.
20448
+ *
20449
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
20450
+ * into its own event, so a frame in which a track enters A while leaving B
20451
+ * produces two events with two directions — never one ambiguous row.
20452
+ *
20453
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
20454
+ * membership the box has NOW, and by definition it no longer contains the zone
20455
+ * that was just left. Without the id here, a zone-scoped rule could never match
20456
+ * the exit it asked for.
20457
+ */
20458
+ var ZoneCrossingSchema = object({
20459
+ direction: _enum(["enter", "exit"]),
20460
+ /** Admin zone id crossed. */
20461
+ zoneId: string$2(),
20462
+ /** Zone display name at crossing time (falls back to the id). */
20463
+ zoneName: string$2().optional()
20464
+ });
20219
20465
  var ObjectEventSchema = object({
20220
20466
  ...BaseEventFields,
20221
20467
  kind: literal("object"),
@@ -20242,6 +20488,12 @@ var ObjectEventSchema = object({
20242
20488
  zones: array(string$2()).readonly().optional(),
20243
20489
  /** Omitted in slim projection. */
20244
20490
  state: TrackStateSchema.optional(),
20491
+ /**
20492
+ * The zone crossing this event IS, when it is one. Absent on every other
20493
+ * event kind (movement state, appearance, package) — see
20494
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
20495
+ */
20496
+ zoneCrossing: ZoneCrossingSchema.optional(),
20245
20497
  /** Detection-frame dimensions in pixels — let consumers normalize the
20246
20498
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
20247
20499
  frameWidth: number().optional(),
@@ -20500,6 +20752,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20500
20752
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
20501
20753
  kind: "mutation",
20502
20754
  auth: "admin"
20755
+ }), method(RelocateMediaInputSchema, object({ jobId: string$2() }), {
20756
+ kind: "mutation",
20757
+ auth: "admin"
20758
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
20759
+ kind: "query",
20760
+ auth: "admin"
20761
+ }), method(object({ jobId: string$2() }), object({ cancelled: boolean() }), {
20762
+ kind: "mutation",
20763
+ auth: "admin"
20503
20764
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
20504
20765
  kind: "query",
20505
20766
  auth: "admin"
@@ -22996,6 +23257,17 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
22996
23257
  */
22997
23258
  priority: number()
22998
23259
  })).readonly() });
23260
+ /**
23261
+ * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
23262
+ * AUTO (resolved from the candidate ranking at send time); `resolved` reports
23263
+ * what AUTO currently picks, so the UI can show the effective value either way.
23264
+ */
23265
+ var NotificationEndpointSchema = object({
23266
+ /** The operator's explicit choice, or null for AUTO. */
23267
+ baseUrl: string$2().nullable(),
23268
+ /** What the ranking currently resolves to (null when nothing is reachable). */
23269
+ resolved: string$2().nullable()
23270
+ });
22999
23271
  var AllowedAddressesSchema = object({
23000
23272
  /**
23001
23273
  * Allowlist of interface addresses operators have explicitly opted
@@ -23018,7 +23290,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
23018
23290
  * to avoid mixed-content blocks in the browser. The public
23019
23291
  * tunnel always emits `https://` regardless. */
23020
23292
  scheme: _enum(["http", "https"]).optional()
23021
- }), GetConnectionEndpointsResultSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
23293
+ }), GetConnectionEndpointsResultSchema), method(_void(), NotificationEndpointSchema), method(object({ baseUrl: string$2().nullable() }), NotificationEndpointSchema, { kind: "mutation" }), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
23022
23294
  /**
23023
23295
  * mesh-network — collection cap for mesh-VPN providers.
23024
23296
  *
@@ -23817,7 +24089,12 @@ var RecordingDeviceUsageSchema = object({
23817
24089
  var RecordingLocationUsageSchema = object({
23818
24090
  /** StorageLocation id; null for the legacy/degraded single-root fallback. */
23819
24091
  locationId: string$2().nullable(),
23820
- /** Bytes of recordings stored on this location. */
24092
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
24093
+ * is emitted per physical disk (2026-07-29): two locations on one root
24094
+ * previously rendered as two identical "disks" with a nonsensical used
24095
+ * split — hydrate attribution across aliases is arbitrary by nature. */
24096
+ locationIds: array(string$2()).optional(),
24097
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). */
23821
24098
  usedBytes: number(),
23822
24099
  /** Free bytes on the location's volume; null when capacity is unknown (remote). */
23823
24100
  availableBytes: number().nullable(),
@@ -23929,6 +24206,44 @@ method(object({
23929
24206
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
23930
24207
  kind: "query",
23931
24208
  auth: "admin"
24209
+ }), method(object({
24210
+ deviceId: number(),
24211
+ aroundMs: number(),
24212
+ preRollSec: number().min(0).max(30).default(2),
24213
+ postRollSec: number().min(0).max(30).default(5),
24214
+ maxWidth: number().int().min(120).max(1280).default(480),
24215
+ fps: number().int().min(1).max(15).default(5)
24216
+ }), object({
24217
+ gifBase64: string$2(),
24218
+ fromMs: number(),
24219
+ toMs: number()
24220
+ }), {
24221
+ kind: "mutation",
24222
+ auth: "admin"
24223
+ }), method(object({
24224
+ deviceId: number(),
24225
+ aroundMs: number(),
24226
+ preRollSec: number().min(0).max(30).default(3),
24227
+ postRollSec: number().min(0).max(30).default(7),
24228
+ maxWidth: number().int().min(160).max(1920).default(640)
24229
+ }), object({
24230
+ clipBase64: string$2(),
24231
+ mime: string$2(),
24232
+ fromMs: number(),
24233
+ toMs: number(),
24234
+ bytes: number().int()
24235
+ }), {
24236
+ kind: "mutation",
24237
+ auth: "admin"
24238
+ }), method(RelocateFootageInputSchema, object({ jobId: string$2() }), {
24239
+ kind: "mutation",
24240
+ auth: "admin"
24241
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
24242
+ kind: "query",
24243
+ auth: "admin"
24244
+ }), method(object({ jobId: string$2() }), object({ cancelled: boolean() }), {
24245
+ kind: "mutation",
24246
+ auth: "admin"
23932
24247
  });
23933
24248
  /**
23934
24249
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -25520,6 +25835,12 @@ Object.freeze({
25520
25835
  addonId: null,
25521
25836
  access: "view"
25522
25837
  },
25838
+ "deviceManager.getDeviceStatusAggregateBatch": {
25839
+ capName: "device-manager",
25840
+ capScope: "system",
25841
+ addonId: null,
25842
+ access: "view"
25843
+ },
25523
25844
  "deviceManager.getLinkedDevices": {
25524
25845
  capName: "device-manager",
25525
25846
  capScope: "system",
@@ -26414,6 +26735,12 @@ Object.freeze({
26414
26735
  addonId: null,
26415
26736
  access: "view"
26416
26737
  },
26738
+ "localNetwork.getNotificationEndpoint": {
26739
+ capName: "local-network",
26740
+ capScope: "system",
26741
+ addonId: null,
26742
+ access: "view"
26743
+ },
26417
26744
  "localNetwork.getPreferred": {
26418
26745
  capName: "local-network",
26419
26746
  capScope: "system",
@@ -26438,6 +26765,12 @@ Object.freeze({
26438
26765
  addonId: null,
26439
26766
  access: "create"
26440
26767
  },
26768
+ "localNetwork.setNotificationEndpoint": {
26769
+ capName: "local-network",
26770
+ capScope: "system",
26771
+ addonId: null,
26772
+ access: "create"
26773
+ },
26441
26774
  "lockControl.lock": {
26442
26775
  capName: "lock-control",
26443
26776
  capScope: "device",
@@ -27080,6 +27413,12 @@ Object.freeze({
27080
27413
  addonId: null,
27081
27414
  access: "create"
27082
27415
  },
27416
+ "pipelineAnalytics.cancelMediaRelocate": {
27417
+ capName: "pipeline-analytics",
27418
+ capScope: "device",
27419
+ addonId: null,
27420
+ access: "create"
27421
+ },
27083
27422
  "pipelineAnalytics.clearTracks": {
27084
27423
  capName: "pipeline-analytics",
27085
27424
  capScope: "device",
@@ -27134,6 +27473,12 @@ Object.freeze({
27134
27473
  addonId: null,
27135
27474
  access: "view"
27136
27475
  },
27476
+ "pipelineAnalytics.getMediaRelocateStatus": {
27477
+ capName: "pipeline-analytics",
27478
+ capScope: "device",
27479
+ addonId: null,
27480
+ access: "view"
27481
+ },
27137
27482
  "pipelineAnalytics.getMotionEvents": {
27138
27483
  capName: "pipeline-analytics",
27139
27484
  capScope: "device",
@@ -27206,6 +27551,12 @@ Object.freeze({
27206
27551
  addonId: null,
27207
27552
  access: "create"
27208
27553
  },
27554
+ "pipelineAnalytics.relocateMedia": {
27555
+ capName: "pipeline-analytics",
27556
+ capScope: "device",
27557
+ addonId: null,
27558
+ access: "create"
27559
+ },
27209
27560
  "pipelineAnalytics.searchObjectEvents": {
27210
27561
  capName: "pipeline-analytics",
27211
27562
  capScope: "device",
@@ -27968,6 +28319,12 @@ Object.freeze({
27968
28319
  addonId: null,
27969
28320
  access: "create"
27970
28321
  },
28322
+ "recording.cancelRelocate": {
28323
+ capName: "recording",
28324
+ capScope: "system",
28325
+ addonId: null,
28326
+ access: "create"
28327
+ },
27971
28328
  "recording.deleteFootprint": {
27972
28329
  capName: "recording",
27973
28330
  capScope: "system",
@@ -27998,6 +28355,12 @@ Object.freeze({
27998
28355
  addonId: null,
27999
28356
  access: "view"
28000
28357
  },
28358
+ "recording.getRelocateStatus": {
28359
+ capName: "recording",
28360
+ capScope: "system",
28361
+ addonId: null,
28362
+ access: "view"
28363
+ },
28001
28364
  "recording.getStorageUsage": {
28002
28365
  capName: "recording",
28003
28366
  capScope: "system",
@@ -28028,6 +28391,24 @@ Object.freeze({
28028
28391
  addonId: null,
28029
28392
  access: "view"
28030
28393
  },
28394
+ "recording.relocateFootage": {
28395
+ capName: "recording",
28396
+ capScope: "system",
28397
+ addonId: null,
28398
+ access: "create"
28399
+ },
28400
+ "recording.renderClip": {
28401
+ capName: "recording",
28402
+ capScope: "system",
28403
+ addonId: null,
28404
+ access: "create"
28405
+ },
28406
+ "recording.renderGif": {
28407
+ capName: "recording",
28408
+ capScope: "system",
28409
+ addonId: null,
28410
+ access: "create"
28411
+ },
28031
28412
  "recording.rescanStorage": {
28032
28413
  capName: "recording",
28033
28414
  capScope: "system",
@@ -28622,6 +29003,12 @@ Object.freeze({
28622
29003
  addonId: null,
28623
29004
  access: "create"
28624
29005
  },
29006
+ "streamBroker.renderPreBufferClip": {
29007
+ capName: "stream-broker",
29008
+ capScope: "system",
29009
+ addonId: null,
29010
+ access: "create"
29011
+ },
28625
29012
  "streamBroker.restartProfile": {
28626
29013
  capName: "stream-broker",
28627
29014
  capScope: "system",