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