@camstack/addon-provider-wyze 0.2.6 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +463 -76
  2. package/dist/addon.mjs +463 -76
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -9,7 +9,7 @@ import { spawn } from "node:child_process";
9
9
  //#region \0rolldown/runtime.js
10
10
  var __require$1 = /* @__PURE__ */ createRequire(import.meta.url);
11
11
  //#endregion
12
- //#region ../types/dist/event-category-BLcNejAE.mjs
12
+ //#region ../types/dist/event-category-Bz24uP1U.mjs
13
13
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
14
14
  EventCategory["SystemBoot"] = "system.boot";
15
15
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -280,6 +280,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
280
280
  */
281
281
  EventCategory["DeviceStateChanged"] = "device.state-changed";
282
282
  /**
283
+ * Frame occupancy for a camera CHANGED — a tracked object was gained or
284
+ * lost. Carries `{ deviceId, totalObjects, byClass, zones }`.
285
+ *
286
+ * Emitted only on a change, so a steady scene is silent. It exists so a
287
+ * client can stop polling `zoneAnalytics.getCurrentSnapshot`: that was the
288
+ * one live badge with no push signal at all, and it cost a request every
289
+ * four seconds per visible camera.
290
+ *
291
+ * Like every event it is telemetry and may be dropped ([D8]) — a consumer
292
+ * keeps a slow reconcile rather than trusting it alone.
293
+ */
294
+ EventCategory["ZoneAnalyticsOccupancyChanged"] = "zone-analytics.occupancy-changed";
295
+ /**
283
296
  * Cap event fired by every device that registers the `battery`
284
297
  * capability. Mirrors the cap definition's `onStatusChanged`. Carries
285
298
  * `{ deviceId, status: BatteryStatus }`. Subscribers (alert center,
@@ -7209,35 +7222,22 @@ var ConvertResultSchema = object({
7209
7222
  */
7210
7223
  var RecordingWeekdaySchema = number().int().min(0).max(6);
7211
7224
  var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
7212
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
7213
- kind: literal("timeOfDay"),
7214
- start: string().regex(HHMM),
7215
- end: string().regex(HHMM),
7216
- /** Restrict to these weekdays; omit = every day. */
7217
- days: array(RecordingWeekdaySchema).optional()
7218
- })]);
7219
- var RecordingModeSchema = _enum([
7220
- "continuous",
7221
- "onMotion",
7222
- "onAudioThreshold"
7223
- ]);
7224
7225
  /**
7225
- * First-class, authoritative per-camera storage mode — the explicit choice the
7226
- * UI reads directly (never inferred from `rules`):
7227
- * - `off` — not recording.
7228
- * - `events` — record only around triggers (motion / audio threshold),
7229
- * with pre/post-buffer.
7230
- * - `continuous` — record 24/7 within the schedule.
7226
+ * DERIVED per-camera storage summary — the single field cheap consumers read
7227
+ * (the viewer's status dot, the camera list) instead of walking `bands`:
7228
+ * - `off` — no band covers the camera (or it is disabled).
7229
+ * - `events` — every band records around triggers only.
7230
+ * - `continuous` — at least one band records continuously.
7231
7231
  *
7232
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
7233
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
7232
+ * NEVER authored: the recorder stamps it from the authoritative `bands` on
7233
+ * every save (`activeModeForConfig`). Writing it has no effect.
7234
7234
  */
7235
7235
  var RecordingStorageModeSchema = _enum([
7236
7236
  "off",
7237
7237
  "events",
7238
7238
  "continuous"
7239
7239
  ]);
7240
- /** Which detectors trigger an `events`-mode recording. */
7240
+ /** Which detectors trigger an `events`-mode band. */
7241
7241
  var RecordingTriggersSchema = object({
7242
7242
  motion: boolean().optional(),
7243
7243
  audioThresholdDbfs: number().optional()
@@ -7273,18 +7273,6 @@ var RecordingBandSchema = object({
7273
7273
  preBufferSec: number().min(0).optional(),
7274
7274
  postBufferSec: number().min(0).optional()
7275
7275
  });
7276
- var RecordingRuleSchema = object({
7277
- schedule: RecordingScheduleSchema,
7278
- mode: RecordingModeSchema,
7279
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
7280
- preBufferSec: number().min(0).default(0),
7281
- /** Keep recording until this many seconds after the last trigger. */
7282
- postBufferSec: number().min(0).default(0),
7283
- /** Each new trigger restarts the post-buffer window. */
7284
- resetTimeoutOnNewEvent: boolean().default(true),
7285
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
7286
- thresholdDbfs: number().optional()
7287
- });
7288
7276
  /**
7289
7277
  * Per-device retention overrides. Every field is optional; an unset or `0`
7290
7278
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7318,40 +7306,28 @@ var ScrubThumbnailPresetSchema = _enum([
7318
7306
  /**
7319
7307
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7320
7308
  *
7321
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
7322
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
7323
- * only for transition + migration (`migrateRulesToMode`); the policy engine
7324
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
7309
+ * `bands` is the ONLY authored recording intent: what to record, when, and on
7310
+ * which trigger. `mode` is a derived summary the recorder stamps on save; every
7311
+ * other field is a storage knob (profiles, segment length, retention, scrub).
7312
+ *
7313
+ * STRICT on purpose: the legacy authoring surface (`schedule`/`schedules`/
7314
+ * `triggers`/`preBufferSec`/`postBufferSec`/`rules`) was retired 2026-07-30.
7315
+ * A stale caller must fail loudly — silently stripping its legacy intent would
7316
+ * persist a band-less config, i.e. silently stop recording the camera.
7325
7317
  */
7326
7318
  var RecordingConfigSchema = object({
7327
7319
  enabled: boolean(),
7328
- /** Authoritative storage mode. Absent on legacy targets derived once via
7329
- * `migrateRulesToMode`, then persisted. */
7320
+ /** DERIVED summary of `bands`, stamped by the recorder on every save.
7321
+ * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7330
7322
  mode: RecordingStorageModeSchema.optional(),
7331
7323
  profiles: array(CamProfileSchema).optional(),
7332
7324
  segmentSeconds: number().int().positive().optional(),
7333
- /** Shared recording time-bands for `events` & `continuous` — record only when
7334
- * the wall-clock falls inside one of these windows. Omit or empty = always.
7335
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
7336
- schedules: array(RecordingScheduleSchema).optional(),
7337
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
7338
- * normalized into `schedules` on read and never written going forward. (Not
7339
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
7340
- schedule: RecordingScheduleSchema.optional(),
7341
- /** `events`-mode only — which detectors trigger a recording. */
7342
- triggers: RecordingTriggersSchema.optional(),
7343
- /** `events`-mode only — seconds retained before / after a trigger. */
7344
- preBufferSec: number().min(0).optional(),
7345
- postBufferSec: number().min(0).optional(),
7346
- /** DEPRECATED authoring input; retained for migration/transition. */
7347
- rules: array(RecordingRuleSchema).optional(),
7348
7325
  /**
7349
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
7350
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
7351
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
7352
- * derived into bands once via `migrateConfigToBands`.
7326
+ * AUTHORITATIVE mode-per-band recording model the single source of truth
7327
+ * the recorder's band engine consumes. An empty array = record nothing;
7328
+ * "off" is the absence of a covering band, never a band value.
7353
7329
  */
7354
- bands: array(RecordingBandSchema).optional(),
7330
+ bands: array(RecordingBandSchema).default([]),
7355
7331
  retention: RecordingRetentionSchema.optional(),
7356
7332
  /**
7357
7333
  * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
@@ -7359,8 +7335,15 @@ var RecordingConfigSchema = object({
7359
7335
  * windows only — existing sheets are immutable, and each window's index
7360
7336
  * carries its own tile dims so mixed-preset history renders correctly.
7361
7337
  */
7362
- scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7363
- });
7338
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional(),
7339
+ /**
7340
+ * OPT-IN thumbnail-strip generation for this camera: every keyframe of the
7341
+ * low recording saved as a JPEG (the fast-drag scrub depth), a derived
7342
+ * cache that eviction reclaims with the footage. Absent/false = no strips
7343
+ * are written and scrub reads exact keyframes at every velocity.
7344
+ */
7345
+ stripsEnabled: boolean().optional()
7346
+ }).strict();
7364
7347
  /**
7365
7348
  * Ops-log — the durable, append-only operations audit shared by the
7366
7349
  * recordings and events management surfaces.
@@ -7379,7 +7362,8 @@ var OpsLogOpSchema = _enum([
7379
7362
  "prune",
7380
7363
  "manual-delete",
7381
7364
  "rescan",
7382
- "retention-run"
7365
+ "retention-run",
7366
+ "relocate"
7383
7367
  ]);
7384
7368
  /** Why the operation ran. */
7385
7369
  var OpsLogReasonSchema = _enum([
@@ -7418,6 +7402,55 @@ var OpsLogQueryInputSchema = object({
7418
7402
  limit: number().int().min(1).max(1e3).optional()
7419
7403
  });
7420
7404
  /**
7405
+ * Entity-relocation job state (storage entity-routing spec, Phase 4).
7406
+ *
7407
+ * One shape shared by the recorder's `relocateFootage` (segments + strips) and
7408
+ * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7409
+ * page renders both movers with one component. Jobs are in-RAM (a restart
7410
+ * forgets them — re-running is safe by construction: copy-if-absent, delete
7411
+ * after verify) and each completed/failed run also lands one durable ops-log
7412
+ * row on the owning addon's surface.
7413
+ */
7414
+ var RelocateJobStateSchema = _enum([
7415
+ "running",
7416
+ "done",
7417
+ "failed",
7418
+ "cancelled"
7419
+ ]);
7420
+ var RelocateJobSchema = object({
7421
+ jobId: string(),
7422
+ state: RelocateJobStateSchema,
7423
+ /** Source location — for media relocation this is informational ('*': rows
7424
+ * move from wherever they are to the target). */
7425
+ fromLocationId: string(),
7426
+ toLocationId: string(),
7427
+ /** Scoped device, or null = every device. */
7428
+ deviceId: number().nullable(),
7429
+ /** What the job moves (owner-addon specific: segments/strips or media). */
7430
+ entities: array(string()),
7431
+ filesMoved: number().int(),
7432
+ bytesMoved: number().int(),
7433
+ /** Total files discovered up front; null while (or when) unknown. */
7434
+ filesTotal: number().int().nullable(),
7435
+ startedAt: number(),
7436
+ finishedAt: number().nullable(),
7437
+ error: string().nullable()
7438
+ });
7439
+ var RelocateFootageInputSchema = object({
7440
+ deviceId: number().optional(),
7441
+ fromLocationId: string(),
7442
+ toLocationId: string(),
7443
+ entities: array(_enum(["segments", "strips"])).optional(),
7444
+ /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7445
+ * never allowed to starve live writers. */
7446
+ throttleMbps: number().min(1).max(1e3).optional()
7447
+ });
7448
+ var RelocateMediaInputSchema = object({
7449
+ deviceId: number().optional(),
7450
+ toLocationId: string(),
7451
+ throttleMbps: number().min(1).max(1e3).optional()
7452
+ });
7453
+ /**
7421
7454
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7422
7455
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7423
7456
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -7467,6 +7500,13 @@ var StorageLocationSchema = object({
7467
7500
  nodeId: string().optional(),
7468
7501
  isDefault: boolean().default(false),
7469
7502
  isSystem: boolean().default(false),
7503
+ /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7504
+ * for node-local locations it can reach) — never persisted, absent when the
7505
+ * volume is remote/unreachable. The single capacity truth every UI reads. */
7506
+ capacity: object({
7507
+ totalBytes: number(),
7508
+ availableBytes: number()
7509
+ }).nullable().optional(),
7470
7510
  createdAt: number(),
7471
7511
  updatedAt: number()
7472
7512
  });
@@ -8234,7 +8274,8 @@ var NcTaxonomyEntrySchema = object({
8234
8274
  /** Macro/category parent for grouping ('car' → 'vehicle'); null for a top. */
8235
8275
  parentKind: string().nullable()
8236
8276
  });
8237
- object({
8277
+ /** The complete NC picker taxonomy — three grouped buckets. */
8278
+ var NcTaxonomySchema = object({
8238
8279
  videoClasses: array(NcTaxonomyEntrySchema),
8239
8280
  audioKinds: array(NcTaxonomyEntrySchema),
8240
8281
  labels: array(NcTaxonomyEntrySchema)
@@ -9137,6 +9178,7 @@ function shallowEqual(a, b) {
9137
9178
  for (const k of ak) if (a[k] !== b[k]) return false;
9138
9179
  return true;
9139
9180
  }
9181
+ new Set(["devices", "classes"]);
9140
9182
  /**
9141
9183
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
9142
9184
  * motion-zones, and the detection zones/lines editor all speak this one
@@ -9295,6 +9337,29 @@ var NcOccupancyConditionSchema = object({
9295
9337
  count: number().int().min(0).default(1),
9296
9338
  sustainSeconds: number().int().min(0).max(3600).default(15)
9297
9339
  });
9340
+ /**
9341
+ * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
9342
+ *
9343
+ * The values are not symmetric, and deliberately so — the absent value has to
9344
+ * mean exactly what every rule authored before this condition existed already
9345
+ * does:
9346
+ * - `enter` — entries and every NON-crossing record (movement state,
9347
+ * package, sensor). Exits are rejected. **This is the absent behaviour**:
9348
+ * an operator who never asked for exits must not start receiving them.
9349
+ * - `exit` — ONLY an exit crossing. A record that is not a crossing at all
9350
+ * fails closed, because "the car left the drive" is a question about a
9351
+ * boundary, not about a detection.
9352
+ * - `any` — no direction filter; entries, exits and non-crossings alike.
9353
+ *
9354
+ * A rule asking for a direction should normally also scope `zones`, which the
9355
+ * engine evaluates against the crossed zone as well as the current membership
9356
+ * (an exit's membership no longer contains the zone it just left).
9357
+ */
9358
+ var NcCrossingSchema = _enum([
9359
+ "enter",
9360
+ "exit",
9361
+ "any"
9362
+ ]);
9298
9363
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
9299
9364
  var NcZoneConditionSchema = object({
9300
9365
  ids: array(string().min(1)).min(1),
@@ -9319,6 +9384,13 @@ var NcConditionsSchema = object({
9319
9384
  /** Veto zones — any hit fails the rule. */
9320
9385
  zonesExclude: array(string().min(1)).optional(),
9321
9386
  /**
9387
+ * Zone-crossing direction. IMMEDIATE only — a crossing is a per-event fact
9388
+ * and a closed track carries none, so a `track-end` rule asking for one
9389
+ * fails closed (use `zones`, which tests `zonesVisited`). ABSENT = `enter`,
9390
+ * which is exactly today's behaviour. See {@link NcCrossingSchema}.
9391
+ */
9392
+ crossing: NcCrossingSchema.optional(),
9393
+ /**
9322
9394
  * Exact (case-insensitive) match on the record's collapsed `label`
9323
9395
  * (identity name / plate text / subclass).
9324
9396
  */
@@ -9453,17 +9525,85 @@ var NcRuleTargetSchema = object({
9453
9525
  * - `keyFrame` — the clean scene frame (no subject box).
9454
9526
  * - `none` — no attachment.
9455
9527
  */
9456
- var NcMediaPolicySchema = object({ attach: _enum([
9457
- "best",
9458
- "best-matching",
9459
- "keyFrame",
9460
- "none"
9461
- ]).default("best") });
9528
+ /**
9529
+ * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
9530
+ * conflate it with the selection strategy and betray the request: asking for
9531
+ * the clean scene frame on an object-event owner used to start at
9532
+ * `fullFrameBoxed`, i.e. the annotated frame (2026-07-30).
9533
+ * - `cropped` — the subject, tight. What "who is at the door" wants.
9534
+ * - `full` — the clean scene, no annotation. What "what is going on" wants.
9535
+ * - `boxed` — the scene WITH the detection boxes drawn, for verifying what
9536
+ * the pipeline actually saw.
9537
+ */
9538
+ var NcMediaFrameSchema = _enum([
9539
+ "cropped",
9540
+ "full",
9541
+ "boxed"
9542
+ ]);
9543
+ var NcMediaPolicySchema = object({
9544
+ attach: _enum([
9545
+ "best",
9546
+ "best-matching",
9547
+ "keyFrame",
9548
+ "none"
9549
+ ]).default("best"),
9550
+ /** What the still shows. Absent = `cropped` (the historical `best` shape). */
9551
+ frame: NcMediaFrameSchema.optional(),
9552
+ /** Crop the attached still to the rule's condition-zone bbox (padded) —
9553
+ * "show me the ZONE", not the whole scene or the subject crop. */
9554
+ zoneCrop: boolean().optional(),
9555
+ /**
9556
+ * Also attach a short GIF cut from the stream broker's clip ring around the
9557
+ * event — NOT from the recording, so the camera does not have to be
9558
+ * recording, and the window sits AROUND the moment instead of a segment
9559
+ * behind it. Fail-closed: a window the ring does not cover contributes no
9560
+ * gif, never a failed notification.
9561
+ */
9562
+ gif: boolean().optional(),
9563
+ /**
9564
+ * Also attach a short MP4 CLIP of the same cut. Same source and the same
9565
+ * fail-closed rule as `gif`. Prefer it where the backend takes video
9566
+ * (telegram, discord, zentik, webhook); backends that do not are handled by
9567
+ * the degrade engine, which drops the video and keeps the still.
9568
+ */
9569
+ clip: boolean().optional(),
9570
+ /** Seconds of footage BEFORE / AFTER the event instant. Defaults 3 / 7. */
9571
+ clipPreRollSec: number().int().min(0).max(30).optional(),
9572
+ clipPostRollSec: number().int().min(0).max(30).optional(),
9573
+ /**
9574
+ * Which stream profile the footage is cut from. Absent = the CHEAPEST
9575
+ * assigned profile: a notification is watched on a phone, so the 4K
9576
+ * rendition would burn CPU to produce a file the client downscales anyway.
9577
+ * A profile that is not assigned falls back to the cheapest, and the render
9578
+ * reports which one actually ran.
9579
+ */
9580
+ profile: CamProfileSchema.optional()
9581
+ });
9582
+ /**
9583
+ * Cooldown GRANULARITY over the subject's class — how much a fired
9584
+ * notification suppresses.
9585
+ * - `shared` (default, and the absent value) — one window for the whole
9586
+ * rule/scope: a cat silences the next dog for `cooldownSec`.
9587
+ * - `per-class` — an independent window per detected class, so cat→dog fires
9588
+ * at once and cat→cat still waits.
9589
+ *
9590
+ * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
9591
+ * must not be swallowed by a bark's window (the precedent this generalizes —
9592
+ * see `cooldownKey` in the rule engine).
9593
+ */
9594
+ var NcThrottleGranularitySchema = _enum(["shared", "per-class"]);
9462
9595
  /** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
9463
9596
  var NcThrottleSchema = object({
9464
9597
  cooldownSec: number().int().min(0).max(86400).default(60),
9465
9598
  /** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
9466
- scope: _enum(["rule", "rule-device"]).default("rule-device")
9599
+ scope: _enum(["rule", "rule-device"]).default("rule-device"),
9600
+ /**
9601
+ * Class granularity of the cooldown key. Optional rather than defaulted:
9602
+ * a Zod default does NOT run on the addon→addon cap path, so a persisted
9603
+ * rule authored before this field simply carries none — and the engine
9604
+ * reads absent as `shared`, the pre-existing behaviour.
9605
+ */
9606
+ granularity: NcThrottleGranularitySchema.optional()
9467
9607
  });
9468
9608
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
9469
9609
  var NcRuleInputSchema = object({
@@ -9472,7 +9612,19 @@ var NcRuleInputSchema = object({
9472
9612
  delivery: NcDeliverySchema,
9473
9613
  conditions: NcConditionsSchema.default({}),
9474
9614
  schedule: NcScheduleSchema.optional(),
9475
- targets: array(NcRuleTargetSchema).min(1),
9615
+ /** May be empty when `targetUsers` addresses at least one user — the
9616
+ * "at least one addressee" invariant is enforced by the provider, because
9617
+ * a cross-field refine here would break `NcRulePatchSchema.partial()`. */
9618
+ targets: array(NcRuleTargetSchema),
9619
+ /**
9620
+ * USERS this rule addresses in addition to `targets` (Phase 4). At fire
9621
+ * time each user fans out to the personal targets they own
9622
+ * (`config.ownerUserId`), filtered by that user's `allowedDevices` for the
9623
+ * firing camera — a user is never notified about a device they cannot open.
9624
+ * Per-user opt-outs (`disabledTargetIds`) still apply to the fanned-out
9625
+ * targets.
9626
+ */
9627
+ targetUsers: array(string()).optional(),
9476
9628
  media: NcMediaPolicySchema.default({ attach: "best" }),
9477
9629
  throttle: NcThrottleSchema.default({
9478
9630
  cooldownSec: 60,
@@ -9559,6 +9711,7 @@ var NcConditionDescriptorSchema = object({
9559
9711
  "schedule",
9560
9712
  "plateMatcher",
9561
9713
  "packagePhase",
9714
+ "crossingSelect",
9562
9715
  "polygonDraw",
9563
9716
  "occupancy"
9564
9717
  ]),
@@ -9685,7 +9838,10 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
9685
9838
  }), object({ results: array(NcTestResultSchema) }), {
9686
9839
  kind: "mutation",
9687
9840
  auth: "admin"
9688
- }), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9841
+ }), method(object({}), object({
9842
+ catalog: array(NcConditionDescriptorSchema),
9843
+ taxonomy: NcTaxonomySchema.optional()
9844
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9689
9845
  /**
9690
9846
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
9691
9847
  *
@@ -10694,6 +10850,28 @@ method(object({
10694
10850
  }), object({ success: literal(true) }), {
10695
10851
  kind: "mutation",
10696
10852
  auth: "admin"
10853
+ }), method(object({
10854
+ deviceId: number(),
10855
+ /** Absent = the LOWEST assigned profile — a notification attachment is
10856
+ * watched on a phone, and the cheap rendition is the right default. */
10857
+ profile: CamProfileSchema.optional(),
10858
+ aroundMs: number(),
10859
+ preRollSec: number().min(0).max(20).default(3),
10860
+ postRollSec: number().min(0).max(20).default(5),
10861
+ format: _enum(["gif", "mp4"]).default("gif"),
10862
+ maxWidth: number().int().min(120).max(1920).default(480),
10863
+ /** GIF only — MP4 keeps the source cadence. */
10864
+ fps: number().int().min(1).max(15).default(5)
10865
+ }), object({
10866
+ base64: string(),
10867
+ mime: string(),
10868
+ bytes: number().int(),
10869
+ /** The profile actually rendered (what the default resolved to). */
10870
+ profile: CamProfileSchema,
10871
+ durationMs: number()
10872
+ }), {
10873
+ kind: "mutation",
10874
+ auth: "admin"
10697
10875
  }), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string() }), BrokerStatsSchema), method(object({ brokerId: string() }), object({
10698
10876
  probed: boolean(),
10699
10877
  summary: string()
@@ -13824,6 +14002,18 @@ var motionCapability = {
13824
14002
  name: "motion",
13825
14003
  scope: "device",
13826
14004
  mode: "singleton",
14005
+ /**
14006
+ * Providers register per-device natives via `ctx.registerNativeCap`
14007
+ * (Hikvision/Reolink/Amcrest/Wyze/HA/Homematic/Alexa/Matter) — there is
14008
+ * NO system singleton provider. Without this flag `resolveCapMount`
14009
+ * derived `{ kind: 'singleton' }`, so `motion.getStatus`/`isDetected`
14010
+ * resolved via `registry.getSingleton('motion')` (always null) and every
14011
+ * call 412'd "provider not available" while bindings listed a live
14012
+ * `motion` native (2026-08-02). The flag routes the router through
14013
+ * `requireDeviceScoped` → `getProviderForDevice`, like `motion-trigger`,
14014
+ * `snapshot` and every other per-device native cap.
14015
+ */
14016
+ deviceNative: true,
13827
14017
  deviceTypes: [DeviceType.Camera, DeviceType.Sensor],
13828
14018
  methods: {
13829
14019
  /**
@@ -18773,7 +18963,10 @@ method(object({
18773
18963
  }), method(object({
18774
18964
  deviceId: number(),
18775
18965
  caps: array(string()).readonly().optional()
18776
- }), record(string(), unknown().nullable()));
18966
+ }), record(string(), unknown().nullable())), method(object({
18967
+ deviceIds: array(number()).readonly(),
18968
+ caps: array(string()).readonly().optional()
18969
+ }), record(string(), record(string(), unknown().nullable())));
18777
18970
  method(object({ deviceId: number() }), record(string(), record(string(), unknown()))), method(object({
18778
18971
  deviceId: number(),
18779
18972
  capName: string()
@@ -19704,6 +19897,36 @@ var TargetKindSchema = object({
19704
19897
  icon: string(),
19705
19898
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
19706
19899
  addonId: string(),
19900
+ /**
19901
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
19902
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
19903
+ * when the addon bundles no icon for that kind — the client then falls back
19904
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
19905
+ *
19906
+ * Root-relative on purpose: it resolves against whatever origin serves a web
19907
+ * client, and a native client joins it onto its own hub base.
19908
+ *
19909
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
19910
+ * field that survived only because the runtime cap-router forwards provider
19911
+ * output verbatim — so every consumer had to re-declare it by hand to stop
19912
+ * its own Zod parse from stripping it, and the whole arrangement would have
19913
+ * broken silently the moment output validation was tightened anywhere.
19914
+ */
19915
+ iconUrl: string().optional(),
19916
+ /**
19917
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
19918
+ *
19919
+ * The server knows this and therefore says it, because the client cannot
19920
+ * safely guess: a React-Native client renders SVG and raster through two
19921
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
19922
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
19923
+ * placeholder glyph for every vector icon while the web build looked fine.
19924
+ *
19925
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
19926
+ * not been updated — a client that cannot determine the type should prefer
19927
+ * its raster path, which is the safe default for an unknown image.
19928
+ */
19929
+ iconMediaType: string().optional(),
19707
19930
  configSchema: ConfigSchemaPassthrough,
19708
19931
  supportsDiscovery: boolean(),
19709
19932
  caps: TargetKindCapsSchema
@@ -20151,6 +20374,29 @@ var MotionEventSchema = object({
20151
20374
  * Absent on legacy rows ⇒ treat as `pipeline`.
20152
20375
  */
20153
20376
  var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
20377
+ /**
20378
+ * The confirmed zone crossing that produced an object event. Present ONLY on
20379
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
20380
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
20381
+ * appearance event carry none, so a rule asking for a direction fails closed
20382
+ * on them.
20383
+ *
20384
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
20385
+ * into its own event, so a frame in which a track enters A while leaving B
20386
+ * produces two events with two directions — never one ambiguous row.
20387
+ *
20388
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
20389
+ * membership the box has NOW, and by definition it no longer contains the zone
20390
+ * that was just left. Without the id here, a zone-scoped rule could never match
20391
+ * the exit it asked for.
20392
+ */
20393
+ var ZoneCrossingSchema = object({
20394
+ direction: _enum(["enter", "exit"]),
20395
+ /** Admin zone id crossed. */
20396
+ zoneId: string(),
20397
+ /** Zone display name at crossing time (falls back to the id). */
20398
+ zoneName: string().optional()
20399
+ });
20154
20400
  var ObjectEventSchema = object({
20155
20401
  ...BaseEventFields,
20156
20402
  kind: literal("object"),
@@ -20177,6 +20423,12 @@ var ObjectEventSchema = object({
20177
20423
  zones: array(string()).readonly().optional(),
20178
20424
  /** Omitted in slim projection. */
20179
20425
  state: TrackStateSchema.optional(),
20426
+ /**
20427
+ * The zone crossing this event IS, when it is one. Absent on every other
20428
+ * event kind (movement state, appearance, package) — see
20429
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
20430
+ */
20431
+ zoneCrossing: ZoneCrossingSchema.optional(),
20180
20432
  /** Detection-frame dimensions in pixels — let consumers normalize the
20181
20433
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
20182
20434
  frameWidth: number().optional(),
@@ -20435,6 +20687,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20435
20687
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
20436
20688
  kind: "mutation",
20437
20689
  auth: "admin"
20690
+ }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
20691
+ kind: "mutation",
20692
+ auth: "admin"
20693
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
20694
+ kind: "query",
20695
+ auth: "admin"
20696
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
20697
+ kind: "mutation",
20698
+ auth: "admin"
20438
20699
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
20439
20700
  kind: "query",
20440
20701
  auth: "admin"
@@ -23016,6 +23277,17 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
23016
23277
  */
23017
23278
  priority: number()
23018
23279
  })).readonly() });
23280
+ /**
23281
+ * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
23282
+ * AUTO (resolved from the candidate ranking at send time); `resolved` reports
23283
+ * what AUTO currently picks, so the UI can show the effective value either way.
23284
+ */
23285
+ var NotificationEndpointSchema = object({
23286
+ /** The operator's explicit choice, or null for AUTO. */
23287
+ baseUrl: string().nullable(),
23288
+ /** What the ranking currently resolves to (null when nothing is reachable). */
23289
+ resolved: string().nullable()
23290
+ });
23019
23291
  var AllowedAddressesSchema = object({
23020
23292
  /**
23021
23293
  * Allowlist of interface addresses operators have explicitly opted
@@ -23038,7 +23310,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
23038
23310
  * to avoid mixed-content blocks in the browser. The public
23039
23311
  * tunnel always emits `https://` regardless. */
23040
23312
  scheme: _enum(["http", "https"]).optional()
23041
- }), GetConnectionEndpointsResultSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
23313
+ }), 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" });
23042
23314
  /**
23043
23315
  * mesh-network — collection cap for mesh-VPN providers.
23044
23316
  *
@@ -23837,7 +24109,12 @@ var RecordingDeviceUsageSchema = object({
23837
24109
  var RecordingLocationUsageSchema = object({
23838
24110
  /** StorageLocation id; null for the legacy/degraded single-root fallback. */
23839
24111
  locationId: string().nullable(),
23840
- /** Bytes of recordings stored on this location. */
24112
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
24113
+ * is emitted per physical disk (2026-07-29): two locations on one root
24114
+ * previously rendered as two identical "disks" with a nonsensical used
24115
+ * split — hydrate attribution across aliases is arbitrary by nature. */
24116
+ locationIds: array(string()).optional(),
24117
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). */
23841
24118
  usedBytes: number(),
23842
24119
  /** Free bytes on the location's volume; null when capacity is unknown (remote). */
23843
24120
  availableBytes: number().nullable(),
@@ -23949,6 +24226,44 @@ method(object({
23949
24226
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
23950
24227
  kind: "query",
23951
24228
  auth: "admin"
24229
+ }), method(object({
24230
+ deviceId: number(),
24231
+ aroundMs: number(),
24232
+ preRollSec: number().min(0).max(30).default(2),
24233
+ postRollSec: number().min(0).max(30).default(5),
24234
+ maxWidth: number().int().min(120).max(1280).default(480),
24235
+ fps: number().int().min(1).max(15).default(5)
24236
+ }), object({
24237
+ gifBase64: string(),
24238
+ fromMs: number(),
24239
+ toMs: number()
24240
+ }), {
24241
+ kind: "mutation",
24242
+ auth: "admin"
24243
+ }), method(object({
24244
+ deviceId: number(),
24245
+ aroundMs: number(),
24246
+ preRollSec: number().min(0).max(30).default(3),
24247
+ postRollSec: number().min(0).max(30).default(7),
24248
+ maxWidth: number().int().min(160).max(1920).default(640)
24249
+ }), object({
24250
+ clipBase64: string(),
24251
+ mime: string(),
24252
+ fromMs: number(),
24253
+ toMs: number(),
24254
+ bytes: number().int()
24255
+ }), {
24256
+ kind: "mutation",
24257
+ auth: "admin"
24258
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
24259
+ kind: "mutation",
24260
+ auth: "admin"
24261
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
24262
+ kind: "query",
24263
+ auth: "admin"
24264
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
24265
+ kind: "mutation",
24266
+ auth: "admin"
23952
24267
  });
23953
24268
  /**
23954
24269
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -25553,6 +25868,12 @@ Object.freeze({
25553
25868
  addonId: null,
25554
25869
  access: "view"
25555
25870
  },
25871
+ "deviceManager.getDeviceStatusAggregateBatch": {
25872
+ capName: "device-manager",
25873
+ capScope: "system",
25874
+ addonId: null,
25875
+ access: "view"
25876
+ },
25556
25877
  "deviceManager.getLinkedDevices": {
25557
25878
  capName: "device-manager",
25558
25879
  capScope: "system",
@@ -26447,6 +26768,12 @@ Object.freeze({
26447
26768
  addonId: null,
26448
26769
  access: "view"
26449
26770
  },
26771
+ "localNetwork.getNotificationEndpoint": {
26772
+ capName: "local-network",
26773
+ capScope: "system",
26774
+ addonId: null,
26775
+ access: "view"
26776
+ },
26450
26777
  "localNetwork.getPreferred": {
26451
26778
  capName: "local-network",
26452
26779
  capScope: "system",
@@ -26471,6 +26798,12 @@ Object.freeze({
26471
26798
  addonId: null,
26472
26799
  access: "create"
26473
26800
  },
26801
+ "localNetwork.setNotificationEndpoint": {
26802
+ capName: "local-network",
26803
+ capScope: "system",
26804
+ addonId: null,
26805
+ access: "create"
26806
+ },
26474
26807
  "lockControl.lock": {
26475
26808
  capName: "lock-control",
26476
26809
  capScope: "device",
@@ -27113,6 +27446,12 @@ Object.freeze({
27113
27446
  addonId: null,
27114
27447
  access: "create"
27115
27448
  },
27449
+ "pipelineAnalytics.cancelMediaRelocate": {
27450
+ capName: "pipeline-analytics",
27451
+ capScope: "device",
27452
+ addonId: null,
27453
+ access: "create"
27454
+ },
27116
27455
  "pipelineAnalytics.clearTracks": {
27117
27456
  capName: "pipeline-analytics",
27118
27457
  capScope: "device",
@@ -27167,6 +27506,12 @@ Object.freeze({
27167
27506
  addonId: null,
27168
27507
  access: "view"
27169
27508
  },
27509
+ "pipelineAnalytics.getMediaRelocateStatus": {
27510
+ capName: "pipeline-analytics",
27511
+ capScope: "device",
27512
+ addonId: null,
27513
+ access: "view"
27514
+ },
27170
27515
  "pipelineAnalytics.getMotionEvents": {
27171
27516
  capName: "pipeline-analytics",
27172
27517
  capScope: "device",
@@ -27239,6 +27584,12 @@ Object.freeze({
27239
27584
  addonId: null,
27240
27585
  access: "create"
27241
27586
  },
27587
+ "pipelineAnalytics.relocateMedia": {
27588
+ capName: "pipeline-analytics",
27589
+ capScope: "device",
27590
+ addonId: null,
27591
+ access: "create"
27592
+ },
27242
27593
  "pipelineAnalytics.searchObjectEvents": {
27243
27594
  capName: "pipeline-analytics",
27244
27595
  capScope: "device",
@@ -28001,6 +28352,12 @@ Object.freeze({
28001
28352
  addonId: null,
28002
28353
  access: "create"
28003
28354
  },
28355
+ "recording.cancelRelocate": {
28356
+ capName: "recording",
28357
+ capScope: "system",
28358
+ addonId: null,
28359
+ access: "create"
28360
+ },
28004
28361
  "recording.deleteFootprint": {
28005
28362
  capName: "recording",
28006
28363
  capScope: "system",
@@ -28031,6 +28388,12 @@ Object.freeze({
28031
28388
  addonId: null,
28032
28389
  access: "view"
28033
28390
  },
28391
+ "recording.getRelocateStatus": {
28392
+ capName: "recording",
28393
+ capScope: "system",
28394
+ addonId: null,
28395
+ access: "view"
28396
+ },
28034
28397
  "recording.getStorageUsage": {
28035
28398
  capName: "recording",
28036
28399
  capScope: "system",
@@ -28061,6 +28424,24 @@ Object.freeze({
28061
28424
  addonId: null,
28062
28425
  access: "view"
28063
28426
  },
28427
+ "recording.relocateFootage": {
28428
+ capName: "recording",
28429
+ capScope: "system",
28430
+ addonId: null,
28431
+ access: "create"
28432
+ },
28433
+ "recording.renderClip": {
28434
+ capName: "recording",
28435
+ capScope: "system",
28436
+ addonId: null,
28437
+ access: "create"
28438
+ },
28439
+ "recording.renderGif": {
28440
+ capName: "recording",
28441
+ capScope: "system",
28442
+ addonId: null,
28443
+ access: "create"
28444
+ },
28064
28445
  "recording.rescanStorage": {
28065
28446
  capName: "recording",
28066
28447
  capScope: "system",
@@ -28655,6 +29036,12 @@ Object.freeze({
28655
29036
  addonId: null,
28656
29037
  access: "create"
28657
29038
  },
29039
+ "streamBroker.renderPreBufferClip": {
29040
+ capName: "stream-broker",
29041
+ capScope: "system",
29042
+ addonId: null,
29043
+ access: "create"
29044
+ },
28658
29045
  "streamBroker.restartProfile": {
28659
29046
  capName: "stream-broker",
28660
29047
  capScope: "system",