@camstack/addon-provider-amcrest 0.2.6 → 0.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/addon.js +451 -76
  2. package/dist/addon.mjs +451 -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()
@@ -18830,7 +19008,10 @@ method(object({
18830
19008
  }), method(object({
18831
19009
  deviceId: number(),
18832
19010
  caps: array(string()).readonly().optional()
18833
- }), record(string(), unknown().nullable()));
19011
+ }), record(string(), unknown().nullable())), method(object({
19012
+ deviceIds: array(number()).readonly(),
19013
+ caps: array(string()).readonly().optional()
19014
+ }), record(string(), record(string(), unknown().nullable())));
18834
19015
  method(object({ deviceId: number() }), record(string(), record(string(), unknown()))), method(object({
18835
19016
  deviceId: number(),
18836
19017
  capName: string()
@@ -19761,6 +19942,36 @@ var TargetKindSchema = object({
19761
19942
  icon: string(),
19762
19943
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
19763
19944
  addonId: string(),
19945
+ /**
19946
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
19947
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
19948
+ * when the addon bundles no icon for that kind — the client then falls back
19949
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
19950
+ *
19951
+ * Root-relative on purpose: it resolves against whatever origin serves a web
19952
+ * client, and a native client joins it onto its own hub base.
19953
+ *
19954
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
19955
+ * field that survived only because the runtime cap-router forwards provider
19956
+ * output verbatim — so every consumer had to re-declare it by hand to stop
19957
+ * its own Zod parse from stripping it, and the whole arrangement would have
19958
+ * broken silently the moment output validation was tightened anywhere.
19959
+ */
19960
+ iconUrl: string().optional(),
19961
+ /**
19962
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
19963
+ *
19964
+ * The server knows this and therefore says it, because the client cannot
19965
+ * safely guess: a React-Native client renders SVG and raster through two
19966
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
19967
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
19968
+ * placeholder glyph for every vector icon while the web build looked fine.
19969
+ *
19970
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
19971
+ * not been updated — a client that cannot determine the type should prefer
19972
+ * its raster path, which is the safe default for an unknown image.
19973
+ */
19974
+ iconMediaType: string().optional(),
19764
19975
  configSchema: ConfigSchemaPassthrough,
19765
19976
  supportsDiscovery: boolean(),
19766
19977
  caps: TargetKindCapsSchema
@@ -20208,6 +20419,29 @@ var MotionEventSchema = object({
20208
20419
  * Absent on legacy rows ⇒ treat as `pipeline`.
20209
20420
  */
20210
20421
  var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
20422
+ /**
20423
+ * The confirmed zone crossing that produced an object event. Present ONLY on
20424
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
20425
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
20426
+ * appearance event carry none, so a rule asking for a direction fails closed
20427
+ * on them.
20428
+ *
20429
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
20430
+ * into its own event, so a frame in which a track enters A while leaving B
20431
+ * produces two events with two directions — never one ambiguous row.
20432
+ *
20433
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
20434
+ * membership the box has NOW, and by definition it no longer contains the zone
20435
+ * that was just left. Without the id here, a zone-scoped rule could never match
20436
+ * the exit it asked for.
20437
+ */
20438
+ var ZoneCrossingSchema = object({
20439
+ direction: _enum(["enter", "exit"]),
20440
+ /** Admin zone id crossed. */
20441
+ zoneId: string(),
20442
+ /** Zone display name at crossing time (falls back to the id). */
20443
+ zoneName: string().optional()
20444
+ });
20211
20445
  var ObjectEventSchema = object({
20212
20446
  ...BaseEventFields,
20213
20447
  kind: literal("object"),
@@ -20234,6 +20468,12 @@ var ObjectEventSchema = object({
20234
20468
  zones: array(string()).readonly().optional(),
20235
20469
  /** Omitted in slim projection. */
20236
20470
  state: TrackStateSchema.optional(),
20471
+ /**
20472
+ * The zone crossing this event IS, when it is one. Absent on every other
20473
+ * event kind (movement state, appearance, package) — see
20474
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
20475
+ */
20476
+ zoneCrossing: ZoneCrossingSchema.optional(),
20237
20477
  /** Detection-frame dimensions in pixels — let consumers normalize the
20238
20478
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
20239
20479
  frameWidth: number().optional(),
@@ -20492,6 +20732,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20492
20732
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
20493
20733
  kind: "mutation",
20494
20734
  auth: "admin"
20735
+ }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
20736
+ kind: "mutation",
20737
+ auth: "admin"
20738
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
20739
+ kind: "query",
20740
+ auth: "admin"
20741
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
20742
+ kind: "mutation",
20743
+ auth: "admin"
20495
20744
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
20496
20745
  kind: "query",
20497
20746
  auth: "admin"
@@ -23022,6 +23271,17 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
23022
23271
  */
23023
23272
  priority: number()
23024
23273
  })).readonly() });
23274
+ /**
23275
+ * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
23276
+ * AUTO (resolved from the candidate ranking at send time); `resolved` reports
23277
+ * what AUTO currently picks, so the UI can show the effective value either way.
23278
+ */
23279
+ var NotificationEndpointSchema = object({
23280
+ /** The operator's explicit choice, or null for AUTO. */
23281
+ baseUrl: string().nullable(),
23282
+ /** What the ranking currently resolves to (null when nothing is reachable). */
23283
+ resolved: string().nullable()
23284
+ });
23025
23285
  var AllowedAddressesSchema = object({
23026
23286
  /**
23027
23287
  * Allowlist of interface addresses operators have explicitly opted
@@ -23044,7 +23304,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
23044
23304
  * to avoid mixed-content blocks in the browser. The public
23045
23305
  * tunnel always emits `https://` regardless. */
23046
23306
  scheme: _enum(["http", "https"]).optional()
23047
- }), GetConnectionEndpointsResultSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
23307
+ }), 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
23308
  /**
23049
23309
  * mesh-network — collection cap for mesh-VPN providers.
23050
23310
  *
@@ -23931,7 +24191,12 @@ var RecordingDeviceUsageSchema = object({
23931
24191
  var RecordingLocationUsageSchema = object({
23932
24192
  /** StorageLocation id; null for the legacy/degraded single-root fallback. */
23933
24193
  locationId: string().nullable(),
23934
- /** Bytes of recordings stored on this location. */
24194
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
24195
+ * is emitted per physical disk (2026-07-29): two locations on one root
24196
+ * previously rendered as two identical "disks" with a nonsensical used
24197
+ * split — hydrate attribution across aliases is arbitrary by nature. */
24198
+ locationIds: array(string()).optional(),
24199
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). */
23935
24200
  usedBytes: number(),
23936
24201
  /** Free bytes on the location's volume; null when capacity is unknown (remote). */
23937
24202
  availableBytes: number().nullable(),
@@ -24043,6 +24308,44 @@ method(object({
24043
24308
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
24044
24309
  kind: "query",
24045
24310
  auth: "admin"
24311
+ }), method(object({
24312
+ deviceId: number(),
24313
+ aroundMs: number(),
24314
+ preRollSec: number().min(0).max(30).default(2),
24315
+ postRollSec: number().min(0).max(30).default(5),
24316
+ maxWidth: number().int().min(120).max(1280).default(480),
24317
+ fps: number().int().min(1).max(15).default(5)
24318
+ }), object({
24319
+ gifBase64: string(),
24320
+ fromMs: number(),
24321
+ toMs: number()
24322
+ }), {
24323
+ kind: "mutation",
24324
+ auth: "admin"
24325
+ }), method(object({
24326
+ deviceId: number(),
24327
+ aroundMs: number(),
24328
+ preRollSec: number().min(0).max(30).default(3),
24329
+ postRollSec: number().min(0).max(30).default(7),
24330
+ maxWidth: number().int().min(160).max(1920).default(640)
24331
+ }), object({
24332
+ clipBase64: string(),
24333
+ mime: string(),
24334
+ fromMs: number(),
24335
+ toMs: number(),
24336
+ bytes: number().int()
24337
+ }), {
24338
+ kind: "mutation",
24339
+ auth: "admin"
24340
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
24341
+ kind: "mutation",
24342
+ auth: "admin"
24343
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
24344
+ kind: "query",
24345
+ auth: "admin"
24346
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
24347
+ kind: "mutation",
24348
+ auth: "admin"
24046
24349
  });
24047
24350
  /**
24048
24351
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -25845,6 +26148,12 @@ Object.freeze({
25845
26148
  addonId: null,
25846
26149
  access: "view"
25847
26150
  },
26151
+ "deviceManager.getDeviceStatusAggregateBatch": {
26152
+ capName: "device-manager",
26153
+ capScope: "system",
26154
+ addonId: null,
26155
+ access: "view"
26156
+ },
25848
26157
  "deviceManager.getLinkedDevices": {
25849
26158
  capName: "device-manager",
25850
26159
  capScope: "system",
@@ -26739,6 +27048,12 @@ Object.freeze({
26739
27048
  addonId: null,
26740
27049
  access: "view"
26741
27050
  },
27051
+ "localNetwork.getNotificationEndpoint": {
27052
+ capName: "local-network",
27053
+ capScope: "system",
27054
+ addonId: null,
27055
+ access: "view"
27056
+ },
26742
27057
  "localNetwork.getPreferred": {
26743
27058
  capName: "local-network",
26744
27059
  capScope: "system",
@@ -26763,6 +27078,12 @@ Object.freeze({
26763
27078
  addonId: null,
26764
27079
  access: "create"
26765
27080
  },
27081
+ "localNetwork.setNotificationEndpoint": {
27082
+ capName: "local-network",
27083
+ capScope: "system",
27084
+ addonId: null,
27085
+ access: "create"
27086
+ },
26766
27087
  "lockControl.lock": {
26767
27088
  capName: "lock-control",
26768
27089
  capScope: "device",
@@ -27405,6 +27726,12 @@ Object.freeze({
27405
27726
  addonId: null,
27406
27727
  access: "create"
27407
27728
  },
27729
+ "pipelineAnalytics.cancelMediaRelocate": {
27730
+ capName: "pipeline-analytics",
27731
+ capScope: "device",
27732
+ addonId: null,
27733
+ access: "create"
27734
+ },
27408
27735
  "pipelineAnalytics.clearTracks": {
27409
27736
  capName: "pipeline-analytics",
27410
27737
  capScope: "device",
@@ -27459,6 +27786,12 @@ Object.freeze({
27459
27786
  addonId: null,
27460
27787
  access: "view"
27461
27788
  },
27789
+ "pipelineAnalytics.getMediaRelocateStatus": {
27790
+ capName: "pipeline-analytics",
27791
+ capScope: "device",
27792
+ addonId: null,
27793
+ access: "view"
27794
+ },
27462
27795
  "pipelineAnalytics.getMotionEvents": {
27463
27796
  capName: "pipeline-analytics",
27464
27797
  capScope: "device",
@@ -27531,6 +27864,12 @@ Object.freeze({
27531
27864
  addonId: null,
27532
27865
  access: "create"
27533
27866
  },
27867
+ "pipelineAnalytics.relocateMedia": {
27868
+ capName: "pipeline-analytics",
27869
+ capScope: "device",
27870
+ addonId: null,
27871
+ access: "create"
27872
+ },
27534
27873
  "pipelineAnalytics.searchObjectEvents": {
27535
27874
  capName: "pipeline-analytics",
27536
27875
  capScope: "device",
@@ -28293,6 +28632,12 @@ Object.freeze({
28293
28632
  addonId: null,
28294
28633
  access: "create"
28295
28634
  },
28635
+ "recording.cancelRelocate": {
28636
+ capName: "recording",
28637
+ capScope: "system",
28638
+ addonId: null,
28639
+ access: "create"
28640
+ },
28296
28641
  "recording.deleteFootprint": {
28297
28642
  capName: "recording",
28298
28643
  capScope: "system",
@@ -28323,6 +28668,12 @@ Object.freeze({
28323
28668
  addonId: null,
28324
28669
  access: "view"
28325
28670
  },
28671
+ "recording.getRelocateStatus": {
28672
+ capName: "recording",
28673
+ capScope: "system",
28674
+ addonId: null,
28675
+ access: "view"
28676
+ },
28326
28677
  "recording.getStorageUsage": {
28327
28678
  capName: "recording",
28328
28679
  capScope: "system",
@@ -28353,6 +28704,24 @@ Object.freeze({
28353
28704
  addonId: null,
28354
28705
  access: "view"
28355
28706
  },
28707
+ "recording.relocateFootage": {
28708
+ capName: "recording",
28709
+ capScope: "system",
28710
+ addonId: null,
28711
+ access: "create"
28712
+ },
28713
+ "recording.renderClip": {
28714
+ capName: "recording",
28715
+ capScope: "system",
28716
+ addonId: null,
28717
+ access: "create"
28718
+ },
28719
+ "recording.renderGif": {
28720
+ capName: "recording",
28721
+ capScope: "system",
28722
+ addonId: null,
28723
+ access: "create"
28724
+ },
28356
28725
  "recording.rescanStorage": {
28357
28726
  capName: "recording",
28358
28727
  capScope: "system",
@@ -28947,6 +29316,12 @@ Object.freeze({
28947
29316
  addonId: null,
28948
29317
  access: "create"
28949
29318
  },
29319
+ "streamBroker.renderPreBufferClip": {
29320
+ capName: "stream-broker",
29321
+ capScope: "system",
29322
+ addonId: null,
29323
+ access: "create"
29324
+ },
28950
29325
  "streamBroker.restartProfile": {
28951
29326
  capName: "stream-broker",
28952
29327
  capScope: "system",