@camstack/addon-provider-petkit 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.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createHash } from "crypto";
2
2
  import { EventEmitter } from "events";
3
- //#region ../types/dist/event-category-BLcNejAE.mjs
3
+ //#region ../types/dist/event-category-Bz24uP1U.mjs
4
4
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
5
5
  EventCategory["SystemBoot"] = "system.boot";
6
6
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -271,6 +271,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
271
271
  */
272
272
  EventCategory["DeviceStateChanged"] = "device.state-changed";
273
273
  /**
274
+ * Frame occupancy for a camera CHANGED — a tracked object was gained or
275
+ * lost. Carries `{ deviceId, totalObjects, byClass, zones }`.
276
+ *
277
+ * Emitted only on a change, so a steady scene is silent. It exists so a
278
+ * client can stop polling `zoneAnalytics.getCurrentSnapshot`: that was the
279
+ * one live badge with no push signal at all, and it cost a request every
280
+ * four seconds per visible camera.
281
+ *
282
+ * Like every event it is telemetry and may be dropped ([D8]) — a consumer
283
+ * keeps a slow reconcile rather than trusting it alone.
284
+ */
285
+ EventCategory["ZoneAnalyticsOccupancyChanged"] = "zone-analytics.occupancy-changed";
286
+ /**
274
287
  * Cap event fired by every device that registers the `battery`
275
288
  * capability. Mirrors the cap definition's `onStatusChanged`. Carries
276
289
  * `{ deviceId, status: BatteryStatus }`. Subscribers (alert center,
@@ -7214,35 +7227,22 @@ var ConvertResultSchema = object({
7214
7227
  */
7215
7228
  var RecordingWeekdaySchema = number().int().min(0).max(6);
7216
7229
  var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
7217
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
7218
- kind: literal("timeOfDay"),
7219
- start: string().regex(HHMM),
7220
- end: string().regex(HHMM),
7221
- /** Restrict to these weekdays; omit = every day. */
7222
- days: array(RecordingWeekdaySchema).optional()
7223
- })]);
7224
- var RecordingModeSchema = _enum([
7225
- "continuous",
7226
- "onMotion",
7227
- "onAudioThreshold"
7228
- ]);
7229
7230
  /**
7230
- * First-class, authoritative per-camera storage mode — the explicit choice the
7231
- * UI reads directly (never inferred from `rules`):
7232
- * - `off` — not recording.
7233
- * - `events` — record only around triggers (motion / audio threshold),
7234
- * with pre/post-buffer.
7235
- * - `continuous` — record 24/7 within the schedule.
7231
+ * DERIVED per-camera storage summary — the single field cheap consumers read
7232
+ * (the viewer's status dot, the camera list) instead of walking `bands`:
7233
+ * - `off` — no band covers the camera (or it is disabled).
7234
+ * - `events` — every band records around triggers only.
7235
+ * - `continuous` — at least one band records continuously.
7236
7236
  *
7237
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
7238
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
7237
+ * NEVER authored: the recorder stamps it from the authoritative `bands` on
7238
+ * every save (`activeModeForConfig`). Writing it has no effect.
7239
7239
  */
7240
7240
  var RecordingStorageModeSchema = _enum([
7241
7241
  "off",
7242
7242
  "events",
7243
7243
  "continuous"
7244
7244
  ]);
7245
- /** Which detectors trigger an `events`-mode recording. */
7245
+ /** Which detectors trigger an `events`-mode band. */
7246
7246
  var RecordingTriggersSchema = object({
7247
7247
  motion: boolean().optional(),
7248
7248
  audioThresholdDbfs: number().optional()
@@ -7278,18 +7278,6 @@ var RecordingBandSchema = object({
7278
7278
  preBufferSec: number().min(0).optional(),
7279
7279
  postBufferSec: number().min(0).optional()
7280
7280
  });
7281
- var RecordingRuleSchema = object({
7282
- schedule: RecordingScheduleSchema,
7283
- mode: RecordingModeSchema,
7284
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
7285
- preBufferSec: number().min(0).default(0),
7286
- /** Keep recording until this many seconds after the last trigger. */
7287
- postBufferSec: number().min(0).default(0),
7288
- /** Each new trigger restarts the post-buffer window. */
7289
- resetTimeoutOnNewEvent: boolean().default(true),
7290
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
7291
- thresholdDbfs: number().optional()
7292
- });
7293
7281
  /**
7294
7282
  * Per-device retention overrides. Every field is optional; an unset or `0`
7295
7283
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7323,40 +7311,28 @@ var ScrubThumbnailPresetSchema = _enum([
7323
7311
  /**
7324
7312
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7325
7313
  *
7326
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
7327
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
7328
- * only for transition + migration (`migrateRulesToMode`); the policy engine
7329
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
7314
+ * `bands` is the ONLY authored recording intent: what to record, when, and on
7315
+ * which trigger. `mode` is a derived summary the recorder stamps on save; every
7316
+ * other field is a storage knob (profiles, segment length, retention, scrub).
7317
+ *
7318
+ * STRICT on purpose: the legacy authoring surface (`schedule`/`schedules`/
7319
+ * `triggers`/`preBufferSec`/`postBufferSec`/`rules`) was retired 2026-07-30.
7320
+ * A stale caller must fail loudly — silently stripping its legacy intent would
7321
+ * persist a band-less config, i.e. silently stop recording the camera.
7330
7322
  */
7331
7323
  var RecordingConfigSchema = object({
7332
7324
  enabled: boolean(),
7333
- /** Authoritative storage mode. Absent on legacy targets derived once via
7334
- * `migrateRulesToMode`, then persisted. */
7325
+ /** DERIVED summary of `bands`, stamped by the recorder on every save.
7326
+ * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7335
7327
  mode: RecordingStorageModeSchema.optional(),
7336
7328
  profiles: array(CamProfileSchema).optional(),
7337
7329
  segmentSeconds: number().int().positive().optional(),
7338
- /** Shared recording time-bands for `events` & `continuous` — record only when
7339
- * the wall-clock falls inside one of these windows. Omit or empty = always.
7340
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
7341
- schedules: array(RecordingScheduleSchema).optional(),
7342
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
7343
- * normalized into `schedules` on read and never written going forward. (Not
7344
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
7345
- schedule: RecordingScheduleSchema.optional(),
7346
- /** `events`-mode only — which detectors trigger a recording. */
7347
- triggers: RecordingTriggersSchema.optional(),
7348
- /** `events`-mode only — seconds retained before / after a trigger. */
7349
- preBufferSec: number().min(0).optional(),
7350
- postBufferSec: number().min(0).optional(),
7351
- /** DEPRECATED authoring input; retained for migration/transition. */
7352
- rules: array(RecordingRuleSchema).optional(),
7353
7330
  /**
7354
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
7355
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
7356
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
7357
- * derived into bands once via `migrateConfigToBands`.
7331
+ * AUTHORITATIVE mode-per-band recording model the single source of truth
7332
+ * the recorder's band engine consumes. An empty array = record nothing;
7333
+ * "off" is the absence of a covering band, never a band value.
7358
7334
  */
7359
- bands: array(RecordingBandSchema).optional(),
7335
+ bands: array(RecordingBandSchema).default([]),
7360
7336
  retention: RecordingRetentionSchema.optional(),
7361
7337
  /**
7362
7338
  * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
@@ -7364,8 +7340,15 @@ var RecordingConfigSchema = object({
7364
7340
  * windows only — existing sheets are immutable, and each window's index
7365
7341
  * carries its own tile dims so mixed-preset history renders correctly.
7366
7342
  */
7367
- scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7368
- });
7343
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional(),
7344
+ /**
7345
+ * OPT-IN thumbnail-strip generation for this camera: every keyframe of the
7346
+ * low recording saved as a JPEG (the fast-drag scrub depth), a derived
7347
+ * cache that eviction reclaims with the footage. Absent/false = no strips
7348
+ * are written and scrub reads exact keyframes at every velocity.
7349
+ */
7350
+ stripsEnabled: boolean().optional()
7351
+ }).strict();
7369
7352
  /**
7370
7353
  * Ops-log — the durable, append-only operations audit shared by the
7371
7354
  * recordings and events management surfaces.
@@ -7384,7 +7367,8 @@ var OpsLogOpSchema = _enum([
7384
7367
  "prune",
7385
7368
  "manual-delete",
7386
7369
  "rescan",
7387
- "retention-run"
7370
+ "retention-run",
7371
+ "relocate"
7388
7372
  ]);
7389
7373
  /** Why the operation ran. */
7390
7374
  var OpsLogReasonSchema = _enum([
@@ -7423,6 +7407,55 @@ var OpsLogQueryInputSchema = object({
7423
7407
  limit: number().int().min(1).max(1e3).optional()
7424
7408
  });
7425
7409
  /**
7410
+ * Entity-relocation job state (storage entity-routing spec, Phase 4).
7411
+ *
7412
+ * One shape shared by the recorder's `relocateFootage` (segments + strips) and
7413
+ * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7414
+ * page renders both movers with one component. Jobs are in-RAM (a restart
7415
+ * forgets them — re-running is safe by construction: copy-if-absent, delete
7416
+ * after verify) and each completed/failed run also lands one durable ops-log
7417
+ * row on the owning addon's surface.
7418
+ */
7419
+ var RelocateJobStateSchema = _enum([
7420
+ "running",
7421
+ "done",
7422
+ "failed",
7423
+ "cancelled"
7424
+ ]);
7425
+ var RelocateJobSchema = object({
7426
+ jobId: string(),
7427
+ state: RelocateJobStateSchema,
7428
+ /** Source location — for media relocation this is informational ('*': rows
7429
+ * move from wherever they are to the target). */
7430
+ fromLocationId: string(),
7431
+ toLocationId: string(),
7432
+ /** Scoped device, or null = every device. */
7433
+ deviceId: number().nullable(),
7434
+ /** What the job moves (owner-addon specific: segments/strips or media). */
7435
+ entities: array(string()),
7436
+ filesMoved: number().int(),
7437
+ bytesMoved: number().int(),
7438
+ /** Total files discovered up front; null while (or when) unknown. */
7439
+ filesTotal: number().int().nullable(),
7440
+ startedAt: number(),
7441
+ finishedAt: number().nullable(),
7442
+ error: string().nullable()
7443
+ });
7444
+ var RelocateFootageInputSchema = object({
7445
+ deviceId: number().optional(),
7446
+ fromLocationId: string(),
7447
+ toLocationId: string(),
7448
+ entities: array(_enum(["segments", "strips"])).optional(),
7449
+ /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7450
+ * never allowed to starve live writers. */
7451
+ throttleMbps: number().min(1).max(1e3).optional()
7452
+ });
7453
+ var RelocateMediaInputSchema = object({
7454
+ deviceId: number().optional(),
7455
+ toLocationId: string(),
7456
+ throttleMbps: number().min(1).max(1e3).optional()
7457
+ });
7458
+ /**
7426
7459
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7427
7460
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7428
7461
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -7472,6 +7505,13 @@ var StorageLocationSchema = object({
7472
7505
  nodeId: string().optional(),
7473
7506
  isDefault: boolean().default(false),
7474
7507
  isSystem: boolean().default(false),
7508
+ /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7509
+ * for node-local locations it can reach) — never persisted, absent when the
7510
+ * volume is remote/unreachable. The single capacity truth every UI reads. */
7511
+ capacity: object({
7512
+ totalBytes: number(),
7513
+ availableBytes: number()
7514
+ }).nullable().optional(),
7475
7515
  createdAt: number(),
7476
7516
  updatedAt: number()
7477
7517
  });
@@ -8239,7 +8279,8 @@ var NcTaxonomyEntrySchema = object({
8239
8279
  /** Macro/category parent for grouping ('car' → 'vehicle'); null for a top. */
8240
8280
  parentKind: string().nullable()
8241
8281
  });
8242
- object({
8282
+ /** The complete NC picker taxonomy — three grouped buckets. */
8283
+ var NcTaxonomySchema = object({
8243
8284
  videoClasses: array(NcTaxonomyEntrySchema),
8244
8285
  audioKinds: array(NcTaxonomyEntrySchema),
8245
8286
  labels: array(NcTaxonomyEntrySchema)
@@ -9142,6 +9183,7 @@ function shallowEqual(a, b) {
9142
9183
  for (const k of ak) if (a[k] !== b[k]) return false;
9143
9184
  return true;
9144
9185
  }
9186
+ new Set(["devices", "classes"]);
9145
9187
  /**
9146
9188
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
9147
9189
  * motion-zones, and the detection zones/lines editor all speak this one
@@ -9300,6 +9342,29 @@ var NcOccupancyConditionSchema = object({
9300
9342
  count: number().int().min(0).default(1),
9301
9343
  sustainSeconds: number().int().min(0).max(3600).default(15)
9302
9344
  });
9345
+ /**
9346
+ * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
9347
+ *
9348
+ * The values are not symmetric, and deliberately so — the absent value has to
9349
+ * mean exactly what every rule authored before this condition existed already
9350
+ * does:
9351
+ * - `enter` — entries and every NON-crossing record (movement state,
9352
+ * package, sensor). Exits are rejected. **This is the absent behaviour**:
9353
+ * an operator who never asked for exits must not start receiving them.
9354
+ * - `exit` — ONLY an exit crossing. A record that is not a crossing at all
9355
+ * fails closed, because "the car left the drive" is a question about a
9356
+ * boundary, not about a detection.
9357
+ * - `any` — no direction filter; entries, exits and non-crossings alike.
9358
+ *
9359
+ * A rule asking for a direction should normally also scope `zones`, which the
9360
+ * engine evaluates against the crossed zone as well as the current membership
9361
+ * (an exit's membership no longer contains the zone it just left).
9362
+ */
9363
+ var NcCrossingSchema = _enum([
9364
+ "enter",
9365
+ "exit",
9366
+ "any"
9367
+ ]);
9303
9368
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
9304
9369
  var NcZoneConditionSchema = object({
9305
9370
  ids: array(string().min(1)).min(1),
@@ -9324,6 +9389,13 @@ var NcConditionsSchema = object({
9324
9389
  /** Veto zones — any hit fails the rule. */
9325
9390
  zonesExclude: array(string().min(1)).optional(),
9326
9391
  /**
9392
+ * Zone-crossing direction. IMMEDIATE only — a crossing is a per-event fact
9393
+ * and a closed track carries none, so a `track-end` rule asking for one
9394
+ * fails closed (use `zones`, which tests `zonesVisited`). ABSENT = `enter`,
9395
+ * which is exactly today's behaviour. See {@link NcCrossingSchema}.
9396
+ */
9397
+ crossing: NcCrossingSchema.optional(),
9398
+ /**
9327
9399
  * Exact (case-insensitive) match on the record's collapsed `label`
9328
9400
  * (identity name / plate text / subclass).
9329
9401
  */
@@ -9458,17 +9530,85 @@ var NcRuleTargetSchema = object({
9458
9530
  * - `keyFrame` — the clean scene frame (no subject box).
9459
9531
  * - `none` — no attachment.
9460
9532
  */
9461
- var NcMediaPolicySchema = object({ attach: _enum([
9462
- "best",
9463
- "best-matching",
9464
- "keyFrame",
9465
- "none"
9466
- ]).default("best") });
9533
+ /**
9534
+ * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
9535
+ * conflate it with the selection strategy and betray the request: asking for
9536
+ * the clean scene frame on an object-event owner used to start at
9537
+ * `fullFrameBoxed`, i.e. the annotated frame (2026-07-30).
9538
+ * - `cropped` — the subject, tight. What "who is at the door" wants.
9539
+ * - `full` — the clean scene, no annotation. What "what is going on" wants.
9540
+ * - `boxed` — the scene WITH the detection boxes drawn, for verifying what
9541
+ * the pipeline actually saw.
9542
+ */
9543
+ var NcMediaFrameSchema = _enum([
9544
+ "cropped",
9545
+ "full",
9546
+ "boxed"
9547
+ ]);
9548
+ var NcMediaPolicySchema = object({
9549
+ attach: _enum([
9550
+ "best",
9551
+ "best-matching",
9552
+ "keyFrame",
9553
+ "none"
9554
+ ]).default("best"),
9555
+ /** What the still shows. Absent = `cropped` (the historical `best` shape). */
9556
+ frame: NcMediaFrameSchema.optional(),
9557
+ /** Crop the attached still to the rule's condition-zone bbox (padded) —
9558
+ * "show me the ZONE", not the whole scene or the subject crop. */
9559
+ zoneCrop: boolean().optional(),
9560
+ /**
9561
+ * Also attach a short GIF cut from the stream broker's clip ring around the
9562
+ * event — NOT from the recording, so the camera does not have to be
9563
+ * recording, and the window sits AROUND the moment instead of a segment
9564
+ * behind it. Fail-closed: a window the ring does not cover contributes no
9565
+ * gif, never a failed notification.
9566
+ */
9567
+ gif: boolean().optional(),
9568
+ /**
9569
+ * Also attach a short MP4 CLIP of the same cut. Same source and the same
9570
+ * fail-closed rule as `gif`. Prefer it where the backend takes video
9571
+ * (telegram, discord, zentik, webhook); backends that do not are handled by
9572
+ * the degrade engine, which drops the video and keeps the still.
9573
+ */
9574
+ clip: boolean().optional(),
9575
+ /** Seconds of footage BEFORE / AFTER the event instant. Defaults 3 / 7. */
9576
+ clipPreRollSec: number().int().min(0).max(30).optional(),
9577
+ clipPostRollSec: number().int().min(0).max(30).optional(),
9578
+ /**
9579
+ * Which stream profile the footage is cut from. Absent = the CHEAPEST
9580
+ * assigned profile: a notification is watched on a phone, so the 4K
9581
+ * rendition would burn CPU to produce a file the client downscales anyway.
9582
+ * A profile that is not assigned falls back to the cheapest, and the render
9583
+ * reports which one actually ran.
9584
+ */
9585
+ profile: CamProfileSchema.optional()
9586
+ });
9587
+ /**
9588
+ * Cooldown GRANULARITY over the subject's class — how much a fired
9589
+ * notification suppresses.
9590
+ * - `shared` (default, and the absent value) — one window for the whole
9591
+ * rule/scope: a cat silences the next dog for `cooldownSec`.
9592
+ * - `per-class` — an independent window per detected class, so cat→dog fires
9593
+ * at once and cat→cat still waits.
9594
+ *
9595
+ * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
9596
+ * must not be swallowed by a bark's window (the precedent this generalizes —
9597
+ * see `cooldownKey` in the rule engine).
9598
+ */
9599
+ var NcThrottleGranularitySchema = _enum(["shared", "per-class"]);
9467
9600
  /** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
9468
9601
  var NcThrottleSchema = object({
9469
9602
  cooldownSec: number().int().min(0).max(86400).default(60),
9470
9603
  /** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
9471
- scope: _enum(["rule", "rule-device"]).default("rule-device")
9604
+ scope: _enum(["rule", "rule-device"]).default("rule-device"),
9605
+ /**
9606
+ * Class granularity of the cooldown key. Optional rather than defaulted:
9607
+ * a Zod default does NOT run on the addon→addon cap path, so a persisted
9608
+ * rule authored before this field simply carries none — and the engine
9609
+ * reads absent as `shared`, the pre-existing behaviour.
9610
+ */
9611
+ granularity: NcThrottleGranularitySchema.optional()
9472
9612
  });
9473
9613
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
9474
9614
  var NcRuleInputSchema = object({
@@ -9477,7 +9617,19 @@ var NcRuleInputSchema = object({
9477
9617
  delivery: NcDeliverySchema,
9478
9618
  conditions: NcConditionsSchema.default({}),
9479
9619
  schedule: NcScheduleSchema.optional(),
9480
- targets: array(NcRuleTargetSchema).min(1),
9620
+ /** May be empty when `targetUsers` addresses at least one user — the
9621
+ * "at least one addressee" invariant is enforced by the provider, because
9622
+ * a cross-field refine here would break `NcRulePatchSchema.partial()`. */
9623
+ targets: array(NcRuleTargetSchema),
9624
+ /**
9625
+ * USERS this rule addresses in addition to `targets` (Phase 4). At fire
9626
+ * time each user fans out to the personal targets they own
9627
+ * (`config.ownerUserId`), filtered by that user's `allowedDevices` for the
9628
+ * firing camera — a user is never notified about a device they cannot open.
9629
+ * Per-user opt-outs (`disabledTargetIds`) still apply to the fanned-out
9630
+ * targets.
9631
+ */
9632
+ targetUsers: array(string()).optional(),
9481
9633
  media: NcMediaPolicySchema.default({ attach: "best" }),
9482
9634
  throttle: NcThrottleSchema.default({
9483
9635
  cooldownSec: 60,
@@ -9564,6 +9716,7 @@ var NcConditionDescriptorSchema = object({
9564
9716
  "schedule",
9565
9717
  "plateMatcher",
9566
9718
  "packagePhase",
9719
+ "crossingSelect",
9567
9720
  "polygonDraw",
9568
9721
  "occupancy"
9569
9722
  ]),
@@ -9690,7 +9843,10 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
9690
9843
  }), object({ results: array(NcTestResultSchema) }), {
9691
9844
  kind: "mutation",
9692
9845
  auth: "admin"
9693
- }), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9846
+ }), method(object({}), object({
9847
+ catalog: array(NcConditionDescriptorSchema),
9848
+ taxonomy: NcTaxonomySchema.optional()
9849
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9694
9850
  /**
9695
9851
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
9696
9852
  *
@@ -10699,6 +10855,28 @@ method(object({
10699
10855
  }), object({ success: literal(true) }), {
10700
10856
  kind: "mutation",
10701
10857
  auth: "admin"
10858
+ }), method(object({
10859
+ deviceId: number(),
10860
+ /** Absent = the LOWEST assigned profile — a notification attachment is
10861
+ * watched on a phone, and the cheap rendition is the right default. */
10862
+ profile: CamProfileSchema.optional(),
10863
+ aroundMs: number(),
10864
+ preRollSec: number().min(0).max(20).default(3),
10865
+ postRollSec: number().min(0).max(20).default(5),
10866
+ format: _enum(["gif", "mp4"]).default("gif"),
10867
+ maxWidth: number().int().min(120).max(1920).default(480),
10868
+ /** GIF only — MP4 keeps the source cadence. */
10869
+ fps: number().int().min(1).max(15).default(5)
10870
+ }), object({
10871
+ base64: string(),
10872
+ mime: string(),
10873
+ bytes: number().int(),
10874
+ /** The profile actually rendered (what the default resolved to). */
10875
+ profile: CamProfileSchema,
10876
+ durationMs: number()
10877
+ }), {
10878
+ kind: "mutation",
10879
+ auth: "admin"
10702
10880
  }), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string() }), BrokerStatsSchema), method(object({ brokerId: string() }), object({
10703
10881
  probed: boolean(),
10704
10882
  summary: string()
@@ -18778,7 +18956,10 @@ method(object({
18778
18956
  }), method(object({
18779
18957
  deviceId: number(),
18780
18958
  caps: array(string()).readonly().optional()
18781
- }), record(string(), unknown().nullable()));
18959
+ }), record(string(), unknown().nullable())), method(object({
18960
+ deviceIds: array(number()).readonly(),
18961
+ caps: array(string()).readonly().optional()
18962
+ }), record(string(), record(string(), unknown().nullable())));
18782
18963
  method(object({ deviceId: number() }), record(string(), record(string(), unknown()))), method(object({
18783
18964
  deviceId: number(),
18784
18965
  capName: string()
@@ -19709,6 +19890,36 @@ var TargetKindSchema = object({
19709
19890
  icon: string(),
19710
19891
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
19711
19892
  addonId: string(),
19893
+ /**
19894
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
19895
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
19896
+ * when the addon bundles no icon for that kind — the client then falls back
19897
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
19898
+ *
19899
+ * Root-relative on purpose: it resolves against whatever origin serves a web
19900
+ * client, and a native client joins it onto its own hub base.
19901
+ *
19902
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
19903
+ * field that survived only because the runtime cap-router forwards provider
19904
+ * output verbatim — so every consumer had to re-declare it by hand to stop
19905
+ * its own Zod parse from stripping it, and the whole arrangement would have
19906
+ * broken silently the moment output validation was tightened anywhere.
19907
+ */
19908
+ iconUrl: string().optional(),
19909
+ /**
19910
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
19911
+ *
19912
+ * The server knows this and therefore says it, because the client cannot
19913
+ * safely guess: a React-Native client renders SVG and raster through two
19914
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
19915
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
19916
+ * placeholder glyph for every vector icon while the web build looked fine.
19917
+ *
19918
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
19919
+ * not been updated — a client that cannot determine the type should prefer
19920
+ * its raster path, which is the safe default for an unknown image.
19921
+ */
19922
+ iconMediaType: string().optional(),
19712
19923
  configSchema: ConfigSchemaPassthrough,
19713
19924
  supportsDiscovery: boolean(),
19714
19925
  caps: TargetKindCapsSchema
@@ -20156,6 +20367,29 @@ var MotionEventSchema = object({
20156
20367
  * Absent on legacy rows ⇒ treat as `pipeline`.
20157
20368
  */
20158
20369
  var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
20370
+ /**
20371
+ * The confirmed zone crossing that produced an object event. Present ONLY on
20372
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
20373
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
20374
+ * appearance event carry none, so a rule asking for a direction fails closed
20375
+ * on them.
20376
+ *
20377
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
20378
+ * into its own event, so a frame in which a track enters A while leaving B
20379
+ * produces two events with two directions — never one ambiguous row.
20380
+ *
20381
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
20382
+ * membership the box has NOW, and by definition it no longer contains the zone
20383
+ * that was just left. Without the id here, a zone-scoped rule could never match
20384
+ * the exit it asked for.
20385
+ */
20386
+ var ZoneCrossingSchema = object({
20387
+ direction: _enum(["enter", "exit"]),
20388
+ /** Admin zone id crossed. */
20389
+ zoneId: string(),
20390
+ /** Zone display name at crossing time (falls back to the id). */
20391
+ zoneName: string().optional()
20392
+ });
20159
20393
  var ObjectEventSchema = object({
20160
20394
  ...BaseEventFields,
20161
20395
  kind: literal("object"),
@@ -20182,6 +20416,12 @@ var ObjectEventSchema = object({
20182
20416
  zones: array(string()).readonly().optional(),
20183
20417
  /** Omitted in slim projection. */
20184
20418
  state: TrackStateSchema.optional(),
20419
+ /**
20420
+ * The zone crossing this event IS, when it is one. Absent on every other
20421
+ * event kind (movement state, appearance, package) — see
20422
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
20423
+ */
20424
+ zoneCrossing: ZoneCrossingSchema.optional(),
20185
20425
  /** Detection-frame dimensions in pixels — let consumers normalize the
20186
20426
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
20187
20427
  frameWidth: number().optional(),
@@ -20440,6 +20680,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20440
20680
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
20441
20681
  kind: "mutation",
20442
20682
  auth: "admin"
20683
+ }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
20684
+ kind: "mutation",
20685
+ auth: "admin"
20686
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
20687
+ kind: "query",
20688
+ auth: "admin"
20689
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
20690
+ kind: "mutation",
20691
+ auth: "admin"
20443
20692
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
20444
20693
  kind: "query",
20445
20694
  auth: "admin"
@@ -22919,6 +23168,17 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
22919
23168
  */
22920
23169
  priority: number()
22921
23170
  })).readonly() });
23171
+ /**
23172
+ * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
23173
+ * AUTO (resolved from the candidate ranking at send time); `resolved` reports
23174
+ * what AUTO currently picks, so the UI can show the effective value either way.
23175
+ */
23176
+ var NotificationEndpointSchema = object({
23177
+ /** The operator's explicit choice, or null for AUTO. */
23178
+ baseUrl: string().nullable(),
23179
+ /** What the ranking currently resolves to (null when nothing is reachable). */
23180
+ resolved: string().nullable()
23181
+ });
22922
23182
  var AllowedAddressesSchema = object({
22923
23183
  /**
22924
23184
  * Allowlist of interface addresses operators have explicitly opted
@@ -22941,7 +23201,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
22941
23201
  * to avoid mixed-content blocks in the browser. The public
22942
23202
  * tunnel always emits `https://` regardless. */
22943
23203
  scheme: _enum(["http", "https"]).optional()
22944
- }), GetConnectionEndpointsResultSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
23204
+ }), 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" });
22945
23205
  /**
22946
23206
  * mesh-network — collection cap for mesh-VPN providers.
22947
23207
  *
@@ -23740,7 +24000,12 @@ var RecordingDeviceUsageSchema = object({
23740
24000
  var RecordingLocationUsageSchema = object({
23741
24001
  /** StorageLocation id; null for the legacy/degraded single-root fallback. */
23742
24002
  locationId: string().nullable(),
23743
- /** Bytes of recordings stored on this location. */
24003
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
24004
+ * is emitted per physical disk (2026-07-29): two locations on one root
24005
+ * previously rendered as two identical "disks" with a nonsensical used
24006
+ * split — hydrate attribution across aliases is arbitrary by nature. */
24007
+ locationIds: array(string()).optional(),
24008
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). */
23744
24009
  usedBytes: number(),
23745
24010
  /** Free bytes on the location's volume; null when capacity is unknown (remote). */
23746
24011
  availableBytes: number().nullable(),
@@ -23852,6 +24117,44 @@ method(object({
23852
24117
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
23853
24118
  kind: "query",
23854
24119
  auth: "admin"
24120
+ }), method(object({
24121
+ deviceId: number(),
24122
+ aroundMs: number(),
24123
+ preRollSec: number().min(0).max(30).default(2),
24124
+ postRollSec: number().min(0).max(30).default(5),
24125
+ maxWidth: number().int().min(120).max(1280).default(480),
24126
+ fps: number().int().min(1).max(15).default(5)
24127
+ }), object({
24128
+ gifBase64: string(),
24129
+ fromMs: number(),
24130
+ toMs: number()
24131
+ }), {
24132
+ kind: "mutation",
24133
+ auth: "admin"
24134
+ }), method(object({
24135
+ deviceId: number(),
24136
+ aroundMs: number(),
24137
+ preRollSec: number().min(0).max(30).default(3),
24138
+ postRollSec: number().min(0).max(30).default(7),
24139
+ maxWidth: number().int().min(160).max(1920).default(640)
24140
+ }), object({
24141
+ clipBase64: string(),
24142
+ mime: string(),
24143
+ fromMs: number(),
24144
+ toMs: number(),
24145
+ bytes: number().int()
24146
+ }), {
24147
+ kind: "mutation",
24148
+ auth: "admin"
24149
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
24150
+ kind: "mutation",
24151
+ auth: "admin"
24152
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
24153
+ kind: "query",
24154
+ auth: "admin"
24155
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
24156
+ kind: "mutation",
24157
+ auth: "admin"
23855
24158
  });
23856
24159
  /**
23857
24160
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -25443,6 +25746,12 @@ Object.freeze({
25443
25746
  addonId: null,
25444
25747
  access: "view"
25445
25748
  },
25749
+ "deviceManager.getDeviceStatusAggregateBatch": {
25750
+ capName: "device-manager",
25751
+ capScope: "system",
25752
+ addonId: null,
25753
+ access: "view"
25754
+ },
25446
25755
  "deviceManager.getLinkedDevices": {
25447
25756
  capName: "device-manager",
25448
25757
  capScope: "system",
@@ -26337,6 +26646,12 @@ Object.freeze({
26337
26646
  addonId: null,
26338
26647
  access: "view"
26339
26648
  },
26649
+ "localNetwork.getNotificationEndpoint": {
26650
+ capName: "local-network",
26651
+ capScope: "system",
26652
+ addonId: null,
26653
+ access: "view"
26654
+ },
26340
26655
  "localNetwork.getPreferred": {
26341
26656
  capName: "local-network",
26342
26657
  capScope: "system",
@@ -26361,6 +26676,12 @@ Object.freeze({
26361
26676
  addonId: null,
26362
26677
  access: "create"
26363
26678
  },
26679
+ "localNetwork.setNotificationEndpoint": {
26680
+ capName: "local-network",
26681
+ capScope: "system",
26682
+ addonId: null,
26683
+ access: "create"
26684
+ },
26364
26685
  "lockControl.lock": {
26365
26686
  capName: "lock-control",
26366
26687
  capScope: "device",
@@ -27003,6 +27324,12 @@ Object.freeze({
27003
27324
  addonId: null,
27004
27325
  access: "create"
27005
27326
  },
27327
+ "pipelineAnalytics.cancelMediaRelocate": {
27328
+ capName: "pipeline-analytics",
27329
+ capScope: "device",
27330
+ addonId: null,
27331
+ access: "create"
27332
+ },
27006
27333
  "pipelineAnalytics.clearTracks": {
27007
27334
  capName: "pipeline-analytics",
27008
27335
  capScope: "device",
@@ -27057,6 +27384,12 @@ Object.freeze({
27057
27384
  addonId: null,
27058
27385
  access: "view"
27059
27386
  },
27387
+ "pipelineAnalytics.getMediaRelocateStatus": {
27388
+ capName: "pipeline-analytics",
27389
+ capScope: "device",
27390
+ addonId: null,
27391
+ access: "view"
27392
+ },
27060
27393
  "pipelineAnalytics.getMotionEvents": {
27061
27394
  capName: "pipeline-analytics",
27062
27395
  capScope: "device",
@@ -27129,6 +27462,12 @@ Object.freeze({
27129
27462
  addonId: null,
27130
27463
  access: "create"
27131
27464
  },
27465
+ "pipelineAnalytics.relocateMedia": {
27466
+ capName: "pipeline-analytics",
27467
+ capScope: "device",
27468
+ addonId: null,
27469
+ access: "create"
27470
+ },
27132
27471
  "pipelineAnalytics.searchObjectEvents": {
27133
27472
  capName: "pipeline-analytics",
27134
27473
  capScope: "device",
@@ -27891,6 +28230,12 @@ Object.freeze({
27891
28230
  addonId: null,
27892
28231
  access: "create"
27893
28232
  },
28233
+ "recording.cancelRelocate": {
28234
+ capName: "recording",
28235
+ capScope: "system",
28236
+ addonId: null,
28237
+ access: "create"
28238
+ },
27894
28239
  "recording.deleteFootprint": {
27895
28240
  capName: "recording",
27896
28241
  capScope: "system",
@@ -27921,6 +28266,12 @@ Object.freeze({
27921
28266
  addonId: null,
27922
28267
  access: "view"
27923
28268
  },
28269
+ "recording.getRelocateStatus": {
28270
+ capName: "recording",
28271
+ capScope: "system",
28272
+ addonId: null,
28273
+ access: "view"
28274
+ },
27924
28275
  "recording.getStorageUsage": {
27925
28276
  capName: "recording",
27926
28277
  capScope: "system",
@@ -27951,6 +28302,24 @@ Object.freeze({
27951
28302
  addonId: null,
27952
28303
  access: "view"
27953
28304
  },
28305
+ "recording.relocateFootage": {
28306
+ capName: "recording",
28307
+ capScope: "system",
28308
+ addonId: null,
28309
+ access: "create"
28310
+ },
28311
+ "recording.renderClip": {
28312
+ capName: "recording",
28313
+ capScope: "system",
28314
+ addonId: null,
28315
+ access: "create"
28316
+ },
28317
+ "recording.renderGif": {
28318
+ capName: "recording",
28319
+ capScope: "system",
28320
+ addonId: null,
28321
+ access: "create"
28322
+ },
27954
28323
  "recording.rescanStorage": {
27955
28324
  capName: "recording",
27956
28325
  capScope: "system",
@@ -28545,6 +28914,12 @@ Object.freeze({
28545
28914
  addonId: null,
28546
28915
  access: "create"
28547
28916
  },
28917
+ "streamBroker.renderPreBufferClip": {
28918
+ capName: "stream-broker",
28919
+ capScope: "system",
28920
+ addonId: null,
28921
+ access: "create"
28922
+ },
28548
28923
  "streamBroker.restartProfile": {
28549
28924
  capName: "stream-broker",
28550
28925
  capScope: "system",