@camstack/addon-provider-gree 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
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let dgram = require("dgram");
3
3
  let crypto$1 = require("crypto");
4
4
  let events = require("events");
5
- //#region ../types/dist/event-category-BLcNejAE.mjs
5
+ //#region ../types/dist/event-category-Bz24uP1U.mjs
6
6
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
7
7
  EventCategory["SystemBoot"] = "system.boot";
8
8
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -273,6 +273,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
273
273
  */
274
274
  EventCategory["DeviceStateChanged"] = "device.state-changed";
275
275
  /**
276
+ * Frame occupancy for a camera CHANGED — a tracked object was gained or
277
+ * lost. Carries `{ deviceId, totalObjects, byClass, zones }`.
278
+ *
279
+ * Emitted only on a change, so a steady scene is silent. It exists so a
280
+ * client can stop polling `zoneAnalytics.getCurrentSnapshot`: that was the
281
+ * one live badge with no push signal at all, and it cost a request every
282
+ * four seconds per visible camera.
283
+ *
284
+ * Like every event it is telemetry and may be dropped ([D8]) — a consumer
285
+ * keeps a slow reconcile rather than trusting it alone.
286
+ */
287
+ EventCategory["ZoneAnalyticsOccupancyChanged"] = "zone-analytics.occupancy-changed";
288
+ /**
276
289
  * Cap event fired by every device that registers the `battery`
277
290
  * capability. Mirrors the cap definition's `onStatusChanged`. Carries
278
291
  * `{ deviceId, status: BatteryStatus }`. Subscribers (alert center,
@@ -7216,35 +7229,22 @@ var ConvertResultSchema = object({
7216
7229
  */
7217
7230
  var RecordingWeekdaySchema = number().int().min(0).max(6);
7218
7231
  var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
7219
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
7220
- kind: literal("timeOfDay"),
7221
- start: string().regex(HHMM),
7222
- end: string().regex(HHMM),
7223
- /** Restrict to these weekdays; omit = every day. */
7224
- days: array(RecordingWeekdaySchema).optional()
7225
- })]);
7226
- var RecordingModeSchema = _enum([
7227
- "continuous",
7228
- "onMotion",
7229
- "onAudioThreshold"
7230
- ]);
7231
7232
  /**
7232
- * First-class, authoritative per-camera storage mode — the explicit choice the
7233
- * UI reads directly (never inferred from `rules`):
7234
- * - `off` — not recording.
7235
- * - `events` — record only around triggers (motion / audio threshold),
7236
- * with pre/post-buffer.
7237
- * - `continuous` — record 24/7 within the schedule.
7233
+ * DERIVED per-camera storage summary — the single field cheap consumers read
7234
+ * (the viewer's status dot, the camera list) instead of walking `bands`:
7235
+ * - `off` — no band covers the camera (or it is disabled).
7236
+ * - `events` — every band records around triggers only.
7237
+ * - `continuous` — at least one band records continuously.
7238
7238
  *
7239
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
7240
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
7239
+ * NEVER authored: the recorder stamps it from the authoritative `bands` on
7240
+ * every save (`activeModeForConfig`). Writing it has no effect.
7241
7241
  */
7242
7242
  var RecordingStorageModeSchema = _enum([
7243
7243
  "off",
7244
7244
  "events",
7245
7245
  "continuous"
7246
7246
  ]);
7247
- /** Which detectors trigger an `events`-mode recording. */
7247
+ /** Which detectors trigger an `events`-mode band. */
7248
7248
  var RecordingTriggersSchema = object({
7249
7249
  motion: boolean().optional(),
7250
7250
  audioThresholdDbfs: number().optional()
@@ -7280,18 +7280,6 @@ var RecordingBandSchema = object({
7280
7280
  preBufferSec: number().min(0).optional(),
7281
7281
  postBufferSec: number().min(0).optional()
7282
7282
  });
7283
- var RecordingRuleSchema = object({
7284
- schedule: RecordingScheduleSchema,
7285
- mode: RecordingModeSchema,
7286
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
7287
- preBufferSec: number().min(0).default(0),
7288
- /** Keep recording until this many seconds after the last trigger. */
7289
- postBufferSec: number().min(0).default(0),
7290
- /** Each new trigger restarts the post-buffer window. */
7291
- resetTimeoutOnNewEvent: boolean().default(true),
7292
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
7293
- thresholdDbfs: number().optional()
7294
- });
7295
7283
  /**
7296
7284
  * Per-device retention overrides. Every field is optional; an unset or `0`
7297
7285
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7325,40 +7313,28 @@ var ScrubThumbnailPresetSchema = _enum([
7325
7313
  /**
7326
7314
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7327
7315
  *
7328
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
7329
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
7330
- * only for transition + migration (`migrateRulesToMode`); the policy engine
7331
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
7316
+ * `bands` is the ONLY authored recording intent: what to record, when, and on
7317
+ * which trigger. `mode` is a derived summary the recorder stamps on save; every
7318
+ * other field is a storage knob (profiles, segment length, retention, scrub).
7319
+ *
7320
+ * STRICT on purpose: the legacy authoring surface (`schedule`/`schedules`/
7321
+ * `triggers`/`preBufferSec`/`postBufferSec`/`rules`) was retired 2026-07-30.
7322
+ * A stale caller must fail loudly — silently stripping its legacy intent would
7323
+ * persist a band-less config, i.e. silently stop recording the camera.
7332
7324
  */
7333
7325
  var RecordingConfigSchema = object({
7334
7326
  enabled: boolean(),
7335
- /** Authoritative storage mode. Absent on legacy targets derived once via
7336
- * `migrateRulesToMode`, then persisted. */
7327
+ /** DERIVED summary of `bands`, stamped by the recorder on every save.
7328
+ * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7337
7329
  mode: RecordingStorageModeSchema.optional(),
7338
7330
  profiles: array(CamProfileSchema).optional(),
7339
7331
  segmentSeconds: number().int().positive().optional(),
7340
- /** Shared recording time-bands for `events` & `continuous` — record only when
7341
- * the wall-clock falls inside one of these windows. Omit or empty = always.
7342
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
7343
- schedules: array(RecordingScheduleSchema).optional(),
7344
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
7345
- * normalized into `schedules` on read and never written going forward. (Not
7346
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
7347
- schedule: RecordingScheduleSchema.optional(),
7348
- /** `events`-mode only — which detectors trigger a recording. */
7349
- triggers: RecordingTriggersSchema.optional(),
7350
- /** `events`-mode only — seconds retained before / after a trigger. */
7351
- preBufferSec: number().min(0).optional(),
7352
- postBufferSec: number().min(0).optional(),
7353
- /** DEPRECATED authoring input; retained for migration/transition. */
7354
- rules: array(RecordingRuleSchema).optional(),
7355
7332
  /**
7356
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
7357
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
7358
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
7359
- * derived into bands once via `migrateConfigToBands`.
7333
+ * AUTHORITATIVE mode-per-band recording model the single source of truth
7334
+ * the recorder's band engine consumes. An empty array = record nothing;
7335
+ * "off" is the absence of a covering band, never a band value.
7360
7336
  */
7361
- bands: array(RecordingBandSchema).optional(),
7337
+ bands: array(RecordingBandSchema).default([]),
7362
7338
  retention: RecordingRetentionSchema.optional(),
7363
7339
  /**
7364
7340
  * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
@@ -7366,8 +7342,15 @@ var RecordingConfigSchema = object({
7366
7342
  * windows only — existing sheets are immutable, and each window's index
7367
7343
  * carries its own tile dims so mixed-preset history renders correctly.
7368
7344
  */
7369
- scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7370
- });
7345
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional(),
7346
+ /**
7347
+ * OPT-IN thumbnail-strip generation for this camera: every keyframe of the
7348
+ * low recording saved as a JPEG (the fast-drag scrub depth), a derived
7349
+ * cache that eviction reclaims with the footage. Absent/false = no strips
7350
+ * are written and scrub reads exact keyframes at every velocity.
7351
+ */
7352
+ stripsEnabled: boolean().optional()
7353
+ }).strict();
7371
7354
  /**
7372
7355
  * Ops-log — the durable, append-only operations audit shared by the
7373
7356
  * recordings and events management surfaces.
@@ -7386,7 +7369,8 @@ var OpsLogOpSchema = _enum([
7386
7369
  "prune",
7387
7370
  "manual-delete",
7388
7371
  "rescan",
7389
- "retention-run"
7372
+ "retention-run",
7373
+ "relocate"
7390
7374
  ]);
7391
7375
  /** Why the operation ran. */
7392
7376
  var OpsLogReasonSchema = _enum([
@@ -7425,6 +7409,55 @@ var OpsLogQueryInputSchema = object({
7425
7409
  limit: number().int().min(1).max(1e3).optional()
7426
7410
  });
7427
7411
  /**
7412
+ * Entity-relocation job state (storage entity-routing spec, Phase 4).
7413
+ *
7414
+ * One shape shared by the recorder's `relocateFootage` (segments + strips) and
7415
+ * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7416
+ * page renders both movers with one component. Jobs are in-RAM (a restart
7417
+ * forgets them — re-running is safe by construction: copy-if-absent, delete
7418
+ * after verify) and each completed/failed run also lands one durable ops-log
7419
+ * row on the owning addon's surface.
7420
+ */
7421
+ var RelocateJobStateSchema = _enum([
7422
+ "running",
7423
+ "done",
7424
+ "failed",
7425
+ "cancelled"
7426
+ ]);
7427
+ var RelocateJobSchema = object({
7428
+ jobId: string(),
7429
+ state: RelocateJobStateSchema,
7430
+ /** Source location — for media relocation this is informational ('*': rows
7431
+ * move from wherever they are to the target). */
7432
+ fromLocationId: string(),
7433
+ toLocationId: string(),
7434
+ /** Scoped device, or null = every device. */
7435
+ deviceId: number().nullable(),
7436
+ /** What the job moves (owner-addon specific: segments/strips or media). */
7437
+ entities: array(string()),
7438
+ filesMoved: number().int(),
7439
+ bytesMoved: number().int(),
7440
+ /** Total files discovered up front; null while (or when) unknown. */
7441
+ filesTotal: number().int().nullable(),
7442
+ startedAt: number(),
7443
+ finishedAt: number().nullable(),
7444
+ error: string().nullable()
7445
+ });
7446
+ var RelocateFootageInputSchema = object({
7447
+ deviceId: number().optional(),
7448
+ fromLocationId: string(),
7449
+ toLocationId: string(),
7450
+ entities: array(_enum(["segments", "strips"])).optional(),
7451
+ /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7452
+ * never allowed to starve live writers. */
7453
+ throttleMbps: number().min(1).max(1e3).optional()
7454
+ });
7455
+ var RelocateMediaInputSchema = object({
7456
+ deviceId: number().optional(),
7457
+ toLocationId: string(),
7458
+ throttleMbps: number().min(1).max(1e3).optional()
7459
+ });
7460
+ /**
7428
7461
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7429
7462
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7430
7463
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -7474,6 +7507,13 @@ var StorageLocationSchema = object({
7474
7507
  nodeId: string().optional(),
7475
7508
  isDefault: boolean().default(false),
7476
7509
  isSystem: boolean().default(false),
7510
+ /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7511
+ * for node-local locations it can reach) — never persisted, absent when the
7512
+ * volume is remote/unreachable. The single capacity truth every UI reads. */
7513
+ capacity: object({
7514
+ totalBytes: number(),
7515
+ availableBytes: number()
7516
+ }).nullable().optional(),
7477
7517
  createdAt: number(),
7478
7518
  updatedAt: number()
7479
7519
  });
@@ -8241,7 +8281,8 @@ var NcTaxonomyEntrySchema = object({
8241
8281
  /** Macro/category parent for grouping ('car' → 'vehicle'); null for a top. */
8242
8282
  parentKind: string().nullable()
8243
8283
  });
8244
- object({
8284
+ /** The complete NC picker taxonomy — three grouped buckets. */
8285
+ var NcTaxonomySchema = object({
8245
8286
  videoClasses: array(NcTaxonomyEntrySchema),
8246
8287
  audioKinds: array(NcTaxonomyEntrySchema),
8247
8288
  labels: array(NcTaxonomyEntrySchema)
@@ -9144,6 +9185,7 @@ function shallowEqual(a, b) {
9144
9185
  for (const k of ak) if (a[k] !== b[k]) return false;
9145
9186
  return true;
9146
9187
  }
9188
+ new Set(["devices", "classes"]);
9147
9189
  /**
9148
9190
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
9149
9191
  * motion-zones, and the detection zones/lines editor all speak this one
@@ -9302,6 +9344,29 @@ var NcOccupancyConditionSchema = object({
9302
9344
  count: number().int().min(0).default(1),
9303
9345
  sustainSeconds: number().int().min(0).max(3600).default(15)
9304
9346
  });
9347
+ /**
9348
+ * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
9349
+ *
9350
+ * The values are not symmetric, and deliberately so — the absent value has to
9351
+ * mean exactly what every rule authored before this condition existed already
9352
+ * does:
9353
+ * - `enter` — entries and every NON-crossing record (movement state,
9354
+ * package, sensor). Exits are rejected. **This is the absent behaviour**:
9355
+ * an operator who never asked for exits must not start receiving them.
9356
+ * - `exit` — ONLY an exit crossing. A record that is not a crossing at all
9357
+ * fails closed, because "the car left the drive" is a question about a
9358
+ * boundary, not about a detection.
9359
+ * - `any` — no direction filter; entries, exits and non-crossings alike.
9360
+ *
9361
+ * A rule asking for a direction should normally also scope `zones`, which the
9362
+ * engine evaluates against the crossed zone as well as the current membership
9363
+ * (an exit's membership no longer contains the zone it just left).
9364
+ */
9365
+ var NcCrossingSchema = _enum([
9366
+ "enter",
9367
+ "exit",
9368
+ "any"
9369
+ ]);
9305
9370
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
9306
9371
  var NcZoneConditionSchema = object({
9307
9372
  ids: array(string().min(1)).min(1),
@@ -9326,6 +9391,13 @@ var NcConditionsSchema = object({
9326
9391
  /** Veto zones — any hit fails the rule. */
9327
9392
  zonesExclude: array(string().min(1)).optional(),
9328
9393
  /**
9394
+ * Zone-crossing direction. IMMEDIATE only — a crossing is a per-event fact
9395
+ * and a closed track carries none, so a `track-end` rule asking for one
9396
+ * fails closed (use `zones`, which tests `zonesVisited`). ABSENT = `enter`,
9397
+ * which is exactly today's behaviour. See {@link NcCrossingSchema}.
9398
+ */
9399
+ crossing: NcCrossingSchema.optional(),
9400
+ /**
9329
9401
  * Exact (case-insensitive) match on the record's collapsed `label`
9330
9402
  * (identity name / plate text / subclass).
9331
9403
  */
@@ -9460,17 +9532,85 @@ var NcRuleTargetSchema = object({
9460
9532
  * - `keyFrame` — the clean scene frame (no subject box).
9461
9533
  * - `none` — no attachment.
9462
9534
  */
9463
- var NcMediaPolicySchema = object({ attach: _enum([
9464
- "best",
9465
- "best-matching",
9466
- "keyFrame",
9467
- "none"
9468
- ]).default("best") });
9535
+ /**
9536
+ * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
9537
+ * conflate it with the selection strategy and betray the request: asking for
9538
+ * the clean scene frame on an object-event owner used to start at
9539
+ * `fullFrameBoxed`, i.e. the annotated frame (2026-07-30).
9540
+ * - `cropped` — the subject, tight. What "who is at the door" wants.
9541
+ * - `full` — the clean scene, no annotation. What "what is going on" wants.
9542
+ * - `boxed` — the scene WITH the detection boxes drawn, for verifying what
9543
+ * the pipeline actually saw.
9544
+ */
9545
+ var NcMediaFrameSchema = _enum([
9546
+ "cropped",
9547
+ "full",
9548
+ "boxed"
9549
+ ]);
9550
+ var NcMediaPolicySchema = object({
9551
+ attach: _enum([
9552
+ "best",
9553
+ "best-matching",
9554
+ "keyFrame",
9555
+ "none"
9556
+ ]).default("best"),
9557
+ /** What the still shows. Absent = `cropped` (the historical `best` shape). */
9558
+ frame: NcMediaFrameSchema.optional(),
9559
+ /** Crop the attached still to the rule's condition-zone bbox (padded) —
9560
+ * "show me the ZONE", not the whole scene or the subject crop. */
9561
+ zoneCrop: boolean().optional(),
9562
+ /**
9563
+ * Also attach a short GIF cut from the stream broker's clip ring around the
9564
+ * event — NOT from the recording, so the camera does not have to be
9565
+ * recording, and the window sits AROUND the moment instead of a segment
9566
+ * behind it. Fail-closed: a window the ring does not cover contributes no
9567
+ * gif, never a failed notification.
9568
+ */
9569
+ gif: boolean().optional(),
9570
+ /**
9571
+ * Also attach a short MP4 CLIP of the same cut. Same source and the same
9572
+ * fail-closed rule as `gif`. Prefer it where the backend takes video
9573
+ * (telegram, discord, zentik, webhook); backends that do not are handled by
9574
+ * the degrade engine, which drops the video and keeps the still.
9575
+ */
9576
+ clip: boolean().optional(),
9577
+ /** Seconds of footage BEFORE / AFTER the event instant. Defaults 3 / 7. */
9578
+ clipPreRollSec: number().int().min(0).max(30).optional(),
9579
+ clipPostRollSec: number().int().min(0).max(30).optional(),
9580
+ /**
9581
+ * Which stream profile the footage is cut from. Absent = the CHEAPEST
9582
+ * assigned profile: a notification is watched on a phone, so the 4K
9583
+ * rendition would burn CPU to produce a file the client downscales anyway.
9584
+ * A profile that is not assigned falls back to the cheapest, and the render
9585
+ * reports which one actually ran.
9586
+ */
9587
+ profile: CamProfileSchema.optional()
9588
+ });
9589
+ /**
9590
+ * Cooldown GRANULARITY over the subject's class — how much a fired
9591
+ * notification suppresses.
9592
+ * - `shared` (default, and the absent value) — one window for the whole
9593
+ * rule/scope: a cat silences the next dog for `cooldownSec`.
9594
+ * - `per-class` — an independent window per detected class, so cat→dog fires
9595
+ * at once and cat→cat still waits.
9596
+ *
9597
+ * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
9598
+ * must not be swallowed by a bark's window (the precedent this generalizes —
9599
+ * see `cooldownKey` in the rule engine).
9600
+ */
9601
+ var NcThrottleGranularitySchema = _enum(["shared", "per-class"]);
9469
9602
  /** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
9470
9603
  var NcThrottleSchema = object({
9471
9604
  cooldownSec: number().int().min(0).max(86400).default(60),
9472
9605
  /** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
9473
- scope: _enum(["rule", "rule-device"]).default("rule-device")
9606
+ scope: _enum(["rule", "rule-device"]).default("rule-device"),
9607
+ /**
9608
+ * Class granularity of the cooldown key. Optional rather than defaulted:
9609
+ * a Zod default does NOT run on the addon→addon cap path, so a persisted
9610
+ * rule authored before this field simply carries none — and the engine
9611
+ * reads absent as `shared`, the pre-existing behaviour.
9612
+ */
9613
+ granularity: NcThrottleGranularitySchema.optional()
9474
9614
  });
9475
9615
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
9476
9616
  var NcRuleInputSchema = object({
@@ -9479,7 +9619,19 @@ var NcRuleInputSchema = object({
9479
9619
  delivery: NcDeliverySchema,
9480
9620
  conditions: NcConditionsSchema.default({}),
9481
9621
  schedule: NcScheduleSchema.optional(),
9482
- targets: array(NcRuleTargetSchema).min(1),
9622
+ /** May be empty when `targetUsers` addresses at least one user — the
9623
+ * "at least one addressee" invariant is enforced by the provider, because
9624
+ * a cross-field refine here would break `NcRulePatchSchema.partial()`. */
9625
+ targets: array(NcRuleTargetSchema),
9626
+ /**
9627
+ * USERS this rule addresses in addition to `targets` (Phase 4). At fire
9628
+ * time each user fans out to the personal targets they own
9629
+ * (`config.ownerUserId`), filtered by that user's `allowedDevices` for the
9630
+ * firing camera — a user is never notified about a device they cannot open.
9631
+ * Per-user opt-outs (`disabledTargetIds`) still apply to the fanned-out
9632
+ * targets.
9633
+ */
9634
+ targetUsers: array(string()).optional(),
9483
9635
  media: NcMediaPolicySchema.default({ attach: "best" }),
9484
9636
  throttle: NcThrottleSchema.default({
9485
9637
  cooldownSec: 60,
@@ -9566,6 +9718,7 @@ var NcConditionDescriptorSchema = object({
9566
9718
  "schedule",
9567
9719
  "plateMatcher",
9568
9720
  "packagePhase",
9721
+ "crossingSelect",
9569
9722
  "polygonDraw",
9570
9723
  "occupancy"
9571
9724
  ]),
@@ -9692,7 +9845,10 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
9692
9845
  }), object({ results: array(NcTestResultSchema) }), {
9693
9846
  kind: "mutation",
9694
9847
  auth: "admin"
9695
- }), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9848
+ }), method(object({}), object({
9849
+ catalog: array(NcConditionDescriptorSchema),
9850
+ taxonomy: NcTaxonomySchema.optional()
9851
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9696
9852
  /**
9697
9853
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
9698
9854
  *
@@ -10701,6 +10857,28 @@ method(object({
10701
10857
  }), object({ success: literal(true) }), {
10702
10858
  kind: "mutation",
10703
10859
  auth: "admin"
10860
+ }), method(object({
10861
+ deviceId: number(),
10862
+ /** Absent = the LOWEST assigned profile — a notification attachment is
10863
+ * watched on a phone, and the cheap rendition is the right default. */
10864
+ profile: CamProfileSchema.optional(),
10865
+ aroundMs: number(),
10866
+ preRollSec: number().min(0).max(20).default(3),
10867
+ postRollSec: number().min(0).max(20).default(5),
10868
+ format: _enum(["gif", "mp4"]).default("gif"),
10869
+ maxWidth: number().int().min(120).max(1920).default(480),
10870
+ /** GIF only — MP4 keeps the source cadence. */
10871
+ fps: number().int().min(1).max(15).default(5)
10872
+ }), object({
10873
+ base64: string(),
10874
+ mime: string(),
10875
+ bytes: number().int(),
10876
+ /** The profile actually rendered (what the default resolved to). */
10877
+ profile: CamProfileSchema,
10878
+ durationMs: number()
10879
+ }), {
10880
+ kind: "mutation",
10881
+ auth: "admin"
10704
10882
  }), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string() }), BrokerStatsSchema), method(object({ brokerId: string() }), object({
10705
10883
  probed: boolean(),
10706
10884
  summary: string()
@@ -13831,6 +14009,18 @@ var motionCapability = {
13831
14009
  name: "motion",
13832
14010
  scope: "device",
13833
14011
  mode: "singleton",
14012
+ /**
14013
+ * Providers register per-device natives via `ctx.registerNativeCap`
14014
+ * (Hikvision/Reolink/Amcrest/Wyze/HA/Homematic/Alexa/Matter) — there is
14015
+ * NO system singleton provider. Without this flag `resolveCapMount`
14016
+ * derived `{ kind: 'singleton' }`, so `motion.getStatus`/`isDetected`
14017
+ * resolved via `registry.getSingleton('motion')` (always null) and every
14018
+ * call 412'd "provider not available" while bindings listed a live
14019
+ * `motion` native (2026-08-02). The flag routes the router through
14020
+ * `requireDeviceScoped` → `getProviderForDevice`, like `motion-trigger`,
14021
+ * `snapshot` and every other per-device native cap.
14022
+ */
14023
+ deviceNative: true,
13834
14024
  deviceTypes: [DeviceType.Camera, DeviceType.Sensor],
13835
14025
  methods: {
13836
14026
  /**
@@ -18763,7 +18953,10 @@ method(object({
18763
18953
  }), method(object({
18764
18954
  deviceId: number(),
18765
18955
  caps: array(string()).readonly().optional()
18766
- }), record(string(), unknown().nullable()));
18956
+ }), record(string(), unknown().nullable())), method(object({
18957
+ deviceIds: array(number()).readonly(),
18958
+ caps: array(string()).readonly().optional()
18959
+ }), record(string(), record(string(), unknown().nullable())));
18767
18960
  method(object({ deviceId: number() }), record(string(), record(string(), unknown()))), method(object({
18768
18961
  deviceId: number(),
18769
18962
  capName: string()
@@ -19694,6 +19887,36 @@ var TargetKindSchema = object({
19694
19887
  icon: string(),
19695
19888
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
19696
19889
  addonId: string(),
19890
+ /**
19891
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
19892
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
19893
+ * when the addon bundles no icon for that kind — the client then falls back
19894
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
19895
+ *
19896
+ * Root-relative on purpose: it resolves against whatever origin serves a web
19897
+ * client, and a native client joins it onto its own hub base.
19898
+ *
19899
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
19900
+ * field that survived only because the runtime cap-router forwards provider
19901
+ * output verbatim — so every consumer had to re-declare it by hand to stop
19902
+ * its own Zod parse from stripping it, and the whole arrangement would have
19903
+ * broken silently the moment output validation was tightened anywhere.
19904
+ */
19905
+ iconUrl: string().optional(),
19906
+ /**
19907
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
19908
+ *
19909
+ * The server knows this and therefore says it, because the client cannot
19910
+ * safely guess: a React-Native client renders SVG and raster through two
19911
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
19912
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
19913
+ * placeholder glyph for every vector icon while the web build looked fine.
19914
+ *
19915
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
19916
+ * not been updated — a client that cannot determine the type should prefer
19917
+ * its raster path, which is the safe default for an unknown image.
19918
+ */
19919
+ iconMediaType: string().optional(),
19697
19920
  configSchema: ConfigSchemaPassthrough,
19698
19921
  supportsDiscovery: boolean(),
19699
19922
  caps: TargetKindCapsSchema
@@ -20141,6 +20364,29 @@ var MotionEventSchema = object({
20141
20364
  * Absent on legacy rows ⇒ treat as `pipeline`.
20142
20365
  */
20143
20366
  var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
20367
+ /**
20368
+ * The confirmed zone crossing that produced an object event. Present ONLY on
20369
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
20370
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
20371
+ * appearance event carry none, so a rule asking for a direction fails closed
20372
+ * on them.
20373
+ *
20374
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
20375
+ * into its own event, so a frame in which a track enters A while leaving B
20376
+ * produces two events with two directions — never one ambiguous row.
20377
+ *
20378
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
20379
+ * membership the box has NOW, and by definition it no longer contains the zone
20380
+ * that was just left. Without the id here, a zone-scoped rule could never match
20381
+ * the exit it asked for.
20382
+ */
20383
+ var ZoneCrossingSchema = object({
20384
+ direction: _enum(["enter", "exit"]),
20385
+ /** Admin zone id crossed. */
20386
+ zoneId: string(),
20387
+ /** Zone display name at crossing time (falls back to the id). */
20388
+ zoneName: string().optional()
20389
+ });
20144
20390
  var ObjectEventSchema = object({
20145
20391
  ...BaseEventFields,
20146
20392
  kind: literal("object"),
@@ -20167,6 +20413,12 @@ var ObjectEventSchema = object({
20167
20413
  zones: array(string()).readonly().optional(),
20168
20414
  /** Omitted in slim projection. */
20169
20415
  state: TrackStateSchema.optional(),
20416
+ /**
20417
+ * The zone crossing this event IS, when it is one. Absent on every other
20418
+ * event kind (movement state, appearance, package) — see
20419
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
20420
+ */
20421
+ zoneCrossing: ZoneCrossingSchema.optional(),
20170
20422
  /** Detection-frame dimensions in pixels — let consumers normalize the
20171
20423
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
20172
20424
  frameWidth: number().optional(),
@@ -20425,6 +20677,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20425
20677
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
20426
20678
  kind: "mutation",
20427
20679
  auth: "admin"
20680
+ }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
20681
+ kind: "mutation",
20682
+ auth: "admin"
20683
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
20684
+ kind: "query",
20685
+ auth: "admin"
20686
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
20687
+ kind: "mutation",
20688
+ auth: "admin"
20428
20689
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
20429
20690
  kind: "query",
20430
20691
  auth: "admin"
@@ -22904,6 +23165,17 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
22904
23165
  */
22905
23166
  priority: number()
22906
23167
  })).readonly() });
23168
+ /**
23169
+ * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
23170
+ * AUTO (resolved from the candidate ranking at send time); `resolved` reports
23171
+ * what AUTO currently picks, so the UI can show the effective value either way.
23172
+ */
23173
+ var NotificationEndpointSchema = object({
23174
+ /** The operator's explicit choice, or null for AUTO. */
23175
+ baseUrl: string().nullable(),
23176
+ /** What the ranking currently resolves to (null when nothing is reachable). */
23177
+ resolved: string().nullable()
23178
+ });
22907
23179
  var AllowedAddressesSchema = object({
22908
23180
  /**
22909
23181
  * Allowlist of interface addresses operators have explicitly opted
@@ -22926,7 +23198,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
22926
23198
  * to avoid mixed-content blocks in the browser. The public
22927
23199
  * tunnel always emits `https://` regardless. */
22928
23200
  scheme: _enum(["http", "https"]).optional()
22929
- }), GetConnectionEndpointsResultSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
23201
+ }), 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" });
22930
23202
  /**
22931
23203
  * mesh-network — collection cap for mesh-VPN providers.
22932
23204
  *
@@ -23725,7 +23997,12 @@ var RecordingDeviceUsageSchema = object({
23725
23997
  var RecordingLocationUsageSchema = object({
23726
23998
  /** StorageLocation id; null for the legacy/degraded single-root fallback. */
23727
23999
  locationId: string().nullable(),
23728
- /** Bytes of recordings stored on this location. */
24000
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
24001
+ * is emitted per physical disk (2026-07-29): two locations on one root
24002
+ * previously rendered as two identical "disks" with a nonsensical used
24003
+ * split — hydrate attribution across aliases is arbitrary by nature. */
24004
+ locationIds: array(string()).optional(),
24005
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). */
23729
24006
  usedBytes: number(),
23730
24007
  /** Free bytes on the location's volume; null when capacity is unknown (remote). */
23731
24008
  availableBytes: number().nullable(),
@@ -23837,6 +24114,44 @@ method(object({
23837
24114
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
23838
24115
  kind: "query",
23839
24116
  auth: "admin"
24117
+ }), method(object({
24118
+ deviceId: number(),
24119
+ aroundMs: number(),
24120
+ preRollSec: number().min(0).max(30).default(2),
24121
+ postRollSec: number().min(0).max(30).default(5),
24122
+ maxWidth: number().int().min(120).max(1280).default(480),
24123
+ fps: number().int().min(1).max(15).default(5)
24124
+ }), object({
24125
+ gifBase64: string(),
24126
+ fromMs: number(),
24127
+ toMs: number()
24128
+ }), {
24129
+ kind: "mutation",
24130
+ auth: "admin"
24131
+ }), method(object({
24132
+ deviceId: number(),
24133
+ aroundMs: number(),
24134
+ preRollSec: number().min(0).max(30).default(3),
24135
+ postRollSec: number().min(0).max(30).default(7),
24136
+ maxWidth: number().int().min(160).max(1920).default(640)
24137
+ }), object({
24138
+ clipBase64: string(),
24139
+ mime: string(),
24140
+ fromMs: number(),
24141
+ toMs: number(),
24142
+ bytes: number().int()
24143
+ }), {
24144
+ kind: "mutation",
24145
+ auth: "admin"
24146
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
24147
+ kind: "mutation",
24148
+ auth: "admin"
24149
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
24150
+ kind: "query",
24151
+ auth: "admin"
24152
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
24153
+ kind: "mutation",
24154
+ auth: "admin"
23840
24155
  });
23841
24156
  /**
23842
24157
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -25428,6 +25743,12 @@ Object.freeze({
25428
25743
  addonId: null,
25429
25744
  access: "view"
25430
25745
  },
25746
+ "deviceManager.getDeviceStatusAggregateBatch": {
25747
+ capName: "device-manager",
25748
+ capScope: "system",
25749
+ addonId: null,
25750
+ access: "view"
25751
+ },
25431
25752
  "deviceManager.getLinkedDevices": {
25432
25753
  capName: "device-manager",
25433
25754
  capScope: "system",
@@ -26322,6 +26643,12 @@ Object.freeze({
26322
26643
  addonId: null,
26323
26644
  access: "view"
26324
26645
  },
26646
+ "localNetwork.getNotificationEndpoint": {
26647
+ capName: "local-network",
26648
+ capScope: "system",
26649
+ addonId: null,
26650
+ access: "view"
26651
+ },
26325
26652
  "localNetwork.getPreferred": {
26326
26653
  capName: "local-network",
26327
26654
  capScope: "system",
@@ -26346,6 +26673,12 @@ Object.freeze({
26346
26673
  addonId: null,
26347
26674
  access: "create"
26348
26675
  },
26676
+ "localNetwork.setNotificationEndpoint": {
26677
+ capName: "local-network",
26678
+ capScope: "system",
26679
+ addonId: null,
26680
+ access: "create"
26681
+ },
26349
26682
  "lockControl.lock": {
26350
26683
  capName: "lock-control",
26351
26684
  capScope: "device",
@@ -26988,6 +27321,12 @@ Object.freeze({
26988
27321
  addonId: null,
26989
27322
  access: "create"
26990
27323
  },
27324
+ "pipelineAnalytics.cancelMediaRelocate": {
27325
+ capName: "pipeline-analytics",
27326
+ capScope: "device",
27327
+ addonId: null,
27328
+ access: "create"
27329
+ },
26991
27330
  "pipelineAnalytics.clearTracks": {
26992
27331
  capName: "pipeline-analytics",
26993
27332
  capScope: "device",
@@ -27042,6 +27381,12 @@ Object.freeze({
27042
27381
  addonId: null,
27043
27382
  access: "view"
27044
27383
  },
27384
+ "pipelineAnalytics.getMediaRelocateStatus": {
27385
+ capName: "pipeline-analytics",
27386
+ capScope: "device",
27387
+ addonId: null,
27388
+ access: "view"
27389
+ },
27045
27390
  "pipelineAnalytics.getMotionEvents": {
27046
27391
  capName: "pipeline-analytics",
27047
27392
  capScope: "device",
@@ -27114,6 +27459,12 @@ Object.freeze({
27114
27459
  addonId: null,
27115
27460
  access: "create"
27116
27461
  },
27462
+ "pipelineAnalytics.relocateMedia": {
27463
+ capName: "pipeline-analytics",
27464
+ capScope: "device",
27465
+ addonId: null,
27466
+ access: "create"
27467
+ },
27117
27468
  "pipelineAnalytics.searchObjectEvents": {
27118
27469
  capName: "pipeline-analytics",
27119
27470
  capScope: "device",
@@ -27876,6 +28227,12 @@ Object.freeze({
27876
28227
  addonId: null,
27877
28228
  access: "create"
27878
28229
  },
28230
+ "recording.cancelRelocate": {
28231
+ capName: "recording",
28232
+ capScope: "system",
28233
+ addonId: null,
28234
+ access: "create"
28235
+ },
27879
28236
  "recording.deleteFootprint": {
27880
28237
  capName: "recording",
27881
28238
  capScope: "system",
@@ -27906,6 +28263,12 @@ Object.freeze({
27906
28263
  addonId: null,
27907
28264
  access: "view"
27908
28265
  },
28266
+ "recording.getRelocateStatus": {
28267
+ capName: "recording",
28268
+ capScope: "system",
28269
+ addonId: null,
28270
+ access: "view"
28271
+ },
27909
28272
  "recording.getStorageUsage": {
27910
28273
  capName: "recording",
27911
28274
  capScope: "system",
@@ -27936,6 +28299,24 @@ Object.freeze({
27936
28299
  addonId: null,
27937
28300
  access: "view"
27938
28301
  },
28302
+ "recording.relocateFootage": {
28303
+ capName: "recording",
28304
+ capScope: "system",
28305
+ addonId: null,
28306
+ access: "create"
28307
+ },
28308
+ "recording.renderClip": {
28309
+ capName: "recording",
28310
+ capScope: "system",
28311
+ addonId: null,
28312
+ access: "create"
28313
+ },
28314
+ "recording.renderGif": {
28315
+ capName: "recording",
28316
+ capScope: "system",
28317
+ addonId: null,
28318
+ access: "create"
28319
+ },
27939
28320
  "recording.rescanStorage": {
27940
28321
  capName: "recording",
27941
28322
  capScope: "system",
@@ -28530,6 +28911,12 @@ Object.freeze({
28530
28911
  addonId: null,
28531
28912
  access: "create"
28532
28913
  },
28914
+ "streamBroker.renderPreBufferClip": {
28915
+ capName: "stream-broker",
28916
+ capScope: "system",
28917
+ addonId: null,
28918
+ access: "create"
28919
+ },
28533
28920
  "streamBroker.restartProfile": {
28534
28921
  capName: "stream-broker",
28535
28922
  capScope: "system",