@camstack/addon-provider-rtsp 1.2.6 → 1.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +463 -76
  2. package/dist/addon.mjs +463 -76
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -23,7 +23,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
23
  //#endregion
24
24
  let node_net = require("node:net");
25
25
  node_net = __toESM(node_net);
26
- //#region ../types/dist/event-category-BLcNejAE.mjs
26
+ //#region ../types/dist/event-category-Bz24uP1U.mjs
27
27
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
28
28
  EventCategory["SystemBoot"] = "system.boot";
29
29
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -294,6 +294,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
294
294
  */
295
295
  EventCategory["DeviceStateChanged"] = "device.state-changed";
296
296
  /**
297
+ * Frame occupancy for a camera CHANGED — a tracked object was gained or
298
+ * lost. Carries `{ deviceId, totalObjects, byClass, zones }`.
299
+ *
300
+ * Emitted only on a change, so a steady scene is silent. It exists so a
301
+ * client can stop polling `zoneAnalytics.getCurrentSnapshot`: that was the
302
+ * one live badge with no push signal at all, and it cost a request every
303
+ * four seconds per visible camera.
304
+ *
305
+ * Like every event it is telemetry and may be dropped ([D8]) — a consumer
306
+ * keeps a slow reconcile rather than trusting it alone.
307
+ */
308
+ EventCategory["ZoneAnalyticsOccupancyChanged"] = "zone-analytics.occupancy-changed";
309
+ /**
297
310
  * Cap event fired by every device that registers the `battery`
298
311
  * capability. Mirrors the cap definition's `onStatusChanged`. Carries
299
312
  * `{ 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().regex(HHMM),
7231
- end: string().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(),
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(),
7442
+ toLocationId: string(),
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()),
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().nullable()
7454
+ });
7455
+ var RelocateFootageInputSchema = object({
7456
+ deviceId: number().optional(),
7457
+ fromLocationId: string(),
7458
+ toLocationId: string(),
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(),
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().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
  });
@@ -8282,7 +8322,8 @@ var NcTaxonomyEntrySchema = object({
8282
8322
  /** Macro/category parent for grouping ('car' → 'vehicle'); null for a top. */
8283
8323
  parentKind: string().nullable()
8284
8324
  });
8285
- object({
8325
+ /** The complete NC picker taxonomy — three grouped buckets. */
8326
+ var NcTaxonomySchema = object({
8286
8327
  videoClasses: array(NcTaxonomyEntrySchema),
8287
8328
  audioKinds: array(NcTaxonomyEntrySchema),
8288
8329
  labels: array(NcTaxonomyEntrySchema)
@@ -9251,6 +9292,7 @@ function startReachabilityPoll(options) {
9251
9292
  timer = void 0;
9252
9293
  } };
9253
9294
  }
9295
+ new Set(["devices", "classes"]);
9254
9296
  /**
9255
9297
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
9256
9298
  * motion-zones, and the detection zones/lines editor all speak this one
@@ -9409,6 +9451,29 @@ var NcOccupancyConditionSchema = object({
9409
9451
  count: number().int().min(0).default(1),
9410
9452
  sustainSeconds: number().int().min(0).max(3600).default(15)
9411
9453
  });
9454
+ /**
9455
+ * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
9456
+ *
9457
+ * The values are not symmetric, and deliberately so — the absent value has to
9458
+ * mean exactly what every rule authored before this condition existed already
9459
+ * does:
9460
+ * - `enter` — entries and every NON-crossing record (movement state,
9461
+ * package, sensor). Exits are rejected. **This is the absent behaviour**:
9462
+ * an operator who never asked for exits must not start receiving them.
9463
+ * - `exit` — ONLY an exit crossing. A record that is not a crossing at all
9464
+ * fails closed, because "the car left the drive" is a question about a
9465
+ * boundary, not about a detection.
9466
+ * - `any` — no direction filter; entries, exits and non-crossings alike.
9467
+ *
9468
+ * A rule asking for a direction should normally also scope `zones`, which the
9469
+ * engine evaluates against the crossed zone as well as the current membership
9470
+ * (an exit's membership no longer contains the zone it just left).
9471
+ */
9472
+ var NcCrossingSchema = _enum([
9473
+ "enter",
9474
+ "exit",
9475
+ "any"
9476
+ ]);
9412
9477
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
9413
9478
  var NcZoneConditionSchema = object({
9414
9479
  ids: array(string().min(1)).min(1),
@@ -9433,6 +9498,13 @@ var NcConditionsSchema = object({
9433
9498
  /** Veto zones — any hit fails the rule. */
9434
9499
  zonesExclude: array(string().min(1)).optional(),
9435
9500
  /**
9501
+ * Zone-crossing direction. IMMEDIATE only — a crossing is a per-event fact
9502
+ * and a closed track carries none, so a `track-end` rule asking for one
9503
+ * fails closed (use `zones`, which tests `zonesVisited`). ABSENT = `enter`,
9504
+ * which is exactly today's behaviour. See {@link NcCrossingSchema}.
9505
+ */
9506
+ crossing: NcCrossingSchema.optional(),
9507
+ /**
9436
9508
  * Exact (case-insensitive) match on the record's collapsed `label`
9437
9509
  * (identity name / plate text / subclass).
9438
9510
  */
@@ -9567,17 +9639,85 @@ var NcRuleTargetSchema = object({
9567
9639
  * - `keyFrame` — the clean scene frame (no subject box).
9568
9640
  * - `none` — no attachment.
9569
9641
  */
9570
- var NcMediaPolicySchema = object({ attach: _enum([
9571
- "best",
9572
- "best-matching",
9573
- "keyFrame",
9574
- "none"
9575
- ]).default("best") });
9642
+ /**
9643
+ * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
9644
+ * conflate it with the selection strategy and betray the request: asking for
9645
+ * the clean scene frame on an object-event owner used to start at
9646
+ * `fullFrameBoxed`, i.e. the annotated frame (2026-07-30).
9647
+ * - `cropped` — the subject, tight. What "who is at the door" wants.
9648
+ * - `full` — the clean scene, no annotation. What "what is going on" wants.
9649
+ * - `boxed` — the scene WITH the detection boxes drawn, for verifying what
9650
+ * the pipeline actually saw.
9651
+ */
9652
+ var NcMediaFrameSchema = _enum([
9653
+ "cropped",
9654
+ "full",
9655
+ "boxed"
9656
+ ]);
9657
+ var NcMediaPolicySchema = object({
9658
+ attach: _enum([
9659
+ "best",
9660
+ "best-matching",
9661
+ "keyFrame",
9662
+ "none"
9663
+ ]).default("best"),
9664
+ /** What the still shows. Absent = `cropped` (the historical `best` shape). */
9665
+ frame: NcMediaFrameSchema.optional(),
9666
+ /** Crop the attached still to the rule's condition-zone bbox (padded) —
9667
+ * "show me the ZONE", not the whole scene or the subject crop. */
9668
+ zoneCrop: boolean().optional(),
9669
+ /**
9670
+ * Also attach a short GIF cut from the stream broker's clip ring around the
9671
+ * event — NOT from the recording, so the camera does not have to be
9672
+ * recording, and the window sits AROUND the moment instead of a segment
9673
+ * behind it. Fail-closed: a window the ring does not cover contributes no
9674
+ * gif, never a failed notification.
9675
+ */
9676
+ gif: boolean().optional(),
9677
+ /**
9678
+ * Also attach a short MP4 CLIP of the same cut. Same source and the same
9679
+ * fail-closed rule as `gif`. Prefer it where the backend takes video
9680
+ * (telegram, discord, zentik, webhook); backends that do not are handled by
9681
+ * the degrade engine, which drops the video and keeps the still.
9682
+ */
9683
+ clip: boolean().optional(),
9684
+ /** Seconds of footage BEFORE / AFTER the event instant. Defaults 3 / 7. */
9685
+ clipPreRollSec: number().int().min(0).max(30).optional(),
9686
+ clipPostRollSec: number().int().min(0).max(30).optional(),
9687
+ /**
9688
+ * Which stream profile the footage is cut from. Absent = the CHEAPEST
9689
+ * assigned profile: a notification is watched on a phone, so the 4K
9690
+ * rendition would burn CPU to produce a file the client downscales anyway.
9691
+ * A profile that is not assigned falls back to the cheapest, and the render
9692
+ * reports which one actually ran.
9693
+ */
9694
+ profile: CamProfileSchema.optional()
9695
+ });
9696
+ /**
9697
+ * Cooldown GRANULARITY over the subject's class — how much a fired
9698
+ * notification suppresses.
9699
+ * - `shared` (default, and the absent value) — one window for the whole
9700
+ * rule/scope: a cat silences the next dog for `cooldownSec`.
9701
+ * - `per-class` — an independent window per detected class, so cat→dog fires
9702
+ * at once and cat→cat still waits.
9703
+ *
9704
+ * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
9705
+ * must not be swallowed by a bark's window (the precedent this generalizes —
9706
+ * see `cooldownKey` in the rule engine).
9707
+ */
9708
+ var NcThrottleGranularitySchema = _enum(["shared", "per-class"]);
9576
9709
  /** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
9577
9710
  var NcThrottleSchema = object({
9578
9711
  cooldownSec: number().int().min(0).max(86400).default(60),
9579
9712
  /** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
9580
- scope: _enum(["rule", "rule-device"]).default("rule-device")
9713
+ scope: _enum(["rule", "rule-device"]).default("rule-device"),
9714
+ /**
9715
+ * Class granularity of the cooldown key. Optional rather than defaulted:
9716
+ * a Zod default does NOT run on the addon→addon cap path, so a persisted
9717
+ * rule authored before this field simply carries none — and the engine
9718
+ * reads absent as `shared`, the pre-existing behaviour.
9719
+ */
9720
+ granularity: NcThrottleGranularitySchema.optional()
9581
9721
  });
9582
9722
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
9583
9723
  var NcRuleInputSchema = object({
@@ -9586,7 +9726,19 @@ var NcRuleInputSchema = object({
9586
9726
  delivery: NcDeliverySchema,
9587
9727
  conditions: NcConditionsSchema.default({}),
9588
9728
  schedule: NcScheduleSchema.optional(),
9589
- targets: array(NcRuleTargetSchema).min(1),
9729
+ /** May be empty when `targetUsers` addresses at least one user — the
9730
+ * "at least one addressee" invariant is enforced by the provider, because
9731
+ * a cross-field refine here would break `NcRulePatchSchema.partial()`. */
9732
+ targets: array(NcRuleTargetSchema),
9733
+ /**
9734
+ * USERS this rule addresses in addition to `targets` (Phase 4). At fire
9735
+ * time each user fans out to the personal targets they own
9736
+ * (`config.ownerUserId`), filtered by that user's `allowedDevices` for the
9737
+ * firing camera — a user is never notified about a device they cannot open.
9738
+ * Per-user opt-outs (`disabledTargetIds`) still apply to the fanned-out
9739
+ * targets.
9740
+ */
9741
+ targetUsers: array(string()).optional(),
9590
9742
  media: NcMediaPolicySchema.default({ attach: "best" }),
9591
9743
  throttle: NcThrottleSchema.default({
9592
9744
  cooldownSec: 60,
@@ -9673,6 +9825,7 @@ var NcConditionDescriptorSchema = object({
9673
9825
  "schedule",
9674
9826
  "plateMatcher",
9675
9827
  "packagePhase",
9828
+ "crossingSelect",
9676
9829
  "polygonDraw",
9677
9830
  "occupancy"
9678
9831
  ]),
@@ -9799,7 +9952,10 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
9799
9952
  }), object({ results: array(NcTestResultSchema) }), {
9800
9953
  kind: "mutation",
9801
9954
  auth: "admin"
9802
- }), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9955
+ }), method(object({}), object({
9956
+ catalog: array(NcConditionDescriptorSchema),
9957
+ taxonomy: NcTaxonomySchema.optional()
9958
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9803
9959
  /**
9804
9960
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
9805
9961
  *
@@ -10808,6 +10964,28 @@ method(object({
10808
10964
  }), object({ success: literal(true) }), {
10809
10965
  kind: "mutation",
10810
10966
  auth: "admin"
10967
+ }), method(object({
10968
+ deviceId: number(),
10969
+ /** Absent = the LOWEST assigned profile — a notification attachment is
10970
+ * watched on a phone, and the cheap rendition is the right default. */
10971
+ profile: CamProfileSchema.optional(),
10972
+ aroundMs: number(),
10973
+ preRollSec: number().min(0).max(20).default(3),
10974
+ postRollSec: number().min(0).max(20).default(5),
10975
+ format: _enum(["gif", "mp4"]).default("gif"),
10976
+ maxWidth: number().int().min(120).max(1920).default(480),
10977
+ /** GIF only — MP4 keeps the source cadence. */
10978
+ fps: number().int().min(1).max(15).default(5)
10979
+ }), object({
10980
+ base64: string(),
10981
+ mime: string(),
10982
+ bytes: number().int(),
10983
+ /** The profile actually rendered (what the default resolved to). */
10984
+ profile: CamProfileSchema,
10985
+ durationMs: number()
10986
+ }), {
10987
+ kind: "mutation",
10988
+ auth: "admin"
10811
10989
  }), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string() }), BrokerStatsSchema), method(object({ brokerId: string() }), object({
10812
10990
  probed: boolean(),
10813
10991
  summary: string()
@@ -13938,6 +14116,18 @@ var motionCapability = {
13938
14116
  name: "motion",
13939
14117
  scope: "device",
13940
14118
  mode: "singleton",
14119
+ /**
14120
+ * Providers register per-device natives via `ctx.registerNativeCap`
14121
+ * (Hikvision/Reolink/Amcrest/Wyze/HA/Homematic/Alexa/Matter) — there is
14122
+ * NO system singleton provider. Without this flag `resolveCapMount`
14123
+ * derived `{ kind: 'singleton' }`, so `motion.getStatus`/`isDetected`
14124
+ * resolved via `registry.getSingleton('motion')` (always null) and every
14125
+ * call 412'd "provider not available" while bindings listed a live
14126
+ * `motion` native (2026-08-02). The flag routes the router through
14127
+ * `requireDeviceScoped` → `getProviderForDevice`, like `motion-trigger`,
14128
+ * `snapshot` and every other per-device native cap.
14129
+ */
14130
+ deviceNative: true,
13941
14131
  deviceTypes: [DeviceType.Camera, DeviceType.Sensor],
13942
14132
  methods: {
13943
14133
  /**
@@ -18870,7 +19060,10 @@ method(object({
18870
19060
  }), method(object({
18871
19061
  deviceId: number(),
18872
19062
  caps: array(string()).readonly().optional()
18873
- }), record(string(), unknown().nullable()));
19063
+ }), record(string(), unknown().nullable())), method(object({
19064
+ deviceIds: array(number()).readonly(),
19065
+ caps: array(string()).readonly().optional()
19066
+ }), record(string(), record(string(), unknown().nullable())));
18874
19067
  method(object({ deviceId: number() }), record(string(), record(string(), unknown()))), method(object({
18875
19068
  deviceId: number(),
18876
19069
  capName: string()
@@ -19801,6 +19994,36 @@ var TargetKindSchema = object({
19801
19994
  icon: string(),
19802
19995
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
19803
19996
  addonId: string(),
19997
+ /**
19998
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
19999
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
20000
+ * when the addon bundles no icon for that kind — the client then falls back
20001
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
20002
+ *
20003
+ * Root-relative on purpose: it resolves against whatever origin serves a web
20004
+ * client, and a native client joins it onto its own hub base.
20005
+ *
20006
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
20007
+ * field that survived only because the runtime cap-router forwards provider
20008
+ * output verbatim — so every consumer had to re-declare it by hand to stop
20009
+ * its own Zod parse from stripping it, and the whole arrangement would have
20010
+ * broken silently the moment output validation was tightened anywhere.
20011
+ */
20012
+ iconUrl: string().optional(),
20013
+ /**
20014
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
20015
+ *
20016
+ * The server knows this and therefore says it, because the client cannot
20017
+ * safely guess: a React-Native client renders SVG and raster through two
20018
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
20019
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
20020
+ * placeholder glyph for every vector icon while the web build looked fine.
20021
+ *
20022
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
20023
+ * not been updated — a client that cannot determine the type should prefer
20024
+ * its raster path, which is the safe default for an unknown image.
20025
+ */
20026
+ iconMediaType: string().optional(),
19804
20027
  configSchema: ConfigSchemaPassthrough,
19805
20028
  supportsDiscovery: boolean(),
19806
20029
  caps: TargetKindCapsSchema
@@ -20248,6 +20471,29 @@ var MotionEventSchema = object({
20248
20471
  * Absent on legacy rows ⇒ treat as `pipeline`.
20249
20472
  */
20250
20473
  var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
20474
+ /**
20475
+ * The confirmed zone crossing that produced an object event. Present ONLY on
20476
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
20477
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
20478
+ * appearance event carry none, so a rule asking for a direction fails closed
20479
+ * on them.
20480
+ *
20481
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
20482
+ * into its own event, so a frame in which a track enters A while leaving B
20483
+ * produces two events with two directions — never one ambiguous row.
20484
+ *
20485
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
20486
+ * membership the box has NOW, and by definition it no longer contains the zone
20487
+ * that was just left. Without the id here, a zone-scoped rule could never match
20488
+ * the exit it asked for.
20489
+ */
20490
+ var ZoneCrossingSchema = object({
20491
+ direction: _enum(["enter", "exit"]),
20492
+ /** Admin zone id crossed. */
20493
+ zoneId: string(),
20494
+ /** Zone display name at crossing time (falls back to the id). */
20495
+ zoneName: string().optional()
20496
+ });
20251
20497
  var ObjectEventSchema = object({
20252
20498
  ...BaseEventFields,
20253
20499
  kind: literal("object"),
@@ -20274,6 +20520,12 @@ var ObjectEventSchema = object({
20274
20520
  zones: array(string()).readonly().optional(),
20275
20521
  /** Omitted in slim projection. */
20276
20522
  state: TrackStateSchema.optional(),
20523
+ /**
20524
+ * The zone crossing this event IS, when it is one. Absent on every other
20525
+ * event kind (movement state, appearance, package) — see
20526
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
20527
+ */
20528
+ zoneCrossing: ZoneCrossingSchema.optional(),
20277
20529
  /** Detection-frame dimensions in pixels — let consumers normalize the
20278
20530
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
20279
20531
  frameWidth: number().optional(),
@@ -20532,6 +20784,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20532
20784
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
20533
20785
  kind: "mutation",
20534
20786
  auth: "admin"
20787
+ }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
20788
+ kind: "mutation",
20789
+ auth: "admin"
20790
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
20791
+ kind: "query",
20792
+ auth: "admin"
20793
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
20794
+ kind: "mutation",
20795
+ auth: "admin"
20535
20796
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
20536
20797
  kind: "query",
20537
20798
  auth: "admin"
@@ -23062,6 +23323,17 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
23062
23323
  */
23063
23324
  priority: number()
23064
23325
  })).readonly() });
23326
+ /**
23327
+ * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
23328
+ * AUTO (resolved from the candidate ranking at send time); `resolved` reports
23329
+ * what AUTO currently picks, so the UI can show the effective value either way.
23330
+ */
23331
+ var NotificationEndpointSchema = object({
23332
+ /** The operator's explicit choice, or null for AUTO. */
23333
+ baseUrl: string().nullable(),
23334
+ /** What the ranking currently resolves to (null when nothing is reachable). */
23335
+ resolved: string().nullable()
23336
+ });
23065
23337
  var AllowedAddressesSchema = object({
23066
23338
  /**
23067
23339
  * Allowlist of interface addresses operators have explicitly opted
@@ -23084,7 +23356,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
23084
23356
  * to avoid mixed-content blocks in the browser. The public
23085
23357
  * tunnel always emits `https://` regardless. */
23086
23358
  scheme: _enum(["http", "https"]).optional()
23087
- }), GetConnectionEndpointsResultSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
23359
+ }), 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" });
23088
23360
  /**
23089
23361
  * mesh-network — collection cap for mesh-VPN providers.
23090
23362
  *
@@ -23883,7 +24155,12 @@ var RecordingDeviceUsageSchema = object({
23883
24155
  var RecordingLocationUsageSchema = object({
23884
24156
  /** StorageLocation id; null for the legacy/degraded single-root fallback. */
23885
24157
  locationId: string().nullable(),
23886
- /** Bytes of recordings stored on this location. */
24158
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
24159
+ * is emitted per physical disk (2026-07-29): two locations on one root
24160
+ * previously rendered as two identical "disks" with a nonsensical used
24161
+ * split — hydrate attribution across aliases is arbitrary by nature. */
24162
+ locationIds: array(string()).optional(),
24163
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). */
23887
24164
  usedBytes: number(),
23888
24165
  /** Free bytes on the location's volume; null when capacity is unknown (remote). */
23889
24166
  availableBytes: number().nullable(),
@@ -23995,6 +24272,44 @@ method(object({
23995
24272
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
23996
24273
  kind: "query",
23997
24274
  auth: "admin"
24275
+ }), method(object({
24276
+ deviceId: number(),
24277
+ aroundMs: number(),
24278
+ preRollSec: number().min(0).max(30).default(2),
24279
+ postRollSec: number().min(0).max(30).default(5),
24280
+ maxWidth: number().int().min(120).max(1280).default(480),
24281
+ fps: number().int().min(1).max(15).default(5)
24282
+ }), object({
24283
+ gifBase64: string(),
24284
+ fromMs: number(),
24285
+ toMs: number()
24286
+ }), {
24287
+ kind: "mutation",
24288
+ auth: "admin"
24289
+ }), method(object({
24290
+ deviceId: number(),
24291
+ aroundMs: number(),
24292
+ preRollSec: number().min(0).max(30).default(3),
24293
+ postRollSec: number().min(0).max(30).default(7),
24294
+ maxWidth: number().int().min(160).max(1920).default(640)
24295
+ }), object({
24296
+ clipBase64: string(),
24297
+ mime: string(),
24298
+ fromMs: number(),
24299
+ toMs: number(),
24300
+ bytes: number().int()
24301
+ }), {
24302
+ kind: "mutation",
24303
+ auth: "admin"
24304
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
24305
+ kind: "mutation",
24306
+ auth: "admin"
24307
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
24308
+ kind: "query",
24309
+ auth: "admin"
24310
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
24311
+ kind: "mutation",
24312
+ auth: "admin"
23998
24313
  });
23999
24314
  /**
24000
24315
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -25599,6 +25914,12 @@ Object.freeze({
25599
25914
  addonId: null,
25600
25915
  access: "view"
25601
25916
  },
25917
+ "deviceManager.getDeviceStatusAggregateBatch": {
25918
+ capName: "device-manager",
25919
+ capScope: "system",
25920
+ addonId: null,
25921
+ access: "view"
25922
+ },
25602
25923
  "deviceManager.getLinkedDevices": {
25603
25924
  capName: "device-manager",
25604
25925
  capScope: "system",
@@ -26493,6 +26814,12 @@ Object.freeze({
26493
26814
  addonId: null,
26494
26815
  access: "view"
26495
26816
  },
26817
+ "localNetwork.getNotificationEndpoint": {
26818
+ capName: "local-network",
26819
+ capScope: "system",
26820
+ addonId: null,
26821
+ access: "view"
26822
+ },
26496
26823
  "localNetwork.getPreferred": {
26497
26824
  capName: "local-network",
26498
26825
  capScope: "system",
@@ -26517,6 +26844,12 @@ Object.freeze({
26517
26844
  addonId: null,
26518
26845
  access: "create"
26519
26846
  },
26847
+ "localNetwork.setNotificationEndpoint": {
26848
+ capName: "local-network",
26849
+ capScope: "system",
26850
+ addonId: null,
26851
+ access: "create"
26852
+ },
26520
26853
  "lockControl.lock": {
26521
26854
  capName: "lock-control",
26522
26855
  capScope: "device",
@@ -27159,6 +27492,12 @@ Object.freeze({
27159
27492
  addonId: null,
27160
27493
  access: "create"
27161
27494
  },
27495
+ "pipelineAnalytics.cancelMediaRelocate": {
27496
+ capName: "pipeline-analytics",
27497
+ capScope: "device",
27498
+ addonId: null,
27499
+ access: "create"
27500
+ },
27162
27501
  "pipelineAnalytics.clearTracks": {
27163
27502
  capName: "pipeline-analytics",
27164
27503
  capScope: "device",
@@ -27213,6 +27552,12 @@ Object.freeze({
27213
27552
  addonId: null,
27214
27553
  access: "view"
27215
27554
  },
27555
+ "pipelineAnalytics.getMediaRelocateStatus": {
27556
+ capName: "pipeline-analytics",
27557
+ capScope: "device",
27558
+ addonId: null,
27559
+ access: "view"
27560
+ },
27216
27561
  "pipelineAnalytics.getMotionEvents": {
27217
27562
  capName: "pipeline-analytics",
27218
27563
  capScope: "device",
@@ -27285,6 +27630,12 @@ Object.freeze({
27285
27630
  addonId: null,
27286
27631
  access: "create"
27287
27632
  },
27633
+ "pipelineAnalytics.relocateMedia": {
27634
+ capName: "pipeline-analytics",
27635
+ capScope: "device",
27636
+ addonId: null,
27637
+ access: "create"
27638
+ },
27288
27639
  "pipelineAnalytics.searchObjectEvents": {
27289
27640
  capName: "pipeline-analytics",
27290
27641
  capScope: "device",
@@ -28047,6 +28398,12 @@ Object.freeze({
28047
28398
  addonId: null,
28048
28399
  access: "create"
28049
28400
  },
28401
+ "recording.cancelRelocate": {
28402
+ capName: "recording",
28403
+ capScope: "system",
28404
+ addonId: null,
28405
+ access: "create"
28406
+ },
28050
28407
  "recording.deleteFootprint": {
28051
28408
  capName: "recording",
28052
28409
  capScope: "system",
@@ -28077,6 +28434,12 @@ Object.freeze({
28077
28434
  addonId: null,
28078
28435
  access: "view"
28079
28436
  },
28437
+ "recording.getRelocateStatus": {
28438
+ capName: "recording",
28439
+ capScope: "system",
28440
+ addonId: null,
28441
+ access: "view"
28442
+ },
28080
28443
  "recording.getStorageUsage": {
28081
28444
  capName: "recording",
28082
28445
  capScope: "system",
@@ -28107,6 +28470,24 @@ Object.freeze({
28107
28470
  addonId: null,
28108
28471
  access: "view"
28109
28472
  },
28473
+ "recording.relocateFootage": {
28474
+ capName: "recording",
28475
+ capScope: "system",
28476
+ addonId: null,
28477
+ access: "create"
28478
+ },
28479
+ "recording.renderClip": {
28480
+ capName: "recording",
28481
+ capScope: "system",
28482
+ addonId: null,
28483
+ access: "create"
28484
+ },
28485
+ "recording.renderGif": {
28486
+ capName: "recording",
28487
+ capScope: "system",
28488
+ addonId: null,
28489
+ access: "create"
28490
+ },
28110
28491
  "recording.rescanStorage": {
28111
28492
  capName: "recording",
28112
28493
  capScope: "system",
@@ -28701,6 +29082,12 @@ Object.freeze({
28701
29082
  addonId: null,
28702
29083
  access: "create"
28703
29084
  },
29085
+ "streamBroker.renderPreBufferClip": {
29086
+ capName: "stream-broker",
29087
+ capScope: "system",
29088
+ addonId: null,
29089
+ access: "create"
29090
+ },
28704
29091
  "streamBroker.restartProfile": {
28705
29092
  capName: "stream-broker",
28706
29093
  capScope: "system",