@camstack/addon-mqtt-broker 1.2.6 → 1.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.
@@ -44,7 +44,7 @@ let crypto$10 = __toESM(crypto$1, 1);
44
44
  crypto$1 = __toESM(crypto$1);
45
45
  let node_fs = require("node:fs");
46
46
  let node_path = require("node:path");
47
- //#region ../types/dist/event-category-BLcNejAE.mjs
47
+ //#region ../types/dist/event-category-Bz24uP1U.mjs
48
48
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
49
49
  EventCategory["SystemBoot"] = "system.boot";
50
50
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -315,6 +315,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
315
315
  */
316
316
  EventCategory["DeviceStateChanged"] = "device.state-changed";
317
317
  /**
318
+ * Frame occupancy for a camera CHANGED — a tracked object was gained or
319
+ * lost. Carries `{ deviceId, totalObjects, byClass, zones }`.
320
+ *
321
+ * Emitted only on a change, so a steady scene is silent. It exists so a
322
+ * client can stop polling `zoneAnalytics.getCurrentSnapshot`: that was the
323
+ * one live badge with no push signal at all, and it cost a request every
324
+ * four seconds per visible camera.
325
+ *
326
+ * Like every event it is telemetry and may be dropped ([D8]) — a consumer
327
+ * keeps a slow reconcile rather than trusting it alone.
328
+ */
329
+ EventCategory["ZoneAnalyticsOccupancyChanged"] = "zone-analytics.occupancy-changed";
330
+ /**
318
331
  * Cap event fired by every device that registers the `battery`
319
332
  * capability. Mirrors the cap definition's `onStatusChanged`. Carries
320
333
  * `{ deviceId, status: BatteryStatus }`. Subscribers (alert center,
@@ -7228,35 +7241,22 @@ var ConvertResultSchema = object({
7228
7241
  */
7229
7242
  var RecordingWeekdaySchema = number().int().min(0).max(6);
7230
7243
  var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
7231
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
7232
- kind: literal("timeOfDay"),
7233
- start: string().regex(HHMM),
7234
- end: string().regex(HHMM),
7235
- /** Restrict to these weekdays; omit = every day. */
7236
- days: array(RecordingWeekdaySchema).optional()
7237
- })]);
7238
- var RecordingModeSchema = _enum([
7239
- "continuous",
7240
- "onMotion",
7241
- "onAudioThreshold"
7242
- ]);
7243
7244
  /**
7244
- * First-class, authoritative per-camera storage mode — the explicit choice the
7245
- * UI reads directly (never inferred from `rules`):
7246
- * - `off` — not recording.
7247
- * - `events` — record only around triggers (motion / audio threshold),
7248
- * with pre/post-buffer.
7249
- * - `continuous` — record 24/7 within the schedule.
7245
+ * DERIVED per-camera storage summary — the single field cheap consumers read
7246
+ * (the viewer's status dot, the camera list) instead of walking `bands`:
7247
+ * - `off` — no band covers the camera (or it is disabled).
7248
+ * - `events` — every band records around triggers only.
7249
+ * - `continuous` — at least one band records continuously.
7250
7250
  *
7251
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
7252
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
7251
+ * NEVER authored: the recorder stamps it from the authoritative `bands` on
7252
+ * every save (`activeModeForConfig`). Writing it has no effect.
7253
7253
  */
7254
7254
  var RecordingStorageModeSchema = _enum([
7255
7255
  "off",
7256
7256
  "events",
7257
7257
  "continuous"
7258
7258
  ]);
7259
- /** Which detectors trigger an `events`-mode recording. */
7259
+ /** Which detectors trigger an `events`-mode band. */
7260
7260
  var RecordingTriggersSchema = object({
7261
7261
  motion: boolean().optional(),
7262
7262
  audioThresholdDbfs: number().optional()
@@ -7292,18 +7292,6 @@ var RecordingBandSchema = object({
7292
7292
  preBufferSec: number().min(0).optional(),
7293
7293
  postBufferSec: number().min(0).optional()
7294
7294
  });
7295
- var RecordingRuleSchema = object({
7296
- schedule: RecordingScheduleSchema,
7297
- mode: RecordingModeSchema,
7298
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
7299
- preBufferSec: number().min(0).default(0),
7300
- /** Keep recording until this many seconds after the last trigger. */
7301
- postBufferSec: number().min(0).default(0),
7302
- /** Each new trigger restarts the post-buffer window. */
7303
- resetTimeoutOnNewEvent: boolean().default(true),
7304
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
7305
- thresholdDbfs: number().optional()
7306
- });
7307
7295
  /**
7308
7296
  * Per-device retention overrides. Every field is optional; an unset or `0`
7309
7297
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7337,40 +7325,28 @@ var ScrubThumbnailPresetSchema = _enum([
7337
7325
  /**
7338
7326
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7339
7327
  *
7340
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
7341
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
7342
- * only for transition + migration (`migrateRulesToMode`); the policy engine
7343
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
7328
+ * `bands` is the ONLY authored recording intent: what to record, when, and on
7329
+ * which trigger. `mode` is a derived summary the recorder stamps on save; every
7330
+ * other field is a storage knob (profiles, segment length, retention, scrub).
7331
+ *
7332
+ * STRICT on purpose: the legacy authoring surface (`schedule`/`schedules`/
7333
+ * `triggers`/`preBufferSec`/`postBufferSec`/`rules`) was retired 2026-07-30.
7334
+ * A stale caller must fail loudly — silently stripping its legacy intent would
7335
+ * persist a band-less config, i.e. silently stop recording the camera.
7344
7336
  */
7345
7337
  var RecordingConfigSchema = object({
7346
7338
  enabled: boolean(),
7347
- /** Authoritative storage mode. Absent on legacy targets derived once via
7348
- * `migrateRulesToMode`, then persisted. */
7339
+ /** DERIVED summary of `bands`, stamped by the recorder on every save.
7340
+ * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7349
7341
  mode: RecordingStorageModeSchema.optional(),
7350
7342
  profiles: array(CamProfileSchema).optional(),
7351
7343
  segmentSeconds: number().int().positive().optional(),
7352
- /** Shared recording time-bands for `events` & `continuous` — record only when
7353
- * the wall-clock falls inside one of these windows. Omit or empty = always.
7354
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
7355
- schedules: array(RecordingScheduleSchema).optional(),
7356
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
7357
- * normalized into `schedules` on read and never written going forward. (Not
7358
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
7359
- schedule: RecordingScheduleSchema.optional(),
7360
- /** `events`-mode only — which detectors trigger a recording. */
7361
- triggers: RecordingTriggersSchema.optional(),
7362
- /** `events`-mode only — seconds retained before / after a trigger. */
7363
- preBufferSec: number().min(0).optional(),
7364
- postBufferSec: number().min(0).optional(),
7365
- /** DEPRECATED authoring input; retained for migration/transition. */
7366
- rules: array(RecordingRuleSchema).optional(),
7367
7344
  /**
7368
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
7369
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
7370
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
7371
- * derived into bands once via `migrateConfigToBands`.
7345
+ * AUTHORITATIVE mode-per-band recording model the single source of truth
7346
+ * the recorder's band engine consumes. An empty array = record nothing;
7347
+ * "off" is the absence of a covering band, never a band value.
7372
7348
  */
7373
- bands: array(RecordingBandSchema).optional(),
7349
+ bands: array(RecordingBandSchema).default([]),
7374
7350
  retention: RecordingRetentionSchema.optional(),
7375
7351
  /**
7376
7352
  * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
@@ -7378,8 +7354,15 @@ var RecordingConfigSchema = object({
7378
7354
  * windows only — existing sheets are immutable, and each window's index
7379
7355
  * carries its own tile dims so mixed-preset history renders correctly.
7380
7356
  */
7381
- scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7382
- });
7357
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional(),
7358
+ /**
7359
+ * OPT-IN thumbnail-strip generation for this camera: every keyframe of the
7360
+ * low recording saved as a JPEG (the fast-drag scrub depth), a derived
7361
+ * cache that eviction reclaims with the footage. Absent/false = no strips
7362
+ * are written and scrub reads exact keyframes at every velocity.
7363
+ */
7364
+ stripsEnabled: boolean().optional()
7365
+ }).strict();
7383
7366
  /**
7384
7367
  * Ops-log — the durable, append-only operations audit shared by the
7385
7368
  * recordings and events management surfaces.
@@ -7398,7 +7381,8 @@ var OpsLogOpSchema = _enum([
7398
7381
  "prune",
7399
7382
  "manual-delete",
7400
7383
  "rescan",
7401
- "retention-run"
7384
+ "retention-run",
7385
+ "relocate"
7402
7386
  ]);
7403
7387
  /** Why the operation ran. */
7404
7388
  var OpsLogReasonSchema = _enum([
@@ -7437,6 +7421,55 @@ var OpsLogQueryInputSchema = object({
7437
7421
  limit: number().int().min(1).max(1e3).optional()
7438
7422
  });
7439
7423
  /**
7424
+ * Entity-relocation job state (storage entity-routing spec, Phase 4).
7425
+ *
7426
+ * One shape shared by the recorder's `relocateFootage` (segments + strips) and
7427
+ * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7428
+ * page renders both movers with one component. Jobs are in-RAM (a restart
7429
+ * forgets them — re-running is safe by construction: copy-if-absent, delete
7430
+ * after verify) and each completed/failed run also lands one durable ops-log
7431
+ * row on the owning addon's surface.
7432
+ */
7433
+ var RelocateJobStateSchema = _enum([
7434
+ "running",
7435
+ "done",
7436
+ "failed",
7437
+ "cancelled"
7438
+ ]);
7439
+ var RelocateJobSchema = object({
7440
+ jobId: string(),
7441
+ state: RelocateJobStateSchema,
7442
+ /** Source location — for media relocation this is informational ('*': rows
7443
+ * move from wherever they are to the target). */
7444
+ fromLocationId: string(),
7445
+ toLocationId: string(),
7446
+ /** Scoped device, or null = every device. */
7447
+ deviceId: number().nullable(),
7448
+ /** What the job moves (owner-addon specific: segments/strips or media). */
7449
+ entities: array(string()),
7450
+ filesMoved: number().int(),
7451
+ bytesMoved: number().int(),
7452
+ /** Total files discovered up front; null while (or when) unknown. */
7453
+ filesTotal: number().int().nullable(),
7454
+ startedAt: number(),
7455
+ finishedAt: number().nullable(),
7456
+ error: string().nullable()
7457
+ });
7458
+ var RelocateFootageInputSchema = object({
7459
+ deviceId: number().optional(),
7460
+ fromLocationId: string(),
7461
+ toLocationId: string(),
7462
+ entities: array(_enum(["segments", "strips"])).optional(),
7463
+ /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7464
+ * never allowed to starve live writers. */
7465
+ throttleMbps: number().min(1).max(1e3).optional()
7466
+ });
7467
+ var RelocateMediaInputSchema = object({
7468
+ deviceId: number().optional(),
7469
+ toLocationId: string(),
7470
+ throttleMbps: number().min(1).max(1e3).optional()
7471
+ });
7472
+ /**
7440
7473
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7441
7474
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7442
7475
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -7486,6 +7519,13 @@ var StorageLocationSchema = object({
7486
7519
  nodeId: string().optional(),
7487
7520
  isDefault: boolean().default(false),
7488
7521
  isSystem: boolean().default(false),
7522
+ /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7523
+ * for node-local locations it can reach) — never persisted, absent when the
7524
+ * volume is remote/unreachable. The single capacity truth every UI reads. */
7525
+ capacity: object({
7526
+ totalBytes: number(),
7527
+ availableBytes: number()
7528
+ }).nullable().optional(),
7489
7529
  createdAt: number(),
7490
7530
  updatedAt: number()
7491
7531
  });
@@ -8253,7 +8293,8 @@ var NcTaxonomyEntrySchema = object({
8253
8293
  /** Macro/category parent for grouping ('car' → 'vehicle'); null for a top. */
8254
8294
  parentKind: string().nullable()
8255
8295
  });
8256
- object({
8296
+ /** The complete NC picker taxonomy — three grouped buckets. */
8297
+ var NcTaxonomySchema = object({
8257
8298
  videoClasses: array(NcTaxonomyEntrySchema),
8258
8299
  audioKinds: array(NcTaxonomyEntrySchema),
8259
8300
  labels: array(NcTaxonomyEntrySchema)
@@ -8913,6 +8954,7 @@ var AccessoryKind = {
8913
8954
  };
8914
8955
  AccessoryKind.Siren, AccessoryKind.Floodlight, AccessoryKind.Spotlight, AccessoryKind.PirSensor, AccessoryKind.Chime, AccessoryKind.Autotrack, AccessoryKind.Nightvision, AccessoryKind.PrivacyMask;
8915
8956
  DeviceFeature.BatteryOperated;
8957
+ new Set(["devices", "classes"]);
8916
8958
  /**
8917
8959
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
8918
8960
  * motion-zones, and the detection zones/lines editor all speak this one
@@ -9071,6 +9113,29 @@ var NcOccupancyConditionSchema = object({
9071
9113
  count: number().int().min(0).default(1),
9072
9114
  sustainSeconds: number().int().min(0).max(3600).default(15)
9073
9115
  });
9116
+ /**
9117
+ * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
9118
+ *
9119
+ * The values are not symmetric, and deliberately so — the absent value has to
9120
+ * mean exactly what every rule authored before this condition existed already
9121
+ * does:
9122
+ * - `enter` — entries and every NON-crossing record (movement state,
9123
+ * package, sensor). Exits are rejected. **This is the absent behaviour**:
9124
+ * an operator who never asked for exits must not start receiving them.
9125
+ * - `exit` — ONLY an exit crossing. A record that is not a crossing at all
9126
+ * fails closed, because "the car left the drive" is a question about a
9127
+ * boundary, not about a detection.
9128
+ * - `any` — no direction filter; entries, exits and non-crossings alike.
9129
+ *
9130
+ * A rule asking for a direction should normally also scope `zones`, which the
9131
+ * engine evaluates against the crossed zone as well as the current membership
9132
+ * (an exit's membership no longer contains the zone it just left).
9133
+ */
9134
+ var NcCrossingSchema = _enum([
9135
+ "enter",
9136
+ "exit",
9137
+ "any"
9138
+ ]);
9074
9139
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
9075
9140
  var NcZoneConditionSchema = object({
9076
9141
  ids: array(string().min(1)).min(1),
@@ -9095,6 +9160,13 @@ var NcConditionsSchema = object({
9095
9160
  /** Veto zones — any hit fails the rule. */
9096
9161
  zonesExclude: array(string().min(1)).optional(),
9097
9162
  /**
9163
+ * Zone-crossing direction. IMMEDIATE only — a crossing is a per-event fact
9164
+ * and a closed track carries none, so a `track-end` rule asking for one
9165
+ * fails closed (use `zones`, which tests `zonesVisited`). ABSENT = `enter`,
9166
+ * which is exactly today's behaviour. See {@link NcCrossingSchema}.
9167
+ */
9168
+ crossing: NcCrossingSchema.optional(),
9169
+ /**
9098
9170
  * Exact (case-insensitive) match on the record's collapsed `label`
9099
9171
  * (identity name / plate text / subclass).
9100
9172
  */
@@ -9229,17 +9301,85 @@ var NcRuleTargetSchema = object({
9229
9301
  * - `keyFrame` — the clean scene frame (no subject box).
9230
9302
  * - `none` — no attachment.
9231
9303
  */
9232
- var NcMediaPolicySchema = object({ attach: _enum([
9233
- "best",
9234
- "best-matching",
9235
- "keyFrame",
9236
- "none"
9237
- ]).default("best") });
9304
+ /**
9305
+ * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
9306
+ * conflate it with the selection strategy and betray the request: asking for
9307
+ * the clean scene frame on an object-event owner used to start at
9308
+ * `fullFrameBoxed`, i.e. the annotated frame (2026-07-30).
9309
+ * - `cropped` — the subject, tight. What "who is at the door" wants.
9310
+ * - `full` — the clean scene, no annotation. What "what is going on" wants.
9311
+ * - `boxed` — the scene WITH the detection boxes drawn, for verifying what
9312
+ * the pipeline actually saw.
9313
+ */
9314
+ var NcMediaFrameSchema = _enum([
9315
+ "cropped",
9316
+ "full",
9317
+ "boxed"
9318
+ ]);
9319
+ var NcMediaPolicySchema = object({
9320
+ attach: _enum([
9321
+ "best",
9322
+ "best-matching",
9323
+ "keyFrame",
9324
+ "none"
9325
+ ]).default("best"),
9326
+ /** What the still shows. Absent = `cropped` (the historical `best` shape). */
9327
+ frame: NcMediaFrameSchema.optional(),
9328
+ /** Crop the attached still to the rule's condition-zone bbox (padded) —
9329
+ * "show me the ZONE", not the whole scene or the subject crop. */
9330
+ zoneCrop: boolean().optional(),
9331
+ /**
9332
+ * Also attach a short GIF cut from the stream broker's clip ring around the
9333
+ * event — NOT from the recording, so the camera does not have to be
9334
+ * recording, and the window sits AROUND the moment instead of a segment
9335
+ * behind it. Fail-closed: a window the ring does not cover contributes no
9336
+ * gif, never a failed notification.
9337
+ */
9338
+ gif: boolean().optional(),
9339
+ /**
9340
+ * Also attach a short MP4 CLIP of the same cut. Same source and the same
9341
+ * fail-closed rule as `gif`. Prefer it where the backend takes video
9342
+ * (telegram, discord, zentik, webhook); backends that do not are handled by
9343
+ * the degrade engine, which drops the video and keeps the still.
9344
+ */
9345
+ clip: boolean().optional(),
9346
+ /** Seconds of footage BEFORE / AFTER the event instant. Defaults 3 / 7. */
9347
+ clipPreRollSec: number().int().min(0).max(30).optional(),
9348
+ clipPostRollSec: number().int().min(0).max(30).optional(),
9349
+ /**
9350
+ * Which stream profile the footage is cut from. Absent = the CHEAPEST
9351
+ * assigned profile: a notification is watched on a phone, so the 4K
9352
+ * rendition would burn CPU to produce a file the client downscales anyway.
9353
+ * A profile that is not assigned falls back to the cheapest, and the render
9354
+ * reports which one actually ran.
9355
+ */
9356
+ profile: CamProfileSchema.optional()
9357
+ });
9358
+ /**
9359
+ * Cooldown GRANULARITY over the subject's class — how much a fired
9360
+ * notification suppresses.
9361
+ * - `shared` (default, and the absent value) — one window for the whole
9362
+ * rule/scope: a cat silences the next dog for `cooldownSec`.
9363
+ * - `per-class` — an independent window per detected class, so cat→dog fires
9364
+ * at once and cat→cat still waits.
9365
+ *
9366
+ * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
9367
+ * must not be swallowed by a bark's window (the precedent this generalizes —
9368
+ * see `cooldownKey` in the rule engine).
9369
+ */
9370
+ var NcThrottleGranularitySchema = _enum(["shared", "per-class"]);
9238
9371
  /** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
9239
9372
  var NcThrottleSchema = object({
9240
9373
  cooldownSec: number().int().min(0).max(86400).default(60),
9241
9374
  /** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
9242
- scope: _enum(["rule", "rule-device"]).default("rule-device")
9375
+ scope: _enum(["rule", "rule-device"]).default("rule-device"),
9376
+ /**
9377
+ * Class granularity of the cooldown key. Optional rather than defaulted:
9378
+ * a Zod default does NOT run on the addon→addon cap path, so a persisted
9379
+ * rule authored before this field simply carries none — and the engine
9380
+ * reads absent as `shared`, the pre-existing behaviour.
9381
+ */
9382
+ granularity: NcThrottleGranularitySchema.optional()
9243
9383
  });
9244
9384
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
9245
9385
  var NcRuleInputSchema = object({
@@ -9248,7 +9388,19 @@ var NcRuleInputSchema = object({
9248
9388
  delivery: NcDeliverySchema,
9249
9389
  conditions: NcConditionsSchema.default({}),
9250
9390
  schedule: NcScheduleSchema.optional(),
9251
- targets: array(NcRuleTargetSchema).min(1),
9391
+ /** May be empty when `targetUsers` addresses at least one user — the
9392
+ * "at least one addressee" invariant is enforced by the provider, because
9393
+ * a cross-field refine here would break `NcRulePatchSchema.partial()`. */
9394
+ targets: array(NcRuleTargetSchema),
9395
+ /**
9396
+ * USERS this rule addresses in addition to `targets` (Phase 4). At fire
9397
+ * time each user fans out to the personal targets they own
9398
+ * (`config.ownerUserId`), filtered by that user's `allowedDevices` for the
9399
+ * firing camera — a user is never notified about a device they cannot open.
9400
+ * Per-user opt-outs (`disabledTargetIds`) still apply to the fanned-out
9401
+ * targets.
9402
+ */
9403
+ targetUsers: array(string()).optional(),
9252
9404
  media: NcMediaPolicySchema.default({ attach: "best" }),
9253
9405
  throttle: NcThrottleSchema.default({
9254
9406
  cooldownSec: 60,
@@ -9335,6 +9487,7 @@ var NcConditionDescriptorSchema = object({
9335
9487
  "schedule",
9336
9488
  "plateMatcher",
9337
9489
  "packagePhase",
9490
+ "crossingSelect",
9338
9491
  "polygonDraw",
9339
9492
  "occupancy"
9340
9493
  ]),
@@ -9461,7 +9614,10 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
9461
9614
  }), object({ results: array(NcTestResultSchema) }), {
9462
9615
  kind: "mutation",
9463
9616
  auth: "admin"
9464
- }), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9617
+ }), method(object({}), object({
9618
+ catalog: array(NcConditionDescriptorSchema),
9619
+ taxonomy: NcTaxonomySchema.optional()
9620
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9465
9621
  /**
9466
9622
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
9467
9623
  *
@@ -10198,6 +10354,28 @@ method(object({
10198
10354
  }), object({ success: literal(true) }), {
10199
10355
  kind: "mutation",
10200
10356
  auth: "admin"
10357
+ }), method(object({
10358
+ deviceId: number(),
10359
+ /** Absent = the LOWEST assigned profile — a notification attachment is
10360
+ * watched on a phone, and the cheap rendition is the right default. */
10361
+ profile: CamProfileSchema.optional(),
10362
+ aroundMs: number(),
10363
+ preRollSec: number().min(0).max(20).default(3),
10364
+ postRollSec: number().min(0).max(20).default(5),
10365
+ format: _enum(["gif", "mp4"]).default("gif"),
10366
+ maxWidth: number().int().min(120).max(1920).default(480),
10367
+ /** GIF only — MP4 keeps the source cadence. */
10368
+ fps: number().int().min(1).max(15).default(5)
10369
+ }), object({
10370
+ base64: string(),
10371
+ mime: string(),
10372
+ bytes: number().int(),
10373
+ /** The profile actually rendered (what the default resolved to). */
10374
+ profile: CamProfileSchema,
10375
+ durationMs: number()
10376
+ }), {
10377
+ kind: "mutation",
10378
+ auth: "admin"
10201
10379
  }), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string() }), BrokerStatsSchema), method(object({ brokerId: string() }), object({
10202
10380
  probed: boolean(),
10203
10381
  summary: string()
@@ -15841,7 +16019,10 @@ method(object({
15841
16019
  }), method(object({
15842
16020
  deviceId: number(),
15843
16021
  caps: array(string()).readonly().optional()
15844
- }), record(string(), unknown().nullable()));
16022
+ }), record(string(), unknown().nullable())), method(object({
16023
+ deviceIds: array(number()).readonly(),
16024
+ caps: array(string()).readonly().optional()
16025
+ }), record(string(), record(string(), unknown().nullable())));
15845
16026
  method(object({ deviceId: number() }), record(string(), record(string(), unknown()))), method(object({
15846
16027
  deviceId: number(),
15847
16028
  capName: string()
@@ -16791,6 +16972,36 @@ var TargetKindSchema = object({
16791
16972
  icon: string(),
16792
16973
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
16793
16974
  addonId: string(),
16975
+ /**
16976
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
16977
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
16978
+ * when the addon bundles no icon for that kind — the client then falls back
16979
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
16980
+ *
16981
+ * Root-relative on purpose: it resolves against whatever origin serves a web
16982
+ * client, and a native client joins it onto its own hub base.
16983
+ *
16984
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
16985
+ * field that survived only because the runtime cap-router forwards provider
16986
+ * output verbatim — so every consumer had to re-declare it by hand to stop
16987
+ * its own Zod parse from stripping it, and the whole arrangement would have
16988
+ * broken silently the moment output validation was tightened anywhere.
16989
+ */
16990
+ iconUrl: string().optional(),
16991
+ /**
16992
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
16993
+ *
16994
+ * The server knows this and therefore says it, because the client cannot
16995
+ * safely guess: a React-Native client renders SVG and raster through two
16996
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
16997
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
16998
+ * placeholder glyph for every vector icon while the web build looked fine.
16999
+ *
17000
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
17001
+ * not been updated — a client that cannot determine the type should prefer
17002
+ * its raster path, which is the safe default for an unknown image.
17003
+ */
17004
+ iconMediaType: string().optional(),
16794
17005
  configSchema: ConfigSchemaPassthrough,
16795
17006
  supportsDiscovery: boolean(),
16796
17007
  caps: TargetKindCapsSchema
@@ -17238,6 +17449,29 @@ var MotionEventSchema = object({
17238
17449
  * Absent on legacy rows ⇒ treat as `pipeline`.
17239
17450
  */
17240
17451
  var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
17452
+ /**
17453
+ * The confirmed zone crossing that produced an object event. Present ONLY on
17454
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
17455
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
17456
+ * appearance event carry none, so a rule asking for a direction fails closed
17457
+ * on them.
17458
+ *
17459
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
17460
+ * into its own event, so a frame in which a track enters A while leaving B
17461
+ * produces two events with two directions — never one ambiguous row.
17462
+ *
17463
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
17464
+ * membership the box has NOW, and by definition it no longer contains the zone
17465
+ * that was just left. Without the id here, a zone-scoped rule could never match
17466
+ * the exit it asked for.
17467
+ */
17468
+ var ZoneCrossingSchema = object({
17469
+ direction: _enum(["enter", "exit"]),
17470
+ /** Admin zone id crossed. */
17471
+ zoneId: string(),
17472
+ /** Zone display name at crossing time (falls back to the id). */
17473
+ zoneName: string().optional()
17474
+ });
17241
17475
  var ObjectEventSchema = object({
17242
17476
  ...BaseEventFields,
17243
17477
  kind: literal("object"),
@@ -17264,6 +17498,12 @@ var ObjectEventSchema = object({
17264
17498
  zones: array(string()).readonly().optional(),
17265
17499
  /** Omitted in slim projection. */
17266
17500
  state: TrackStateSchema.optional(),
17501
+ /**
17502
+ * The zone crossing this event IS, when it is one. Absent on every other
17503
+ * event kind (movement state, appearance, package) — see
17504
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
17505
+ */
17506
+ zoneCrossing: ZoneCrossingSchema.optional(),
17267
17507
  /** Detection-frame dimensions in pixels — let consumers normalize the
17268
17508
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
17269
17509
  frameWidth: number().optional(),
@@ -17522,6 +17762,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17522
17762
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
17523
17763
  kind: "mutation",
17524
17764
  auth: "admin"
17765
+ }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
17766
+ kind: "mutation",
17767
+ auth: "admin"
17768
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
17769
+ kind: "query",
17770
+ auth: "admin"
17771
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
17772
+ kind: "mutation",
17773
+ auth: "admin"
17525
17774
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
17526
17775
  kind: "query",
17527
17776
  auth: "admin"
@@ -20001,6 +20250,17 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
20001
20250
  */
20002
20251
  priority: number()
20003
20252
  })).readonly() });
20253
+ /**
20254
+ * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
20255
+ * AUTO (resolved from the candidate ranking at send time); `resolved` reports
20256
+ * what AUTO currently picks, so the UI can show the effective value either way.
20257
+ */
20258
+ var NotificationEndpointSchema = object({
20259
+ /** The operator's explicit choice, or null for AUTO. */
20260
+ baseUrl: string().nullable(),
20261
+ /** What the ranking currently resolves to (null when nothing is reachable). */
20262
+ resolved: string().nullable()
20263
+ });
20004
20264
  var AllowedAddressesSchema = object({
20005
20265
  /**
20006
20266
  * Allowlist of interface addresses operators have explicitly opted
@@ -20023,7 +20283,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
20023
20283
  * to avoid mixed-content blocks in the browser. The public
20024
20284
  * tunnel always emits `https://` regardless. */
20025
20285
  scheme: _enum(["http", "https"]).optional()
20026
- }), GetConnectionEndpointsResultSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
20286
+ }), 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" });
20027
20287
  /**
20028
20288
  * mesh-network — collection cap for mesh-VPN providers.
20029
20289
  *
@@ -20822,7 +21082,12 @@ var RecordingDeviceUsageSchema = object({
20822
21082
  var RecordingLocationUsageSchema = object({
20823
21083
  /** StorageLocation id; null for the legacy/degraded single-root fallback. */
20824
21084
  locationId: string().nullable(),
20825
- /** Bytes of recordings stored on this location. */
21085
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
21086
+ * is emitted per physical disk (2026-07-29): two locations on one root
21087
+ * previously rendered as two identical "disks" with a nonsensical used
21088
+ * split — hydrate attribution across aliases is arbitrary by nature. */
21089
+ locationIds: array(string()).optional(),
21090
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). */
20826
21091
  usedBytes: number(),
20827
21092
  /** Free bytes on the location's volume; null when capacity is unknown (remote). */
20828
21093
  availableBytes: number().nullable(),
@@ -20934,6 +21199,44 @@ method(object({
20934
21199
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
20935
21200
  kind: "query",
20936
21201
  auth: "admin"
21202
+ }), method(object({
21203
+ deviceId: number(),
21204
+ aroundMs: number(),
21205
+ preRollSec: number().min(0).max(30).default(2),
21206
+ postRollSec: number().min(0).max(30).default(5),
21207
+ maxWidth: number().int().min(120).max(1280).default(480),
21208
+ fps: number().int().min(1).max(15).default(5)
21209
+ }), object({
21210
+ gifBase64: string(),
21211
+ fromMs: number(),
21212
+ toMs: number()
21213
+ }), {
21214
+ kind: "mutation",
21215
+ auth: "admin"
21216
+ }), method(object({
21217
+ deviceId: number(),
21218
+ aroundMs: number(),
21219
+ preRollSec: number().min(0).max(30).default(3),
21220
+ postRollSec: number().min(0).max(30).default(7),
21221
+ maxWidth: number().int().min(160).max(1920).default(640)
21222
+ }), object({
21223
+ clipBase64: string(),
21224
+ mime: string(),
21225
+ fromMs: number(),
21226
+ toMs: number(),
21227
+ bytes: number().int()
21228
+ }), {
21229
+ kind: "mutation",
21230
+ auth: "admin"
21231
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
21232
+ kind: "mutation",
21233
+ auth: "admin"
21234
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
21235
+ kind: "query",
21236
+ auth: "admin"
21237
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
21238
+ kind: "mutation",
21239
+ auth: "admin"
20937
21240
  });
20938
21241
  /**
20939
21242
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -22525,6 +22828,12 @@ Object.freeze({
22525
22828
  addonId: null,
22526
22829
  access: "view"
22527
22830
  },
22831
+ "deviceManager.getDeviceStatusAggregateBatch": {
22832
+ capName: "device-manager",
22833
+ capScope: "system",
22834
+ addonId: null,
22835
+ access: "view"
22836
+ },
22528
22837
  "deviceManager.getLinkedDevices": {
22529
22838
  capName: "device-manager",
22530
22839
  capScope: "system",
@@ -23419,6 +23728,12 @@ Object.freeze({
23419
23728
  addonId: null,
23420
23729
  access: "view"
23421
23730
  },
23731
+ "localNetwork.getNotificationEndpoint": {
23732
+ capName: "local-network",
23733
+ capScope: "system",
23734
+ addonId: null,
23735
+ access: "view"
23736
+ },
23422
23737
  "localNetwork.getPreferred": {
23423
23738
  capName: "local-network",
23424
23739
  capScope: "system",
@@ -23443,6 +23758,12 @@ Object.freeze({
23443
23758
  addonId: null,
23444
23759
  access: "create"
23445
23760
  },
23761
+ "localNetwork.setNotificationEndpoint": {
23762
+ capName: "local-network",
23763
+ capScope: "system",
23764
+ addonId: null,
23765
+ access: "create"
23766
+ },
23446
23767
  "lockControl.lock": {
23447
23768
  capName: "lock-control",
23448
23769
  capScope: "device",
@@ -24085,6 +24406,12 @@ Object.freeze({
24085
24406
  addonId: null,
24086
24407
  access: "create"
24087
24408
  },
24409
+ "pipelineAnalytics.cancelMediaRelocate": {
24410
+ capName: "pipeline-analytics",
24411
+ capScope: "device",
24412
+ addonId: null,
24413
+ access: "create"
24414
+ },
24088
24415
  "pipelineAnalytics.clearTracks": {
24089
24416
  capName: "pipeline-analytics",
24090
24417
  capScope: "device",
@@ -24139,6 +24466,12 @@ Object.freeze({
24139
24466
  addonId: null,
24140
24467
  access: "view"
24141
24468
  },
24469
+ "pipelineAnalytics.getMediaRelocateStatus": {
24470
+ capName: "pipeline-analytics",
24471
+ capScope: "device",
24472
+ addonId: null,
24473
+ access: "view"
24474
+ },
24142
24475
  "pipelineAnalytics.getMotionEvents": {
24143
24476
  capName: "pipeline-analytics",
24144
24477
  capScope: "device",
@@ -24211,6 +24544,12 @@ Object.freeze({
24211
24544
  addonId: null,
24212
24545
  access: "create"
24213
24546
  },
24547
+ "pipelineAnalytics.relocateMedia": {
24548
+ capName: "pipeline-analytics",
24549
+ capScope: "device",
24550
+ addonId: null,
24551
+ access: "create"
24552
+ },
24214
24553
  "pipelineAnalytics.searchObjectEvents": {
24215
24554
  capName: "pipeline-analytics",
24216
24555
  capScope: "device",
@@ -24973,6 +25312,12 @@ Object.freeze({
24973
25312
  addonId: null,
24974
25313
  access: "create"
24975
25314
  },
25315
+ "recording.cancelRelocate": {
25316
+ capName: "recording",
25317
+ capScope: "system",
25318
+ addonId: null,
25319
+ access: "create"
25320
+ },
24976
25321
  "recording.deleteFootprint": {
24977
25322
  capName: "recording",
24978
25323
  capScope: "system",
@@ -25003,6 +25348,12 @@ Object.freeze({
25003
25348
  addonId: null,
25004
25349
  access: "view"
25005
25350
  },
25351
+ "recording.getRelocateStatus": {
25352
+ capName: "recording",
25353
+ capScope: "system",
25354
+ addonId: null,
25355
+ access: "view"
25356
+ },
25006
25357
  "recording.getStorageUsage": {
25007
25358
  capName: "recording",
25008
25359
  capScope: "system",
@@ -25033,6 +25384,24 @@ Object.freeze({
25033
25384
  addonId: null,
25034
25385
  access: "view"
25035
25386
  },
25387
+ "recording.relocateFootage": {
25388
+ capName: "recording",
25389
+ capScope: "system",
25390
+ addonId: null,
25391
+ access: "create"
25392
+ },
25393
+ "recording.renderClip": {
25394
+ capName: "recording",
25395
+ capScope: "system",
25396
+ addonId: null,
25397
+ access: "create"
25398
+ },
25399
+ "recording.renderGif": {
25400
+ capName: "recording",
25401
+ capScope: "system",
25402
+ addonId: null,
25403
+ access: "create"
25404
+ },
25036
25405
  "recording.rescanStorage": {
25037
25406
  capName: "recording",
25038
25407
  capScope: "system",
@@ -25627,6 +25996,12 @@ Object.freeze({
25627
25996
  addonId: null,
25628
25997
  access: "create"
25629
25998
  },
25999
+ "streamBroker.renderPreBufferClip": {
26000
+ capName: "stream-broker",
26001
+ capScope: "system",
26002
+ addonId: null,
26003
+ access: "create"
26004
+ },
25630
26005
  "streamBroker.restartProfile": {
25631
26006
  capName: "stream-broker",
25632
26007
  capScope: "system",