@camstack/addon-provider-amcrest 0.2.6 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +463 -76
  2. package/dist/addon.mjs +463 -76
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -5,7 +5,7 @@ import { networkInterfaces } from "node:os";
5
5
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
6
6
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
7
7
  //#endregion
8
- //#region ../types/dist/event-category-BLcNejAE.mjs
8
+ //#region ../types/dist/event-category-Bz24uP1U.mjs
9
9
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
10
10
  EventCategory["SystemBoot"] = "system.boot";
11
11
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -276,6 +276,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
276
276
  */
277
277
  EventCategory["DeviceStateChanged"] = "device.state-changed";
278
278
  /**
279
+ * Frame occupancy for a camera CHANGED — a tracked object was gained or
280
+ * lost. Carries `{ deviceId, totalObjects, byClass, zones }`.
281
+ *
282
+ * Emitted only on a change, so a steady scene is silent. It exists so a
283
+ * client can stop polling `zoneAnalytics.getCurrentSnapshot`: that was the
284
+ * one live badge with no push signal at all, and it cost a request every
285
+ * four seconds per visible camera.
286
+ *
287
+ * Like every event it is telemetry and may be dropped ([D8]) — a consumer
288
+ * keeps a slow reconcile rather than trusting it alone.
289
+ */
290
+ EventCategory["ZoneAnalyticsOccupancyChanged"] = "zone-analytics.occupancy-changed";
291
+ /**
279
292
  * Cap event fired by every device that registers the `battery`
280
293
  * capability. Mirrors the cap definition's `onStatusChanged`. Carries
281
294
  * `{ deviceId, status: BatteryStatus }`. Subscribers (alert center,
@@ -7193,35 +7206,22 @@ var ConvertResultSchema = object({
7193
7206
  */
7194
7207
  var RecordingWeekdaySchema = number().int().min(0).max(6);
7195
7208
  var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
7196
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
7197
- kind: literal("timeOfDay"),
7198
- start: string().regex(HHMM),
7199
- end: string().regex(HHMM),
7200
- /** Restrict to these weekdays; omit = every day. */
7201
- days: array(RecordingWeekdaySchema).optional()
7202
- })]);
7203
- var RecordingModeSchema = _enum([
7204
- "continuous",
7205
- "onMotion",
7206
- "onAudioThreshold"
7207
- ]);
7208
7209
  /**
7209
- * First-class, authoritative per-camera storage mode — the explicit choice the
7210
- * UI reads directly (never inferred from `rules`):
7211
- * - `off` — not recording.
7212
- * - `events` — record only around triggers (motion / audio threshold),
7213
- * with pre/post-buffer.
7214
- * - `continuous` — record 24/7 within the schedule.
7210
+ * DERIVED per-camera storage summary — the single field cheap consumers read
7211
+ * (the viewer's status dot, the camera list) instead of walking `bands`:
7212
+ * - `off` — no band covers the camera (or it is disabled).
7213
+ * - `events` — every band records around triggers only.
7214
+ * - `continuous` — at least one band records continuously.
7215
7215
  *
7216
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
7217
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
7216
+ * NEVER authored: the recorder stamps it from the authoritative `bands` on
7217
+ * every save (`activeModeForConfig`). Writing it has no effect.
7218
7218
  */
7219
7219
  var RecordingStorageModeSchema = _enum([
7220
7220
  "off",
7221
7221
  "events",
7222
7222
  "continuous"
7223
7223
  ]);
7224
- /** Which detectors trigger an `events`-mode recording. */
7224
+ /** Which detectors trigger an `events`-mode band. */
7225
7225
  var RecordingTriggersSchema = object({
7226
7226
  motion: boolean().optional(),
7227
7227
  audioThresholdDbfs: number().optional()
@@ -7257,18 +7257,6 @@ var RecordingBandSchema = object({
7257
7257
  preBufferSec: number().min(0).optional(),
7258
7258
  postBufferSec: number().min(0).optional()
7259
7259
  });
7260
- var RecordingRuleSchema = object({
7261
- schedule: RecordingScheduleSchema,
7262
- mode: RecordingModeSchema,
7263
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
7264
- preBufferSec: number().min(0).default(0),
7265
- /** Keep recording until this many seconds after the last trigger. */
7266
- postBufferSec: number().min(0).default(0),
7267
- /** Each new trigger restarts the post-buffer window. */
7268
- resetTimeoutOnNewEvent: boolean().default(true),
7269
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
7270
- thresholdDbfs: number().optional()
7271
- });
7272
7260
  /**
7273
7261
  * Per-device retention overrides. Every field is optional; an unset or `0`
7274
7262
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7302,40 +7290,28 @@ var ScrubThumbnailPresetSchema = _enum([
7302
7290
  /**
7303
7291
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7304
7292
  *
7305
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
7306
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
7307
- * only for transition + migration (`migrateRulesToMode`); the policy engine
7308
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
7293
+ * `bands` is the ONLY authored recording intent: what to record, when, and on
7294
+ * which trigger. `mode` is a derived summary the recorder stamps on save; every
7295
+ * other field is a storage knob (profiles, segment length, retention, scrub).
7296
+ *
7297
+ * STRICT on purpose: the legacy authoring surface (`schedule`/`schedules`/
7298
+ * `triggers`/`preBufferSec`/`postBufferSec`/`rules`) was retired 2026-07-30.
7299
+ * A stale caller must fail loudly — silently stripping its legacy intent would
7300
+ * persist a band-less config, i.e. silently stop recording the camera.
7309
7301
  */
7310
7302
  var RecordingConfigSchema = object({
7311
7303
  enabled: boolean(),
7312
- /** Authoritative storage mode. Absent on legacy targets derived once via
7313
- * `migrateRulesToMode`, then persisted. */
7304
+ /** DERIVED summary of `bands`, stamped by the recorder on every save.
7305
+ * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7314
7306
  mode: RecordingStorageModeSchema.optional(),
7315
7307
  profiles: array(CamProfileSchema).optional(),
7316
7308
  segmentSeconds: number().int().positive().optional(),
7317
- /** Shared recording time-bands for `events` & `continuous` — record only when
7318
- * the wall-clock falls inside one of these windows. Omit or empty = always.
7319
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
7320
- schedules: array(RecordingScheduleSchema).optional(),
7321
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
7322
- * normalized into `schedules` on read and never written going forward. (Not
7323
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
7324
- schedule: RecordingScheduleSchema.optional(),
7325
- /** `events`-mode only — which detectors trigger a recording. */
7326
- triggers: RecordingTriggersSchema.optional(),
7327
- /** `events`-mode only — seconds retained before / after a trigger. */
7328
- preBufferSec: number().min(0).optional(),
7329
- postBufferSec: number().min(0).optional(),
7330
- /** DEPRECATED authoring input; retained for migration/transition. */
7331
- rules: array(RecordingRuleSchema).optional(),
7332
7309
  /**
7333
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
7334
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
7335
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
7336
- * derived into bands once via `migrateConfigToBands`.
7310
+ * AUTHORITATIVE mode-per-band recording model the single source of truth
7311
+ * the recorder's band engine consumes. An empty array = record nothing;
7312
+ * "off" is the absence of a covering band, never a band value.
7337
7313
  */
7338
- bands: array(RecordingBandSchema).optional(),
7314
+ bands: array(RecordingBandSchema).default([]),
7339
7315
  retention: RecordingRetentionSchema.optional(),
7340
7316
  /**
7341
7317
  * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
@@ -7343,8 +7319,15 @@ var RecordingConfigSchema = object({
7343
7319
  * windows only — existing sheets are immutable, and each window's index
7344
7320
  * carries its own tile dims so mixed-preset history renders correctly.
7345
7321
  */
7346
- scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7347
- });
7322
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional(),
7323
+ /**
7324
+ * OPT-IN thumbnail-strip generation for this camera: every keyframe of the
7325
+ * low recording saved as a JPEG (the fast-drag scrub depth), a derived
7326
+ * cache that eviction reclaims with the footage. Absent/false = no strips
7327
+ * are written and scrub reads exact keyframes at every velocity.
7328
+ */
7329
+ stripsEnabled: boolean().optional()
7330
+ }).strict();
7348
7331
  /**
7349
7332
  * Ops-log — the durable, append-only operations audit shared by the
7350
7333
  * recordings and events management surfaces.
@@ -7363,7 +7346,8 @@ var OpsLogOpSchema = _enum([
7363
7346
  "prune",
7364
7347
  "manual-delete",
7365
7348
  "rescan",
7366
- "retention-run"
7349
+ "retention-run",
7350
+ "relocate"
7367
7351
  ]);
7368
7352
  /** Why the operation ran. */
7369
7353
  var OpsLogReasonSchema = _enum([
@@ -7402,6 +7386,55 @@ var OpsLogQueryInputSchema = object({
7402
7386
  limit: number().int().min(1).max(1e3).optional()
7403
7387
  });
7404
7388
  /**
7389
+ * Entity-relocation job state (storage entity-routing spec, Phase 4).
7390
+ *
7391
+ * One shape shared by the recorder's `relocateFootage` (segments + strips) and
7392
+ * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7393
+ * page renders both movers with one component. Jobs are in-RAM (a restart
7394
+ * forgets them — re-running is safe by construction: copy-if-absent, delete
7395
+ * after verify) and each completed/failed run also lands one durable ops-log
7396
+ * row on the owning addon's surface.
7397
+ */
7398
+ var RelocateJobStateSchema = _enum([
7399
+ "running",
7400
+ "done",
7401
+ "failed",
7402
+ "cancelled"
7403
+ ]);
7404
+ var RelocateJobSchema = object({
7405
+ jobId: string(),
7406
+ state: RelocateJobStateSchema,
7407
+ /** Source location — for media relocation this is informational ('*': rows
7408
+ * move from wherever they are to the target). */
7409
+ fromLocationId: string(),
7410
+ toLocationId: string(),
7411
+ /** Scoped device, or null = every device. */
7412
+ deviceId: number().nullable(),
7413
+ /** What the job moves (owner-addon specific: segments/strips or media). */
7414
+ entities: array(string()),
7415
+ filesMoved: number().int(),
7416
+ bytesMoved: number().int(),
7417
+ /** Total files discovered up front; null while (or when) unknown. */
7418
+ filesTotal: number().int().nullable(),
7419
+ startedAt: number(),
7420
+ finishedAt: number().nullable(),
7421
+ error: string().nullable()
7422
+ });
7423
+ var RelocateFootageInputSchema = object({
7424
+ deviceId: number().optional(),
7425
+ fromLocationId: string(),
7426
+ toLocationId: string(),
7427
+ entities: array(_enum(["segments", "strips"])).optional(),
7428
+ /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7429
+ * never allowed to starve live writers. */
7430
+ throttleMbps: number().min(1).max(1e3).optional()
7431
+ });
7432
+ var RelocateMediaInputSchema = object({
7433
+ deviceId: number().optional(),
7434
+ toLocationId: string(),
7435
+ throttleMbps: number().min(1).max(1e3).optional()
7436
+ });
7437
+ /**
7405
7438
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7406
7439
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7407
7440
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -7451,6 +7484,13 @@ var StorageLocationSchema = object({
7451
7484
  nodeId: string().optional(),
7452
7485
  isDefault: boolean().default(false),
7453
7486
  isSystem: boolean().default(false),
7487
+ /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7488
+ * for node-local locations it can reach) — never persisted, absent when the
7489
+ * volume is remote/unreachable. The single capacity truth every UI reads. */
7490
+ capacity: object({
7491
+ totalBytes: number(),
7492
+ availableBytes: number()
7493
+ }).nullable().optional(),
7454
7494
  createdAt: number(),
7455
7495
  updatedAt: number()
7456
7496
  });
@@ -8218,7 +8258,8 @@ var NcTaxonomyEntrySchema = object({
8218
8258
  /** Macro/category parent for grouping ('car' → 'vehicle'); null for a top. */
8219
8259
  parentKind: string().nullable()
8220
8260
  });
8221
- object({
8261
+ /** The complete NC picker taxonomy — three grouped buckets. */
8262
+ var NcTaxonomySchema = object({
8222
8263
  videoClasses: array(NcTaxonomyEntrySchema),
8223
8264
  audioKinds: array(NcTaxonomyEntrySchema),
8224
8265
  labels: array(NcTaxonomyEntrySchema)
@@ -9211,6 +9252,7 @@ function startReachabilityPoll(options) {
9211
9252
  timer = void 0;
9212
9253
  } };
9213
9254
  }
9255
+ new Set(["devices", "classes"]);
9214
9256
  /**
9215
9257
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
9216
9258
  * motion-zones, and the detection zones/lines editor all speak this one
@@ -9369,6 +9411,29 @@ var NcOccupancyConditionSchema = object({
9369
9411
  count: number().int().min(0).default(1),
9370
9412
  sustainSeconds: number().int().min(0).max(3600).default(15)
9371
9413
  });
9414
+ /**
9415
+ * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
9416
+ *
9417
+ * The values are not symmetric, and deliberately so — the absent value has to
9418
+ * mean exactly what every rule authored before this condition existed already
9419
+ * does:
9420
+ * - `enter` — entries and every NON-crossing record (movement state,
9421
+ * package, sensor). Exits are rejected. **This is the absent behaviour**:
9422
+ * an operator who never asked for exits must not start receiving them.
9423
+ * - `exit` — ONLY an exit crossing. A record that is not a crossing at all
9424
+ * fails closed, because "the car left the drive" is a question about a
9425
+ * boundary, not about a detection.
9426
+ * - `any` — no direction filter; entries, exits and non-crossings alike.
9427
+ *
9428
+ * A rule asking for a direction should normally also scope `zones`, which the
9429
+ * engine evaluates against the crossed zone as well as the current membership
9430
+ * (an exit's membership no longer contains the zone it just left).
9431
+ */
9432
+ var NcCrossingSchema = _enum([
9433
+ "enter",
9434
+ "exit",
9435
+ "any"
9436
+ ]);
9372
9437
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
9373
9438
  var NcZoneConditionSchema = object({
9374
9439
  ids: array(string().min(1)).min(1),
@@ -9393,6 +9458,13 @@ var NcConditionsSchema = object({
9393
9458
  /** Veto zones — any hit fails the rule. */
9394
9459
  zonesExclude: array(string().min(1)).optional(),
9395
9460
  /**
9461
+ * Zone-crossing direction. IMMEDIATE only — a crossing is a per-event fact
9462
+ * and a closed track carries none, so a `track-end` rule asking for one
9463
+ * fails closed (use `zones`, which tests `zonesVisited`). ABSENT = `enter`,
9464
+ * which is exactly today's behaviour. See {@link NcCrossingSchema}.
9465
+ */
9466
+ crossing: NcCrossingSchema.optional(),
9467
+ /**
9396
9468
  * Exact (case-insensitive) match on the record's collapsed `label`
9397
9469
  * (identity name / plate text / subclass).
9398
9470
  */
@@ -9527,17 +9599,85 @@ var NcRuleTargetSchema = object({
9527
9599
  * - `keyFrame` — the clean scene frame (no subject box).
9528
9600
  * - `none` — no attachment.
9529
9601
  */
9530
- var NcMediaPolicySchema = object({ attach: _enum([
9531
- "best",
9532
- "best-matching",
9533
- "keyFrame",
9534
- "none"
9535
- ]).default("best") });
9602
+ /**
9603
+ * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
9604
+ * conflate it with the selection strategy and betray the request: asking for
9605
+ * the clean scene frame on an object-event owner used to start at
9606
+ * `fullFrameBoxed`, i.e. the annotated frame (2026-07-30).
9607
+ * - `cropped` — the subject, tight. What "who is at the door" wants.
9608
+ * - `full` — the clean scene, no annotation. What "what is going on" wants.
9609
+ * - `boxed` — the scene WITH the detection boxes drawn, for verifying what
9610
+ * the pipeline actually saw.
9611
+ */
9612
+ var NcMediaFrameSchema = _enum([
9613
+ "cropped",
9614
+ "full",
9615
+ "boxed"
9616
+ ]);
9617
+ var NcMediaPolicySchema = object({
9618
+ attach: _enum([
9619
+ "best",
9620
+ "best-matching",
9621
+ "keyFrame",
9622
+ "none"
9623
+ ]).default("best"),
9624
+ /** What the still shows. Absent = `cropped` (the historical `best` shape). */
9625
+ frame: NcMediaFrameSchema.optional(),
9626
+ /** Crop the attached still to the rule's condition-zone bbox (padded) —
9627
+ * "show me the ZONE", not the whole scene or the subject crop. */
9628
+ zoneCrop: boolean().optional(),
9629
+ /**
9630
+ * Also attach a short GIF cut from the stream broker's clip ring around the
9631
+ * event — NOT from the recording, so the camera does not have to be
9632
+ * recording, and the window sits AROUND the moment instead of a segment
9633
+ * behind it. Fail-closed: a window the ring does not cover contributes no
9634
+ * gif, never a failed notification.
9635
+ */
9636
+ gif: boolean().optional(),
9637
+ /**
9638
+ * Also attach a short MP4 CLIP of the same cut. Same source and the same
9639
+ * fail-closed rule as `gif`. Prefer it where the backend takes video
9640
+ * (telegram, discord, zentik, webhook); backends that do not are handled by
9641
+ * the degrade engine, which drops the video and keeps the still.
9642
+ */
9643
+ clip: boolean().optional(),
9644
+ /** Seconds of footage BEFORE / AFTER the event instant. Defaults 3 / 7. */
9645
+ clipPreRollSec: number().int().min(0).max(30).optional(),
9646
+ clipPostRollSec: number().int().min(0).max(30).optional(),
9647
+ /**
9648
+ * Which stream profile the footage is cut from. Absent = the CHEAPEST
9649
+ * assigned profile: a notification is watched on a phone, so the 4K
9650
+ * rendition would burn CPU to produce a file the client downscales anyway.
9651
+ * A profile that is not assigned falls back to the cheapest, and the render
9652
+ * reports which one actually ran.
9653
+ */
9654
+ profile: CamProfileSchema.optional()
9655
+ });
9656
+ /**
9657
+ * Cooldown GRANULARITY over the subject's class — how much a fired
9658
+ * notification suppresses.
9659
+ * - `shared` (default, and the absent value) — one window for the whole
9660
+ * rule/scope: a cat silences the next dog for `cooldownSec`.
9661
+ * - `per-class` — an independent window per detected class, so cat→dog fires
9662
+ * at once and cat→cat still waits.
9663
+ *
9664
+ * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
9665
+ * must not be swallowed by a bark's window (the precedent this generalizes —
9666
+ * see `cooldownKey` in the rule engine).
9667
+ */
9668
+ var NcThrottleGranularitySchema = _enum(["shared", "per-class"]);
9536
9669
  /** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
9537
9670
  var NcThrottleSchema = object({
9538
9671
  cooldownSec: number().int().min(0).max(86400).default(60),
9539
9672
  /** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
9540
- scope: _enum(["rule", "rule-device"]).default("rule-device")
9673
+ scope: _enum(["rule", "rule-device"]).default("rule-device"),
9674
+ /**
9675
+ * Class granularity of the cooldown key. Optional rather than defaulted:
9676
+ * a Zod default does NOT run on the addon→addon cap path, so a persisted
9677
+ * rule authored before this field simply carries none — and the engine
9678
+ * reads absent as `shared`, the pre-existing behaviour.
9679
+ */
9680
+ granularity: NcThrottleGranularitySchema.optional()
9541
9681
  });
9542
9682
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
9543
9683
  var NcRuleInputSchema = object({
@@ -9546,7 +9686,19 @@ var NcRuleInputSchema = object({
9546
9686
  delivery: NcDeliverySchema,
9547
9687
  conditions: NcConditionsSchema.default({}),
9548
9688
  schedule: NcScheduleSchema.optional(),
9549
- targets: array(NcRuleTargetSchema).min(1),
9689
+ /** May be empty when `targetUsers` addresses at least one user — the
9690
+ * "at least one addressee" invariant is enforced by the provider, because
9691
+ * a cross-field refine here would break `NcRulePatchSchema.partial()`. */
9692
+ targets: array(NcRuleTargetSchema),
9693
+ /**
9694
+ * USERS this rule addresses in addition to `targets` (Phase 4). At fire
9695
+ * time each user fans out to the personal targets they own
9696
+ * (`config.ownerUserId`), filtered by that user's `allowedDevices` for the
9697
+ * firing camera — a user is never notified about a device they cannot open.
9698
+ * Per-user opt-outs (`disabledTargetIds`) still apply to the fanned-out
9699
+ * targets.
9700
+ */
9701
+ targetUsers: array(string()).optional(),
9550
9702
  media: NcMediaPolicySchema.default({ attach: "best" }),
9551
9703
  throttle: NcThrottleSchema.default({
9552
9704
  cooldownSec: 60,
@@ -9633,6 +9785,7 @@ var NcConditionDescriptorSchema = object({
9633
9785
  "schedule",
9634
9786
  "plateMatcher",
9635
9787
  "packagePhase",
9788
+ "crossingSelect",
9636
9789
  "polygonDraw",
9637
9790
  "occupancy"
9638
9791
  ]),
@@ -9759,7 +9912,10 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
9759
9912
  }), object({ results: array(NcTestResultSchema) }), {
9760
9913
  kind: "mutation",
9761
9914
  auth: "admin"
9762
- }), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9915
+ }), method(object({}), object({
9916
+ catalog: array(NcConditionDescriptorSchema),
9917
+ taxonomy: NcTaxonomySchema.optional()
9918
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9763
9919
  /**
9764
9920
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
9765
9921
  *
@@ -10768,6 +10924,28 @@ method(object({
10768
10924
  }), object({ success: literal(true) }), {
10769
10925
  kind: "mutation",
10770
10926
  auth: "admin"
10927
+ }), method(object({
10928
+ deviceId: number(),
10929
+ /** Absent = the LOWEST assigned profile — a notification attachment is
10930
+ * watched on a phone, and the cheap rendition is the right default. */
10931
+ profile: CamProfileSchema.optional(),
10932
+ aroundMs: number(),
10933
+ preRollSec: number().min(0).max(20).default(3),
10934
+ postRollSec: number().min(0).max(20).default(5),
10935
+ format: _enum(["gif", "mp4"]).default("gif"),
10936
+ maxWidth: number().int().min(120).max(1920).default(480),
10937
+ /** GIF only — MP4 keeps the source cadence. */
10938
+ fps: number().int().min(1).max(15).default(5)
10939
+ }), object({
10940
+ base64: string(),
10941
+ mime: string(),
10942
+ bytes: number().int(),
10943
+ /** The profile actually rendered (what the default resolved to). */
10944
+ profile: CamProfileSchema,
10945
+ durationMs: number()
10946
+ }), {
10947
+ kind: "mutation",
10948
+ auth: "admin"
10771
10949
  }), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string() }), BrokerStatsSchema), method(object({ brokerId: string() }), object({
10772
10950
  probed: boolean(),
10773
10951
  summary: string()
@@ -13898,6 +14076,18 @@ var motionCapability = {
13898
14076
  name: "motion",
13899
14077
  scope: "device",
13900
14078
  mode: "singleton",
14079
+ /**
14080
+ * Providers register per-device natives via `ctx.registerNativeCap`
14081
+ * (Hikvision/Reolink/Amcrest/Wyze/HA/Homematic/Alexa/Matter) — there is
14082
+ * NO system singleton provider. Without this flag `resolveCapMount`
14083
+ * derived `{ kind: 'singleton' }`, so `motion.getStatus`/`isDetected`
14084
+ * resolved via `registry.getSingleton('motion')` (always null) and every
14085
+ * call 412'd "provider not available" while bindings listed a live
14086
+ * `motion` native (2026-08-02). The flag routes the router through
14087
+ * `requireDeviceScoped` → `getProviderForDevice`, like `motion-trigger`,
14088
+ * `snapshot` and every other per-device native cap.
14089
+ */
14090
+ deviceNative: true,
13901
14091
  deviceTypes: [DeviceType.Camera, DeviceType.Sensor],
13902
14092
  methods: {
13903
14093
  /**
@@ -18830,7 +19020,10 @@ method(object({
18830
19020
  }), method(object({
18831
19021
  deviceId: number(),
18832
19022
  caps: array(string()).readonly().optional()
18833
- }), record(string(), unknown().nullable()));
19023
+ }), record(string(), unknown().nullable())), method(object({
19024
+ deviceIds: array(number()).readonly(),
19025
+ caps: array(string()).readonly().optional()
19026
+ }), record(string(), record(string(), unknown().nullable())));
18834
19027
  method(object({ deviceId: number() }), record(string(), record(string(), unknown()))), method(object({
18835
19028
  deviceId: number(),
18836
19029
  capName: string()
@@ -19761,6 +19954,36 @@ var TargetKindSchema = object({
19761
19954
  icon: string(),
19762
19955
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
19763
19956
  addonId: string(),
19957
+ /**
19958
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
19959
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
19960
+ * when the addon bundles no icon for that kind — the client then falls back
19961
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
19962
+ *
19963
+ * Root-relative on purpose: it resolves against whatever origin serves a web
19964
+ * client, and a native client joins it onto its own hub base.
19965
+ *
19966
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
19967
+ * field that survived only because the runtime cap-router forwards provider
19968
+ * output verbatim — so every consumer had to re-declare it by hand to stop
19969
+ * its own Zod parse from stripping it, and the whole arrangement would have
19970
+ * broken silently the moment output validation was tightened anywhere.
19971
+ */
19972
+ iconUrl: string().optional(),
19973
+ /**
19974
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
19975
+ *
19976
+ * The server knows this and therefore says it, because the client cannot
19977
+ * safely guess: a React-Native client renders SVG and raster through two
19978
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
19979
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
19980
+ * placeholder glyph for every vector icon while the web build looked fine.
19981
+ *
19982
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
19983
+ * not been updated — a client that cannot determine the type should prefer
19984
+ * its raster path, which is the safe default for an unknown image.
19985
+ */
19986
+ iconMediaType: string().optional(),
19764
19987
  configSchema: ConfigSchemaPassthrough,
19765
19988
  supportsDiscovery: boolean(),
19766
19989
  caps: TargetKindCapsSchema
@@ -20208,6 +20431,29 @@ var MotionEventSchema = object({
20208
20431
  * Absent on legacy rows ⇒ treat as `pipeline`.
20209
20432
  */
20210
20433
  var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
20434
+ /**
20435
+ * The confirmed zone crossing that produced an object event. Present ONLY on
20436
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
20437
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
20438
+ * appearance event carry none, so a rule asking for a direction fails closed
20439
+ * on them.
20440
+ *
20441
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
20442
+ * into its own event, so a frame in which a track enters A while leaving B
20443
+ * produces two events with two directions — never one ambiguous row.
20444
+ *
20445
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
20446
+ * membership the box has NOW, and by definition it no longer contains the zone
20447
+ * that was just left. Without the id here, a zone-scoped rule could never match
20448
+ * the exit it asked for.
20449
+ */
20450
+ var ZoneCrossingSchema = object({
20451
+ direction: _enum(["enter", "exit"]),
20452
+ /** Admin zone id crossed. */
20453
+ zoneId: string(),
20454
+ /** Zone display name at crossing time (falls back to the id). */
20455
+ zoneName: string().optional()
20456
+ });
20211
20457
  var ObjectEventSchema = object({
20212
20458
  ...BaseEventFields,
20213
20459
  kind: literal("object"),
@@ -20234,6 +20480,12 @@ var ObjectEventSchema = object({
20234
20480
  zones: array(string()).readonly().optional(),
20235
20481
  /** Omitted in slim projection. */
20236
20482
  state: TrackStateSchema.optional(),
20483
+ /**
20484
+ * The zone crossing this event IS, when it is one. Absent on every other
20485
+ * event kind (movement state, appearance, package) — see
20486
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
20487
+ */
20488
+ zoneCrossing: ZoneCrossingSchema.optional(),
20237
20489
  /** Detection-frame dimensions in pixels — let consumers normalize the
20238
20490
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
20239
20491
  frameWidth: number().optional(),
@@ -20492,6 +20744,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20492
20744
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
20493
20745
  kind: "mutation",
20494
20746
  auth: "admin"
20747
+ }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
20748
+ kind: "mutation",
20749
+ auth: "admin"
20750
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
20751
+ kind: "query",
20752
+ auth: "admin"
20753
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
20754
+ kind: "mutation",
20755
+ auth: "admin"
20495
20756
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
20496
20757
  kind: "query",
20497
20758
  auth: "admin"
@@ -23022,6 +23283,17 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
23022
23283
  */
23023
23284
  priority: number()
23024
23285
  })).readonly() });
23286
+ /**
23287
+ * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
23288
+ * AUTO (resolved from the candidate ranking at send time); `resolved` reports
23289
+ * what AUTO currently picks, so the UI can show the effective value either way.
23290
+ */
23291
+ var NotificationEndpointSchema = object({
23292
+ /** The operator's explicit choice, or null for AUTO. */
23293
+ baseUrl: string().nullable(),
23294
+ /** What the ranking currently resolves to (null when nothing is reachable). */
23295
+ resolved: string().nullable()
23296
+ });
23025
23297
  var AllowedAddressesSchema = object({
23026
23298
  /**
23027
23299
  * Allowlist of interface addresses operators have explicitly opted
@@ -23044,7 +23316,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
23044
23316
  * to avoid mixed-content blocks in the browser. The public
23045
23317
  * tunnel always emits `https://` regardless. */
23046
23318
  scheme: _enum(["http", "https"]).optional()
23047
- }), GetConnectionEndpointsResultSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
23319
+ }), 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" });
23048
23320
  /**
23049
23321
  * mesh-network — collection cap for mesh-VPN providers.
23050
23322
  *
@@ -23931,7 +24203,12 @@ var RecordingDeviceUsageSchema = object({
23931
24203
  var RecordingLocationUsageSchema = object({
23932
24204
  /** StorageLocation id; null for the legacy/degraded single-root fallback. */
23933
24205
  locationId: string().nullable(),
23934
- /** Bytes of recordings stored on this location. */
24206
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
24207
+ * is emitted per physical disk (2026-07-29): two locations on one root
24208
+ * previously rendered as two identical "disks" with a nonsensical used
24209
+ * split — hydrate attribution across aliases is arbitrary by nature. */
24210
+ locationIds: array(string()).optional(),
24211
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). */
23935
24212
  usedBytes: number(),
23936
24213
  /** Free bytes on the location's volume; null when capacity is unknown (remote). */
23937
24214
  availableBytes: number().nullable(),
@@ -24043,6 +24320,44 @@ method(object({
24043
24320
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
24044
24321
  kind: "query",
24045
24322
  auth: "admin"
24323
+ }), method(object({
24324
+ deviceId: number(),
24325
+ aroundMs: number(),
24326
+ preRollSec: number().min(0).max(30).default(2),
24327
+ postRollSec: number().min(0).max(30).default(5),
24328
+ maxWidth: number().int().min(120).max(1280).default(480),
24329
+ fps: number().int().min(1).max(15).default(5)
24330
+ }), object({
24331
+ gifBase64: string(),
24332
+ fromMs: number(),
24333
+ toMs: number()
24334
+ }), {
24335
+ kind: "mutation",
24336
+ auth: "admin"
24337
+ }), method(object({
24338
+ deviceId: number(),
24339
+ aroundMs: number(),
24340
+ preRollSec: number().min(0).max(30).default(3),
24341
+ postRollSec: number().min(0).max(30).default(7),
24342
+ maxWidth: number().int().min(160).max(1920).default(640)
24343
+ }), object({
24344
+ clipBase64: string(),
24345
+ mime: string(),
24346
+ fromMs: number(),
24347
+ toMs: number(),
24348
+ bytes: number().int()
24349
+ }), {
24350
+ kind: "mutation",
24351
+ auth: "admin"
24352
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
24353
+ kind: "mutation",
24354
+ auth: "admin"
24355
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
24356
+ kind: "query",
24357
+ auth: "admin"
24358
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
24359
+ kind: "mutation",
24360
+ auth: "admin"
24046
24361
  });
24047
24362
  /**
24048
24363
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -25845,6 +26160,12 @@ Object.freeze({
25845
26160
  addonId: null,
25846
26161
  access: "view"
25847
26162
  },
26163
+ "deviceManager.getDeviceStatusAggregateBatch": {
26164
+ capName: "device-manager",
26165
+ capScope: "system",
26166
+ addonId: null,
26167
+ access: "view"
26168
+ },
25848
26169
  "deviceManager.getLinkedDevices": {
25849
26170
  capName: "device-manager",
25850
26171
  capScope: "system",
@@ -26739,6 +27060,12 @@ Object.freeze({
26739
27060
  addonId: null,
26740
27061
  access: "view"
26741
27062
  },
27063
+ "localNetwork.getNotificationEndpoint": {
27064
+ capName: "local-network",
27065
+ capScope: "system",
27066
+ addonId: null,
27067
+ access: "view"
27068
+ },
26742
27069
  "localNetwork.getPreferred": {
26743
27070
  capName: "local-network",
26744
27071
  capScope: "system",
@@ -26763,6 +27090,12 @@ Object.freeze({
26763
27090
  addonId: null,
26764
27091
  access: "create"
26765
27092
  },
27093
+ "localNetwork.setNotificationEndpoint": {
27094
+ capName: "local-network",
27095
+ capScope: "system",
27096
+ addonId: null,
27097
+ access: "create"
27098
+ },
26766
27099
  "lockControl.lock": {
26767
27100
  capName: "lock-control",
26768
27101
  capScope: "device",
@@ -27405,6 +27738,12 @@ Object.freeze({
27405
27738
  addonId: null,
27406
27739
  access: "create"
27407
27740
  },
27741
+ "pipelineAnalytics.cancelMediaRelocate": {
27742
+ capName: "pipeline-analytics",
27743
+ capScope: "device",
27744
+ addonId: null,
27745
+ access: "create"
27746
+ },
27408
27747
  "pipelineAnalytics.clearTracks": {
27409
27748
  capName: "pipeline-analytics",
27410
27749
  capScope: "device",
@@ -27459,6 +27798,12 @@ Object.freeze({
27459
27798
  addonId: null,
27460
27799
  access: "view"
27461
27800
  },
27801
+ "pipelineAnalytics.getMediaRelocateStatus": {
27802
+ capName: "pipeline-analytics",
27803
+ capScope: "device",
27804
+ addonId: null,
27805
+ access: "view"
27806
+ },
27462
27807
  "pipelineAnalytics.getMotionEvents": {
27463
27808
  capName: "pipeline-analytics",
27464
27809
  capScope: "device",
@@ -27531,6 +27876,12 @@ Object.freeze({
27531
27876
  addonId: null,
27532
27877
  access: "create"
27533
27878
  },
27879
+ "pipelineAnalytics.relocateMedia": {
27880
+ capName: "pipeline-analytics",
27881
+ capScope: "device",
27882
+ addonId: null,
27883
+ access: "create"
27884
+ },
27534
27885
  "pipelineAnalytics.searchObjectEvents": {
27535
27886
  capName: "pipeline-analytics",
27536
27887
  capScope: "device",
@@ -28293,6 +28644,12 @@ Object.freeze({
28293
28644
  addonId: null,
28294
28645
  access: "create"
28295
28646
  },
28647
+ "recording.cancelRelocate": {
28648
+ capName: "recording",
28649
+ capScope: "system",
28650
+ addonId: null,
28651
+ access: "create"
28652
+ },
28296
28653
  "recording.deleteFootprint": {
28297
28654
  capName: "recording",
28298
28655
  capScope: "system",
@@ -28323,6 +28680,12 @@ Object.freeze({
28323
28680
  addonId: null,
28324
28681
  access: "view"
28325
28682
  },
28683
+ "recording.getRelocateStatus": {
28684
+ capName: "recording",
28685
+ capScope: "system",
28686
+ addonId: null,
28687
+ access: "view"
28688
+ },
28326
28689
  "recording.getStorageUsage": {
28327
28690
  capName: "recording",
28328
28691
  capScope: "system",
@@ -28353,6 +28716,24 @@ Object.freeze({
28353
28716
  addonId: null,
28354
28717
  access: "view"
28355
28718
  },
28719
+ "recording.relocateFootage": {
28720
+ capName: "recording",
28721
+ capScope: "system",
28722
+ addonId: null,
28723
+ access: "create"
28724
+ },
28725
+ "recording.renderClip": {
28726
+ capName: "recording",
28727
+ capScope: "system",
28728
+ addonId: null,
28729
+ access: "create"
28730
+ },
28731
+ "recording.renderGif": {
28732
+ capName: "recording",
28733
+ capScope: "system",
28734
+ addonId: null,
28735
+ access: "create"
28736
+ },
28356
28737
  "recording.rescanStorage": {
28357
28738
  capName: "recording",
28358
28739
  capScope: "system",
@@ -28947,6 +29328,12 @@ Object.freeze({
28947
29328
  addonId: null,
28948
29329
  access: "create"
28949
29330
  },
29331
+ "streamBroker.renderPreBufferClip": {
29332
+ capName: "stream-broker",
29333
+ capScope: "system",
29334
+ addonId: null,
29335
+ access: "create"
29336
+ },
28950
29337
  "streamBroker.restartProfile": {
28951
29338
  capName: "stream-broker",
28952
29339
  capScope: "system",