@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.js CHANGED
@@ -30,7 +30,7 @@ let events = require("events");
30
30
  let net = require("net");
31
31
  net = __toESM(net, 1);
32
32
  let node_child_process = require("node:child_process");
33
- //#region ../types/dist/event-category-BLcNejAE.mjs
33
+ //#region ../types/dist/event-category-Bz24uP1U.mjs
34
34
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
35
35
  EventCategory["SystemBoot"] = "system.boot";
36
36
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -301,6 +301,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
301
301
  */
302
302
  EventCategory["DeviceStateChanged"] = "device.state-changed";
303
303
  /**
304
+ * Frame occupancy for a camera CHANGED — a tracked object was gained or
305
+ * lost. Carries `{ deviceId, totalObjects, byClass, zones }`.
306
+ *
307
+ * Emitted only on a change, so a steady scene is silent. It exists so a
308
+ * client can stop polling `zoneAnalytics.getCurrentSnapshot`: that was the
309
+ * one live badge with no push signal at all, and it cost a request every
310
+ * four seconds per visible camera.
311
+ *
312
+ * Like every event it is telemetry and may be dropped ([D8]) — a consumer
313
+ * keeps a slow reconcile rather than trusting it alone.
314
+ */
315
+ EventCategory["ZoneAnalyticsOccupancyChanged"] = "zone-analytics.occupancy-changed";
316
+ /**
304
317
  * Cap event fired by every device that registers the `battery`
305
318
  * capability. Mirrors the cap definition's `onStatusChanged`. Carries
306
319
  * `{ deviceId, status: BatteryStatus }`. Subscribers (alert center,
@@ -7230,35 +7243,22 @@ var ConvertResultSchema = object({
7230
7243
  */
7231
7244
  var RecordingWeekdaySchema = number().int().min(0).max(6);
7232
7245
  var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
7233
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
7234
- kind: literal("timeOfDay"),
7235
- start: string().regex(HHMM),
7236
- end: string().regex(HHMM),
7237
- /** Restrict to these weekdays; omit = every day. */
7238
- days: array(RecordingWeekdaySchema).optional()
7239
- })]);
7240
- var RecordingModeSchema = _enum([
7241
- "continuous",
7242
- "onMotion",
7243
- "onAudioThreshold"
7244
- ]);
7245
7246
  /**
7246
- * First-class, authoritative per-camera storage mode — the explicit choice the
7247
- * UI reads directly (never inferred from `rules`):
7248
- * - `off` — not recording.
7249
- * - `events` — record only around triggers (motion / audio threshold),
7250
- * with pre/post-buffer.
7251
- * - `continuous` — record 24/7 within the schedule.
7247
+ * DERIVED per-camera storage summary — the single field cheap consumers read
7248
+ * (the viewer's status dot, the camera list) instead of walking `bands`:
7249
+ * - `off` — no band covers the camera (or it is disabled).
7250
+ * - `events` — every band records around triggers only.
7251
+ * - `continuous` — at least one band records continuously.
7252
7252
  *
7253
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
7254
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
7253
+ * NEVER authored: the recorder stamps it from the authoritative `bands` on
7254
+ * every save (`activeModeForConfig`). Writing it has no effect.
7255
7255
  */
7256
7256
  var RecordingStorageModeSchema = _enum([
7257
7257
  "off",
7258
7258
  "events",
7259
7259
  "continuous"
7260
7260
  ]);
7261
- /** Which detectors trigger an `events`-mode recording. */
7261
+ /** Which detectors trigger an `events`-mode band. */
7262
7262
  var RecordingTriggersSchema = object({
7263
7263
  motion: boolean().optional(),
7264
7264
  audioThresholdDbfs: number().optional()
@@ -7294,18 +7294,6 @@ var RecordingBandSchema = object({
7294
7294
  preBufferSec: number().min(0).optional(),
7295
7295
  postBufferSec: number().min(0).optional()
7296
7296
  });
7297
- var RecordingRuleSchema = object({
7298
- schedule: RecordingScheduleSchema,
7299
- mode: RecordingModeSchema,
7300
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
7301
- preBufferSec: number().min(0).default(0),
7302
- /** Keep recording until this many seconds after the last trigger. */
7303
- postBufferSec: number().min(0).default(0),
7304
- /** Each new trigger restarts the post-buffer window. */
7305
- resetTimeoutOnNewEvent: boolean().default(true),
7306
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
7307
- thresholdDbfs: number().optional()
7308
- });
7309
7297
  /**
7310
7298
  * Per-device retention overrides. Every field is optional; an unset or `0`
7311
7299
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7339,40 +7327,28 @@ var ScrubThumbnailPresetSchema = _enum([
7339
7327
  /**
7340
7328
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7341
7329
  *
7342
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
7343
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
7344
- * only for transition + migration (`migrateRulesToMode`); the policy engine
7345
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
7330
+ * `bands` is the ONLY authored recording intent: what to record, when, and on
7331
+ * which trigger. `mode` is a derived summary the recorder stamps on save; every
7332
+ * other field is a storage knob (profiles, segment length, retention, scrub).
7333
+ *
7334
+ * STRICT on purpose: the legacy authoring surface (`schedule`/`schedules`/
7335
+ * `triggers`/`preBufferSec`/`postBufferSec`/`rules`) was retired 2026-07-30.
7336
+ * A stale caller must fail loudly — silently stripping its legacy intent would
7337
+ * persist a band-less config, i.e. silently stop recording the camera.
7346
7338
  */
7347
7339
  var RecordingConfigSchema = object({
7348
7340
  enabled: boolean(),
7349
- /** Authoritative storage mode. Absent on legacy targets derived once via
7350
- * `migrateRulesToMode`, then persisted. */
7341
+ /** DERIVED summary of `bands`, stamped by the recorder on every save.
7342
+ * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7351
7343
  mode: RecordingStorageModeSchema.optional(),
7352
7344
  profiles: array(CamProfileSchema).optional(),
7353
7345
  segmentSeconds: number().int().positive().optional(),
7354
- /** Shared recording time-bands for `events` & `continuous` — record only when
7355
- * the wall-clock falls inside one of these windows. Omit or empty = always.
7356
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
7357
- schedules: array(RecordingScheduleSchema).optional(),
7358
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
7359
- * normalized into `schedules` on read and never written going forward. (Not
7360
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
7361
- schedule: RecordingScheduleSchema.optional(),
7362
- /** `events`-mode only — which detectors trigger a recording. */
7363
- triggers: RecordingTriggersSchema.optional(),
7364
- /** `events`-mode only — seconds retained before / after a trigger. */
7365
- preBufferSec: number().min(0).optional(),
7366
- postBufferSec: number().min(0).optional(),
7367
- /** DEPRECATED authoring input; retained for migration/transition. */
7368
- rules: array(RecordingRuleSchema).optional(),
7369
7346
  /**
7370
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
7371
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
7372
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
7373
- * derived into bands once via `migrateConfigToBands`.
7347
+ * AUTHORITATIVE mode-per-band recording model the single source of truth
7348
+ * the recorder's band engine consumes. An empty array = record nothing;
7349
+ * "off" is the absence of a covering band, never a band value.
7374
7350
  */
7375
- bands: array(RecordingBandSchema).optional(),
7351
+ bands: array(RecordingBandSchema).default([]),
7376
7352
  retention: RecordingRetentionSchema.optional(),
7377
7353
  /**
7378
7354
  * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
@@ -7380,8 +7356,15 @@ var RecordingConfigSchema = object({
7380
7356
  * windows only — existing sheets are immutable, and each window's index
7381
7357
  * carries its own tile dims so mixed-preset history renders correctly.
7382
7358
  */
7383
- scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7384
- });
7359
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional(),
7360
+ /**
7361
+ * OPT-IN thumbnail-strip generation for this camera: every keyframe of the
7362
+ * low recording saved as a JPEG (the fast-drag scrub depth), a derived
7363
+ * cache that eviction reclaims with the footage. Absent/false = no strips
7364
+ * are written and scrub reads exact keyframes at every velocity.
7365
+ */
7366
+ stripsEnabled: boolean().optional()
7367
+ }).strict();
7385
7368
  /**
7386
7369
  * Ops-log — the durable, append-only operations audit shared by the
7387
7370
  * recordings and events management surfaces.
@@ -7400,7 +7383,8 @@ var OpsLogOpSchema = _enum([
7400
7383
  "prune",
7401
7384
  "manual-delete",
7402
7385
  "rescan",
7403
- "retention-run"
7386
+ "retention-run",
7387
+ "relocate"
7404
7388
  ]);
7405
7389
  /** Why the operation ran. */
7406
7390
  var OpsLogReasonSchema = _enum([
@@ -7439,6 +7423,55 @@ var OpsLogQueryInputSchema = object({
7439
7423
  limit: number().int().min(1).max(1e3).optional()
7440
7424
  });
7441
7425
  /**
7426
+ * Entity-relocation job state (storage entity-routing spec, Phase 4).
7427
+ *
7428
+ * One shape shared by the recorder's `relocateFootage` (segments + strips) and
7429
+ * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7430
+ * page renders both movers with one component. Jobs are in-RAM (a restart
7431
+ * forgets them — re-running is safe by construction: copy-if-absent, delete
7432
+ * after verify) and each completed/failed run also lands one durable ops-log
7433
+ * row on the owning addon's surface.
7434
+ */
7435
+ var RelocateJobStateSchema = _enum([
7436
+ "running",
7437
+ "done",
7438
+ "failed",
7439
+ "cancelled"
7440
+ ]);
7441
+ var RelocateJobSchema = object({
7442
+ jobId: string(),
7443
+ state: RelocateJobStateSchema,
7444
+ /** Source location — for media relocation this is informational ('*': rows
7445
+ * move from wherever they are to the target). */
7446
+ fromLocationId: string(),
7447
+ toLocationId: string(),
7448
+ /** Scoped device, or null = every device. */
7449
+ deviceId: number().nullable(),
7450
+ /** What the job moves (owner-addon specific: segments/strips or media). */
7451
+ entities: array(string()),
7452
+ filesMoved: number().int(),
7453
+ bytesMoved: number().int(),
7454
+ /** Total files discovered up front; null while (or when) unknown. */
7455
+ filesTotal: number().int().nullable(),
7456
+ startedAt: number(),
7457
+ finishedAt: number().nullable(),
7458
+ error: string().nullable()
7459
+ });
7460
+ var RelocateFootageInputSchema = object({
7461
+ deviceId: number().optional(),
7462
+ fromLocationId: string(),
7463
+ toLocationId: string(),
7464
+ entities: array(_enum(["segments", "strips"])).optional(),
7465
+ /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7466
+ * never allowed to starve live writers. */
7467
+ throttleMbps: number().min(1).max(1e3).optional()
7468
+ });
7469
+ var RelocateMediaInputSchema = object({
7470
+ deviceId: number().optional(),
7471
+ toLocationId: string(),
7472
+ throttleMbps: number().min(1).max(1e3).optional()
7473
+ });
7474
+ /**
7442
7475
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7443
7476
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7444
7477
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -7488,6 +7521,13 @@ var StorageLocationSchema = object({
7488
7521
  nodeId: string().optional(),
7489
7522
  isDefault: boolean().default(false),
7490
7523
  isSystem: boolean().default(false),
7524
+ /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7525
+ * for node-local locations it can reach) — never persisted, absent when the
7526
+ * volume is remote/unreachable. The single capacity truth every UI reads. */
7527
+ capacity: object({
7528
+ totalBytes: number(),
7529
+ availableBytes: number()
7530
+ }).nullable().optional(),
7491
7531
  createdAt: number(),
7492
7532
  updatedAt: number()
7493
7533
  });
@@ -8255,7 +8295,8 @@ var NcTaxonomyEntrySchema = object({
8255
8295
  /** Macro/category parent for grouping ('car' → 'vehicle'); null for a top. */
8256
8296
  parentKind: string().nullable()
8257
8297
  });
8258
- object({
8298
+ /** The complete NC picker taxonomy — three grouped buckets. */
8299
+ var NcTaxonomySchema = object({
8259
8300
  videoClasses: array(NcTaxonomyEntrySchema),
8260
8301
  audioKinds: array(NcTaxonomyEntrySchema),
8261
8302
  labels: array(NcTaxonomyEntrySchema)
@@ -9158,6 +9199,7 @@ function shallowEqual(a, b) {
9158
9199
  for (const k of ak) if (a[k] !== b[k]) return false;
9159
9200
  return true;
9160
9201
  }
9202
+ new Set(["devices", "classes"]);
9161
9203
  /**
9162
9204
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
9163
9205
  * motion-zones, and the detection zones/lines editor all speak this one
@@ -9316,6 +9358,29 @@ var NcOccupancyConditionSchema = object({
9316
9358
  count: number().int().min(0).default(1),
9317
9359
  sustainSeconds: number().int().min(0).max(3600).default(15)
9318
9360
  });
9361
+ /**
9362
+ * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
9363
+ *
9364
+ * The values are not symmetric, and deliberately so — the absent value has to
9365
+ * mean exactly what every rule authored before this condition existed already
9366
+ * does:
9367
+ * - `enter` — entries and every NON-crossing record (movement state,
9368
+ * package, sensor). Exits are rejected. **This is the absent behaviour**:
9369
+ * an operator who never asked for exits must not start receiving them.
9370
+ * - `exit` — ONLY an exit crossing. A record that is not a crossing at all
9371
+ * fails closed, because "the car left the drive" is a question about a
9372
+ * boundary, not about a detection.
9373
+ * - `any` — no direction filter; entries, exits and non-crossings alike.
9374
+ *
9375
+ * A rule asking for a direction should normally also scope `zones`, which the
9376
+ * engine evaluates against the crossed zone as well as the current membership
9377
+ * (an exit's membership no longer contains the zone it just left).
9378
+ */
9379
+ var NcCrossingSchema = _enum([
9380
+ "enter",
9381
+ "exit",
9382
+ "any"
9383
+ ]);
9319
9384
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
9320
9385
  var NcZoneConditionSchema = object({
9321
9386
  ids: array(string().min(1)).min(1),
@@ -9340,6 +9405,13 @@ var NcConditionsSchema = object({
9340
9405
  /** Veto zones — any hit fails the rule. */
9341
9406
  zonesExclude: array(string().min(1)).optional(),
9342
9407
  /**
9408
+ * Zone-crossing direction. IMMEDIATE only — a crossing is a per-event fact
9409
+ * and a closed track carries none, so a `track-end` rule asking for one
9410
+ * fails closed (use `zones`, which tests `zonesVisited`). ABSENT = `enter`,
9411
+ * which is exactly today's behaviour. See {@link NcCrossingSchema}.
9412
+ */
9413
+ crossing: NcCrossingSchema.optional(),
9414
+ /**
9343
9415
  * Exact (case-insensitive) match on the record's collapsed `label`
9344
9416
  * (identity name / plate text / subclass).
9345
9417
  */
@@ -9474,17 +9546,85 @@ var NcRuleTargetSchema = object({
9474
9546
  * - `keyFrame` — the clean scene frame (no subject box).
9475
9547
  * - `none` — no attachment.
9476
9548
  */
9477
- var NcMediaPolicySchema = object({ attach: _enum([
9478
- "best",
9479
- "best-matching",
9480
- "keyFrame",
9481
- "none"
9482
- ]).default("best") });
9549
+ /**
9550
+ * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
9551
+ * conflate it with the selection strategy and betray the request: asking for
9552
+ * the clean scene frame on an object-event owner used to start at
9553
+ * `fullFrameBoxed`, i.e. the annotated frame (2026-07-30).
9554
+ * - `cropped` — the subject, tight. What "who is at the door" wants.
9555
+ * - `full` — the clean scene, no annotation. What "what is going on" wants.
9556
+ * - `boxed` — the scene WITH the detection boxes drawn, for verifying what
9557
+ * the pipeline actually saw.
9558
+ */
9559
+ var NcMediaFrameSchema = _enum([
9560
+ "cropped",
9561
+ "full",
9562
+ "boxed"
9563
+ ]);
9564
+ var NcMediaPolicySchema = object({
9565
+ attach: _enum([
9566
+ "best",
9567
+ "best-matching",
9568
+ "keyFrame",
9569
+ "none"
9570
+ ]).default("best"),
9571
+ /** What the still shows. Absent = `cropped` (the historical `best` shape). */
9572
+ frame: NcMediaFrameSchema.optional(),
9573
+ /** Crop the attached still to the rule's condition-zone bbox (padded) —
9574
+ * "show me the ZONE", not the whole scene or the subject crop. */
9575
+ zoneCrop: boolean().optional(),
9576
+ /**
9577
+ * Also attach a short GIF cut from the stream broker's clip ring around the
9578
+ * event — NOT from the recording, so the camera does not have to be
9579
+ * recording, and the window sits AROUND the moment instead of a segment
9580
+ * behind it. Fail-closed: a window the ring does not cover contributes no
9581
+ * gif, never a failed notification.
9582
+ */
9583
+ gif: boolean().optional(),
9584
+ /**
9585
+ * Also attach a short MP4 CLIP of the same cut. Same source and the same
9586
+ * fail-closed rule as `gif`. Prefer it where the backend takes video
9587
+ * (telegram, discord, zentik, webhook); backends that do not are handled by
9588
+ * the degrade engine, which drops the video and keeps the still.
9589
+ */
9590
+ clip: boolean().optional(),
9591
+ /** Seconds of footage BEFORE / AFTER the event instant. Defaults 3 / 7. */
9592
+ clipPreRollSec: number().int().min(0).max(30).optional(),
9593
+ clipPostRollSec: number().int().min(0).max(30).optional(),
9594
+ /**
9595
+ * Which stream profile the footage is cut from. Absent = the CHEAPEST
9596
+ * assigned profile: a notification is watched on a phone, so the 4K
9597
+ * rendition would burn CPU to produce a file the client downscales anyway.
9598
+ * A profile that is not assigned falls back to the cheapest, and the render
9599
+ * reports which one actually ran.
9600
+ */
9601
+ profile: CamProfileSchema.optional()
9602
+ });
9603
+ /**
9604
+ * Cooldown GRANULARITY over the subject's class — how much a fired
9605
+ * notification suppresses.
9606
+ * - `shared` (default, and the absent value) — one window for the whole
9607
+ * rule/scope: a cat silences the next dog for `cooldownSec`.
9608
+ * - `per-class` — an independent window per detected class, so cat→dog fires
9609
+ * at once and cat→cat still waits.
9610
+ *
9611
+ * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
9612
+ * must not be swallowed by a bark's window (the precedent this generalizes —
9613
+ * see `cooldownKey` in the rule engine).
9614
+ */
9615
+ var NcThrottleGranularitySchema = _enum(["shared", "per-class"]);
9483
9616
  /** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
9484
9617
  var NcThrottleSchema = object({
9485
9618
  cooldownSec: number().int().min(0).max(86400).default(60),
9486
9619
  /** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
9487
- scope: _enum(["rule", "rule-device"]).default("rule-device")
9620
+ scope: _enum(["rule", "rule-device"]).default("rule-device"),
9621
+ /**
9622
+ * Class granularity of the cooldown key. Optional rather than defaulted:
9623
+ * a Zod default does NOT run on the addon→addon cap path, so a persisted
9624
+ * rule authored before this field simply carries none — and the engine
9625
+ * reads absent as `shared`, the pre-existing behaviour.
9626
+ */
9627
+ granularity: NcThrottleGranularitySchema.optional()
9488
9628
  });
9489
9629
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
9490
9630
  var NcRuleInputSchema = object({
@@ -9493,7 +9633,19 @@ var NcRuleInputSchema = object({
9493
9633
  delivery: NcDeliverySchema,
9494
9634
  conditions: NcConditionsSchema.default({}),
9495
9635
  schedule: NcScheduleSchema.optional(),
9496
- targets: array(NcRuleTargetSchema).min(1),
9636
+ /** May be empty when `targetUsers` addresses at least one user — the
9637
+ * "at least one addressee" invariant is enforced by the provider, because
9638
+ * a cross-field refine here would break `NcRulePatchSchema.partial()`. */
9639
+ targets: array(NcRuleTargetSchema),
9640
+ /**
9641
+ * USERS this rule addresses in addition to `targets` (Phase 4). At fire
9642
+ * time each user fans out to the personal targets they own
9643
+ * (`config.ownerUserId`), filtered by that user's `allowedDevices` for the
9644
+ * firing camera — a user is never notified about a device they cannot open.
9645
+ * Per-user opt-outs (`disabledTargetIds`) still apply to the fanned-out
9646
+ * targets.
9647
+ */
9648
+ targetUsers: array(string()).optional(),
9497
9649
  media: NcMediaPolicySchema.default({ attach: "best" }),
9498
9650
  throttle: NcThrottleSchema.default({
9499
9651
  cooldownSec: 60,
@@ -9580,6 +9732,7 @@ var NcConditionDescriptorSchema = object({
9580
9732
  "schedule",
9581
9733
  "plateMatcher",
9582
9734
  "packagePhase",
9735
+ "crossingSelect",
9583
9736
  "polygonDraw",
9584
9737
  "occupancy"
9585
9738
  ]),
@@ -9706,7 +9859,10 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
9706
9859
  }), object({ results: array(NcTestResultSchema) }), {
9707
9860
  kind: "mutation",
9708
9861
  auth: "admin"
9709
- }), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9862
+ }), method(object({}), object({
9863
+ catalog: array(NcConditionDescriptorSchema),
9864
+ taxonomy: NcTaxonomySchema.optional()
9865
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9710
9866
  /**
9711
9867
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
9712
9868
  *
@@ -10715,6 +10871,28 @@ method(object({
10715
10871
  }), object({ success: literal(true) }), {
10716
10872
  kind: "mutation",
10717
10873
  auth: "admin"
10874
+ }), method(object({
10875
+ deviceId: number(),
10876
+ /** Absent = the LOWEST assigned profile — a notification attachment is
10877
+ * watched on a phone, and the cheap rendition is the right default. */
10878
+ profile: CamProfileSchema.optional(),
10879
+ aroundMs: number(),
10880
+ preRollSec: number().min(0).max(20).default(3),
10881
+ postRollSec: number().min(0).max(20).default(5),
10882
+ format: _enum(["gif", "mp4"]).default("gif"),
10883
+ maxWidth: number().int().min(120).max(1920).default(480),
10884
+ /** GIF only — MP4 keeps the source cadence. */
10885
+ fps: number().int().min(1).max(15).default(5)
10886
+ }), object({
10887
+ base64: string(),
10888
+ mime: string(),
10889
+ bytes: number().int(),
10890
+ /** The profile actually rendered (what the default resolved to). */
10891
+ profile: CamProfileSchema,
10892
+ durationMs: number()
10893
+ }), {
10894
+ kind: "mutation",
10895
+ auth: "admin"
10718
10896
  }), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string() }), BrokerStatsSchema), method(object({ brokerId: string() }), object({
10719
10897
  probed: boolean(),
10720
10898
  summary: string()
@@ -13845,6 +14023,18 @@ var motionCapability = {
13845
14023
  name: "motion",
13846
14024
  scope: "device",
13847
14025
  mode: "singleton",
14026
+ /**
14027
+ * Providers register per-device natives via `ctx.registerNativeCap`
14028
+ * (Hikvision/Reolink/Amcrest/Wyze/HA/Homematic/Alexa/Matter) — there is
14029
+ * NO system singleton provider. Without this flag `resolveCapMount`
14030
+ * derived `{ kind: 'singleton' }`, so `motion.getStatus`/`isDetected`
14031
+ * resolved via `registry.getSingleton('motion')` (always null) and every
14032
+ * call 412'd "provider not available" while bindings listed a live
14033
+ * `motion` native (2026-08-02). The flag routes the router through
14034
+ * `requireDeviceScoped` → `getProviderForDevice`, like `motion-trigger`,
14035
+ * `snapshot` and every other per-device native cap.
14036
+ */
14037
+ deviceNative: true,
13848
14038
  deviceTypes: [DeviceType.Camera, DeviceType.Sensor],
13849
14039
  methods: {
13850
14040
  /**
@@ -18794,7 +18984,10 @@ method(object({
18794
18984
  }), method(object({
18795
18985
  deviceId: number(),
18796
18986
  caps: array(string()).readonly().optional()
18797
- }), record(string(), unknown().nullable()));
18987
+ }), record(string(), unknown().nullable())), method(object({
18988
+ deviceIds: array(number()).readonly(),
18989
+ caps: array(string()).readonly().optional()
18990
+ }), record(string(), record(string(), unknown().nullable())));
18798
18991
  method(object({ deviceId: number() }), record(string(), record(string(), unknown()))), method(object({
18799
18992
  deviceId: number(),
18800
18993
  capName: string()
@@ -19725,6 +19918,36 @@ var TargetKindSchema = object({
19725
19918
  icon: string(),
19726
19919
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
19727
19920
  addonId: string(),
19921
+ /**
19922
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
19923
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
19924
+ * when the addon bundles no icon for that kind — the client then falls back
19925
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
19926
+ *
19927
+ * Root-relative on purpose: it resolves against whatever origin serves a web
19928
+ * client, and a native client joins it onto its own hub base.
19929
+ *
19930
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
19931
+ * field that survived only because the runtime cap-router forwards provider
19932
+ * output verbatim — so every consumer had to re-declare it by hand to stop
19933
+ * its own Zod parse from stripping it, and the whole arrangement would have
19934
+ * broken silently the moment output validation was tightened anywhere.
19935
+ */
19936
+ iconUrl: string().optional(),
19937
+ /**
19938
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
19939
+ *
19940
+ * The server knows this and therefore says it, because the client cannot
19941
+ * safely guess: a React-Native client renders SVG and raster through two
19942
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
19943
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
19944
+ * placeholder glyph for every vector icon while the web build looked fine.
19945
+ *
19946
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
19947
+ * not been updated — a client that cannot determine the type should prefer
19948
+ * its raster path, which is the safe default for an unknown image.
19949
+ */
19950
+ iconMediaType: string().optional(),
19728
19951
  configSchema: ConfigSchemaPassthrough,
19729
19952
  supportsDiscovery: boolean(),
19730
19953
  caps: TargetKindCapsSchema
@@ -20172,6 +20395,29 @@ var MotionEventSchema = object({
20172
20395
  * Absent on legacy rows ⇒ treat as `pipeline`.
20173
20396
  */
20174
20397
  var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
20398
+ /**
20399
+ * The confirmed zone crossing that produced an object event. Present ONLY on
20400
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
20401
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
20402
+ * appearance event carry none, so a rule asking for a direction fails closed
20403
+ * on them.
20404
+ *
20405
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
20406
+ * into its own event, so a frame in which a track enters A while leaving B
20407
+ * produces two events with two directions — never one ambiguous row.
20408
+ *
20409
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
20410
+ * membership the box has NOW, and by definition it no longer contains the zone
20411
+ * that was just left. Without the id here, a zone-scoped rule could never match
20412
+ * the exit it asked for.
20413
+ */
20414
+ var ZoneCrossingSchema = object({
20415
+ direction: _enum(["enter", "exit"]),
20416
+ /** Admin zone id crossed. */
20417
+ zoneId: string(),
20418
+ /** Zone display name at crossing time (falls back to the id). */
20419
+ zoneName: string().optional()
20420
+ });
20175
20421
  var ObjectEventSchema = object({
20176
20422
  ...BaseEventFields,
20177
20423
  kind: literal("object"),
@@ -20198,6 +20444,12 @@ var ObjectEventSchema = object({
20198
20444
  zones: array(string()).readonly().optional(),
20199
20445
  /** Omitted in slim projection. */
20200
20446
  state: TrackStateSchema.optional(),
20447
+ /**
20448
+ * The zone crossing this event IS, when it is one. Absent on every other
20449
+ * event kind (movement state, appearance, package) — see
20450
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
20451
+ */
20452
+ zoneCrossing: ZoneCrossingSchema.optional(),
20201
20453
  /** Detection-frame dimensions in pixels — let consumers normalize the
20202
20454
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
20203
20455
  frameWidth: number().optional(),
@@ -20456,6 +20708,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20456
20708
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
20457
20709
  kind: "mutation",
20458
20710
  auth: "admin"
20711
+ }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
20712
+ kind: "mutation",
20713
+ auth: "admin"
20714
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
20715
+ kind: "query",
20716
+ auth: "admin"
20717
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
20718
+ kind: "mutation",
20719
+ auth: "admin"
20459
20720
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
20460
20721
  kind: "query",
20461
20722
  auth: "admin"
@@ -23037,6 +23298,17 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
23037
23298
  */
23038
23299
  priority: number()
23039
23300
  })).readonly() });
23301
+ /**
23302
+ * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
23303
+ * AUTO (resolved from the candidate ranking at send time); `resolved` reports
23304
+ * what AUTO currently picks, so the UI can show the effective value either way.
23305
+ */
23306
+ var NotificationEndpointSchema = object({
23307
+ /** The operator's explicit choice, or null for AUTO. */
23308
+ baseUrl: string().nullable(),
23309
+ /** What the ranking currently resolves to (null when nothing is reachable). */
23310
+ resolved: string().nullable()
23311
+ });
23040
23312
  var AllowedAddressesSchema = object({
23041
23313
  /**
23042
23314
  * Allowlist of interface addresses operators have explicitly opted
@@ -23059,7 +23331,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
23059
23331
  * to avoid mixed-content blocks in the browser. The public
23060
23332
  * tunnel always emits `https://` regardless. */
23061
23333
  scheme: _enum(["http", "https"]).optional()
23062
- }), GetConnectionEndpointsResultSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
23334
+ }), 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" });
23063
23335
  /**
23064
23336
  * mesh-network — collection cap for mesh-VPN providers.
23065
23337
  *
@@ -23858,7 +24130,12 @@ var RecordingDeviceUsageSchema = object({
23858
24130
  var RecordingLocationUsageSchema = object({
23859
24131
  /** StorageLocation id; null for the legacy/degraded single-root fallback. */
23860
24132
  locationId: string().nullable(),
23861
- /** Bytes of recordings stored on this location. */
24133
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
24134
+ * is emitted per physical disk (2026-07-29): two locations on one root
24135
+ * previously rendered as two identical "disks" with a nonsensical used
24136
+ * split — hydrate attribution across aliases is arbitrary by nature. */
24137
+ locationIds: array(string()).optional(),
24138
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). */
23862
24139
  usedBytes: number(),
23863
24140
  /** Free bytes on the location's volume; null when capacity is unknown (remote). */
23864
24141
  availableBytes: number().nullable(),
@@ -23970,6 +24247,44 @@ method(object({
23970
24247
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
23971
24248
  kind: "query",
23972
24249
  auth: "admin"
24250
+ }), method(object({
24251
+ deviceId: number(),
24252
+ aroundMs: number(),
24253
+ preRollSec: number().min(0).max(30).default(2),
24254
+ postRollSec: number().min(0).max(30).default(5),
24255
+ maxWidth: number().int().min(120).max(1280).default(480),
24256
+ fps: number().int().min(1).max(15).default(5)
24257
+ }), object({
24258
+ gifBase64: string(),
24259
+ fromMs: number(),
24260
+ toMs: number()
24261
+ }), {
24262
+ kind: "mutation",
24263
+ auth: "admin"
24264
+ }), method(object({
24265
+ deviceId: number(),
24266
+ aroundMs: number(),
24267
+ preRollSec: number().min(0).max(30).default(3),
24268
+ postRollSec: number().min(0).max(30).default(7),
24269
+ maxWidth: number().int().min(160).max(1920).default(640)
24270
+ }), object({
24271
+ clipBase64: string(),
24272
+ mime: string(),
24273
+ fromMs: number(),
24274
+ toMs: number(),
24275
+ bytes: number().int()
24276
+ }), {
24277
+ kind: "mutation",
24278
+ auth: "admin"
24279
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
24280
+ kind: "mutation",
24281
+ auth: "admin"
24282
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
24283
+ kind: "query",
24284
+ auth: "admin"
24285
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
24286
+ kind: "mutation",
24287
+ auth: "admin"
23973
24288
  });
23974
24289
  /**
23975
24290
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -25574,6 +25889,12 @@ Object.freeze({
25574
25889
  addonId: null,
25575
25890
  access: "view"
25576
25891
  },
25892
+ "deviceManager.getDeviceStatusAggregateBatch": {
25893
+ capName: "device-manager",
25894
+ capScope: "system",
25895
+ addonId: null,
25896
+ access: "view"
25897
+ },
25577
25898
  "deviceManager.getLinkedDevices": {
25578
25899
  capName: "device-manager",
25579
25900
  capScope: "system",
@@ -26468,6 +26789,12 @@ Object.freeze({
26468
26789
  addonId: null,
26469
26790
  access: "view"
26470
26791
  },
26792
+ "localNetwork.getNotificationEndpoint": {
26793
+ capName: "local-network",
26794
+ capScope: "system",
26795
+ addonId: null,
26796
+ access: "view"
26797
+ },
26471
26798
  "localNetwork.getPreferred": {
26472
26799
  capName: "local-network",
26473
26800
  capScope: "system",
@@ -26492,6 +26819,12 @@ Object.freeze({
26492
26819
  addonId: null,
26493
26820
  access: "create"
26494
26821
  },
26822
+ "localNetwork.setNotificationEndpoint": {
26823
+ capName: "local-network",
26824
+ capScope: "system",
26825
+ addonId: null,
26826
+ access: "create"
26827
+ },
26495
26828
  "lockControl.lock": {
26496
26829
  capName: "lock-control",
26497
26830
  capScope: "device",
@@ -27134,6 +27467,12 @@ Object.freeze({
27134
27467
  addonId: null,
27135
27468
  access: "create"
27136
27469
  },
27470
+ "pipelineAnalytics.cancelMediaRelocate": {
27471
+ capName: "pipeline-analytics",
27472
+ capScope: "device",
27473
+ addonId: null,
27474
+ access: "create"
27475
+ },
27137
27476
  "pipelineAnalytics.clearTracks": {
27138
27477
  capName: "pipeline-analytics",
27139
27478
  capScope: "device",
@@ -27188,6 +27527,12 @@ Object.freeze({
27188
27527
  addonId: null,
27189
27528
  access: "view"
27190
27529
  },
27530
+ "pipelineAnalytics.getMediaRelocateStatus": {
27531
+ capName: "pipeline-analytics",
27532
+ capScope: "device",
27533
+ addonId: null,
27534
+ access: "view"
27535
+ },
27191
27536
  "pipelineAnalytics.getMotionEvents": {
27192
27537
  capName: "pipeline-analytics",
27193
27538
  capScope: "device",
@@ -27260,6 +27605,12 @@ Object.freeze({
27260
27605
  addonId: null,
27261
27606
  access: "create"
27262
27607
  },
27608
+ "pipelineAnalytics.relocateMedia": {
27609
+ capName: "pipeline-analytics",
27610
+ capScope: "device",
27611
+ addonId: null,
27612
+ access: "create"
27613
+ },
27263
27614
  "pipelineAnalytics.searchObjectEvents": {
27264
27615
  capName: "pipeline-analytics",
27265
27616
  capScope: "device",
@@ -28022,6 +28373,12 @@ Object.freeze({
28022
28373
  addonId: null,
28023
28374
  access: "create"
28024
28375
  },
28376
+ "recording.cancelRelocate": {
28377
+ capName: "recording",
28378
+ capScope: "system",
28379
+ addonId: null,
28380
+ access: "create"
28381
+ },
28025
28382
  "recording.deleteFootprint": {
28026
28383
  capName: "recording",
28027
28384
  capScope: "system",
@@ -28052,6 +28409,12 @@ Object.freeze({
28052
28409
  addonId: null,
28053
28410
  access: "view"
28054
28411
  },
28412
+ "recording.getRelocateStatus": {
28413
+ capName: "recording",
28414
+ capScope: "system",
28415
+ addonId: null,
28416
+ access: "view"
28417
+ },
28055
28418
  "recording.getStorageUsage": {
28056
28419
  capName: "recording",
28057
28420
  capScope: "system",
@@ -28082,6 +28445,24 @@ Object.freeze({
28082
28445
  addonId: null,
28083
28446
  access: "view"
28084
28447
  },
28448
+ "recording.relocateFootage": {
28449
+ capName: "recording",
28450
+ capScope: "system",
28451
+ addonId: null,
28452
+ access: "create"
28453
+ },
28454
+ "recording.renderClip": {
28455
+ capName: "recording",
28456
+ capScope: "system",
28457
+ addonId: null,
28458
+ access: "create"
28459
+ },
28460
+ "recording.renderGif": {
28461
+ capName: "recording",
28462
+ capScope: "system",
28463
+ addonId: null,
28464
+ access: "create"
28465
+ },
28085
28466
  "recording.rescanStorage": {
28086
28467
  capName: "recording",
28087
28468
  capScope: "system",
@@ -28676,6 +29057,12 @@ Object.freeze({
28676
29057
  addonId: null,
28677
29058
  access: "create"
28678
29059
  },
29060
+ "streamBroker.renderPreBufferClip": {
29061
+ capName: "stream-broker",
29062
+ capScope: "system",
29063
+ addonId: null,
29064
+ access: "create"
29065
+ },
28679
29066
  "streamBroker.restartProfile": {
28680
29067
  capName: "stream-broker",
28681
29068
  capScope: "system",