@camstack/addon-decoder-ffmpeg 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.
Files changed (3) hide show
  1. package/dist/index.js +451 -76
  2. package/dist/index.mjs +451 -76
  3. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { randomUUID } from "node:crypto";
2
2
  import { spawn } from "node:child_process";
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,
@@ -7196,35 +7209,22 @@ var ConvertResultSchema = object({
7196
7209
  */
7197
7210
  var RecordingWeekdaySchema = number().int().min(0).max(6);
7198
7211
  var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
7199
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
7200
- kind: literal("timeOfDay"),
7201
- start: string().regex(HHMM),
7202
- end: string().regex(HHMM),
7203
- /** Restrict to these weekdays; omit = every day. */
7204
- days: array(RecordingWeekdaySchema).optional()
7205
- })]);
7206
- var RecordingModeSchema = _enum([
7207
- "continuous",
7208
- "onMotion",
7209
- "onAudioThreshold"
7210
- ]);
7211
7212
  /**
7212
- * First-class, authoritative per-camera storage mode — the explicit choice the
7213
- * UI reads directly (never inferred from `rules`):
7214
- * - `off` — not recording.
7215
- * - `events` — record only around triggers (motion / audio threshold),
7216
- * with pre/post-buffer.
7217
- * - `continuous` — record 24/7 within the schedule.
7213
+ * DERIVED per-camera storage summary — the single field cheap consumers read
7214
+ * (the viewer's status dot, the camera list) instead of walking `bands`:
7215
+ * - `off` — no band covers the camera (or it is disabled).
7216
+ * - `events` — every band records around triggers only.
7217
+ * - `continuous` — at least one band records continuously.
7218
7218
  *
7219
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
7220
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
7219
+ * NEVER authored: the recorder stamps it from the authoritative `bands` on
7220
+ * every save (`activeModeForConfig`). Writing it has no effect.
7221
7221
  */
7222
7222
  var RecordingStorageModeSchema = _enum([
7223
7223
  "off",
7224
7224
  "events",
7225
7225
  "continuous"
7226
7226
  ]);
7227
- /** Which detectors trigger an `events`-mode recording. */
7227
+ /** Which detectors trigger an `events`-mode band. */
7228
7228
  var RecordingTriggersSchema = object({
7229
7229
  motion: boolean().optional(),
7230
7230
  audioThresholdDbfs: number().optional()
@@ -7260,18 +7260,6 @@ var RecordingBandSchema = object({
7260
7260
  preBufferSec: number().min(0).optional(),
7261
7261
  postBufferSec: number().min(0).optional()
7262
7262
  });
7263
- var RecordingRuleSchema = object({
7264
- schedule: RecordingScheduleSchema,
7265
- mode: RecordingModeSchema,
7266
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
7267
- preBufferSec: number().min(0).default(0),
7268
- /** Keep recording until this many seconds after the last trigger. */
7269
- postBufferSec: number().min(0).default(0),
7270
- /** Each new trigger restarts the post-buffer window. */
7271
- resetTimeoutOnNewEvent: boolean().default(true),
7272
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
7273
- thresholdDbfs: number().optional()
7274
- });
7275
7263
  /**
7276
7264
  * Per-device retention overrides. Every field is optional; an unset or `0`
7277
7265
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7305,40 +7293,28 @@ var ScrubThumbnailPresetSchema = _enum([
7305
7293
  /**
7306
7294
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7307
7295
  *
7308
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
7309
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
7310
- * only for transition + migration (`migrateRulesToMode`); the policy engine
7311
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
7296
+ * `bands` is the ONLY authored recording intent: what to record, when, and on
7297
+ * which trigger. `mode` is a derived summary the recorder stamps on save; every
7298
+ * other field is a storage knob (profiles, segment length, retention, scrub).
7299
+ *
7300
+ * STRICT on purpose: the legacy authoring surface (`schedule`/`schedules`/
7301
+ * `triggers`/`preBufferSec`/`postBufferSec`/`rules`) was retired 2026-07-30.
7302
+ * A stale caller must fail loudly — silently stripping its legacy intent would
7303
+ * persist a band-less config, i.e. silently stop recording the camera.
7312
7304
  */
7313
7305
  var RecordingConfigSchema = object({
7314
7306
  enabled: boolean(),
7315
- /** Authoritative storage mode. Absent on legacy targets derived once via
7316
- * `migrateRulesToMode`, then persisted. */
7307
+ /** DERIVED summary of `bands`, stamped by the recorder on every save.
7308
+ * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7317
7309
  mode: RecordingStorageModeSchema.optional(),
7318
7310
  profiles: array(CamProfileSchema).optional(),
7319
7311
  segmentSeconds: number().int().positive().optional(),
7320
- /** Shared recording time-bands for `events` & `continuous` — record only when
7321
- * the wall-clock falls inside one of these windows. Omit or empty = always.
7322
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
7323
- schedules: array(RecordingScheduleSchema).optional(),
7324
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
7325
- * normalized into `schedules` on read and never written going forward. (Not
7326
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
7327
- schedule: RecordingScheduleSchema.optional(),
7328
- /** `events`-mode only — which detectors trigger a recording. */
7329
- triggers: RecordingTriggersSchema.optional(),
7330
- /** `events`-mode only — seconds retained before / after a trigger. */
7331
- preBufferSec: number().min(0).optional(),
7332
- postBufferSec: number().min(0).optional(),
7333
- /** DEPRECATED authoring input; retained for migration/transition. */
7334
- rules: array(RecordingRuleSchema).optional(),
7335
7312
  /**
7336
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
7337
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
7338
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
7339
- * derived into bands once via `migrateConfigToBands`.
7313
+ * AUTHORITATIVE mode-per-band recording model the single source of truth
7314
+ * the recorder's band engine consumes. An empty array = record nothing;
7315
+ * "off" is the absence of a covering band, never a band value.
7340
7316
  */
7341
- bands: array(RecordingBandSchema).optional(),
7317
+ bands: array(RecordingBandSchema).default([]),
7342
7318
  retention: RecordingRetentionSchema.optional(),
7343
7319
  /**
7344
7320
  * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
@@ -7346,8 +7322,15 @@ var RecordingConfigSchema = object({
7346
7322
  * windows only — existing sheets are immutable, and each window's index
7347
7323
  * carries its own tile dims so mixed-preset history renders correctly.
7348
7324
  */
7349
- scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7350
- });
7325
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional(),
7326
+ /**
7327
+ * OPT-IN thumbnail-strip generation for this camera: every keyframe of the
7328
+ * low recording saved as a JPEG (the fast-drag scrub depth), a derived
7329
+ * cache that eviction reclaims with the footage. Absent/false = no strips
7330
+ * are written and scrub reads exact keyframes at every velocity.
7331
+ */
7332
+ stripsEnabled: boolean().optional()
7333
+ }).strict();
7351
7334
  /**
7352
7335
  * Ops-log — the durable, append-only operations audit shared by the
7353
7336
  * recordings and events management surfaces.
@@ -7366,7 +7349,8 @@ var OpsLogOpSchema = _enum([
7366
7349
  "prune",
7367
7350
  "manual-delete",
7368
7351
  "rescan",
7369
- "retention-run"
7352
+ "retention-run",
7353
+ "relocate"
7370
7354
  ]);
7371
7355
  /** Why the operation ran. */
7372
7356
  var OpsLogReasonSchema = _enum([
@@ -7405,6 +7389,55 @@ var OpsLogQueryInputSchema = object({
7405
7389
  limit: number().int().min(1).max(1e3).optional()
7406
7390
  });
7407
7391
  /**
7392
+ * Entity-relocation job state (storage entity-routing spec, Phase 4).
7393
+ *
7394
+ * One shape shared by the recorder's `relocateFootage` (segments + strips) and
7395
+ * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7396
+ * page renders both movers with one component. Jobs are in-RAM (a restart
7397
+ * forgets them — re-running is safe by construction: copy-if-absent, delete
7398
+ * after verify) and each completed/failed run also lands one durable ops-log
7399
+ * row on the owning addon's surface.
7400
+ */
7401
+ var RelocateJobStateSchema = _enum([
7402
+ "running",
7403
+ "done",
7404
+ "failed",
7405
+ "cancelled"
7406
+ ]);
7407
+ var RelocateJobSchema = object({
7408
+ jobId: string(),
7409
+ state: RelocateJobStateSchema,
7410
+ /** Source location — for media relocation this is informational ('*': rows
7411
+ * move from wherever they are to the target). */
7412
+ fromLocationId: string(),
7413
+ toLocationId: string(),
7414
+ /** Scoped device, or null = every device. */
7415
+ deviceId: number().nullable(),
7416
+ /** What the job moves (owner-addon specific: segments/strips or media). */
7417
+ entities: array(string()),
7418
+ filesMoved: number().int(),
7419
+ bytesMoved: number().int(),
7420
+ /** Total files discovered up front; null while (or when) unknown. */
7421
+ filesTotal: number().int().nullable(),
7422
+ startedAt: number(),
7423
+ finishedAt: number().nullable(),
7424
+ error: string().nullable()
7425
+ });
7426
+ var RelocateFootageInputSchema = object({
7427
+ deviceId: number().optional(),
7428
+ fromLocationId: string(),
7429
+ toLocationId: string(),
7430
+ entities: array(_enum(["segments", "strips"])).optional(),
7431
+ /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7432
+ * never allowed to starve live writers. */
7433
+ throttleMbps: number().min(1).max(1e3).optional()
7434
+ });
7435
+ var RelocateMediaInputSchema = object({
7436
+ deviceId: number().optional(),
7437
+ toLocationId: string(),
7438
+ throttleMbps: number().min(1).max(1e3).optional()
7439
+ });
7440
+ /**
7408
7441
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7409
7442
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7410
7443
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -7454,6 +7487,13 @@ var StorageLocationSchema = object({
7454
7487
  nodeId: string().optional(),
7455
7488
  isDefault: boolean().default(false),
7456
7489
  isSystem: boolean().default(false),
7490
+ /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7491
+ * for node-local locations it can reach) — never persisted, absent when the
7492
+ * volume is remote/unreachable. The single capacity truth every UI reads. */
7493
+ capacity: object({
7494
+ totalBytes: number(),
7495
+ availableBytes: number()
7496
+ }).nullable().optional(),
7457
7497
  createdAt: number(),
7458
7498
  updatedAt: number()
7459
7499
  });
@@ -8221,7 +8261,8 @@ var NcTaxonomyEntrySchema = object({
8221
8261
  /** Macro/category parent for grouping ('car' → 'vehicle'); null for a top. */
8222
8262
  parentKind: string().nullable()
8223
8263
  });
8224
- object({
8264
+ /** The complete NC picker taxonomy — three grouped buckets. */
8265
+ var NcTaxonomySchema = object({
8225
8266
  videoClasses: array(NcTaxonomyEntrySchema),
8226
8267
  audioKinds: array(NcTaxonomyEntrySchema),
8227
8268
  labels: array(NcTaxonomyEntrySchema)
@@ -8881,6 +8922,7 @@ var AccessoryKind = {
8881
8922
  };
8882
8923
  AccessoryKind.Siren, AccessoryKind.Floodlight, AccessoryKind.Spotlight, AccessoryKind.PirSensor, AccessoryKind.Chime, AccessoryKind.Autotrack, AccessoryKind.Nightvision, AccessoryKind.PrivacyMask;
8883
8924
  DeviceFeature.BatteryOperated;
8925
+ new Set(["devices", "classes"]);
8884
8926
  /**
8885
8927
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
8886
8928
  * motion-zones, and the detection zones/lines editor all speak this one
@@ -9039,6 +9081,29 @@ var NcOccupancyConditionSchema = object({
9039
9081
  count: number().int().min(0).default(1),
9040
9082
  sustainSeconds: number().int().min(0).max(3600).default(15)
9041
9083
  });
9084
+ /**
9085
+ * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
9086
+ *
9087
+ * The values are not symmetric, and deliberately so — the absent value has to
9088
+ * mean exactly what every rule authored before this condition existed already
9089
+ * does:
9090
+ * - `enter` — entries and every NON-crossing record (movement state,
9091
+ * package, sensor). Exits are rejected. **This is the absent behaviour**:
9092
+ * an operator who never asked for exits must not start receiving them.
9093
+ * - `exit` — ONLY an exit crossing. A record that is not a crossing at all
9094
+ * fails closed, because "the car left the drive" is a question about a
9095
+ * boundary, not about a detection.
9096
+ * - `any` — no direction filter; entries, exits and non-crossings alike.
9097
+ *
9098
+ * A rule asking for a direction should normally also scope `zones`, which the
9099
+ * engine evaluates against the crossed zone as well as the current membership
9100
+ * (an exit's membership no longer contains the zone it just left).
9101
+ */
9102
+ var NcCrossingSchema = _enum([
9103
+ "enter",
9104
+ "exit",
9105
+ "any"
9106
+ ]);
9042
9107
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
9043
9108
  var NcZoneConditionSchema = object({
9044
9109
  ids: array(string().min(1)).min(1),
@@ -9063,6 +9128,13 @@ var NcConditionsSchema = object({
9063
9128
  /** Veto zones — any hit fails the rule. */
9064
9129
  zonesExclude: array(string().min(1)).optional(),
9065
9130
  /**
9131
+ * Zone-crossing direction. IMMEDIATE only — a crossing is a per-event fact
9132
+ * and a closed track carries none, so a `track-end` rule asking for one
9133
+ * fails closed (use `zones`, which tests `zonesVisited`). ABSENT = `enter`,
9134
+ * which is exactly today's behaviour. See {@link NcCrossingSchema}.
9135
+ */
9136
+ crossing: NcCrossingSchema.optional(),
9137
+ /**
9066
9138
  * Exact (case-insensitive) match on the record's collapsed `label`
9067
9139
  * (identity name / plate text / subclass).
9068
9140
  */
@@ -9197,17 +9269,85 @@ var NcRuleTargetSchema = object({
9197
9269
  * - `keyFrame` — the clean scene frame (no subject box).
9198
9270
  * - `none` — no attachment.
9199
9271
  */
9200
- var NcMediaPolicySchema = object({ attach: _enum([
9201
- "best",
9202
- "best-matching",
9203
- "keyFrame",
9204
- "none"
9205
- ]).default("best") });
9272
+ /**
9273
+ * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
9274
+ * conflate it with the selection strategy and betray the request: asking for
9275
+ * the clean scene frame on an object-event owner used to start at
9276
+ * `fullFrameBoxed`, i.e. the annotated frame (2026-07-30).
9277
+ * - `cropped` — the subject, tight. What "who is at the door" wants.
9278
+ * - `full` — the clean scene, no annotation. What "what is going on" wants.
9279
+ * - `boxed` — the scene WITH the detection boxes drawn, for verifying what
9280
+ * the pipeline actually saw.
9281
+ */
9282
+ var NcMediaFrameSchema = _enum([
9283
+ "cropped",
9284
+ "full",
9285
+ "boxed"
9286
+ ]);
9287
+ var NcMediaPolicySchema = object({
9288
+ attach: _enum([
9289
+ "best",
9290
+ "best-matching",
9291
+ "keyFrame",
9292
+ "none"
9293
+ ]).default("best"),
9294
+ /** What the still shows. Absent = `cropped` (the historical `best` shape). */
9295
+ frame: NcMediaFrameSchema.optional(),
9296
+ /** Crop the attached still to the rule's condition-zone bbox (padded) —
9297
+ * "show me the ZONE", not the whole scene or the subject crop. */
9298
+ zoneCrop: boolean().optional(),
9299
+ /**
9300
+ * Also attach a short GIF cut from the stream broker's clip ring around the
9301
+ * event — NOT from the recording, so the camera does not have to be
9302
+ * recording, and the window sits AROUND the moment instead of a segment
9303
+ * behind it. Fail-closed: a window the ring does not cover contributes no
9304
+ * gif, never a failed notification.
9305
+ */
9306
+ gif: boolean().optional(),
9307
+ /**
9308
+ * Also attach a short MP4 CLIP of the same cut. Same source and the same
9309
+ * fail-closed rule as `gif`. Prefer it where the backend takes video
9310
+ * (telegram, discord, zentik, webhook); backends that do not are handled by
9311
+ * the degrade engine, which drops the video and keeps the still.
9312
+ */
9313
+ clip: boolean().optional(),
9314
+ /** Seconds of footage BEFORE / AFTER the event instant. Defaults 3 / 7. */
9315
+ clipPreRollSec: number().int().min(0).max(30).optional(),
9316
+ clipPostRollSec: number().int().min(0).max(30).optional(),
9317
+ /**
9318
+ * Which stream profile the footage is cut from. Absent = the CHEAPEST
9319
+ * assigned profile: a notification is watched on a phone, so the 4K
9320
+ * rendition would burn CPU to produce a file the client downscales anyway.
9321
+ * A profile that is not assigned falls back to the cheapest, and the render
9322
+ * reports which one actually ran.
9323
+ */
9324
+ profile: CamProfileSchema.optional()
9325
+ });
9326
+ /**
9327
+ * Cooldown GRANULARITY over the subject's class — how much a fired
9328
+ * notification suppresses.
9329
+ * - `shared` (default, and the absent value) — one window for the whole
9330
+ * rule/scope: a cat silences the next dog for `cooldownSec`.
9331
+ * - `per-class` — an independent window per detected class, so cat→dog fires
9332
+ * at once and cat→cat still waits.
9333
+ *
9334
+ * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
9335
+ * must not be swallowed by a bark's window (the precedent this generalizes —
9336
+ * see `cooldownKey` in the rule engine).
9337
+ */
9338
+ var NcThrottleGranularitySchema = _enum(["shared", "per-class"]);
9206
9339
  /** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
9207
9340
  var NcThrottleSchema = object({
9208
9341
  cooldownSec: number().int().min(0).max(86400).default(60),
9209
9342
  /** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
9210
- scope: _enum(["rule", "rule-device"]).default("rule-device")
9343
+ scope: _enum(["rule", "rule-device"]).default("rule-device"),
9344
+ /**
9345
+ * Class granularity of the cooldown key. Optional rather than defaulted:
9346
+ * a Zod default does NOT run on the addon→addon cap path, so a persisted
9347
+ * rule authored before this field simply carries none — and the engine
9348
+ * reads absent as `shared`, the pre-existing behaviour.
9349
+ */
9350
+ granularity: NcThrottleGranularitySchema.optional()
9211
9351
  });
9212
9352
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
9213
9353
  var NcRuleInputSchema = object({
@@ -9216,7 +9356,19 @@ var NcRuleInputSchema = object({
9216
9356
  delivery: NcDeliverySchema,
9217
9357
  conditions: NcConditionsSchema.default({}),
9218
9358
  schedule: NcScheduleSchema.optional(),
9219
- targets: array(NcRuleTargetSchema).min(1),
9359
+ /** May be empty when `targetUsers` addresses at least one user — the
9360
+ * "at least one addressee" invariant is enforced by the provider, because
9361
+ * a cross-field refine here would break `NcRulePatchSchema.partial()`. */
9362
+ targets: array(NcRuleTargetSchema),
9363
+ /**
9364
+ * USERS this rule addresses in addition to `targets` (Phase 4). At fire
9365
+ * time each user fans out to the personal targets they own
9366
+ * (`config.ownerUserId`), filtered by that user's `allowedDevices` for the
9367
+ * firing camera — a user is never notified about a device they cannot open.
9368
+ * Per-user opt-outs (`disabledTargetIds`) still apply to the fanned-out
9369
+ * targets.
9370
+ */
9371
+ targetUsers: array(string()).optional(),
9220
9372
  media: NcMediaPolicySchema.default({ attach: "best" }),
9221
9373
  throttle: NcThrottleSchema.default({
9222
9374
  cooldownSec: 60,
@@ -9303,6 +9455,7 @@ var NcConditionDescriptorSchema = object({
9303
9455
  "schedule",
9304
9456
  "plateMatcher",
9305
9457
  "packagePhase",
9458
+ "crossingSelect",
9306
9459
  "polygonDraw",
9307
9460
  "occupancy"
9308
9461
  ]),
@@ -9429,7 +9582,10 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
9429
9582
  }), object({ results: array(NcTestResultSchema) }), {
9430
9583
  kind: "mutation",
9431
9584
  auth: "admin"
9432
- }), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9585
+ }), method(object({}), object({
9586
+ catalog: array(NcConditionDescriptorSchema),
9587
+ taxonomy: NcTaxonomySchema.optional()
9588
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9433
9589
  /**
9434
9590
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
9435
9591
  *
@@ -10166,6 +10322,28 @@ method(object({
10166
10322
  }), object({ success: literal(true) }), {
10167
10323
  kind: "mutation",
10168
10324
  auth: "admin"
10325
+ }), method(object({
10326
+ deviceId: number(),
10327
+ /** Absent = the LOWEST assigned profile — a notification attachment is
10328
+ * watched on a phone, and the cheap rendition is the right default. */
10329
+ profile: CamProfileSchema.optional(),
10330
+ aroundMs: number(),
10331
+ preRollSec: number().min(0).max(20).default(3),
10332
+ postRollSec: number().min(0).max(20).default(5),
10333
+ format: _enum(["gif", "mp4"]).default("gif"),
10334
+ maxWidth: number().int().min(120).max(1920).default(480),
10335
+ /** GIF only — MP4 keeps the source cadence. */
10336
+ fps: number().int().min(1).max(15).default(5)
10337
+ }), object({
10338
+ base64: string(),
10339
+ mime: string(),
10340
+ bytes: number().int(),
10341
+ /** The profile actually rendered (what the default resolved to). */
10342
+ profile: CamProfileSchema,
10343
+ durationMs: number()
10344
+ }), {
10345
+ kind: "mutation",
10346
+ auth: "admin"
10169
10347
  }), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string() }), BrokerStatsSchema), method(object({ brokerId: string() }), object({
10170
10348
  probed: boolean(),
10171
10349
  summary: string()
@@ -15890,7 +16068,10 @@ method(object({
15890
16068
  }), method(object({
15891
16069
  deviceId: number(),
15892
16070
  caps: array(string()).readonly().optional()
15893
- }), record(string(), unknown().nullable()));
16071
+ }), record(string(), unknown().nullable())), method(object({
16072
+ deviceIds: array(number()).readonly(),
16073
+ caps: array(string()).readonly().optional()
16074
+ }), record(string(), record(string(), unknown().nullable())));
15894
16075
  method(object({ deviceId: number() }), record(string(), record(string(), unknown()))), method(object({
15895
16076
  deviceId: number(),
15896
16077
  capName: string()
@@ -16821,6 +17002,36 @@ var TargetKindSchema = object({
16821
17002
  icon: string(),
16822
17003
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
16823
17004
  addonId: string(),
17005
+ /**
17006
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
17007
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
17008
+ * when the addon bundles no icon for that kind — the client then falls back
17009
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
17010
+ *
17011
+ * Root-relative on purpose: it resolves against whatever origin serves a web
17012
+ * client, and a native client joins it onto its own hub base.
17013
+ *
17014
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
17015
+ * field that survived only because the runtime cap-router forwards provider
17016
+ * output verbatim — so every consumer had to re-declare it by hand to stop
17017
+ * its own Zod parse from stripping it, and the whole arrangement would have
17018
+ * broken silently the moment output validation was tightened anywhere.
17019
+ */
17020
+ iconUrl: string().optional(),
17021
+ /**
17022
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
17023
+ *
17024
+ * The server knows this and therefore says it, because the client cannot
17025
+ * safely guess: a React-Native client renders SVG and raster through two
17026
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
17027
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
17028
+ * placeholder glyph for every vector icon while the web build looked fine.
17029
+ *
17030
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
17031
+ * not been updated — a client that cannot determine the type should prefer
17032
+ * its raster path, which is the safe default for an unknown image.
17033
+ */
17034
+ iconMediaType: string().optional(),
16824
17035
  configSchema: ConfigSchemaPassthrough,
16825
17036
  supportsDiscovery: boolean(),
16826
17037
  caps: TargetKindCapsSchema
@@ -17268,6 +17479,29 @@ var MotionEventSchema = object({
17268
17479
  * Absent on legacy rows ⇒ treat as `pipeline`.
17269
17480
  */
17270
17481
  var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
17482
+ /**
17483
+ * The confirmed zone crossing that produced an object event. Present ONLY on
17484
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
17485
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
17486
+ * appearance event carry none, so a rule asking for a direction fails closed
17487
+ * on them.
17488
+ *
17489
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
17490
+ * into its own event, so a frame in which a track enters A while leaving B
17491
+ * produces two events with two directions — never one ambiguous row.
17492
+ *
17493
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
17494
+ * membership the box has NOW, and by definition it no longer contains the zone
17495
+ * that was just left. Without the id here, a zone-scoped rule could never match
17496
+ * the exit it asked for.
17497
+ */
17498
+ var ZoneCrossingSchema = object({
17499
+ direction: _enum(["enter", "exit"]),
17500
+ /** Admin zone id crossed. */
17501
+ zoneId: string(),
17502
+ /** Zone display name at crossing time (falls back to the id). */
17503
+ zoneName: string().optional()
17504
+ });
17271
17505
  var ObjectEventSchema = object({
17272
17506
  ...BaseEventFields,
17273
17507
  kind: literal("object"),
@@ -17294,6 +17528,12 @@ var ObjectEventSchema = object({
17294
17528
  zones: array(string()).readonly().optional(),
17295
17529
  /** Omitted in slim projection. */
17296
17530
  state: TrackStateSchema.optional(),
17531
+ /**
17532
+ * The zone crossing this event IS, when it is one. Absent on every other
17533
+ * event kind (movement state, appearance, package) — see
17534
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
17535
+ */
17536
+ zoneCrossing: ZoneCrossingSchema.optional(),
17297
17537
  /** Detection-frame dimensions in pixels — let consumers normalize the
17298
17538
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
17299
17539
  frameWidth: number().optional(),
@@ -17552,6 +17792,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17552
17792
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
17553
17793
  kind: "mutation",
17554
17794
  auth: "admin"
17795
+ }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
17796
+ kind: "mutation",
17797
+ auth: "admin"
17798
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
17799
+ kind: "query",
17800
+ auth: "admin"
17801
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
17802
+ kind: "mutation",
17803
+ auth: "admin"
17555
17804
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
17556
17805
  kind: "query",
17557
17806
  auth: "admin"
@@ -20031,6 +20280,17 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
20031
20280
  */
20032
20281
  priority: number()
20033
20282
  })).readonly() });
20283
+ /**
20284
+ * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
20285
+ * AUTO (resolved from the candidate ranking at send time); `resolved` reports
20286
+ * what AUTO currently picks, so the UI can show the effective value either way.
20287
+ */
20288
+ var NotificationEndpointSchema = object({
20289
+ /** The operator's explicit choice, or null for AUTO. */
20290
+ baseUrl: string().nullable(),
20291
+ /** What the ranking currently resolves to (null when nothing is reachable). */
20292
+ resolved: string().nullable()
20293
+ });
20034
20294
  var AllowedAddressesSchema = object({
20035
20295
  /**
20036
20296
  * Allowlist of interface addresses operators have explicitly opted
@@ -20053,7 +20313,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
20053
20313
  * to avoid mixed-content blocks in the browser. The public
20054
20314
  * tunnel always emits `https://` regardless. */
20055
20315
  scheme: _enum(["http", "https"]).optional()
20056
- }), GetConnectionEndpointsResultSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
20316
+ }), 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" });
20057
20317
  /**
20058
20318
  * mesh-network — collection cap for mesh-VPN providers.
20059
20319
  *
@@ -20852,7 +21112,12 @@ var RecordingDeviceUsageSchema = object({
20852
21112
  var RecordingLocationUsageSchema = object({
20853
21113
  /** StorageLocation id; null for the legacy/degraded single-root fallback. */
20854
21114
  locationId: string().nullable(),
20855
- /** Bytes of recordings stored on this location. */
21115
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
21116
+ * is emitted per physical disk (2026-07-29): two locations on one root
21117
+ * previously rendered as two identical "disks" with a nonsensical used
21118
+ * split — hydrate attribution across aliases is arbitrary by nature. */
21119
+ locationIds: array(string()).optional(),
21120
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). */
20856
21121
  usedBytes: number(),
20857
21122
  /** Free bytes on the location's volume; null when capacity is unknown (remote). */
20858
21123
  availableBytes: number().nullable(),
@@ -20964,6 +21229,44 @@ method(object({
20964
21229
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
20965
21230
  kind: "query",
20966
21231
  auth: "admin"
21232
+ }), method(object({
21233
+ deviceId: number(),
21234
+ aroundMs: number(),
21235
+ preRollSec: number().min(0).max(30).default(2),
21236
+ postRollSec: number().min(0).max(30).default(5),
21237
+ maxWidth: number().int().min(120).max(1280).default(480),
21238
+ fps: number().int().min(1).max(15).default(5)
21239
+ }), object({
21240
+ gifBase64: string(),
21241
+ fromMs: number(),
21242
+ toMs: number()
21243
+ }), {
21244
+ kind: "mutation",
21245
+ auth: "admin"
21246
+ }), method(object({
21247
+ deviceId: number(),
21248
+ aroundMs: number(),
21249
+ preRollSec: number().min(0).max(30).default(3),
21250
+ postRollSec: number().min(0).max(30).default(7),
21251
+ maxWidth: number().int().min(160).max(1920).default(640)
21252
+ }), object({
21253
+ clipBase64: string(),
21254
+ mime: string(),
21255
+ fromMs: number(),
21256
+ toMs: number(),
21257
+ bytes: number().int()
21258
+ }), {
21259
+ kind: "mutation",
21260
+ auth: "admin"
21261
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
21262
+ kind: "mutation",
21263
+ auth: "admin"
21264
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
21265
+ kind: "query",
21266
+ auth: "admin"
21267
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
21268
+ kind: "mutation",
21269
+ auth: "admin"
20967
21270
  });
20968
21271
  /**
20969
21272
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -22555,6 +22858,12 @@ Object.freeze({
22555
22858
  addonId: null,
22556
22859
  access: "view"
22557
22860
  },
22861
+ "deviceManager.getDeviceStatusAggregateBatch": {
22862
+ capName: "device-manager",
22863
+ capScope: "system",
22864
+ addonId: null,
22865
+ access: "view"
22866
+ },
22558
22867
  "deviceManager.getLinkedDevices": {
22559
22868
  capName: "device-manager",
22560
22869
  capScope: "system",
@@ -23449,6 +23758,12 @@ Object.freeze({
23449
23758
  addonId: null,
23450
23759
  access: "view"
23451
23760
  },
23761
+ "localNetwork.getNotificationEndpoint": {
23762
+ capName: "local-network",
23763
+ capScope: "system",
23764
+ addonId: null,
23765
+ access: "view"
23766
+ },
23452
23767
  "localNetwork.getPreferred": {
23453
23768
  capName: "local-network",
23454
23769
  capScope: "system",
@@ -23473,6 +23788,12 @@ Object.freeze({
23473
23788
  addonId: null,
23474
23789
  access: "create"
23475
23790
  },
23791
+ "localNetwork.setNotificationEndpoint": {
23792
+ capName: "local-network",
23793
+ capScope: "system",
23794
+ addonId: null,
23795
+ access: "create"
23796
+ },
23476
23797
  "lockControl.lock": {
23477
23798
  capName: "lock-control",
23478
23799
  capScope: "device",
@@ -24115,6 +24436,12 @@ Object.freeze({
24115
24436
  addonId: null,
24116
24437
  access: "create"
24117
24438
  },
24439
+ "pipelineAnalytics.cancelMediaRelocate": {
24440
+ capName: "pipeline-analytics",
24441
+ capScope: "device",
24442
+ addonId: null,
24443
+ access: "create"
24444
+ },
24118
24445
  "pipelineAnalytics.clearTracks": {
24119
24446
  capName: "pipeline-analytics",
24120
24447
  capScope: "device",
@@ -24169,6 +24496,12 @@ Object.freeze({
24169
24496
  addonId: null,
24170
24497
  access: "view"
24171
24498
  },
24499
+ "pipelineAnalytics.getMediaRelocateStatus": {
24500
+ capName: "pipeline-analytics",
24501
+ capScope: "device",
24502
+ addonId: null,
24503
+ access: "view"
24504
+ },
24172
24505
  "pipelineAnalytics.getMotionEvents": {
24173
24506
  capName: "pipeline-analytics",
24174
24507
  capScope: "device",
@@ -24241,6 +24574,12 @@ Object.freeze({
24241
24574
  addonId: null,
24242
24575
  access: "create"
24243
24576
  },
24577
+ "pipelineAnalytics.relocateMedia": {
24578
+ capName: "pipeline-analytics",
24579
+ capScope: "device",
24580
+ addonId: null,
24581
+ access: "create"
24582
+ },
24244
24583
  "pipelineAnalytics.searchObjectEvents": {
24245
24584
  capName: "pipeline-analytics",
24246
24585
  capScope: "device",
@@ -25003,6 +25342,12 @@ Object.freeze({
25003
25342
  addonId: null,
25004
25343
  access: "create"
25005
25344
  },
25345
+ "recording.cancelRelocate": {
25346
+ capName: "recording",
25347
+ capScope: "system",
25348
+ addonId: null,
25349
+ access: "create"
25350
+ },
25006
25351
  "recording.deleteFootprint": {
25007
25352
  capName: "recording",
25008
25353
  capScope: "system",
@@ -25033,6 +25378,12 @@ Object.freeze({
25033
25378
  addonId: null,
25034
25379
  access: "view"
25035
25380
  },
25381
+ "recording.getRelocateStatus": {
25382
+ capName: "recording",
25383
+ capScope: "system",
25384
+ addonId: null,
25385
+ access: "view"
25386
+ },
25036
25387
  "recording.getStorageUsage": {
25037
25388
  capName: "recording",
25038
25389
  capScope: "system",
@@ -25063,6 +25414,24 @@ Object.freeze({
25063
25414
  addonId: null,
25064
25415
  access: "view"
25065
25416
  },
25417
+ "recording.relocateFootage": {
25418
+ capName: "recording",
25419
+ capScope: "system",
25420
+ addonId: null,
25421
+ access: "create"
25422
+ },
25423
+ "recording.renderClip": {
25424
+ capName: "recording",
25425
+ capScope: "system",
25426
+ addonId: null,
25427
+ access: "create"
25428
+ },
25429
+ "recording.renderGif": {
25430
+ capName: "recording",
25431
+ capScope: "system",
25432
+ addonId: null,
25433
+ access: "create"
25434
+ },
25066
25435
  "recording.rescanStorage": {
25067
25436
  capName: "recording",
25068
25437
  capScope: "system",
@@ -25657,6 +26026,12 @@ Object.freeze({
25657
26026
  addonId: null,
25658
26027
  access: "create"
25659
26028
  },
26029
+ "streamBroker.renderPreBufferClip": {
26030
+ capName: "stream-broker",
26031
+ capScope: "system",
26032
+ addonId: null,
26033
+ access: "create"
26034
+ },
25660
26035
  "streamBroker.restartProfile": {
25661
26036
  capName: "stream-broker",
25662
26037
  capScope: "system",