@camstack/addon-provider-wyze 0.2.6 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +451 -76
  2. package/dist/addon.mjs +451 -76
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -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()
@@ -18794,7 +18972,10 @@ method(object({
18794
18972
  }), method(object({
18795
18973
  deviceId: number(),
18796
18974
  caps: array(string()).readonly().optional()
18797
- }), record(string(), unknown().nullable()));
18975
+ }), record(string(), unknown().nullable())), method(object({
18976
+ deviceIds: array(number()).readonly(),
18977
+ caps: array(string()).readonly().optional()
18978
+ }), record(string(), record(string(), unknown().nullable())));
18798
18979
  method(object({ deviceId: number() }), record(string(), record(string(), unknown()))), method(object({
18799
18980
  deviceId: number(),
18800
18981
  capName: string()
@@ -19725,6 +19906,36 @@ var TargetKindSchema = object({
19725
19906
  icon: string(),
19726
19907
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
19727
19908
  addonId: string(),
19909
+ /**
19910
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
19911
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
19912
+ * when the addon bundles no icon for that kind — the client then falls back
19913
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
19914
+ *
19915
+ * Root-relative on purpose: it resolves against whatever origin serves a web
19916
+ * client, and a native client joins it onto its own hub base.
19917
+ *
19918
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
19919
+ * field that survived only because the runtime cap-router forwards provider
19920
+ * output verbatim — so every consumer had to re-declare it by hand to stop
19921
+ * its own Zod parse from stripping it, and the whole arrangement would have
19922
+ * broken silently the moment output validation was tightened anywhere.
19923
+ */
19924
+ iconUrl: string().optional(),
19925
+ /**
19926
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
19927
+ *
19928
+ * The server knows this and therefore says it, because the client cannot
19929
+ * safely guess: a React-Native client renders SVG and raster through two
19930
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
19931
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
19932
+ * placeholder glyph for every vector icon while the web build looked fine.
19933
+ *
19934
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
19935
+ * not been updated — a client that cannot determine the type should prefer
19936
+ * its raster path, which is the safe default for an unknown image.
19937
+ */
19938
+ iconMediaType: string().optional(),
19728
19939
  configSchema: ConfigSchemaPassthrough,
19729
19940
  supportsDiscovery: boolean(),
19730
19941
  caps: TargetKindCapsSchema
@@ -20172,6 +20383,29 @@ var MotionEventSchema = object({
20172
20383
  * Absent on legacy rows ⇒ treat as `pipeline`.
20173
20384
  */
20174
20385
  var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
20386
+ /**
20387
+ * The confirmed zone crossing that produced an object event. Present ONLY on
20388
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
20389
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
20390
+ * appearance event carry none, so a rule asking for a direction fails closed
20391
+ * on them.
20392
+ *
20393
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
20394
+ * into its own event, so a frame in which a track enters A while leaving B
20395
+ * produces two events with two directions — never one ambiguous row.
20396
+ *
20397
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
20398
+ * membership the box has NOW, and by definition it no longer contains the zone
20399
+ * that was just left. Without the id here, a zone-scoped rule could never match
20400
+ * the exit it asked for.
20401
+ */
20402
+ var ZoneCrossingSchema = object({
20403
+ direction: _enum(["enter", "exit"]),
20404
+ /** Admin zone id crossed. */
20405
+ zoneId: string(),
20406
+ /** Zone display name at crossing time (falls back to the id). */
20407
+ zoneName: string().optional()
20408
+ });
20175
20409
  var ObjectEventSchema = object({
20176
20410
  ...BaseEventFields,
20177
20411
  kind: literal("object"),
@@ -20198,6 +20432,12 @@ var ObjectEventSchema = object({
20198
20432
  zones: array(string()).readonly().optional(),
20199
20433
  /** Omitted in slim projection. */
20200
20434
  state: TrackStateSchema.optional(),
20435
+ /**
20436
+ * The zone crossing this event IS, when it is one. Absent on every other
20437
+ * event kind (movement state, appearance, package) — see
20438
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
20439
+ */
20440
+ zoneCrossing: ZoneCrossingSchema.optional(),
20201
20441
  /** Detection-frame dimensions in pixels — let consumers normalize the
20202
20442
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
20203
20443
  frameWidth: number().optional(),
@@ -20456,6 +20696,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20456
20696
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
20457
20697
  kind: "mutation",
20458
20698
  auth: "admin"
20699
+ }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
20700
+ kind: "mutation",
20701
+ auth: "admin"
20702
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
20703
+ kind: "query",
20704
+ auth: "admin"
20705
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
20706
+ kind: "mutation",
20707
+ auth: "admin"
20459
20708
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
20460
20709
  kind: "query",
20461
20710
  auth: "admin"
@@ -23037,6 +23286,17 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
23037
23286
  */
23038
23287
  priority: number()
23039
23288
  })).readonly() });
23289
+ /**
23290
+ * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
23291
+ * AUTO (resolved from the candidate ranking at send time); `resolved` reports
23292
+ * what AUTO currently picks, so the UI can show the effective value either way.
23293
+ */
23294
+ var NotificationEndpointSchema = object({
23295
+ /** The operator's explicit choice, or null for AUTO. */
23296
+ baseUrl: string().nullable(),
23297
+ /** What the ranking currently resolves to (null when nothing is reachable). */
23298
+ resolved: string().nullable()
23299
+ });
23040
23300
  var AllowedAddressesSchema = object({
23041
23301
  /**
23042
23302
  * Allowlist of interface addresses operators have explicitly opted
@@ -23059,7 +23319,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
23059
23319
  * to avoid mixed-content blocks in the browser. The public
23060
23320
  * tunnel always emits `https://` regardless. */
23061
23321
  scheme: _enum(["http", "https"]).optional()
23062
- }), GetConnectionEndpointsResultSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
23322
+ }), 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
23323
  /**
23064
23324
  * mesh-network — collection cap for mesh-VPN providers.
23065
23325
  *
@@ -23858,7 +24118,12 @@ var RecordingDeviceUsageSchema = object({
23858
24118
  var RecordingLocationUsageSchema = object({
23859
24119
  /** StorageLocation id; null for the legacy/degraded single-root fallback. */
23860
24120
  locationId: string().nullable(),
23861
- /** Bytes of recordings stored on this location. */
24121
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
24122
+ * is emitted per physical disk (2026-07-29): two locations on one root
24123
+ * previously rendered as two identical "disks" with a nonsensical used
24124
+ * split — hydrate attribution across aliases is arbitrary by nature. */
24125
+ locationIds: array(string()).optional(),
24126
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). */
23862
24127
  usedBytes: number(),
23863
24128
  /** Free bytes on the location's volume; null when capacity is unknown (remote). */
23864
24129
  availableBytes: number().nullable(),
@@ -23970,6 +24235,44 @@ method(object({
23970
24235
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
23971
24236
  kind: "query",
23972
24237
  auth: "admin"
24238
+ }), method(object({
24239
+ deviceId: number(),
24240
+ aroundMs: number(),
24241
+ preRollSec: number().min(0).max(30).default(2),
24242
+ postRollSec: number().min(0).max(30).default(5),
24243
+ maxWidth: number().int().min(120).max(1280).default(480),
24244
+ fps: number().int().min(1).max(15).default(5)
24245
+ }), object({
24246
+ gifBase64: string(),
24247
+ fromMs: number(),
24248
+ toMs: number()
24249
+ }), {
24250
+ kind: "mutation",
24251
+ auth: "admin"
24252
+ }), method(object({
24253
+ deviceId: number(),
24254
+ aroundMs: number(),
24255
+ preRollSec: number().min(0).max(30).default(3),
24256
+ postRollSec: number().min(0).max(30).default(7),
24257
+ maxWidth: number().int().min(160).max(1920).default(640)
24258
+ }), object({
24259
+ clipBase64: string(),
24260
+ mime: string(),
24261
+ fromMs: number(),
24262
+ toMs: number(),
24263
+ bytes: number().int()
24264
+ }), {
24265
+ kind: "mutation",
24266
+ auth: "admin"
24267
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
24268
+ kind: "mutation",
24269
+ auth: "admin"
24270
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
24271
+ kind: "query",
24272
+ auth: "admin"
24273
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
24274
+ kind: "mutation",
24275
+ auth: "admin"
23973
24276
  });
23974
24277
  /**
23975
24278
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -25574,6 +25877,12 @@ Object.freeze({
25574
25877
  addonId: null,
25575
25878
  access: "view"
25576
25879
  },
25880
+ "deviceManager.getDeviceStatusAggregateBatch": {
25881
+ capName: "device-manager",
25882
+ capScope: "system",
25883
+ addonId: null,
25884
+ access: "view"
25885
+ },
25577
25886
  "deviceManager.getLinkedDevices": {
25578
25887
  capName: "device-manager",
25579
25888
  capScope: "system",
@@ -26468,6 +26777,12 @@ Object.freeze({
26468
26777
  addonId: null,
26469
26778
  access: "view"
26470
26779
  },
26780
+ "localNetwork.getNotificationEndpoint": {
26781
+ capName: "local-network",
26782
+ capScope: "system",
26783
+ addonId: null,
26784
+ access: "view"
26785
+ },
26471
26786
  "localNetwork.getPreferred": {
26472
26787
  capName: "local-network",
26473
26788
  capScope: "system",
@@ -26492,6 +26807,12 @@ Object.freeze({
26492
26807
  addonId: null,
26493
26808
  access: "create"
26494
26809
  },
26810
+ "localNetwork.setNotificationEndpoint": {
26811
+ capName: "local-network",
26812
+ capScope: "system",
26813
+ addonId: null,
26814
+ access: "create"
26815
+ },
26495
26816
  "lockControl.lock": {
26496
26817
  capName: "lock-control",
26497
26818
  capScope: "device",
@@ -27134,6 +27455,12 @@ Object.freeze({
27134
27455
  addonId: null,
27135
27456
  access: "create"
27136
27457
  },
27458
+ "pipelineAnalytics.cancelMediaRelocate": {
27459
+ capName: "pipeline-analytics",
27460
+ capScope: "device",
27461
+ addonId: null,
27462
+ access: "create"
27463
+ },
27137
27464
  "pipelineAnalytics.clearTracks": {
27138
27465
  capName: "pipeline-analytics",
27139
27466
  capScope: "device",
@@ -27188,6 +27515,12 @@ Object.freeze({
27188
27515
  addonId: null,
27189
27516
  access: "view"
27190
27517
  },
27518
+ "pipelineAnalytics.getMediaRelocateStatus": {
27519
+ capName: "pipeline-analytics",
27520
+ capScope: "device",
27521
+ addonId: null,
27522
+ access: "view"
27523
+ },
27191
27524
  "pipelineAnalytics.getMotionEvents": {
27192
27525
  capName: "pipeline-analytics",
27193
27526
  capScope: "device",
@@ -27260,6 +27593,12 @@ Object.freeze({
27260
27593
  addonId: null,
27261
27594
  access: "create"
27262
27595
  },
27596
+ "pipelineAnalytics.relocateMedia": {
27597
+ capName: "pipeline-analytics",
27598
+ capScope: "device",
27599
+ addonId: null,
27600
+ access: "create"
27601
+ },
27263
27602
  "pipelineAnalytics.searchObjectEvents": {
27264
27603
  capName: "pipeline-analytics",
27265
27604
  capScope: "device",
@@ -28022,6 +28361,12 @@ Object.freeze({
28022
28361
  addonId: null,
28023
28362
  access: "create"
28024
28363
  },
28364
+ "recording.cancelRelocate": {
28365
+ capName: "recording",
28366
+ capScope: "system",
28367
+ addonId: null,
28368
+ access: "create"
28369
+ },
28025
28370
  "recording.deleteFootprint": {
28026
28371
  capName: "recording",
28027
28372
  capScope: "system",
@@ -28052,6 +28397,12 @@ Object.freeze({
28052
28397
  addonId: null,
28053
28398
  access: "view"
28054
28399
  },
28400
+ "recording.getRelocateStatus": {
28401
+ capName: "recording",
28402
+ capScope: "system",
28403
+ addonId: null,
28404
+ access: "view"
28405
+ },
28055
28406
  "recording.getStorageUsage": {
28056
28407
  capName: "recording",
28057
28408
  capScope: "system",
@@ -28082,6 +28433,24 @@ Object.freeze({
28082
28433
  addonId: null,
28083
28434
  access: "view"
28084
28435
  },
28436
+ "recording.relocateFootage": {
28437
+ capName: "recording",
28438
+ capScope: "system",
28439
+ addonId: null,
28440
+ access: "create"
28441
+ },
28442
+ "recording.renderClip": {
28443
+ capName: "recording",
28444
+ capScope: "system",
28445
+ addonId: null,
28446
+ access: "create"
28447
+ },
28448
+ "recording.renderGif": {
28449
+ capName: "recording",
28450
+ capScope: "system",
28451
+ addonId: null,
28452
+ access: "create"
28453
+ },
28085
28454
  "recording.rescanStorage": {
28086
28455
  capName: "recording",
28087
28456
  capScope: "system",
@@ -28676,6 +29045,12 @@ Object.freeze({
28676
29045
  addonId: null,
28677
29046
  access: "create"
28678
29047
  },
29048
+ "streamBroker.renderPreBufferClip": {
29049
+ capName: "stream-broker",
29050
+ capScope: "system",
29051
+ addonId: null,
29052
+ access: "create"
29053
+ },
28679
29054
  "streamBroker.restartProfile": {
28680
29055
  capName: "stream-broker",
28681
29056
  capScope: "system",