@camstack/addon-remote-storage 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 path from "node:path";
2
2
  import { randomUUID } 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,
@@ -7184,35 +7197,22 @@ var ConvertResultSchema = object({
7184
7197
  */
7185
7198
  var RecordingWeekdaySchema = number().int().min(0).max(6);
7186
7199
  var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
7187
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
7188
- kind: literal("timeOfDay"),
7189
- start: string().regex(HHMM),
7190
- end: string().regex(HHMM),
7191
- /** Restrict to these weekdays; omit = every day. */
7192
- days: array(RecordingWeekdaySchema).optional()
7193
- })]);
7194
- var RecordingModeSchema = _enum([
7195
- "continuous",
7196
- "onMotion",
7197
- "onAudioThreshold"
7198
- ]);
7199
7200
  /**
7200
- * First-class, authoritative per-camera storage mode — the explicit choice the
7201
- * UI reads directly (never inferred from `rules`):
7202
- * - `off` — not recording.
7203
- * - `events` — record only around triggers (motion / audio threshold),
7204
- * with pre/post-buffer.
7205
- * - `continuous` — record 24/7 within the schedule.
7201
+ * DERIVED per-camera storage summary — the single field cheap consumers read
7202
+ * (the viewer's status dot, the camera list) instead of walking `bands`:
7203
+ * - `off` — no band covers the camera (or it is disabled).
7204
+ * - `events` — every band records around triggers only.
7205
+ * - `continuous` — at least one band records continuously.
7206
7206
  *
7207
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
7208
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
7207
+ * NEVER authored: the recorder stamps it from the authoritative `bands` on
7208
+ * every save (`activeModeForConfig`). Writing it has no effect.
7209
7209
  */
7210
7210
  var RecordingStorageModeSchema = _enum([
7211
7211
  "off",
7212
7212
  "events",
7213
7213
  "continuous"
7214
7214
  ]);
7215
- /** Which detectors trigger an `events`-mode recording. */
7215
+ /** Which detectors trigger an `events`-mode band. */
7216
7216
  var RecordingTriggersSchema = object({
7217
7217
  motion: boolean().optional(),
7218
7218
  audioThresholdDbfs: number().optional()
@@ -7248,18 +7248,6 @@ var RecordingBandSchema = object({
7248
7248
  preBufferSec: number().min(0).optional(),
7249
7249
  postBufferSec: number().min(0).optional()
7250
7250
  });
7251
- var RecordingRuleSchema = object({
7252
- schedule: RecordingScheduleSchema,
7253
- mode: RecordingModeSchema,
7254
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
7255
- preBufferSec: number().min(0).default(0),
7256
- /** Keep recording until this many seconds after the last trigger. */
7257
- postBufferSec: number().min(0).default(0),
7258
- /** Each new trigger restarts the post-buffer window. */
7259
- resetTimeoutOnNewEvent: boolean().default(true),
7260
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
7261
- thresholdDbfs: number().optional()
7262
- });
7263
7251
  /**
7264
7252
  * Per-device retention overrides. Every field is optional; an unset or `0`
7265
7253
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7293,40 +7281,28 @@ var ScrubThumbnailPresetSchema = _enum([
7293
7281
  /**
7294
7282
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7295
7283
  *
7296
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
7297
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
7298
- * only for transition + migration (`migrateRulesToMode`); the policy engine
7299
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
7284
+ * `bands` is the ONLY authored recording intent: what to record, when, and on
7285
+ * which trigger. `mode` is a derived summary the recorder stamps on save; every
7286
+ * other field is a storage knob (profiles, segment length, retention, scrub).
7287
+ *
7288
+ * STRICT on purpose: the legacy authoring surface (`schedule`/`schedules`/
7289
+ * `triggers`/`preBufferSec`/`postBufferSec`/`rules`) was retired 2026-07-30.
7290
+ * A stale caller must fail loudly — silently stripping its legacy intent would
7291
+ * persist a band-less config, i.e. silently stop recording the camera.
7300
7292
  */
7301
7293
  var RecordingConfigSchema = object({
7302
7294
  enabled: boolean(),
7303
- /** Authoritative storage mode. Absent on legacy targets derived once via
7304
- * `migrateRulesToMode`, then persisted. */
7295
+ /** DERIVED summary of `bands`, stamped by the recorder on every save.
7296
+ * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7305
7297
  mode: RecordingStorageModeSchema.optional(),
7306
7298
  profiles: array(CamProfileSchema).optional(),
7307
7299
  segmentSeconds: number().int().positive().optional(),
7308
- /** Shared recording time-bands for `events` & `continuous` — record only when
7309
- * the wall-clock falls inside one of these windows. Omit or empty = always.
7310
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
7311
- schedules: array(RecordingScheduleSchema).optional(),
7312
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
7313
- * normalized into `schedules` on read and never written going forward. (Not
7314
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
7315
- schedule: RecordingScheduleSchema.optional(),
7316
- /** `events`-mode only — which detectors trigger a recording. */
7317
- triggers: RecordingTriggersSchema.optional(),
7318
- /** `events`-mode only — seconds retained before / after a trigger. */
7319
- preBufferSec: number().min(0).optional(),
7320
- postBufferSec: number().min(0).optional(),
7321
- /** DEPRECATED authoring input; retained for migration/transition. */
7322
- rules: array(RecordingRuleSchema).optional(),
7323
7300
  /**
7324
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
7325
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
7326
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
7327
- * derived into bands once via `migrateConfigToBands`.
7301
+ * AUTHORITATIVE mode-per-band recording model the single source of truth
7302
+ * the recorder's band engine consumes. An empty array = record nothing;
7303
+ * "off" is the absence of a covering band, never a band value.
7328
7304
  */
7329
- bands: array(RecordingBandSchema).optional(),
7305
+ bands: array(RecordingBandSchema).default([]),
7330
7306
  retention: RecordingRetentionSchema.optional(),
7331
7307
  /**
7332
7308
  * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
@@ -7334,8 +7310,15 @@ var RecordingConfigSchema = object({
7334
7310
  * windows only — existing sheets are immutable, and each window's index
7335
7311
  * carries its own tile dims so mixed-preset history renders correctly.
7336
7312
  */
7337
- scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7338
- });
7313
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional(),
7314
+ /**
7315
+ * OPT-IN thumbnail-strip generation for this camera: every keyframe of the
7316
+ * low recording saved as a JPEG (the fast-drag scrub depth), a derived
7317
+ * cache that eviction reclaims with the footage. Absent/false = no strips
7318
+ * are written and scrub reads exact keyframes at every velocity.
7319
+ */
7320
+ stripsEnabled: boolean().optional()
7321
+ }).strict();
7339
7322
  /**
7340
7323
  * Ops-log — the durable, append-only operations audit shared by the
7341
7324
  * recordings and events management surfaces.
@@ -7354,7 +7337,8 @@ var OpsLogOpSchema = _enum([
7354
7337
  "prune",
7355
7338
  "manual-delete",
7356
7339
  "rescan",
7357
- "retention-run"
7340
+ "retention-run",
7341
+ "relocate"
7358
7342
  ]);
7359
7343
  /** Why the operation ran. */
7360
7344
  var OpsLogReasonSchema = _enum([
@@ -7393,6 +7377,55 @@ var OpsLogQueryInputSchema = object({
7393
7377
  limit: number().int().min(1).max(1e3).optional()
7394
7378
  });
7395
7379
  /**
7380
+ * Entity-relocation job state (storage entity-routing spec, Phase 4).
7381
+ *
7382
+ * One shape shared by the recorder's `relocateFootage` (segments + strips) and
7383
+ * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7384
+ * page renders both movers with one component. Jobs are in-RAM (a restart
7385
+ * forgets them — re-running is safe by construction: copy-if-absent, delete
7386
+ * after verify) and each completed/failed run also lands one durable ops-log
7387
+ * row on the owning addon's surface.
7388
+ */
7389
+ var RelocateJobStateSchema = _enum([
7390
+ "running",
7391
+ "done",
7392
+ "failed",
7393
+ "cancelled"
7394
+ ]);
7395
+ var RelocateJobSchema = object({
7396
+ jobId: string(),
7397
+ state: RelocateJobStateSchema,
7398
+ /** Source location — for media relocation this is informational ('*': rows
7399
+ * move from wherever they are to the target). */
7400
+ fromLocationId: string(),
7401
+ toLocationId: string(),
7402
+ /** Scoped device, or null = every device. */
7403
+ deviceId: number().nullable(),
7404
+ /** What the job moves (owner-addon specific: segments/strips or media). */
7405
+ entities: array(string()),
7406
+ filesMoved: number().int(),
7407
+ bytesMoved: number().int(),
7408
+ /** Total files discovered up front; null while (or when) unknown. */
7409
+ filesTotal: number().int().nullable(),
7410
+ startedAt: number(),
7411
+ finishedAt: number().nullable(),
7412
+ error: string().nullable()
7413
+ });
7414
+ var RelocateFootageInputSchema = object({
7415
+ deviceId: number().optional(),
7416
+ fromLocationId: string(),
7417
+ toLocationId: string(),
7418
+ entities: array(_enum(["segments", "strips"])).optional(),
7419
+ /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7420
+ * never allowed to starve live writers. */
7421
+ throttleMbps: number().min(1).max(1e3).optional()
7422
+ });
7423
+ var RelocateMediaInputSchema = object({
7424
+ deviceId: number().optional(),
7425
+ toLocationId: string(),
7426
+ throttleMbps: number().min(1).max(1e3).optional()
7427
+ });
7428
+ /**
7396
7429
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7397
7430
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7398
7431
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -7442,6 +7475,13 @@ var StorageLocationSchema = object({
7442
7475
  nodeId: string().optional(),
7443
7476
  isDefault: boolean().default(false),
7444
7477
  isSystem: boolean().default(false),
7478
+ /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7479
+ * for node-local locations it can reach) — never persisted, absent when the
7480
+ * volume is remote/unreachable. The single capacity truth every UI reads. */
7481
+ capacity: object({
7482
+ totalBytes: number(),
7483
+ availableBytes: number()
7484
+ }).nullable().optional(),
7445
7485
  createdAt: number(),
7446
7486
  updatedAt: number()
7447
7487
  });
@@ -8209,7 +8249,8 @@ var NcTaxonomyEntrySchema = object({
8209
8249
  /** Macro/category parent for grouping ('car' → 'vehicle'); null for a top. */
8210
8250
  parentKind: string().nullable()
8211
8251
  });
8212
- object({
8252
+ /** The complete NC picker taxonomy — three grouped buckets. */
8253
+ var NcTaxonomySchema = object({
8213
8254
  videoClasses: array(NcTaxonomyEntrySchema),
8214
8255
  audioKinds: array(NcTaxonomyEntrySchema),
8215
8256
  labels: array(NcTaxonomyEntrySchema)
@@ -8869,6 +8910,7 @@ var AccessoryKind = {
8869
8910
  };
8870
8911
  AccessoryKind.Siren, AccessoryKind.Floodlight, AccessoryKind.Spotlight, AccessoryKind.PirSensor, AccessoryKind.Chime, AccessoryKind.Autotrack, AccessoryKind.Nightvision, AccessoryKind.PrivacyMask;
8871
8912
  DeviceFeature.BatteryOperated;
8913
+ new Set(["devices", "classes"]);
8872
8914
  /**
8873
8915
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
8874
8916
  * motion-zones, and the detection zones/lines editor all speak this one
@@ -9027,6 +9069,29 @@ var NcOccupancyConditionSchema = object({
9027
9069
  count: number().int().min(0).default(1),
9028
9070
  sustainSeconds: number().int().min(0).max(3600).default(15)
9029
9071
  });
9072
+ /**
9073
+ * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
9074
+ *
9075
+ * The values are not symmetric, and deliberately so — the absent value has to
9076
+ * mean exactly what every rule authored before this condition existed already
9077
+ * does:
9078
+ * - `enter` — entries and every NON-crossing record (movement state,
9079
+ * package, sensor). Exits are rejected. **This is the absent behaviour**:
9080
+ * an operator who never asked for exits must not start receiving them.
9081
+ * - `exit` — ONLY an exit crossing. A record that is not a crossing at all
9082
+ * fails closed, because "the car left the drive" is a question about a
9083
+ * boundary, not about a detection.
9084
+ * - `any` — no direction filter; entries, exits and non-crossings alike.
9085
+ *
9086
+ * A rule asking for a direction should normally also scope `zones`, which the
9087
+ * engine evaluates against the crossed zone as well as the current membership
9088
+ * (an exit's membership no longer contains the zone it just left).
9089
+ */
9090
+ var NcCrossingSchema = _enum([
9091
+ "enter",
9092
+ "exit",
9093
+ "any"
9094
+ ]);
9030
9095
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
9031
9096
  var NcZoneConditionSchema = object({
9032
9097
  ids: array(string().min(1)).min(1),
@@ -9051,6 +9116,13 @@ var NcConditionsSchema = object({
9051
9116
  /** Veto zones — any hit fails the rule. */
9052
9117
  zonesExclude: array(string().min(1)).optional(),
9053
9118
  /**
9119
+ * Zone-crossing direction. IMMEDIATE only — a crossing is a per-event fact
9120
+ * and a closed track carries none, so a `track-end` rule asking for one
9121
+ * fails closed (use `zones`, which tests `zonesVisited`). ABSENT = `enter`,
9122
+ * which is exactly today's behaviour. See {@link NcCrossingSchema}.
9123
+ */
9124
+ crossing: NcCrossingSchema.optional(),
9125
+ /**
9054
9126
  * Exact (case-insensitive) match on the record's collapsed `label`
9055
9127
  * (identity name / plate text / subclass).
9056
9128
  */
@@ -9185,17 +9257,85 @@ var NcRuleTargetSchema = object({
9185
9257
  * - `keyFrame` — the clean scene frame (no subject box).
9186
9258
  * - `none` — no attachment.
9187
9259
  */
9188
- var NcMediaPolicySchema = object({ attach: _enum([
9189
- "best",
9190
- "best-matching",
9191
- "keyFrame",
9192
- "none"
9193
- ]).default("best") });
9260
+ /**
9261
+ * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
9262
+ * conflate it with the selection strategy and betray the request: asking for
9263
+ * the clean scene frame on an object-event owner used to start at
9264
+ * `fullFrameBoxed`, i.e. the annotated frame (2026-07-30).
9265
+ * - `cropped` — the subject, tight. What "who is at the door" wants.
9266
+ * - `full` — the clean scene, no annotation. What "what is going on" wants.
9267
+ * - `boxed` — the scene WITH the detection boxes drawn, for verifying what
9268
+ * the pipeline actually saw.
9269
+ */
9270
+ var NcMediaFrameSchema = _enum([
9271
+ "cropped",
9272
+ "full",
9273
+ "boxed"
9274
+ ]);
9275
+ var NcMediaPolicySchema = object({
9276
+ attach: _enum([
9277
+ "best",
9278
+ "best-matching",
9279
+ "keyFrame",
9280
+ "none"
9281
+ ]).default("best"),
9282
+ /** What the still shows. Absent = `cropped` (the historical `best` shape). */
9283
+ frame: NcMediaFrameSchema.optional(),
9284
+ /** Crop the attached still to the rule's condition-zone bbox (padded) —
9285
+ * "show me the ZONE", not the whole scene or the subject crop. */
9286
+ zoneCrop: boolean().optional(),
9287
+ /**
9288
+ * Also attach a short GIF cut from the stream broker's clip ring around the
9289
+ * event — NOT from the recording, so the camera does not have to be
9290
+ * recording, and the window sits AROUND the moment instead of a segment
9291
+ * behind it. Fail-closed: a window the ring does not cover contributes no
9292
+ * gif, never a failed notification.
9293
+ */
9294
+ gif: boolean().optional(),
9295
+ /**
9296
+ * Also attach a short MP4 CLIP of the same cut. Same source and the same
9297
+ * fail-closed rule as `gif`. Prefer it where the backend takes video
9298
+ * (telegram, discord, zentik, webhook); backends that do not are handled by
9299
+ * the degrade engine, which drops the video and keeps the still.
9300
+ */
9301
+ clip: boolean().optional(),
9302
+ /** Seconds of footage BEFORE / AFTER the event instant. Defaults 3 / 7. */
9303
+ clipPreRollSec: number().int().min(0).max(30).optional(),
9304
+ clipPostRollSec: number().int().min(0).max(30).optional(),
9305
+ /**
9306
+ * Which stream profile the footage is cut from. Absent = the CHEAPEST
9307
+ * assigned profile: a notification is watched on a phone, so the 4K
9308
+ * rendition would burn CPU to produce a file the client downscales anyway.
9309
+ * A profile that is not assigned falls back to the cheapest, and the render
9310
+ * reports which one actually ran.
9311
+ */
9312
+ profile: CamProfileSchema.optional()
9313
+ });
9314
+ /**
9315
+ * Cooldown GRANULARITY over the subject's class — how much a fired
9316
+ * notification suppresses.
9317
+ * - `shared` (default, and the absent value) — one window for the whole
9318
+ * rule/scope: a cat silences the next dog for `cooldownSec`.
9319
+ * - `per-class` — an independent window per detected class, so cat→dog fires
9320
+ * at once and cat→cat still waits.
9321
+ *
9322
+ * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
9323
+ * must not be swallowed by a bark's window (the precedent this generalizes —
9324
+ * see `cooldownKey` in the rule engine).
9325
+ */
9326
+ var NcThrottleGranularitySchema = _enum(["shared", "per-class"]);
9194
9327
  /** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
9195
9328
  var NcThrottleSchema = object({
9196
9329
  cooldownSec: number().int().min(0).max(86400).default(60),
9197
9330
  /** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
9198
- scope: _enum(["rule", "rule-device"]).default("rule-device")
9331
+ scope: _enum(["rule", "rule-device"]).default("rule-device"),
9332
+ /**
9333
+ * Class granularity of the cooldown key. Optional rather than defaulted:
9334
+ * a Zod default does NOT run on the addon→addon cap path, so a persisted
9335
+ * rule authored before this field simply carries none — and the engine
9336
+ * reads absent as `shared`, the pre-existing behaviour.
9337
+ */
9338
+ granularity: NcThrottleGranularitySchema.optional()
9199
9339
  });
9200
9340
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
9201
9341
  var NcRuleInputSchema = object({
@@ -9204,7 +9344,19 @@ var NcRuleInputSchema = object({
9204
9344
  delivery: NcDeliverySchema,
9205
9345
  conditions: NcConditionsSchema.default({}),
9206
9346
  schedule: NcScheduleSchema.optional(),
9207
- targets: array(NcRuleTargetSchema).min(1),
9347
+ /** May be empty when `targetUsers` addresses at least one user — the
9348
+ * "at least one addressee" invariant is enforced by the provider, because
9349
+ * a cross-field refine here would break `NcRulePatchSchema.partial()`. */
9350
+ targets: array(NcRuleTargetSchema),
9351
+ /**
9352
+ * USERS this rule addresses in addition to `targets` (Phase 4). At fire
9353
+ * time each user fans out to the personal targets they own
9354
+ * (`config.ownerUserId`), filtered by that user's `allowedDevices` for the
9355
+ * firing camera — a user is never notified about a device they cannot open.
9356
+ * Per-user opt-outs (`disabledTargetIds`) still apply to the fanned-out
9357
+ * targets.
9358
+ */
9359
+ targetUsers: array(string()).optional(),
9208
9360
  media: NcMediaPolicySchema.default({ attach: "best" }),
9209
9361
  throttle: NcThrottleSchema.default({
9210
9362
  cooldownSec: 60,
@@ -9291,6 +9443,7 @@ var NcConditionDescriptorSchema = object({
9291
9443
  "schedule",
9292
9444
  "plateMatcher",
9293
9445
  "packagePhase",
9446
+ "crossingSelect",
9294
9447
  "polygonDraw",
9295
9448
  "occupancy"
9296
9449
  ]),
@@ -9417,7 +9570,10 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
9417
9570
  }), object({ results: array(NcTestResultSchema) }), {
9418
9571
  kind: "mutation",
9419
9572
  auth: "admin"
9420
- }), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9573
+ }), method(object({}), object({
9574
+ catalog: array(NcConditionDescriptorSchema),
9575
+ taxonomy: NcTaxonomySchema.optional()
9576
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9421
9577
  /**
9422
9578
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
9423
9579
  *
@@ -10154,6 +10310,28 @@ method(object({
10154
10310
  }), object({ success: literal(true) }), {
10155
10311
  kind: "mutation",
10156
10312
  auth: "admin"
10313
+ }), method(object({
10314
+ deviceId: number(),
10315
+ /** Absent = the LOWEST assigned profile — a notification attachment is
10316
+ * watched on a phone, and the cheap rendition is the right default. */
10317
+ profile: CamProfileSchema.optional(),
10318
+ aroundMs: number(),
10319
+ preRollSec: number().min(0).max(20).default(3),
10320
+ postRollSec: number().min(0).max(20).default(5),
10321
+ format: _enum(["gif", "mp4"]).default("gif"),
10322
+ maxWidth: number().int().min(120).max(1920).default(480),
10323
+ /** GIF only — MP4 keeps the source cadence. */
10324
+ fps: number().int().min(1).max(15).default(5)
10325
+ }), object({
10326
+ base64: string(),
10327
+ mime: string(),
10328
+ bytes: number().int(),
10329
+ /** The profile actually rendered (what the default resolved to). */
10330
+ profile: CamProfileSchema,
10331
+ durationMs: number()
10332
+ }), {
10333
+ kind: "mutation",
10334
+ auth: "admin"
10157
10335
  }), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string() }), BrokerStatsSchema), method(object({ brokerId: string() }), object({
10158
10336
  probed: boolean(),
10159
10337
  summary: string()
@@ -15748,7 +15926,10 @@ method(object({
15748
15926
  }), method(object({
15749
15927
  deviceId: number(),
15750
15928
  caps: array(string()).readonly().optional()
15751
- }), record(string(), unknown().nullable()));
15929
+ }), record(string(), unknown().nullable())), method(object({
15930
+ deviceIds: array(number()).readonly(),
15931
+ caps: array(string()).readonly().optional()
15932
+ }), record(string(), record(string(), unknown().nullable())));
15752
15933
  method(object({ deviceId: number() }), record(string(), record(string(), unknown()))), method(object({
15753
15934
  deviceId: number(),
15754
15935
  capName: string()
@@ -16679,6 +16860,36 @@ var TargetKindSchema = object({
16679
16860
  icon: string(),
16680
16861
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
16681
16862
  addonId: string(),
16863
+ /**
16864
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
16865
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
16866
+ * when the addon bundles no icon for that kind — the client then falls back
16867
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
16868
+ *
16869
+ * Root-relative on purpose: it resolves against whatever origin serves a web
16870
+ * client, and a native client joins it onto its own hub base.
16871
+ *
16872
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
16873
+ * field that survived only because the runtime cap-router forwards provider
16874
+ * output verbatim — so every consumer had to re-declare it by hand to stop
16875
+ * its own Zod parse from stripping it, and the whole arrangement would have
16876
+ * broken silently the moment output validation was tightened anywhere.
16877
+ */
16878
+ iconUrl: string().optional(),
16879
+ /**
16880
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
16881
+ *
16882
+ * The server knows this and therefore says it, because the client cannot
16883
+ * safely guess: a React-Native client renders SVG and raster through two
16884
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
16885
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
16886
+ * placeholder glyph for every vector icon while the web build looked fine.
16887
+ *
16888
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
16889
+ * not been updated — a client that cannot determine the type should prefer
16890
+ * its raster path, which is the safe default for an unknown image.
16891
+ */
16892
+ iconMediaType: string().optional(),
16682
16893
  configSchema: ConfigSchemaPassthrough,
16683
16894
  supportsDiscovery: boolean(),
16684
16895
  caps: TargetKindCapsSchema
@@ -17126,6 +17337,29 @@ var MotionEventSchema = object({
17126
17337
  * Absent on legacy rows ⇒ treat as `pipeline`.
17127
17338
  */
17128
17339
  var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
17340
+ /**
17341
+ * The confirmed zone crossing that produced an object event. Present ONLY on
17342
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
17343
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
17344
+ * appearance event carry none, so a rule asking for a direction fails closed
17345
+ * on them.
17346
+ *
17347
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
17348
+ * into its own event, so a frame in which a track enters A while leaving B
17349
+ * produces two events with two directions — never one ambiguous row.
17350
+ *
17351
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
17352
+ * membership the box has NOW, and by definition it no longer contains the zone
17353
+ * that was just left. Without the id here, a zone-scoped rule could never match
17354
+ * the exit it asked for.
17355
+ */
17356
+ var ZoneCrossingSchema = object({
17357
+ direction: _enum(["enter", "exit"]),
17358
+ /** Admin zone id crossed. */
17359
+ zoneId: string(),
17360
+ /** Zone display name at crossing time (falls back to the id). */
17361
+ zoneName: string().optional()
17362
+ });
17129
17363
  var ObjectEventSchema = object({
17130
17364
  ...BaseEventFields,
17131
17365
  kind: literal("object"),
@@ -17152,6 +17386,12 @@ var ObjectEventSchema = object({
17152
17386
  zones: array(string()).readonly().optional(),
17153
17387
  /** Omitted in slim projection. */
17154
17388
  state: TrackStateSchema.optional(),
17389
+ /**
17390
+ * The zone crossing this event IS, when it is one. Absent on every other
17391
+ * event kind (movement state, appearance, package) — see
17392
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
17393
+ */
17394
+ zoneCrossing: ZoneCrossingSchema.optional(),
17155
17395
  /** Detection-frame dimensions in pixels — let consumers normalize the
17156
17396
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
17157
17397
  frameWidth: number().optional(),
@@ -17410,6 +17650,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17410
17650
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
17411
17651
  kind: "mutation",
17412
17652
  auth: "admin"
17653
+ }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
17654
+ kind: "mutation",
17655
+ auth: "admin"
17656
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
17657
+ kind: "query",
17658
+ auth: "admin"
17659
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
17660
+ kind: "mutation",
17661
+ auth: "admin"
17413
17662
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
17414
17663
  kind: "query",
17415
17664
  auth: "admin"
@@ -19934,6 +20183,17 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
19934
20183
  */
19935
20184
  priority: number()
19936
20185
  })).readonly() });
20186
+ /**
20187
+ * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
20188
+ * AUTO (resolved from the candidate ranking at send time); `resolved` reports
20189
+ * what AUTO currently picks, so the UI can show the effective value either way.
20190
+ */
20191
+ var NotificationEndpointSchema = object({
20192
+ /** The operator's explicit choice, or null for AUTO. */
20193
+ baseUrl: string().nullable(),
20194
+ /** What the ranking currently resolves to (null when nothing is reachable). */
20195
+ resolved: string().nullable()
20196
+ });
19937
20197
  var AllowedAddressesSchema = object({
19938
20198
  /**
19939
20199
  * Allowlist of interface addresses operators have explicitly opted
@@ -19956,7 +20216,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
19956
20216
  * to avoid mixed-content blocks in the browser. The public
19957
20217
  * tunnel always emits `https://` regardless. */
19958
20218
  scheme: _enum(["http", "https"]).optional()
19959
- }), GetConnectionEndpointsResultSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
20219
+ }), 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" });
19960
20220
  /**
19961
20221
  * mesh-network — collection cap for mesh-VPN providers.
19962
20222
  *
@@ -20755,7 +21015,12 @@ var RecordingDeviceUsageSchema = object({
20755
21015
  var RecordingLocationUsageSchema = object({
20756
21016
  /** StorageLocation id; null for the legacy/degraded single-root fallback. */
20757
21017
  locationId: string().nullable(),
20758
- /** Bytes of recordings stored on this location. */
21018
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
21019
+ * is emitted per physical disk (2026-07-29): two locations on one root
21020
+ * previously rendered as two identical "disks" with a nonsensical used
21021
+ * split — hydrate attribution across aliases is arbitrary by nature. */
21022
+ locationIds: array(string()).optional(),
21023
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). */
20759
21024
  usedBytes: number(),
20760
21025
  /** Free bytes on the location's volume; null when capacity is unknown (remote). */
20761
21026
  availableBytes: number().nullable(),
@@ -20867,6 +21132,44 @@ method(object({
20867
21132
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
20868
21133
  kind: "query",
20869
21134
  auth: "admin"
21135
+ }), method(object({
21136
+ deviceId: number(),
21137
+ aroundMs: number(),
21138
+ preRollSec: number().min(0).max(30).default(2),
21139
+ postRollSec: number().min(0).max(30).default(5),
21140
+ maxWidth: number().int().min(120).max(1280).default(480),
21141
+ fps: number().int().min(1).max(15).default(5)
21142
+ }), object({
21143
+ gifBase64: string(),
21144
+ fromMs: number(),
21145
+ toMs: number()
21146
+ }), {
21147
+ kind: "mutation",
21148
+ auth: "admin"
21149
+ }), method(object({
21150
+ deviceId: number(),
21151
+ aroundMs: number(),
21152
+ preRollSec: number().min(0).max(30).default(3),
21153
+ postRollSec: number().min(0).max(30).default(7),
21154
+ maxWidth: number().int().min(160).max(1920).default(640)
21155
+ }), object({
21156
+ clipBase64: string(),
21157
+ mime: string(),
21158
+ fromMs: number(),
21159
+ toMs: number(),
21160
+ bytes: number().int()
21161
+ }), {
21162
+ kind: "mutation",
21163
+ auth: "admin"
21164
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
21165
+ kind: "mutation",
21166
+ auth: "admin"
21167
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
21168
+ kind: "query",
21169
+ auth: "admin"
21170
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
21171
+ kind: "mutation",
21172
+ auth: "admin"
20870
21173
  });
20871
21174
  /**
20872
21175
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -22458,6 +22761,12 @@ Object.freeze({
22458
22761
  addonId: null,
22459
22762
  access: "view"
22460
22763
  },
22764
+ "deviceManager.getDeviceStatusAggregateBatch": {
22765
+ capName: "device-manager",
22766
+ capScope: "system",
22767
+ addonId: null,
22768
+ access: "view"
22769
+ },
22461
22770
  "deviceManager.getLinkedDevices": {
22462
22771
  capName: "device-manager",
22463
22772
  capScope: "system",
@@ -23352,6 +23661,12 @@ Object.freeze({
23352
23661
  addonId: null,
23353
23662
  access: "view"
23354
23663
  },
23664
+ "localNetwork.getNotificationEndpoint": {
23665
+ capName: "local-network",
23666
+ capScope: "system",
23667
+ addonId: null,
23668
+ access: "view"
23669
+ },
23355
23670
  "localNetwork.getPreferred": {
23356
23671
  capName: "local-network",
23357
23672
  capScope: "system",
@@ -23376,6 +23691,12 @@ Object.freeze({
23376
23691
  addonId: null,
23377
23692
  access: "create"
23378
23693
  },
23694
+ "localNetwork.setNotificationEndpoint": {
23695
+ capName: "local-network",
23696
+ capScope: "system",
23697
+ addonId: null,
23698
+ access: "create"
23699
+ },
23379
23700
  "lockControl.lock": {
23380
23701
  capName: "lock-control",
23381
23702
  capScope: "device",
@@ -24018,6 +24339,12 @@ Object.freeze({
24018
24339
  addonId: null,
24019
24340
  access: "create"
24020
24341
  },
24342
+ "pipelineAnalytics.cancelMediaRelocate": {
24343
+ capName: "pipeline-analytics",
24344
+ capScope: "device",
24345
+ addonId: null,
24346
+ access: "create"
24347
+ },
24021
24348
  "pipelineAnalytics.clearTracks": {
24022
24349
  capName: "pipeline-analytics",
24023
24350
  capScope: "device",
@@ -24072,6 +24399,12 @@ Object.freeze({
24072
24399
  addonId: null,
24073
24400
  access: "view"
24074
24401
  },
24402
+ "pipelineAnalytics.getMediaRelocateStatus": {
24403
+ capName: "pipeline-analytics",
24404
+ capScope: "device",
24405
+ addonId: null,
24406
+ access: "view"
24407
+ },
24075
24408
  "pipelineAnalytics.getMotionEvents": {
24076
24409
  capName: "pipeline-analytics",
24077
24410
  capScope: "device",
@@ -24144,6 +24477,12 @@ Object.freeze({
24144
24477
  addonId: null,
24145
24478
  access: "create"
24146
24479
  },
24480
+ "pipelineAnalytics.relocateMedia": {
24481
+ capName: "pipeline-analytics",
24482
+ capScope: "device",
24483
+ addonId: null,
24484
+ access: "create"
24485
+ },
24147
24486
  "pipelineAnalytics.searchObjectEvents": {
24148
24487
  capName: "pipeline-analytics",
24149
24488
  capScope: "device",
@@ -24906,6 +25245,12 @@ Object.freeze({
24906
25245
  addonId: null,
24907
25246
  access: "create"
24908
25247
  },
25248
+ "recording.cancelRelocate": {
25249
+ capName: "recording",
25250
+ capScope: "system",
25251
+ addonId: null,
25252
+ access: "create"
25253
+ },
24909
25254
  "recording.deleteFootprint": {
24910
25255
  capName: "recording",
24911
25256
  capScope: "system",
@@ -24936,6 +25281,12 @@ Object.freeze({
24936
25281
  addonId: null,
24937
25282
  access: "view"
24938
25283
  },
25284
+ "recording.getRelocateStatus": {
25285
+ capName: "recording",
25286
+ capScope: "system",
25287
+ addonId: null,
25288
+ access: "view"
25289
+ },
24939
25290
  "recording.getStorageUsage": {
24940
25291
  capName: "recording",
24941
25292
  capScope: "system",
@@ -24966,6 +25317,24 @@ Object.freeze({
24966
25317
  addonId: null,
24967
25318
  access: "view"
24968
25319
  },
25320
+ "recording.relocateFootage": {
25321
+ capName: "recording",
25322
+ capScope: "system",
25323
+ addonId: null,
25324
+ access: "create"
25325
+ },
25326
+ "recording.renderClip": {
25327
+ capName: "recording",
25328
+ capScope: "system",
25329
+ addonId: null,
25330
+ access: "create"
25331
+ },
25332
+ "recording.renderGif": {
25333
+ capName: "recording",
25334
+ capScope: "system",
25335
+ addonId: null,
25336
+ access: "create"
25337
+ },
24969
25338
  "recording.rescanStorage": {
24970
25339
  capName: "recording",
24971
25340
  capScope: "system",
@@ -25560,6 +25929,12 @@ Object.freeze({
25560
25929
  addonId: null,
25561
25930
  access: "create"
25562
25931
  },
25932
+ "streamBroker.renderPreBufferClip": {
25933
+ capName: "stream-broker",
25934
+ capScope: "system",
25935
+ addonId: null,
25936
+ access: "create"
25937
+ },
25563
25938
  "streamBroker.restartProfile": {
25564
25939
  capName: "stream-broker",
25565
25940
  capScope: "system",