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