@camstack/addon-export-alexa 1.2.6 → 1.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.
@@ -1,6 +1,6 @@
1
1
  import * as crypto$1 from "node:crypto";
2
2
  import { createHash } from "node:crypto";
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,
@@ -7324,35 +7337,22 @@ function buildCapturingReply(envelope) {
7324
7337
  */
7325
7338
  var RecordingWeekdaySchema = number().int().min(0).max(6);
7326
7339
  var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
7327
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
7328
- kind: literal("timeOfDay"),
7329
- start: string().regex(HHMM),
7330
- end: string().regex(HHMM),
7331
- /** Restrict to these weekdays; omit = every day. */
7332
- days: array(RecordingWeekdaySchema).optional()
7333
- })]);
7334
- var RecordingModeSchema = _enum([
7335
- "continuous",
7336
- "onMotion",
7337
- "onAudioThreshold"
7338
- ]);
7339
7340
  /**
7340
- * First-class, authoritative per-camera storage mode — the explicit choice the
7341
- * UI reads directly (never inferred from `rules`):
7342
- * - `off` — not recording.
7343
- * - `events` — record only around triggers (motion / audio threshold),
7344
- * with pre/post-buffer.
7345
- * - `continuous` — record 24/7 within the schedule.
7341
+ * DERIVED per-camera storage summary — the single field cheap consumers read
7342
+ * (the viewer's status dot, the camera list) instead of walking `bands`:
7343
+ * - `off` — no band covers the camera (or it is disabled).
7344
+ * - `events` — every band records around triggers only.
7345
+ * - `continuous` — at least one band records continuously.
7346
7346
  *
7347
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
7348
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
7347
+ * NEVER authored: the recorder stamps it from the authoritative `bands` on
7348
+ * every save (`activeModeForConfig`). Writing it has no effect.
7349
7349
  */
7350
7350
  var RecordingStorageModeSchema = _enum([
7351
7351
  "off",
7352
7352
  "events",
7353
7353
  "continuous"
7354
7354
  ]);
7355
- /** Which detectors trigger an `events`-mode recording. */
7355
+ /** Which detectors trigger an `events`-mode band. */
7356
7356
  var RecordingTriggersSchema = object({
7357
7357
  motion: boolean().optional(),
7358
7358
  audioThresholdDbfs: number().optional()
@@ -7388,18 +7388,6 @@ var RecordingBandSchema = object({
7388
7388
  preBufferSec: number().min(0).optional(),
7389
7389
  postBufferSec: number().min(0).optional()
7390
7390
  });
7391
- var RecordingRuleSchema = object({
7392
- schedule: RecordingScheduleSchema,
7393
- mode: RecordingModeSchema,
7394
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
7395
- preBufferSec: number().min(0).default(0),
7396
- /** Keep recording until this many seconds after the last trigger. */
7397
- postBufferSec: number().min(0).default(0),
7398
- /** Each new trigger restarts the post-buffer window. */
7399
- resetTimeoutOnNewEvent: boolean().default(true),
7400
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
7401
- thresholdDbfs: number().optional()
7402
- });
7403
7391
  /**
7404
7392
  * Per-device retention overrides. Every field is optional; an unset or `0`
7405
7393
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7433,40 +7421,28 @@ var ScrubThumbnailPresetSchema = _enum([
7433
7421
  /**
7434
7422
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7435
7423
  *
7436
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
7437
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
7438
- * only for transition + migration (`migrateRulesToMode`); the policy engine
7439
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
7424
+ * `bands` is the ONLY authored recording intent: what to record, when, and on
7425
+ * which trigger. `mode` is a derived summary the recorder stamps on save; every
7426
+ * other field is a storage knob (profiles, segment length, retention, scrub).
7427
+ *
7428
+ * STRICT on purpose: the legacy authoring surface (`schedule`/`schedules`/
7429
+ * `triggers`/`preBufferSec`/`postBufferSec`/`rules`) was retired 2026-07-30.
7430
+ * A stale caller must fail loudly — silently stripping its legacy intent would
7431
+ * persist a band-less config, i.e. silently stop recording the camera.
7440
7432
  */
7441
7433
  var RecordingConfigSchema = object({
7442
7434
  enabled: boolean(),
7443
- /** Authoritative storage mode. Absent on legacy targets derived once via
7444
- * `migrateRulesToMode`, then persisted. */
7435
+ /** DERIVED summary of `bands`, stamped by the recorder on every save.
7436
+ * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7445
7437
  mode: RecordingStorageModeSchema.optional(),
7446
7438
  profiles: array(CamProfileSchema).optional(),
7447
7439
  segmentSeconds: number().int().positive().optional(),
7448
- /** Shared recording time-bands for `events` & `continuous` — record only when
7449
- * the wall-clock falls inside one of these windows. Omit or empty = always.
7450
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
7451
- schedules: array(RecordingScheduleSchema).optional(),
7452
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
7453
- * normalized into `schedules` on read and never written going forward. (Not
7454
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
7455
- schedule: RecordingScheduleSchema.optional(),
7456
- /** `events`-mode only — which detectors trigger a recording. */
7457
- triggers: RecordingTriggersSchema.optional(),
7458
- /** `events`-mode only — seconds retained before / after a trigger. */
7459
- preBufferSec: number().min(0).optional(),
7460
- postBufferSec: number().min(0).optional(),
7461
- /** DEPRECATED authoring input; retained for migration/transition. */
7462
- rules: array(RecordingRuleSchema).optional(),
7463
7440
  /**
7464
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
7465
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
7466
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
7467
- * derived into bands once via `migrateConfigToBands`.
7441
+ * AUTHORITATIVE mode-per-band recording model the single source of truth
7442
+ * the recorder's band engine consumes. An empty array = record nothing;
7443
+ * "off" is the absence of a covering band, never a band value.
7468
7444
  */
7469
- bands: array(RecordingBandSchema).optional(),
7445
+ bands: array(RecordingBandSchema).default([]),
7470
7446
  retention: RecordingRetentionSchema.optional(),
7471
7447
  /**
7472
7448
  * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
@@ -7474,8 +7450,15 @@ var RecordingConfigSchema = object({
7474
7450
  * windows only — existing sheets are immutable, and each window's index
7475
7451
  * carries its own tile dims so mixed-preset history renders correctly.
7476
7452
  */
7477
- scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7478
- });
7453
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional(),
7454
+ /**
7455
+ * OPT-IN thumbnail-strip generation for this camera: every keyframe of the
7456
+ * low recording saved as a JPEG (the fast-drag scrub depth), a derived
7457
+ * cache that eviction reclaims with the footage. Absent/false = no strips
7458
+ * are written and scrub reads exact keyframes at every velocity.
7459
+ */
7460
+ stripsEnabled: boolean().optional()
7461
+ }).strict();
7479
7462
  /**
7480
7463
  * Ops-log — the durable, append-only operations audit shared by the
7481
7464
  * recordings and events management surfaces.
@@ -7494,7 +7477,8 @@ var OpsLogOpSchema = _enum([
7494
7477
  "prune",
7495
7478
  "manual-delete",
7496
7479
  "rescan",
7497
- "retention-run"
7480
+ "retention-run",
7481
+ "relocate"
7498
7482
  ]);
7499
7483
  /** Why the operation ran. */
7500
7484
  var OpsLogReasonSchema = _enum([
@@ -7533,6 +7517,55 @@ var OpsLogQueryInputSchema = object({
7533
7517
  limit: number().int().min(1).max(1e3).optional()
7534
7518
  });
7535
7519
  /**
7520
+ * Entity-relocation job state (storage entity-routing spec, Phase 4).
7521
+ *
7522
+ * One shape shared by the recorder's `relocateFootage` (segments + strips) and
7523
+ * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7524
+ * page renders both movers with one component. Jobs are in-RAM (a restart
7525
+ * forgets them — re-running is safe by construction: copy-if-absent, delete
7526
+ * after verify) and each completed/failed run also lands one durable ops-log
7527
+ * row on the owning addon's surface.
7528
+ */
7529
+ var RelocateJobStateSchema = _enum([
7530
+ "running",
7531
+ "done",
7532
+ "failed",
7533
+ "cancelled"
7534
+ ]);
7535
+ var RelocateJobSchema = object({
7536
+ jobId: string(),
7537
+ state: RelocateJobStateSchema,
7538
+ /** Source location — for media relocation this is informational ('*': rows
7539
+ * move from wherever they are to the target). */
7540
+ fromLocationId: string(),
7541
+ toLocationId: string(),
7542
+ /** Scoped device, or null = every device. */
7543
+ deviceId: number().nullable(),
7544
+ /** What the job moves (owner-addon specific: segments/strips or media). */
7545
+ entities: array(string()),
7546
+ filesMoved: number().int(),
7547
+ bytesMoved: number().int(),
7548
+ /** Total files discovered up front; null while (or when) unknown. */
7549
+ filesTotal: number().int().nullable(),
7550
+ startedAt: number(),
7551
+ finishedAt: number().nullable(),
7552
+ error: string().nullable()
7553
+ });
7554
+ var RelocateFootageInputSchema = object({
7555
+ deviceId: number().optional(),
7556
+ fromLocationId: string(),
7557
+ toLocationId: string(),
7558
+ entities: array(_enum(["segments", "strips"])).optional(),
7559
+ /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7560
+ * never allowed to starve live writers. */
7561
+ throttleMbps: number().min(1).max(1e3).optional()
7562
+ });
7563
+ var RelocateMediaInputSchema = object({
7564
+ deviceId: number().optional(),
7565
+ toLocationId: string(),
7566
+ throttleMbps: number().min(1).max(1e3).optional()
7567
+ });
7568
+ /**
7536
7569
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7537
7570
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7538
7571
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -7582,6 +7615,13 @@ var StorageLocationSchema = object({
7582
7615
  nodeId: string().optional(),
7583
7616
  isDefault: boolean().default(false),
7584
7617
  isSystem: boolean().default(false),
7618
+ /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7619
+ * for node-local locations it can reach) — never persisted, absent when the
7620
+ * volume is remote/unreachable. The single capacity truth every UI reads. */
7621
+ capacity: object({
7622
+ totalBytes: number(),
7623
+ availableBytes: number()
7624
+ }).nullable().optional(),
7585
7625
  createdAt: number(),
7586
7626
  updatedAt: number()
7587
7627
  });
@@ -8403,7 +8443,8 @@ var NcTaxonomyEntrySchema = object({
8403
8443
  /** Macro/category parent for grouping ('car' → 'vehicle'); null for a top. */
8404
8444
  parentKind: string().nullable()
8405
8445
  });
8406
- object({
8446
+ /** The complete NC picker taxonomy — three grouped buckets. */
8447
+ var NcTaxonomySchema = object({
8407
8448
  videoClasses: array(NcTaxonomyEntrySchema),
8408
8449
  audioKinds: array(NcTaxonomyEntrySchema),
8409
8450
  labels: array(NcTaxonomyEntrySchema)
@@ -9063,6 +9104,7 @@ var AccessoryKind = {
9063
9104
  };
9064
9105
  AccessoryKind.Siren, AccessoryKind.Floodlight, AccessoryKind.Spotlight, AccessoryKind.PirSensor, AccessoryKind.Chime, AccessoryKind.Autotrack, AccessoryKind.Nightvision, AccessoryKind.PrivacyMask;
9065
9106
  DeviceFeature.BatteryOperated;
9107
+ new Set(["devices", "classes"]);
9066
9108
  /**
9067
9109
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
9068
9110
  * motion-zones, and the detection zones/lines editor all speak this one
@@ -9221,6 +9263,29 @@ var NcOccupancyConditionSchema = object({
9221
9263
  count: number().int().min(0).default(1),
9222
9264
  sustainSeconds: number().int().min(0).max(3600).default(15)
9223
9265
  });
9266
+ /**
9267
+ * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
9268
+ *
9269
+ * The values are not symmetric, and deliberately so — the absent value has to
9270
+ * mean exactly what every rule authored before this condition existed already
9271
+ * does:
9272
+ * - `enter` — entries and every NON-crossing record (movement state,
9273
+ * package, sensor). Exits are rejected. **This is the absent behaviour**:
9274
+ * an operator who never asked for exits must not start receiving them.
9275
+ * - `exit` — ONLY an exit crossing. A record that is not a crossing at all
9276
+ * fails closed, because "the car left the drive" is a question about a
9277
+ * boundary, not about a detection.
9278
+ * - `any` — no direction filter; entries, exits and non-crossings alike.
9279
+ *
9280
+ * A rule asking for a direction should normally also scope `zones`, which the
9281
+ * engine evaluates against the crossed zone as well as the current membership
9282
+ * (an exit's membership no longer contains the zone it just left).
9283
+ */
9284
+ var NcCrossingSchema = _enum([
9285
+ "enter",
9286
+ "exit",
9287
+ "any"
9288
+ ]);
9224
9289
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
9225
9290
  var NcZoneConditionSchema = object({
9226
9291
  ids: array(string().min(1)).min(1),
@@ -9245,6 +9310,13 @@ var NcConditionsSchema = object({
9245
9310
  /** Veto zones — any hit fails the rule. */
9246
9311
  zonesExclude: array(string().min(1)).optional(),
9247
9312
  /**
9313
+ * Zone-crossing direction. IMMEDIATE only — a crossing is a per-event fact
9314
+ * and a closed track carries none, so a `track-end` rule asking for one
9315
+ * fails closed (use `zones`, which tests `zonesVisited`). ABSENT = `enter`,
9316
+ * which is exactly today's behaviour. See {@link NcCrossingSchema}.
9317
+ */
9318
+ crossing: NcCrossingSchema.optional(),
9319
+ /**
9248
9320
  * Exact (case-insensitive) match on the record's collapsed `label`
9249
9321
  * (identity name / plate text / subclass).
9250
9322
  */
@@ -9379,17 +9451,85 @@ var NcRuleTargetSchema = object({
9379
9451
  * - `keyFrame` — the clean scene frame (no subject box).
9380
9452
  * - `none` — no attachment.
9381
9453
  */
9382
- var NcMediaPolicySchema = object({ attach: _enum([
9383
- "best",
9384
- "best-matching",
9385
- "keyFrame",
9386
- "none"
9387
- ]).default("best") });
9454
+ /**
9455
+ * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
9456
+ * conflate it with the selection strategy and betray the request: asking for
9457
+ * the clean scene frame on an object-event owner used to start at
9458
+ * `fullFrameBoxed`, i.e. the annotated frame (2026-07-30).
9459
+ * - `cropped` — the subject, tight. What "who is at the door" wants.
9460
+ * - `full` — the clean scene, no annotation. What "what is going on" wants.
9461
+ * - `boxed` — the scene WITH the detection boxes drawn, for verifying what
9462
+ * the pipeline actually saw.
9463
+ */
9464
+ var NcMediaFrameSchema = _enum([
9465
+ "cropped",
9466
+ "full",
9467
+ "boxed"
9468
+ ]);
9469
+ var NcMediaPolicySchema = object({
9470
+ attach: _enum([
9471
+ "best",
9472
+ "best-matching",
9473
+ "keyFrame",
9474
+ "none"
9475
+ ]).default("best"),
9476
+ /** What the still shows. Absent = `cropped` (the historical `best` shape). */
9477
+ frame: NcMediaFrameSchema.optional(),
9478
+ /** Crop the attached still to the rule's condition-zone bbox (padded) —
9479
+ * "show me the ZONE", not the whole scene or the subject crop. */
9480
+ zoneCrop: boolean().optional(),
9481
+ /**
9482
+ * Also attach a short GIF cut from the stream broker's clip ring around the
9483
+ * event — NOT from the recording, so the camera does not have to be
9484
+ * recording, and the window sits AROUND the moment instead of a segment
9485
+ * behind it. Fail-closed: a window the ring does not cover contributes no
9486
+ * gif, never a failed notification.
9487
+ */
9488
+ gif: boolean().optional(),
9489
+ /**
9490
+ * Also attach a short MP4 CLIP of the same cut. Same source and the same
9491
+ * fail-closed rule as `gif`. Prefer it where the backend takes video
9492
+ * (telegram, discord, zentik, webhook); backends that do not are handled by
9493
+ * the degrade engine, which drops the video and keeps the still.
9494
+ */
9495
+ clip: boolean().optional(),
9496
+ /** Seconds of footage BEFORE / AFTER the event instant. Defaults 3 / 7. */
9497
+ clipPreRollSec: number().int().min(0).max(30).optional(),
9498
+ clipPostRollSec: number().int().min(0).max(30).optional(),
9499
+ /**
9500
+ * Which stream profile the footage is cut from. Absent = the CHEAPEST
9501
+ * assigned profile: a notification is watched on a phone, so the 4K
9502
+ * rendition would burn CPU to produce a file the client downscales anyway.
9503
+ * A profile that is not assigned falls back to the cheapest, and the render
9504
+ * reports which one actually ran.
9505
+ */
9506
+ profile: CamProfileSchema.optional()
9507
+ });
9508
+ /**
9509
+ * Cooldown GRANULARITY over the subject's class — how much a fired
9510
+ * notification suppresses.
9511
+ * - `shared` (default, and the absent value) — one window for the whole
9512
+ * rule/scope: a cat silences the next dog for `cooldownSec`.
9513
+ * - `per-class` — an independent window per detected class, so cat→dog fires
9514
+ * at once and cat→cat still waits.
9515
+ *
9516
+ * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
9517
+ * must not be swallowed by a bark's window (the precedent this generalizes —
9518
+ * see `cooldownKey` in the rule engine).
9519
+ */
9520
+ var NcThrottleGranularitySchema = _enum(["shared", "per-class"]);
9388
9521
  /** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
9389
9522
  var NcThrottleSchema = object({
9390
9523
  cooldownSec: number().int().min(0).max(86400).default(60),
9391
9524
  /** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
9392
- scope: _enum(["rule", "rule-device"]).default("rule-device")
9525
+ scope: _enum(["rule", "rule-device"]).default("rule-device"),
9526
+ /**
9527
+ * Class granularity of the cooldown key. Optional rather than defaulted:
9528
+ * a Zod default does NOT run on the addon→addon cap path, so a persisted
9529
+ * rule authored before this field simply carries none — and the engine
9530
+ * reads absent as `shared`, the pre-existing behaviour.
9531
+ */
9532
+ granularity: NcThrottleGranularitySchema.optional()
9393
9533
  });
9394
9534
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
9395
9535
  var NcRuleInputSchema = object({
@@ -9398,7 +9538,19 @@ var NcRuleInputSchema = object({
9398
9538
  delivery: NcDeliverySchema,
9399
9539
  conditions: NcConditionsSchema.default({}),
9400
9540
  schedule: NcScheduleSchema.optional(),
9401
- targets: array(NcRuleTargetSchema).min(1),
9541
+ /** May be empty when `targetUsers` addresses at least one user — the
9542
+ * "at least one addressee" invariant is enforced by the provider, because
9543
+ * a cross-field refine here would break `NcRulePatchSchema.partial()`. */
9544
+ targets: array(NcRuleTargetSchema),
9545
+ /**
9546
+ * USERS this rule addresses in addition to `targets` (Phase 4). At fire
9547
+ * time each user fans out to the personal targets they own
9548
+ * (`config.ownerUserId`), filtered by that user's `allowedDevices` for the
9549
+ * firing camera — a user is never notified about a device they cannot open.
9550
+ * Per-user opt-outs (`disabledTargetIds`) still apply to the fanned-out
9551
+ * targets.
9552
+ */
9553
+ targetUsers: array(string()).optional(),
9402
9554
  media: NcMediaPolicySchema.default({ attach: "best" }),
9403
9555
  throttle: NcThrottleSchema.default({
9404
9556
  cooldownSec: 60,
@@ -9485,6 +9637,7 @@ var NcConditionDescriptorSchema = object({
9485
9637
  "schedule",
9486
9638
  "plateMatcher",
9487
9639
  "packagePhase",
9640
+ "crossingSelect",
9488
9641
  "polygonDraw",
9489
9642
  "occupancy"
9490
9643
  ]),
@@ -9611,7 +9764,10 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
9611
9764
  }), object({ results: array(NcTestResultSchema) }), {
9612
9765
  kind: "mutation",
9613
9766
  auth: "admin"
9614
- }), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9767
+ }), method(object({}), object({
9768
+ catalog: array(NcConditionDescriptorSchema),
9769
+ taxonomy: NcTaxonomySchema.optional()
9770
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9615
9771
  /**
9616
9772
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
9617
9773
  *
@@ -10348,6 +10504,28 @@ method(object({
10348
10504
  }), object({ success: literal(true) }), {
10349
10505
  kind: "mutation",
10350
10506
  auth: "admin"
10507
+ }), method(object({
10508
+ deviceId: number(),
10509
+ /** Absent = the LOWEST assigned profile — a notification attachment is
10510
+ * watched on a phone, and the cheap rendition is the right default. */
10511
+ profile: CamProfileSchema.optional(),
10512
+ aroundMs: number(),
10513
+ preRollSec: number().min(0).max(20).default(3),
10514
+ postRollSec: number().min(0).max(20).default(5),
10515
+ format: _enum(["gif", "mp4"]).default("gif"),
10516
+ maxWidth: number().int().min(120).max(1920).default(480),
10517
+ /** GIF only — MP4 keeps the source cadence. */
10518
+ fps: number().int().min(1).max(15).default(5)
10519
+ }), object({
10520
+ base64: string(),
10521
+ mime: string(),
10522
+ bytes: number().int(),
10523
+ /** The profile actually rendered (what the default resolved to). */
10524
+ profile: CamProfileSchema,
10525
+ durationMs: number()
10526
+ }), {
10527
+ kind: "mutation",
10528
+ auth: "admin"
10351
10529
  }), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string() }), BrokerStatsSchema), method(object({ brokerId: string() }), object({
10352
10530
  probed: boolean(),
10353
10531
  summary: string()
@@ -16008,7 +16186,10 @@ method(object({
16008
16186
  }), method(object({
16009
16187
  deviceId: number(),
16010
16188
  caps: array(string()).readonly().optional()
16011
- }), record(string(), unknown().nullable()));
16189
+ }), record(string(), unknown().nullable())), method(object({
16190
+ deviceIds: array(number()).readonly(),
16191
+ caps: array(string()).readonly().optional()
16192
+ }), record(string(), record(string(), unknown().nullable())));
16012
16193
  method(object({ deviceId: number() }), record(string(), record(string(), unknown()))), method(object({
16013
16194
  deviceId: number(),
16014
16195
  capName: string()
@@ -16939,6 +17120,36 @@ var TargetKindSchema = object({
16939
17120
  icon: string(),
16940
17121
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
16941
17122
  addonId: string(),
17123
+ /**
17124
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
17125
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
17126
+ * when the addon bundles no icon for that kind — the client then falls back
17127
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
17128
+ *
17129
+ * Root-relative on purpose: it resolves against whatever origin serves a web
17130
+ * client, and a native client joins it onto its own hub base.
17131
+ *
17132
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
17133
+ * field that survived only because the runtime cap-router forwards provider
17134
+ * output verbatim — so every consumer had to re-declare it by hand to stop
17135
+ * its own Zod parse from stripping it, and the whole arrangement would have
17136
+ * broken silently the moment output validation was tightened anywhere.
17137
+ */
17138
+ iconUrl: string().optional(),
17139
+ /**
17140
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
17141
+ *
17142
+ * The server knows this and therefore says it, because the client cannot
17143
+ * safely guess: a React-Native client renders SVG and raster through two
17144
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
17145
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
17146
+ * placeholder glyph for every vector icon while the web build looked fine.
17147
+ *
17148
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
17149
+ * not been updated — a client that cannot determine the type should prefer
17150
+ * its raster path, which is the safe default for an unknown image.
17151
+ */
17152
+ iconMediaType: string().optional(),
16942
17153
  configSchema: ConfigSchemaPassthrough,
16943
17154
  supportsDiscovery: boolean(),
16944
17155
  caps: TargetKindCapsSchema
@@ -17392,6 +17603,29 @@ var MotionEventSchema = object({
17392
17603
  * Absent on legacy rows ⇒ treat as `pipeline`.
17393
17604
  */
17394
17605
  var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
17606
+ /**
17607
+ * The confirmed zone crossing that produced an object event. Present ONLY on
17608
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
17609
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
17610
+ * appearance event carry none, so a rule asking for a direction fails closed
17611
+ * on them.
17612
+ *
17613
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
17614
+ * into its own event, so a frame in which a track enters A while leaving B
17615
+ * produces two events with two directions — never one ambiguous row.
17616
+ *
17617
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
17618
+ * membership the box has NOW, and by definition it no longer contains the zone
17619
+ * that was just left. Without the id here, a zone-scoped rule could never match
17620
+ * the exit it asked for.
17621
+ */
17622
+ var ZoneCrossingSchema = object({
17623
+ direction: _enum(["enter", "exit"]),
17624
+ /** Admin zone id crossed. */
17625
+ zoneId: string(),
17626
+ /** Zone display name at crossing time (falls back to the id). */
17627
+ zoneName: string().optional()
17628
+ });
17395
17629
  var ObjectEventSchema = object({
17396
17630
  ...BaseEventFields,
17397
17631
  kind: literal("object"),
@@ -17418,6 +17652,12 @@ var ObjectEventSchema = object({
17418
17652
  zones: array(string()).readonly().optional(),
17419
17653
  /** Omitted in slim projection. */
17420
17654
  state: TrackStateSchema.optional(),
17655
+ /**
17656
+ * The zone crossing this event IS, when it is one. Absent on every other
17657
+ * event kind (movement state, appearance, package) — see
17658
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
17659
+ */
17660
+ zoneCrossing: ZoneCrossingSchema.optional(),
17421
17661
  /** Detection-frame dimensions in pixels — let consumers normalize the
17422
17662
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
17423
17663
  frameWidth: number().optional(),
@@ -17676,6 +17916,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17676
17916
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
17677
17917
  kind: "mutation",
17678
17918
  auth: "admin"
17919
+ }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
17920
+ kind: "mutation",
17921
+ auth: "admin"
17922
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
17923
+ kind: "query",
17924
+ auth: "admin"
17925
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
17926
+ kind: "mutation",
17927
+ auth: "admin"
17679
17928
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
17680
17929
  kind: "query",
17681
17930
  auth: "admin"
@@ -20155,6 +20404,17 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
20155
20404
  */
20156
20405
  priority: number()
20157
20406
  })).readonly() });
20407
+ /**
20408
+ * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
20409
+ * AUTO (resolved from the candidate ranking at send time); `resolved` reports
20410
+ * what AUTO currently picks, so the UI can show the effective value either way.
20411
+ */
20412
+ var NotificationEndpointSchema = object({
20413
+ /** The operator's explicit choice, or null for AUTO. */
20414
+ baseUrl: string().nullable(),
20415
+ /** What the ranking currently resolves to (null when nothing is reachable). */
20416
+ resolved: string().nullable()
20417
+ });
20158
20418
  var AllowedAddressesSchema = object({
20159
20419
  /**
20160
20420
  * Allowlist of interface addresses operators have explicitly opted
@@ -20177,7 +20437,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
20177
20437
  * to avoid mixed-content blocks in the browser. The public
20178
20438
  * tunnel always emits `https://` regardless. */
20179
20439
  scheme: _enum(["http", "https"]).optional()
20180
- }), GetConnectionEndpointsResultSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
20440
+ }), 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" });
20181
20441
  /**
20182
20442
  * mesh-network — collection cap for mesh-VPN providers.
20183
20443
  *
@@ -20976,7 +21236,12 @@ var RecordingDeviceUsageSchema = object({
20976
21236
  var RecordingLocationUsageSchema = object({
20977
21237
  /** StorageLocation id; null for the legacy/degraded single-root fallback. */
20978
21238
  locationId: string().nullable(),
20979
- /** Bytes of recordings stored on this location. */
21239
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
21240
+ * is emitted per physical disk (2026-07-29): two locations on one root
21241
+ * previously rendered as two identical "disks" with a nonsensical used
21242
+ * split — hydrate attribution across aliases is arbitrary by nature. */
21243
+ locationIds: array(string()).optional(),
21244
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). */
20980
21245
  usedBytes: number(),
20981
21246
  /** Free bytes on the location's volume; null when capacity is unknown (remote). */
20982
21247
  availableBytes: number().nullable(),
@@ -21088,6 +21353,44 @@ method(object({
21088
21353
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
21089
21354
  kind: "query",
21090
21355
  auth: "admin"
21356
+ }), method(object({
21357
+ deviceId: number(),
21358
+ aroundMs: number(),
21359
+ preRollSec: number().min(0).max(30).default(2),
21360
+ postRollSec: number().min(0).max(30).default(5),
21361
+ maxWidth: number().int().min(120).max(1280).default(480),
21362
+ fps: number().int().min(1).max(15).default(5)
21363
+ }), object({
21364
+ gifBase64: string(),
21365
+ fromMs: number(),
21366
+ toMs: number()
21367
+ }), {
21368
+ kind: "mutation",
21369
+ auth: "admin"
21370
+ }), method(object({
21371
+ deviceId: number(),
21372
+ aroundMs: number(),
21373
+ preRollSec: number().min(0).max(30).default(3),
21374
+ postRollSec: number().min(0).max(30).default(7),
21375
+ maxWidth: number().int().min(160).max(1920).default(640)
21376
+ }), object({
21377
+ clipBase64: string(),
21378
+ mime: string(),
21379
+ fromMs: number(),
21380
+ toMs: number(),
21381
+ bytes: number().int()
21382
+ }), {
21383
+ kind: "mutation",
21384
+ auth: "admin"
21385
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
21386
+ kind: "mutation",
21387
+ auth: "admin"
21388
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
21389
+ kind: "query",
21390
+ auth: "admin"
21391
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
21392
+ kind: "mutation",
21393
+ auth: "admin"
21091
21394
  });
21092
21395
  /**
21093
21396
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -22679,6 +22982,12 @@ Object.freeze({
22679
22982
  addonId: null,
22680
22983
  access: "view"
22681
22984
  },
22985
+ "deviceManager.getDeviceStatusAggregateBatch": {
22986
+ capName: "device-manager",
22987
+ capScope: "system",
22988
+ addonId: null,
22989
+ access: "view"
22990
+ },
22682
22991
  "deviceManager.getLinkedDevices": {
22683
22992
  capName: "device-manager",
22684
22993
  capScope: "system",
@@ -23573,6 +23882,12 @@ Object.freeze({
23573
23882
  addonId: null,
23574
23883
  access: "view"
23575
23884
  },
23885
+ "localNetwork.getNotificationEndpoint": {
23886
+ capName: "local-network",
23887
+ capScope: "system",
23888
+ addonId: null,
23889
+ access: "view"
23890
+ },
23576
23891
  "localNetwork.getPreferred": {
23577
23892
  capName: "local-network",
23578
23893
  capScope: "system",
@@ -23597,6 +23912,12 @@ Object.freeze({
23597
23912
  addonId: null,
23598
23913
  access: "create"
23599
23914
  },
23915
+ "localNetwork.setNotificationEndpoint": {
23916
+ capName: "local-network",
23917
+ capScope: "system",
23918
+ addonId: null,
23919
+ access: "create"
23920
+ },
23600
23921
  "lockControl.lock": {
23601
23922
  capName: "lock-control",
23602
23923
  capScope: "device",
@@ -24239,6 +24560,12 @@ Object.freeze({
24239
24560
  addonId: null,
24240
24561
  access: "create"
24241
24562
  },
24563
+ "pipelineAnalytics.cancelMediaRelocate": {
24564
+ capName: "pipeline-analytics",
24565
+ capScope: "device",
24566
+ addonId: null,
24567
+ access: "create"
24568
+ },
24242
24569
  "pipelineAnalytics.clearTracks": {
24243
24570
  capName: "pipeline-analytics",
24244
24571
  capScope: "device",
@@ -24293,6 +24620,12 @@ Object.freeze({
24293
24620
  addonId: null,
24294
24621
  access: "view"
24295
24622
  },
24623
+ "pipelineAnalytics.getMediaRelocateStatus": {
24624
+ capName: "pipeline-analytics",
24625
+ capScope: "device",
24626
+ addonId: null,
24627
+ access: "view"
24628
+ },
24296
24629
  "pipelineAnalytics.getMotionEvents": {
24297
24630
  capName: "pipeline-analytics",
24298
24631
  capScope: "device",
@@ -24365,6 +24698,12 @@ Object.freeze({
24365
24698
  addonId: null,
24366
24699
  access: "create"
24367
24700
  },
24701
+ "pipelineAnalytics.relocateMedia": {
24702
+ capName: "pipeline-analytics",
24703
+ capScope: "device",
24704
+ addonId: null,
24705
+ access: "create"
24706
+ },
24368
24707
  "pipelineAnalytics.searchObjectEvents": {
24369
24708
  capName: "pipeline-analytics",
24370
24709
  capScope: "device",
@@ -25127,6 +25466,12 @@ Object.freeze({
25127
25466
  addonId: null,
25128
25467
  access: "create"
25129
25468
  },
25469
+ "recording.cancelRelocate": {
25470
+ capName: "recording",
25471
+ capScope: "system",
25472
+ addonId: null,
25473
+ access: "create"
25474
+ },
25130
25475
  "recording.deleteFootprint": {
25131
25476
  capName: "recording",
25132
25477
  capScope: "system",
@@ -25157,6 +25502,12 @@ Object.freeze({
25157
25502
  addonId: null,
25158
25503
  access: "view"
25159
25504
  },
25505
+ "recording.getRelocateStatus": {
25506
+ capName: "recording",
25507
+ capScope: "system",
25508
+ addonId: null,
25509
+ access: "view"
25510
+ },
25160
25511
  "recording.getStorageUsage": {
25161
25512
  capName: "recording",
25162
25513
  capScope: "system",
@@ -25187,6 +25538,24 @@ Object.freeze({
25187
25538
  addonId: null,
25188
25539
  access: "view"
25189
25540
  },
25541
+ "recording.relocateFootage": {
25542
+ capName: "recording",
25543
+ capScope: "system",
25544
+ addonId: null,
25545
+ access: "create"
25546
+ },
25547
+ "recording.renderClip": {
25548
+ capName: "recording",
25549
+ capScope: "system",
25550
+ addonId: null,
25551
+ access: "create"
25552
+ },
25553
+ "recording.renderGif": {
25554
+ capName: "recording",
25555
+ capScope: "system",
25556
+ addonId: null,
25557
+ access: "create"
25558
+ },
25190
25559
  "recording.rescanStorage": {
25191
25560
  capName: "recording",
25192
25561
  capScope: "system",
@@ -25781,6 +26150,12 @@ Object.freeze({
25781
26150
  addonId: null,
25782
26151
  access: "create"
25783
26152
  },
26153
+ "streamBroker.renderPreBufferClip": {
26154
+ capName: "stream-broker",
26155
+ capScope: "system",
26156
+ addonId: null,
26157
+ access: "create"
26158
+ },
25784
26159
  "streamBroker.restartProfile": {
25785
26160
  capName: "stream-broker",
25786
26161
  capScope: "system",