@camstack/addon-matter-broker 0.2.6 → 0.2.7

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 +451 -76
  2. package/dist/addon.mjs +451 -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()
@@ -18838,7 +19016,10 @@ method(object({
18838
19016
  }), method(object({
18839
19017
  deviceId: number(),
18840
19018
  caps: array(string$2()).readonly().optional()
18841
- }), record(string$2(), unknown().nullable()));
19019
+ }), record(string$2(), unknown().nullable())), method(object({
19020
+ deviceIds: array(number()).readonly(),
19021
+ caps: array(string$2()).readonly().optional()
19022
+ }), record(string$2(), record(string$2(), unknown().nullable())));
18842
19023
  method(object({ deviceId: number() }), record(string$2(), record(string$2(), unknown()))), method(object({
18843
19024
  deviceId: number(),
18844
19025
  capName: string$2()
@@ -19769,6 +19950,36 @@ var TargetKindSchema = object({
19769
19950
  icon: string$2(),
19770
19951
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
19771
19952
  addonId: string$2(),
19953
+ /**
19954
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
19955
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
19956
+ * when the addon bundles no icon for that kind — the client then falls back
19957
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
19958
+ *
19959
+ * Root-relative on purpose: it resolves against whatever origin serves a web
19960
+ * client, and a native client joins it onto its own hub base.
19961
+ *
19962
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
19963
+ * field that survived only because the runtime cap-router forwards provider
19964
+ * output verbatim — so every consumer had to re-declare it by hand to stop
19965
+ * its own Zod parse from stripping it, and the whole arrangement would have
19966
+ * broken silently the moment output validation was tightened anywhere.
19967
+ */
19968
+ iconUrl: string$2().optional(),
19969
+ /**
19970
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
19971
+ *
19972
+ * The server knows this and therefore says it, because the client cannot
19973
+ * safely guess: a React-Native client renders SVG and raster through two
19974
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
19975
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
19976
+ * placeholder glyph for every vector icon while the web build looked fine.
19977
+ *
19978
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
19979
+ * not been updated — a client that cannot determine the type should prefer
19980
+ * its raster path, which is the safe default for an unknown image.
19981
+ */
19982
+ iconMediaType: string$2().optional(),
19772
19983
  configSchema: ConfigSchemaPassthrough,
19773
19984
  supportsDiscovery: boolean(),
19774
19985
  caps: TargetKindCapsSchema
@@ -20216,6 +20427,29 @@ var MotionEventSchema = object({
20216
20427
  * Absent on legacy rows ⇒ treat as `pipeline`.
20217
20428
  */
20218
20429
  var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
20430
+ /**
20431
+ * The confirmed zone crossing that produced an object event. Present ONLY on
20432
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
20433
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
20434
+ * appearance event carry none, so a rule asking for a direction fails closed
20435
+ * on them.
20436
+ *
20437
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
20438
+ * into its own event, so a frame in which a track enters A while leaving B
20439
+ * produces two events with two directions — never one ambiguous row.
20440
+ *
20441
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
20442
+ * membership the box has NOW, and by definition it no longer contains the zone
20443
+ * that was just left. Without the id here, a zone-scoped rule could never match
20444
+ * the exit it asked for.
20445
+ */
20446
+ var ZoneCrossingSchema = object({
20447
+ direction: _enum(["enter", "exit"]),
20448
+ /** Admin zone id crossed. */
20449
+ zoneId: string$2(),
20450
+ /** Zone display name at crossing time (falls back to the id). */
20451
+ zoneName: string$2().optional()
20452
+ });
20219
20453
  var ObjectEventSchema = object({
20220
20454
  ...BaseEventFields,
20221
20455
  kind: literal("object"),
@@ -20242,6 +20476,12 @@ var ObjectEventSchema = object({
20242
20476
  zones: array(string$2()).readonly().optional(),
20243
20477
  /** Omitted in slim projection. */
20244
20478
  state: TrackStateSchema.optional(),
20479
+ /**
20480
+ * The zone crossing this event IS, when it is one. Absent on every other
20481
+ * event kind (movement state, appearance, package) — see
20482
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
20483
+ */
20484
+ zoneCrossing: ZoneCrossingSchema.optional(),
20245
20485
  /** Detection-frame dimensions in pixels — let consumers normalize the
20246
20486
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
20247
20487
  frameWidth: number().optional(),
@@ -20500,6 +20740,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20500
20740
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
20501
20741
  kind: "mutation",
20502
20742
  auth: "admin"
20743
+ }), method(RelocateMediaInputSchema, object({ jobId: string$2() }), {
20744
+ kind: "mutation",
20745
+ auth: "admin"
20746
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
20747
+ kind: "query",
20748
+ auth: "admin"
20749
+ }), method(object({ jobId: string$2() }), object({ cancelled: boolean() }), {
20750
+ kind: "mutation",
20751
+ auth: "admin"
20503
20752
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
20504
20753
  kind: "query",
20505
20754
  auth: "admin"
@@ -22996,6 +23245,17 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
22996
23245
  */
22997
23246
  priority: number()
22998
23247
  })).readonly() });
23248
+ /**
23249
+ * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
23250
+ * AUTO (resolved from the candidate ranking at send time); `resolved` reports
23251
+ * what AUTO currently picks, so the UI can show the effective value either way.
23252
+ */
23253
+ var NotificationEndpointSchema = object({
23254
+ /** The operator's explicit choice, or null for AUTO. */
23255
+ baseUrl: string$2().nullable(),
23256
+ /** What the ranking currently resolves to (null when nothing is reachable). */
23257
+ resolved: string$2().nullable()
23258
+ });
22999
23259
  var AllowedAddressesSchema = object({
23000
23260
  /**
23001
23261
  * Allowlist of interface addresses operators have explicitly opted
@@ -23018,7 +23278,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
23018
23278
  * to avoid mixed-content blocks in the browser. The public
23019
23279
  * tunnel always emits `https://` regardless. */
23020
23280
  scheme: _enum(["http", "https"]).optional()
23021
- }), GetConnectionEndpointsResultSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
23281
+ }), 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
23282
  /**
23023
23283
  * mesh-network — collection cap for mesh-VPN providers.
23024
23284
  *
@@ -23817,7 +24077,12 @@ var RecordingDeviceUsageSchema = object({
23817
24077
  var RecordingLocationUsageSchema = object({
23818
24078
  /** StorageLocation id; null for the legacy/degraded single-root fallback. */
23819
24079
  locationId: string$2().nullable(),
23820
- /** Bytes of recordings stored on this location. */
24080
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
24081
+ * is emitted per physical disk (2026-07-29): two locations on one root
24082
+ * previously rendered as two identical "disks" with a nonsensical used
24083
+ * split — hydrate attribution across aliases is arbitrary by nature. */
24084
+ locationIds: array(string$2()).optional(),
24085
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). */
23821
24086
  usedBytes: number(),
23822
24087
  /** Free bytes on the location's volume; null when capacity is unknown (remote). */
23823
24088
  availableBytes: number().nullable(),
@@ -23929,6 +24194,44 @@ method(object({
23929
24194
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
23930
24195
  kind: "query",
23931
24196
  auth: "admin"
24197
+ }), method(object({
24198
+ deviceId: number(),
24199
+ aroundMs: number(),
24200
+ preRollSec: number().min(0).max(30).default(2),
24201
+ postRollSec: number().min(0).max(30).default(5),
24202
+ maxWidth: number().int().min(120).max(1280).default(480),
24203
+ fps: number().int().min(1).max(15).default(5)
24204
+ }), object({
24205
+ gifBase64: string$2(),
24206
+ fromMs: number(),
24207
+ toMs: number()
24208
+ }), {
24209
+ kind: "mutation",
24210
+ auth: "admin"
24211
+ }), method(object({
24212
+ deviceId: number(),
24213
+ aroundMs: number(),
24214
+ preRollSec: number().min(0).max(30).default(3),
24215
+ postRollSec: number().min(0).max(30).default(7),
24216
+ maxWidth: number().int().min(160).max(1920).default(640)
24217
+ }), object({
24218
+ clipBase64: string$2(),
24219
+ mime: string$2(),
24220
+ fromMs: number(),
24221
+ toMs: number(),
24222
+ bytes: number().int()
24223
+ }), {
24224
+ kind: "mutation",
24225
+ auth: "admin"
24226
+ }), method(RelocateFootageInputSchema, object({ jobId: string$2() }), {
24227
+ kind: "mutation",
24228
+ auth: "admin"
24229
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
24230
+ kind: "query",
24231
+ auth: "admin"
24232
+ }), method(object({ jobId: string$2() }), object({ cancelled: boolean() }), {
24233
+ kind: "mutation",
24234
+ auth: "admin"
23932
24235
  });
23933
24236
  /**
23934
24237
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -25520,6 +25823,12 @@ Object.freeze({
25520
25823
  addonId: null,
25521
25824
  access: "view"
25522
25825
  },
25826
+ "deviceManager.getDeviceStatusAggregateBatch": {
25827
+ capName: "device-manager",
25828
+ capScope: "system",
25829
+ addonId: null,
25830
+ access: "view"
25831
+ },
25523
25832
  "deviceManager.getLinkedDevices": {
25524
25833
  capName: "device-manager",
25525
25834
  capScope: "system",
@@ -26414,6 +26723,12 @@ Object.freeze({
26414
26723
  addonId: null,
26415
26724
  access: "view"
26416
26725
  },
26726
+ "localNetwork.getNotificationEndpoint": {
26727
+ capName: "local-network",
26728
+ capScope: "system",
26729
+ addonId: null,
26730
+ access: "view"
26731
+ },
26417
26732
  "localNetwork.getPreferred": {
26418
26733
  capName: "local-network",
26419
26734
  capScope: "system",
@@ -26438,6 +26753,12 @@ Object.freeze({
26438
26753
  addonId: null,
26439
26754
  access: "create"
26440
26755
  },
26756
+ "localNetwork.setNotificationEndpoint": {
26757
+ capName: "local-network",
26758
+ capScope: "system",
26759
+ addonId: null,
26760
+ access: "create"
26761
+ },
26441
26762
  "lockControl.lock": {
26442
26763
  capName: "lock-control",
26443
26764
  capScope: "device",
@@ -27080,6 +27401,12 @@ Object.freeze({
27080
27401
  addonId: null,
27081
27402
  access: "create"
27082
27403
  },
27404
+ "pipelineAnalytics.cancelMediaRelocate": {
27405
+ capName: "pipeline-analytics",
27406
+ capScope: "device",
27407
+ addonId: null,
27408
+ access: "create"
27409
+ },
27083
27410
  "pipelineAnalytics.clearTracks": {
27084
27411
  capName: "pipeline-analytics",
27085
27412
  capScope: "device",
@@ -27134,6 +27461,12 @@ Object.freeze({
27134
27461
  addonId: null,
27135
27462
  access: "view"
27136
27463
  },
27464
+ "pipelineAnalytics.getMediaRelocateStatus": {
27465
+ capName: "pipeline-analytics",
27466
+ capScope: "device",
27467
+ addonId: null,
27468
+ access: "view"
27469
+ },
27137
27470
  "pipelineAnalytics.getMotionEvents": {
27138
27471
  capName: "pipeline-analytics",
27139
27472
  capScope: "device",
@@ -27206,6 +27539,12 @@ Object.freeze({
27206
27539
  addonId: null,
27207
27540
  access: "create"
27208
27541
  },
27542
+ "pipelineAnalytics.relocateMedia": {
27543
+ capName: "pipeline-analytics",
27544
+ capScope: "device",
27545
+ addonId: null,
27546
+ access: "create"
27547
+ },
27209
27548
  "pipelineAnalytics.searchObjectEvents": {
27210
27549
  capName: "pipeline-analytics",
27211
27550
  capScope: "device",
@@ -27968,6 +28307,12 @@ Object.freeze({
27968
28307
  addonId: null,
27969
28308
  access: "create"
27970
28309
  },
28310
+ "recording.cancelRelocate": {
28311
+ capName: "recording",
28312
+ capScope: "system",
28313
+ addonId: null,
28314
+ access: "create"
28315
+ },
27971
28316
  "recording.deleteFootprint": {
27972
28317
  capName: "recording",
27973
28318
  capScope: "system",
@@ -27998,6 +28343,12 @@ Object.freeze({
27998
28343
  addonId: null,
27999
28344
  access: "view"
28000
28345
  },
28346
+ "recording.getRelocateStatus": {
28347
+ capName: "recording",
28348
+ capScope: "system",
28349
+ addonId: null,
28350
+ access: "view"
28351
+ },
28001
28352
  "recording.getStorageUsage": {
28002
28353
  capName: "recording",
28003
28354
  capScope: "system",
@@ -28028,6 +28379,24 @@ Object.freeze({
28028
28379
  addonId: null,
28029
28380
  access: "view"
28030
28381
  },
28382
+ "recording.relocateFootage": {
28383
+ capName: "recording",
28384
+ capScope: "system",
28385
+ addonId: null,
28386
+ access: "create"
28387
+ },
28388
+ "recording.renderClip": {
28389
+ capName: "recording",
28390
+ capScope: "system",
28391
+ addonId: null,
28392
+ access: "create"
28393
+ },
28394
+ "recording.renderGif": {
28395
+ capName: "recording",
28396
+ capScope: "system",
28397
+ addonId: null,
28398
+ access: "create"
28399
+ },
28031
28400
  "recording.rescanStorage": {
28032
28401
  capName: "recording",
28033
28402
  capScope: "system",
@@ -28622,6 +28991,12 @@ Object.freeze({
28622
28991
  addonId: null,
28623
28992
  access: "create"
28624
28993
  },
28994
+ "streamBroker.renderPreBufferClip": {
28995
+ capName: "stream-broker",
28996
+ capScope: "system",
28997
+ addonId: null,
28998
+ access: "create"
28999
+ },
28625
29000
  "streamBroker.restartProfile": {
28626
29001
  capName: "stream-broker",
28627
29002
  capScope: "system",