@camstack/addon-provider-dreame 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.js CHANGED
@@ -37,7 +37,7 @@ let crypto$1 = require("crypto");
37
37
  let events = require("events");
38
38
  let zlib = require("zlib");
39
39
  zlib = __toESM(zlib, 1);
40
- //#region ../types/dist/event-category-BLcNejAE.mjs
40
+ //#region ../types/dist/event-category-Bz24uP1U.mjs
41
41
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
42
42
  EventCategory["SystemBoot"] = "system.boot";
43
43
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -308,6 +308,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
308
308
  */
309
309
  EventCategory["DeviceStateChanged"] = "device.state-changed";
310
310
  /**
311
+ * Frame occupancy for a camera CHANGED — a tracked object was gained or
312
+ * lost. Carries `{ deviceId, totalObjects, byClass, zones }`.
313
+ *
314
+ * Emitted only on a change, so a steady scene is silent. It exists so a
315
+ * client can stop polling `zoneAnalytics.getCurrentSnapshot`: that was the
316
+ * one live badge with no push signal at all, and it cost a request every
317
+ * four seconds per visible camera.
318
+ *
319
+ * Like every event it is telemetry and may be dropped ([D8]) — a consumer
320
+ * keeps a slow reconcile rather than trusting it alone.
321
+ */
322
+ EventCategory["ZoneAnalyticsOccupancyChanged"] = "zone-analytics.occupancy-changed";
323
+ /**
311
324
  * Cap event fired by every device that registers the `battery`
312
325
  * capability. Mirrors the cap definition's `onStatusChanged`. Carries
313
326
  * `{ deviceId, status: BatteryStatus }`. Subscribers (alert center,
@@ -7251,35 +7264,22 @@ var ConvertResultSchema = object({
7251
7264
  */
7252
7265
  var RecordingWeekdaySchema = number().int().min(0).max(6);
7253
7266
  var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
7254
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
7255
- kind: literal("timeOfDay"),
7256
- start: string().regex(HHMM),
7257
- end: string().regex(HHMM),
7258
- /** Restrict to these weekdays; omit = every day. */
7259
- days: array(RecordingWeekdaySchema).optional()
7260
- })]);
7261
- var RecordingModeSchema = _enum([
7262
- "continuous",
7263
- "onMotion",
7264
- "onAudioThreshold"
7265
- ]);
7266
7267
  /**
7267
- * First-class, authoritative per-camera storage mode — the explicit choice the
7268
- * UI reads directly (never inferred from `rules`):
7269
- * - `off` — not recording.
7270
- * - `events` — record only around triggers (motion / audio threshold),
7271
- * with pre/post-buffer.
7272
- * - `continuous` — record 24/7 within the schedule.
7268
+ * DERIVED per-camera storage summary — the single field cheap consumers read
7269
+ * (the viewer's status dot, the camera list) instead of walking `bands`:
7270
+ * - `off` — no band covers the camera (or it is disabled).
7271
+ * - `events` — every band records around triggers only.
7272
+ * - `continuous` — at least one band records continuously.
7273
7273
  *
7274
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
7275
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
7274
+ * NEVER authored: the recorder stamps it from the authoritative `bands` on
7275
+ * every save (`activeModeForConfig`). Writing it has no effect.
7276
7276
  */
7277
7277
  var RecordingStorageModeSchema = _enum([
7278
7278
  "off",
7279
7279
  "events",
7280
7280
  "continuous"
7281
7281
  ]);
7282
- /** Which detectors trigger an `events`-mode recording. */
7282
+ /** Which detectors trigger an `events`-mode band. */
7283
7283
  var RecordingTriggersSchema = object({
7284
7284
  motion: boolean().optional(),
7285
7285
  audioThresholdDbfs: number().optional()
@@ -7315,18 +7315,6 @@ var RecordingBandSchema = object({
7315
7315
  preBufferSec: number().min(0).optional(),
7316
7316
  postBufferSec: number().min(0).optional()
7317
7317
  });
7318
- var RecordingRuleSchema = object({
7319
- schedule: RecordingScheduleSchema,
7320
- mode: RecordingModeSchema,
7321
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
7322
- preBufferSec: number().min(0).default(0),
7323
- /** Keep recording until this many seconds after the last trigger. */
7324
- postBufferSec: number().min(0).default(0),
7325
- /** Each new trigger restarts the post-buffer window. */
7326
- resetTimeoutOnNewEvent: boolean().default(true),
7327
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
7328
- thresholdDbfs: number().optional()
7329
- });
7330
7318
  /**
7331
7319
  * Per-device retention overrides. Every field is optional; an unset or `0`
7332
7320
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7360,40 +7348,28 @@ var ScrubThumbnailPresetSchema = _enum([
7360
7348
  /**
7361
7349
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7362
7350
  *
7363
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
7364
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
7365
- * only for transition + migration (`migrateRulesToMode`); the policy engine
7366
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
7351
+ * `bands` is the ONLY authored recording intent: what to record, when, and on
7352
+ * which trigger. `mode` is a derived summary the recorder stamps on save; every
7353
+ * other field is a storage knob (profiles, segment length, retention, scrub).
7354
+ *
7355
+ * STRICT on purpose: the legacy authoring surface (`schedule`/`schedules`/
7356
+ * `triggers`/`preBufferSec`/`postBufferSec`/`rules`) was retired 2026-07-30.
7357
+ * A stale caller must fail loudly — silently stripping its legacy intent would
7358
+ * persist a band-less config, i.e. silently stop recording the camera.
7367
7359
  */
7368
7360
  var RecordingConfigSchema = object({
7369
7361
  enabled: boolean(),
7370
- /** Authoritative storage mode. Absent on legacy targets derived once via
7371
- * `migrateRulesToMode`, then persisted. */
7362
+ /** DERIVED summary of `bands`, stamped by the recorder on every save.
7363
+ * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7372
7364
  mode: RecordingStorageModeSchema.optional(),
7373
7365
  profiles: array(CamProfileSchema).optional(),
7374
7366
  segmentSeconds: number().int().positive().optional(),
7375
- /** Shared recording time-bands for `events` & `continuous` — record only when
7376
- * the wall-clock falls inside one of these windows. Omit or empty = always.
7377
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
7378
- schedules: array(RecordingScheduleSchema).optional(),
7379
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
7380
- * normalized into `schedules` on read and never written going forward. (Not
7381
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
7382
- schedule: RecordingScheduleSchema.optional(),
7383
- /** `events`-mode only — which detectors trigger a recording. */
7384
- triggers: RecordingTriggersSchema.optional(),
7385
- /** `events`-mode only — seconds retained before / after a trigger. */
7386
- preBufferSec: number().min(0).optional(),
7387
- postBufferSec: number().min(0).optional(),
7388
- /** DEPRECATED authoring input; retained for migration/transition. */
7389
- rules: array(RecordingRuleSchema).optional(),
7390
7367
  /**
7391
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
7392
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
7393
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
7394
- * derived into bands once via `migrateConfigToBands`.
7368
+ * AUTHORITATIVE mode-per-band recording model the single source of truth
7369
+ * the recorder's band engine consumes. An empty array = record nothing;
7370
+ * "off" is the absence of a covering band, never a band value.
7395
7371
  */
7396
- bands: array(RecordingBandSchema).optional(),
7372
+ bands: array(RecordingBandSchema).default([]),
7397
7373
  retention: RecordingRetentionSchema.optional(),
7398
7374
  /**
7399
7375
  * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
@@ -7401,8 +7377,15 @@ var RecordingConfigSchema = object({
7401
7377
  * windows only — existing sheets are immutable, and each window's index
7402
7378
  * carries its own tile dims so mixed-preset history renders correctly.
7403
7379
  */
7404
- scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7405
- });
7380
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional(),
7381
+ /**
7382
+ * OPT-IN thumbnail-strip generation for this camera: every keyframe of the
7383
+ * low recording saved as a JPEG (the fast-drag scrub depth), a derived
7384
+ * cache that eviction reclaims with the footage. Absent/false = no strips
7385
+ * are written and scrub reads exact keyframes at every velocity.
7386
+ */
7387
+ stripsEnabled: boolean().optional()
7388
+ }).strict();
7406
7389
  /**
7407
7390
  * Ops-log — the durable, append-only operations audit shared by the
7408
7391
  * recordings and events management surfaces.
@@ -7421,7 +7404,8 @@ var OpsLogOpSchema = _enum([
7421
7404
  "prune",
7422
7405
  "manual-delete",
7423
7406
  "rescan",
7424
- "retention-run"
7407
+ "retention-run",
7408
+ "relocate"
7425
7409
  ]);
7426
7410
  /** Why the operation ran. */
7427
7411
  var OpsLogReasonSchema = _enum([
@@ -7460,6 +7444,55 @@ var OpsLogQueryInputSchema = object({
7460
7444
  limit: number().int().min(1).max(1e3).optional()
7461
7445
  });
7462
7446
  /**
7447
+ * Entity-relocation job state (storage entity-routing spec, Phase 4).
7448
+ *
7449
+ * One shape shared by the recorder's `relocateFootage` (segments + strips) and
7450
+ * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7451
+ * page renders both movers with one component. Jobs are in-RAM (a restart
7452
+ * forgets them — re-running is safe by construction: copy-if-absent, delete
7453
+ * after verify) and each completed/failed run also lands one durable ops-log
7454
+ * row on the owning addon's surface.
7455
+ */
7456
+ var RelocateJobStateSchema = _enum([
7457
+ "running",
7458
+ "done",
7459
+ "failed",
7460
+ "cancelled"
7461
+ ]);
7462
+ var RelocateJobSchema = object({
7463
+ jobId: string(),
7464
+ state: RelocateJobStateSchema,
7465
+ /** Source location — for media relocation this is informational ('*': rows
7466
+ * move from wherever they are to the target). */
7467
+ fromLocationId: string(),
7468
+ toLocationId: string(),
7469
+ /** Scoped device, or null = every device. */
7470
+ deviceId: number().nullable(),
7471
+ /** What the job moves (owner-addon specific: segments/strips or media). */
7472
+ entities: array(string()),
7473
+ filesMoved: number().int(),
7474
+ bytesMoved: number().int(),
7475
+ /** Total files discovered up front; null while (or when) unknown. */
7476
+ filesTotal: number().int().nullable(),
7477
+ startedAt: number(),
7478
+ finishedAt: number().nullable(),
7479
+ error: string().nullable()
7480
+ });
7481
+ var RelocateFootageInputSchema = object({
7482
+ deviceId: number().optional(),
7483
+ fromLocationId: string(),
7484
+ toLocationId: string(),
7485
+ entities: array(_enum(["segments", "strips"])).optional(),
7486
+ /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7487
+ * never allowed to starve live writers. */
7488
+ throttleMbps: number().min(1).max(1e3).optional()
7489
+ });
7490
+ var RelocateMediaInputSchema = object({
7491
+ deviceId: number().optional(),
7492
+ toLocationId: string(),
7493
+ throttleMbps: number().min(1).max(1e3).optional()
7494
+ });
7495
+ /**
7463
7496
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7464
7497
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7465
7498
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -7509,6 +7542,13 @@ var StorageLocationSchema = object({
7509
7542
  nodeId: string().optional(),
7510
7543
  isDefault: boolean().default(false),
7511
7544
  isSystem: boolean().default(false),
7545
+ /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7546
+ * for node-local locations it can reach) — never persisted, absent when the
7547
+ * volume is remote/unreachable. The single capacity truth every UI reads. */
7548
+ capacity: object({
7549
+ totalBytes: number(),
7550
+ availableBytes: number()
7551
+ }).nullable().optional(),
7512
7552
  createdAt: number(),
7513
7553
  updatedAt: number()
7514
7554
  });
@@ -8276,7 +8316,8 @@ var NcTaxonomyEntrySchema = object({
8276
8316
  /** Macro/category parent for grouping ('car' → 'vehicle'); null for a top. */
8277
8317
  parentKind: string().nullable()
8278
8318
  });
8279
- object({
8319
+ /** The complete NC picker taxonomy — three grouped buckets. */
8320
+ var NcTaxonomySchema = object({
8280
8321
  videoClasses: array(NcTaxonomyEntrySchema),
8281
8322
  audioKinds: array(NcTaxonomyEntrySchema),
8282
8323
  labels: array(NcTaxonomyEntrySchema)
@@ -9179,6 +9220,7 @@ function shallowEqual(a, b) {
9179
9220
  for (const k of ak) if (a[k] !== b[k]) return false;
9180
9221
  return true;
9181
9222
  }
9223
+ new Set(["devices", "classes"]);
9182
9224
  /**
9183
9225
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
9184
9226
  * motion-zones, and the detection zones/lines editor all speak this one
@@ -9337,6 +9379,29 @@ var NcOccupancyConditionSchema = object({
9337
9379
  count: number().int().min(0).default(1),
9338
9380
  sustainSeconds: number().int().min(0).max(3600).default(15)
9339
9381
  });
9382
+ /**
9383
+ * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
9384
+ *
9385
+ * The values are not symmetric, and deliberately so — the absent value has to
9386
+ * mean exactly what every rule authored before this condition existed already
9387
+ * does:
9388
+ * - `enter` — entries and every NON-crossing record (movement state,
9389
+ * package, sensor). Exits are rejected. **This is the absent behaviour**:
9390
+ * an operator who never asked for exits must not start receiving them.
9391
+ * - `exit` — ONLY an exit crossing. A record that is not a crossing at all
9392
+ * fails closed, because "the car left the drive" is a question about a
9393
+ * boundary, not about a detection.
9394
+ * - `any` — no direction filter; entries, exits and non-crossings alike.
9395
+ *
9396
+ * A rule asking for a direction should normally also scope `zones`, which the
9397
+ * engine evaluates against the crossed zone as well as the current membership
9398
+ * (an exit's membership no longer contains the zone it just left).
9399
+ */
9400
+ var NcCrossingSchema = _enum([
9401
+ "enter",
9402
+ "exit",
9403
+ "any"
9404
+ ]);
9340
9405
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
9341
9406
  var NcZoneConditionSchema = object({
9342
9407
  ids: array(string().min(1)).min(1),
@@ -9361,6 +9426,13 @@ var NcConditionsSchema = object({
9361
9426
  /** Veto zones — any hit fails the rule. */
9362
9427
  zonesExclude: array(string().min(1)).optional(),
9363
9428
  /**
9429
+ * Zone-crossing direction. IMMEDIATE only — a crossing is a per-event fact
9430
+ * and a closed track carries none, so a `track-end` rule asking for one
9431
+ * fails closed (use `zones`, which tests `zonesVisited`). ABSENT = `enter`,
9432
+ * which is exactly today's behaviour. See {@link NcCrossingSchema}.
9433
+ */
9434
+ crossing: NcCrossingSchema.optional(),
9435
+ /**
9364
9436
  * Exact (case-insensitive) match on the record's collapsed `label`
9365
9437
  * (identity name / plate text / subclass).
9366
9438
  */
@@ -9495,17 +9567,85 @@ var NcRuleTargetSchema = object({
9495
9567
  * - `keyFrame` — the clean scene frame (no subject box).
9496
9568
  * - `none` — no attachment.
9497
9569
  */
9498
- var NcMediaPolicySchema = object({ attach: _enum([
9499
- "best",
9500
- "best-matching",
9501
- "keyFrame",
9502
- "none"
9503
- ]).default("best") });
9570
+ /**
9571
+ * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
9572
+ * conflate it with the selection strategy and betray the request: asking for
9573
+ * the clean scene frame on an object-event owner used to start at
9574
+ * `fullFrameBoxed`, i.e. the annotated frame (2026-07-30).
9575
+ * - `cropped` — the subject, tight. What "who is at the door" wants.
9576
+ * - `full` — the clean scene, no annotation. What "what is going on" wants.
9577
+ * - `boxed` — the scene WITH the detection boxes drawn, for verifying what
9578
+ * the pipeline actually saw.
9579
+ */
9580
+ var NcMediaFrameSchema = _enum([
9581
+ "cropped",
9582
+ "full",
9583
+ "boxed"
9584
+ ]);
9585
+ var NcMediaPolicySchema = object({
9586
+ attach: _enum([
9587
+ "best",
9588
+ "best-matching",
9589
+ "keyFrame",
9590
+ "none"
9591
+ ]).default("best"),
9592
+ /** What the still shows. Absent = `cropped` (the historical `best` shape). */
9593
+ frame: NcMediaFrameSchema.optional(),
9594
+ /** Crop the attached still to the rule's condition-zone bbox (padded) —
9595
+ * "show me the ZONE", not the whole scene or the subject crop. */
9596
+ zoneCrop: boolean().optional(),
9597
+ /**
9598
+ * Also attach a short GIF cut from the stream broker's clip ring around the
9599
+ * event — NOT from the recording, so the camera does not have to be
9600
+ * recording, and the window sits AROUND the moment instead of a segment
9601
+ * behind it. Fail-closed: a window the ring does not cover contributes no
9602
+ * gif, never a failed notification.
9603
+ */
9604
+ gif: boolean().optional(),
9605
+ /**
9606
+ * Also attach a short MP4 CLIP of the same cut. Same source and the same
9607
+ * fail-closed rule as `gif`. Prefer it where the backend takes video
9608
+ * (telegram, discord, zentik, webhook); backends that do not are handled by
9609
+ * the degrade engine, which drops the video and keeps the still.
9610
+ */
9611
+ clip: boolean().optional(),
9612
+ /** Seconds of footage BEFORE / AFTER the event instant. Defaults 3 / 7. */
9613
+ clipPreRollSec: number().int().min(0).max(30).optional(),
9614
+ clipPostRollSec: number().int().min(0).max(30).optional(),
9615
+ /**
9616
+ * Which stream profile the footage is cut from. Absent = the CHEAPEST
9617
+ * assigned profile: a notification is watched on a phone, so the 4K
9618
+ * rendition would burn CPU to produce a file the client downscales anyway.
9619
+ * A profile that is not assigned falls back to the cheapest, and the render
9620
+ * reports which one actually ran.
9621
+ */
9622
+ profile: CamProfileSchema.optional()
9623
+ });
9624
+ /**
9625
+ * Cooldown GRANULARITY over the subject's class — how much a fired
9626
+ * notification suppresses.
9627
+ * - `shared` (default, and the absent value) — one window for the whole
9628
+ * rule/scope: a cat silences the next dog for `cooldownSec`.
9629
+ * - `per-class` — an independent window per detected class, so cat→dog fires
9630
+ * at once and cat→cat still waits.
9631
+ *
9632
+ * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
9633
+ * must not be swallowed by a bark's window (the precedent this generalizes —
9634
+ * see `cooldownKey` in the rule engine).
9635
+ */
9636
+ var NcThrottleGranularitySchema = _enum(["shared", "per-class"]);
9504
9637
  /** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
9505
9638
  var NcThrottleSchema = object({
9506
9639
  cooldownSec: number().int().min(0).max(86400).default(60),
9507
9640
  /** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
9508
- scope: _enum(["rule", "rule-device"]).default("rule-device")
9641
+ scope: _enum(["rule", "rule-device"]).default("rule-device"),
9642
+ /**
9643
+ * Class granularity of the cooldown key. Optional rather than defaulted:
9644
+ * a Zod default does NOT run on the addon→addon cap path, so a persisted
9645
+ * rule authored before this field simply carries none — and the engine
9646
+ * reads absent as `shared`, the pre-existing behaviour.
9647
+ */
9648
+ granularity: NcThrottleGranularitySchema.optional()
9509
9649
  });
9510
9650
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
9511
9651
  var NcRuleInputSchema = object({
@@ -9514,7 +9654,19 @@ var NcRuleInputSchema = object({
9514
9654
  delivery: NcDeliverySchema,
9515
9655
  conditions: NcConditionsSchema.default({}),
9516
9656
  schedule: NcScheduleSchema.optional(),
9517
- targets: array(NcRuleTargetSchema).min(1),
9657
+ /** May be empty when `targetUsers` addresses at least one user — the
9658
+ * "at least one addressee" invariant is enforced by the provider, because
9659
+ * a cross-field refine here would break `NcRulePatchSchema.partial()`. */
9660
+ targets: array(NcRuleTargetSchema),
9661
+ /**
9662
+ * USERS this rule addresses in addition to `targets` (Phase 4). At fire
9663
+ * time each user fans out to the personal targets they own
9664
+ * (`config.ownerUserId`), filtered by that user's `allowedDevices` for the
9665
+ * firing camera — a user is never notified about a device they cannot open.
9666
+ * Per-user opt-outs (`disabledTargetIds`) still apply to the fanned-out
9667
+ * targets.
9668
+ */
9669
+ targetUsers: array(string()).optional(),
9518
9670
  media: NcMediaPolicySchema.default({ attach: "best" }),
9519
9671
  throttle: NcThrottleSchema.default({
9520
9672
  cooldownSec: 60,
@@ -9601,6 +9753,7 @@ var NcConditionDescriptorSchema = object({
9601
9753
  "schedule",
9602
9754
  "plateMatcher",
9603
9755
  "packagePhase",
9756
+ "crossingSelect",
9604
9757
  "polygonDraw",
9605
9758
  "occupancy"
9606
9759
  ]),
@@ -9727,7 +9880,10 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
9727
9880
  }), object({ results: array(NcTestResultSchema) }), {
9728
9881
  kind: "mutation",
9729
9882
  auth: "admin"
9730
- }), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9883
+ }), method(object({}), object({
9884
+ catalog: array(NcConditionDescriptorSchema),
9885
+ taxonomy: NcTaxonomySchema.optional()
9886
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9731
9887
  /**
9732
9888
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
9733
9889
  *
@@ -10736,6 +10892,28 @@ method(object({
10736
10892
  }), object({ success: literal(true) }), {
10737
10893
  kind: "mutation",
10738
10894
  auth: "admin"
10895
+ }), method(object({
10896
+ deviceId: number(),
10897
+ /** Absent = the LOWEST assigned profile — a notification attachment is
10898
+ * watched on a phone, and the cheap rendition is the right default. */
10899
+ profile: CamProfileSchema.optional(),
10900
+ aroundMs: number(),
10901
+ preRollSec: number().min(0).max(20).default(3),
10902
+ postRollSec: number().min(0).max(20).default(5),
10903
+ format: _enum(["gif", "mp4"]).default("gif"),
10904
+ maxWidth: number().int().min(120).max(1920).default(480),
10905
+ /** GIF only — MP4 keeps the source cadence. */
10906
+ fps: number().int().min(1).max(15).default(5)
10907
+ }), object({
10908
+ base64: string(),
10909
+ mime: string(),
10910
+ bytes: number().int(),
10911
+ /** The profile actually rendered (what the default resolved to). */
10912
+ profile: CamProfileSchema,
10913
+ durationMs: number()
10914
+ }), {
10915
+ kind: "mutation",
10916
+ auth: "admin"
10739
10917
  }), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string() }), BrokerStatsSchema), method(object({ brokerId: string() }), object({
10740
10918
  probed: boolean(),
10741
10919
  summary: string()
@@ -18815,7 +18993,10 @@ method(object({
18815
18993
  }), method(object({
18816
18994
  deviceId: number(),
18817
18995
  caps: array(string()).readonly().optional()
18818
- }), record(string(), unknown().nullable()));
18996
+ }), record(string(), unknown().nullable())), method(object({
18997
+ deviceIds: array(number()).readonly(),
18998
+ caps: array(string()).readonly().optional()
18999
+ }), record(string(), record(string(), unknown().nullable())));
18819
19000
  method(object({ deviceId: number() }), record(string(), record(string(), unknown()))), method(object({
18820
19001
  deviceId: number(),
18821
19002
  capName: string()
@@ -19746,6 +19927,36 @@ var TargetKindSchema = object({
19746
19927
  icon: string(),
19747
19928
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
19748
19929
  addonId: string(),
19930
+ /**
19931
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
19932
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
19933
+ * when the addon bundles no icon for that kind — the client then falls back
19934
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
19935
+ *
19936
+ * Root-relative on purpose: it resolves against whatever origin serves a web
19937
+ * client, and a native client joins it onto its own hub base.
19938
+ *
19939
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
19940
+ * field that survived only because the runtime cap-router forwards provider
19941
+ * output verbatim — so every consumer had to re-declare it by hand to stop
19942
+ * its own Zod parse from stripping it, and the whole arrangement would have
19943
+ * broken silently the moment output validation was tightened anywhere.
19944
+ */
19945
+ iconUrl: string().optional(),
19946
+ /**
19947
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
19948
+ *
19949
+ * The server knows this and therefore says it, because the client cannot
19950
+ * safely guess: a React-Native client renders SVG and raster through two
19951
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
19952
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
19953
+ * placeholder glyph for every vector icon while the web build looked fine.
19954
+ *
19955
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
19956
+ * not been updated — a client that cannot determine the type should prefer
19957
+ * its raster path, which is the safe default for an unknown image.
19958
+ */
19959
+ iconMediaType: string().optional(),
19749
19960
  configSchema: ConfigSchemaPassthrough,
19750
19961
  supportsDiscovery: boolean(),
19751
19962
  caps: TargetKindCapsSchema
@@ -20193,6 +20404,29 @@ var MotionEventSchema = object({
20193
20404
  * Absent on legacy rows ⇒ treat as `pipeline`.
20194
20405
  */
20195
20406
  var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
20407
+ /**
20408
+ * The confirmed zone crossing that produced an object event. Present ONLY on
20409
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
20410
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
20411
+ * appearance event carry none, so a rule asking for a direction fails closed
20412
+ * on them.
20413
+ *
20414
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
20415
+ * into its own event, so a frame in which a track enters A while leaving B
20416
+ * produces two events with two directions — never one ambiguous row.
20417
+ *
20418
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
20419
+ * membership the box has NOW, and by definition it no longer contains the zone
20420
+ * that was just left. Without the id here, a zone-scoped rule could never match
20421
+ * the exit it asked for.
20422
+ */
20423
+ var ZoneCrossingSchema = object({
20424
+ direction: _enum(["enter", "exit"]),
20425
+ /** Admin zone id crossed. */
20426
+ zoneId: string(),
20427
+ /** Zone display name at crossing time (falls back to the id). */
20428
+ zoneName: string().optional()
20429
+ });
20196
20430
  var ObjectEventSchema = object({
20197
20431
  ...BaseEventFields,
20198
20432
  kind: literal("object"),
@@ -20219,6 +20453,12 @@ var ObjectEventSchema = object({
20219
20453
  zones: array(string()).readonly().optional(),
20220
20454
  /** Omitted in slim projection. */
20221
20455
  state: TrackStateSchema.optional(),
20456
+ /**
20457
+ * The zone crossing this event IS, when it is one. Absent on every other
20458
+ * event kind (movement state, appearance, package) — see
20459
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
20460
+ */
20461
+ zoneCrossing: ZoneCrossingSchema.optional(),
20222
20462
  /** Detection-frame dimensions in pixels — let consumers normalize the
20223
20463
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
20224
20464
  frameWidth: number().optional(),
@@ -20477,6 +20717,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20477
20717
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
20478
20718
  kind: "mutation",
20479
20719
  auth: "admin"
20720
+ }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
20721
+ kind: "mutation",
20722
+ auth: "admin"
20723
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
20724
+ kind: "query",
20725
+ auth: "admin"
20726
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
20727
+ kind: "mutation",
20728
+ auth: "admin"
20480
20729
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
20481
20730
  kind: "query",
20482
20731
  auth: "admin"
@@ -22973,6 +23222,17 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
22973
23222
  */
22974
23223
  priority: number()
22975
23224
  })).readonly() });
23225
+ /**
23226
+ * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
23227
+ * AUTO (resolved from the candidate ranking at send time); `resolved` reports
23228
+ * what AUTO currently picks, so the UI can show the effective value either way.
23229
+ */
23230
+ var NotificationEndpointSchema = object({
23231
+ /** The operator's explicit choice, or null for AUTO. */
23232
+ baseUrl: string().nullable(),
23233
+ /** What the ranking currently resolves to (null when nothing is reachable). */
23234
+ resolved: string().nullable()
23235
+ });
22976
23236
  var AllowedAddressesSchema = object({
22977
23237
  /**
22978
23238
  * Allowlist of interface addresses operators have explicitly opted
@@ -22995,7 +23255,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
22995
23255
  * to avoid mixed-content blocks in the browser. The public
22996
23256
  * tunnel always emits `https://` regardless. */
22997
23257
  scheme: _enum(["http", "https"]).optional()
22998
- }), GetConnectionEndpointsResultSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
23258
+ }), 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" });
22999
23259
  /**
23000
23260
  * mesh-network — collection cap for mesh-VPN providers.
23001
23261
  *
@@ -23794,7 +24054,12 @@ var RecordingDeviceUsageSchema = object({
23794
24054
  var RecordingLocationUsageSchema = object({
23795
24055
  /** StorageLocation id; null for the legacy/degraded single-root fallback. */
23796
24056
  locationId: string().nullable(),
23797
- /** Bytes of recordings stored on this location. */
24057
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
24058
+ * is emitted per physical disk (2026-07-29): two locations on one root
24059
+ * previously rendered as two identical "disks" with a nonsensical used
24060
+ * split — hydrate attribution across aliases is arbitrary by nature. */
24061
+ locationIds: array(string()).optional(),
24062
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). */
23798
24063
  usedBytes: number(),
23799
24064
  /** Free bytes on the location's volume; null when capacity is unknown (remote). */
23800
24065
  availableBytes: number().nullable(),
@@ -23906,6 +24171,44 @@ method(object({
23906
24171
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
23907
24172
  kind: "query",
23908
24173
  auth: "admin"
24174
+ }), method(object({
24175
+ deviceId: number(),
24176
+ aroundMs: number(),
24177
+ preRollSec: number().min(0).max(30).default(2),
24178
+ postRollSec: number().min(0).max(30).default(5),
24179
+ maxWidth: number().int().min(120).max(1280).default(480),
24180
+ fps: number().int().min(1).max(15).default(5)
24181
+ }), object({
24182
+ gifBase64: string(),
24183
+ fromMs: number(),
24184
+ toMs: number()
24185
+ }), {
24186
+ kind: "mutation",
24187
+ auth: "admin"
24188
+ }), method(object({
24189
+ deviceId: number(),
24190
+ aroundMs: number(),
24191
+ preRollSec: number().min(0).max(30).default(3),
24192
+ postRollSec: number().min(0).max(30).default(7),
24193
+ maxWidth: number().int().min(160).max(1920).default(640)
24194
+ }), object({
24195
+ clipBase64: string(),
24196
+ mime: string(),
24197
+ fromMs: number(),
24198
+ toMs: number(),
24199
+ bytes: number().int()
24200
+ }), {
24201
+ kind: "mutation",
24202
+ auth: "admin"
24203
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
24204
+ kind: "mutation",
24205
+ auth: "admin"
24206
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
24207
+ kind: "query",
24208
+ auth: "admin"
24209
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
24210
+ kind: "mutation",
24211
+ auth: "admin"
23909
24212
  });
23910
24213
  /**
23911
24214
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -25497,6 +25800,12 @@ Object.freeze({
25497
25800
  addonId: null,
25498
25801
  access: "view"
25499
25802
  },
25803
+ "deviceManager.getDeviceStatusAggregateBatch": {
25804
+ capName: "device-manager",
25805
+ capScope: "system",
25806
+ addonId: null,
25807
+ access: "view"
25808
+ },
25500
25809
  "deviceManager.getLinkedDevices": {
25501
25810
  capName: "device-manager",
25502
25811
  capScope: "system",
@@ -26391,6 +26700,12 @@ Object.freeze({
26391
26700
  addonId: null,
26392
26701
  access: "view"
26393
26702
  },
26703
+ "localNetwork.getNotificationEndpoint": {
26704
+ capName: "local-network",
26705
+ capScope: "system",
26706
+ addonId: null,
26707
+ access: "view"
26708
+ },
26394
26709
  "localNetwork.getPreferred": {
26395
26710
  capName: "local-network",
26396
26711
  capScope: "system",
@@ -26415,6 +26730,12 @@ Object.freeze({
26415
26730
  addonId: null,
26416
26731
  access: "create"
26417
26732
  },
26733
+ "localNetwork.setNotificationEndpoint": {
26734
+ capName: "local-network",
26735
+ capScope: "system",
26736
+ addonId: null,
26737
+ access: "create"
26738
+ },
26418
26739
  "lockControl.lock": {
26419
26740
  capName: "lock-control",
26420
26741
  capScope: "device",
@@ -27057,6 +27378,12 @@ Object.freeze({
27057
27378
  addonId: null,
27058
27379
  access: "create"
27059
27380
  },
27381
+ "pipelineAnalytics.cancelMediaRelocate": {
27382
+ capName: "pipeline-analytics",
27383
+ capScope: "device",
27384
+ addonId: null,
27385
+ access: "create"
27386
+ },
27060
27387
  "pipelineAnalytics.clearTracks": {
27061
27388
  capName: "pipeline-analytics",
27062
27389
  capScope: "device",
@@ -27111,6 +27438,12 @@ Object.freeze({
27111
27438
  addonId: null,
27112
27439
  access: "view"
27113
27440
  },
27441
+ "pipelineAnalytics.getMediaRelocateStatus": {
27442
+ capName: "pipeline-analytics",
27443
+ capScope: "device",
27444
+ addonId: null,
27445
+ access: "view"
27446
+ },
27114
27447
  "pipelineAnalytics.getMotionEvents": {
27115
27448
  capName: "pipeline-analytics",
27116
27449
  capScope: "device",
@@ -27183,6 +27516,12 @@ Object.freeze({
27183
27516
  addonId: null,
27184
27517
  access: "create"
27185
27518
  },
27519
+ "pipelineAnalytics.relocateMedia": {
27520
+ capName: "pipeline-analytics",
27521
+ capScope: "device",
27522
+ addonId: null,
27523
+ access: "create"
27524
+ },
27186
27525
  "pipelineAnalytics.searchObjectEvents": {
27187
27526
  capName: "pipeline-analytics",
27188
27527
  capScope: "device",
@@ -27945,6 +28284,12 @@ Object.freeze({
27945
28284
  addonId: null,
27946
28285
  access: "create"
27947
28286
  },
28287
+ "recording.cancelRelocate": {
28288
+ capName: "recording",
28289
+ capScope: "system",
28290
+ addonId: null,
28291
+ access: "create"
28292
+ },
27948
28293
  "recording.deleteFootprint": {
27949
28294
  capName: "recording",
27950
28295
  capScope: "system",
@@ -27975,6 +28320,12 @@ Object.freeze({
27975
28320
  addonId: null,
27976
28321
  access: "view"
27977
28322
  },
28323
+ "recording.getRelocateStatus": {
28324
+ capName: "recording",
28325
+ capScope: "system",
28326
+ addonId: null,
28327
+ access: "view"
28328
+ },
27978
28329
  "recording.getStorageUsage": {
27979
28330
  capName: "recording",
27980
28331
  capScope: "system",
@@ -28005,6 +28356,24 @@ Object.freeze({
28005
28356
  addonId: null,
28006
28357
  access: "view"
28007
28358
  },
28359
+ "recording.relocateFootage": {
28360
+ capName: "recording",
28361
+ capScope: "system",
28362
+ addonId: null,
28363
+ access: "create"
28364
+ },
28365
+ "recording.renderClip": {
28366
+ capName: "recording",
28367
+ capScope: "system",
28368
+ addonId: null,
28369
+ access: "create"
28370
+ },
28371
+ "recording.renderGif": {
28372
+ capName: "recording",
28373
+ capScope: "system",
28374
+ addonId: null,
28375
+ access: "create"
28376
+ },
28008
28377
  "recording.rescanStorage": {
28009
28378
  capName: "recording",
28010
28379
  capScope: "system",
@@ -28599,6 +28968,12 @@ Object.freeze({
28599
28968
  addonId: null,
28600
28969
  access: "create"
28601
28970
  },
28971
+ "streamBroker.renderPreBufferClip": {
28972
+ capName: "stream-broker",
28973
+ capScope: "system",
28974
+ addonId: null,
28975
+ access: "create"
28976
+ },
28602
28977
  "streamBroker.restartProfile": {
28603
28978
  capName: "stream-broker",
28604
28979
  capScope: "system",