@camstack/addon-provider-ecowitt 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
@@ -1,7 +1,7 @@
1
1
  import { createServer } from "http";
2
2
  import { EventEmitter } from "events";
3
3
  import { createSocket } from "dgram";
4
- //#region ../types/dist/event-category-BLcNejAE.mjs
4
+ //#region ../types/dist/event-category-Bz24uP1U.mjs
5
5
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
6
6
  EventCategory["SystemBoot"] = "system.boot";
7
7
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -272,6 +272,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
272
272
  */
273
273
  EventCategory["DeviceStateChanged"] = "device.state-changed";
274
274
  /**
275
+ * Frame occupancy for a camera CHANGED — a tracked object was gained or
276
+ * lost. Carries `{ deviceId, totalObjects, byClass, zones }`.
277
+ *
278
+ * Emitted only on a change, so a steady scene is silent. It exists so a
279
+ * client can stop polling `zoneAnalytics.getCurrentSnapshot`: that was the
280
+ * one live badge with no push signal at all, and it cost a request every
281
+ * four seconds per visible camera.
282
+ *
283
+ * Like every event it is telemetry and may be dropped ([D8]) — a consumer
284
+ * keeps a slow reconcile rather than trusting it alone.
285
+ */
286
+ EventCategory["ZoneAnalyticsOccupancyChanged"] = "zone-analytics.occupancy-changed";
287
+ /**
275
288
  * Cap event fired by every device that registers the `battery`
276
289
  * capability. Mirrors the cap definition's `onStatusChanged`. Carries
277
290
  * `{ deviceId, status: BatteryStatus }`. Subscribers (alert center,
@@ -7215,35 +7228,22 @@ var ConvertResultSchema = object({
7215
7228
  */
7216
7229
  var RecordingWeekdaySchema = number().int().min(0).max(6);
7217
7230
  var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
7218
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
7219
- kind: literal("timeOfDay"),
7220
- start: string().regex(HHMM),
7221
- end: string().regex(HHMM),
7222
- /** Restrict to these weekdays; omit = every day. */
7223
- days: array(RecordingWeekdaySchema).optional()
7224
- })]);
7225
- var RecordingModeSchema = _enum([
7226
- "continuous",
7227
- "onMotion",
7228
- "onAudioThreshold"
7229
- ]);
7230
7231
  /**
7231
- * First-class, authoritative per-camera storage mode — the explicit choice the
7232
- * UI reads directly (never inferred from `rules`):
7233
- * - `off` — not recording.
7234
- * - `events` — record only around triggers (motion / audio threshold),
7235
- * with pre/post-buffer.
7236
- * - `continuous` — record 24/7 within the schedule.
7232
+ * DERIVED per-camera storage summary — the single field cheap consumers read
7233
+ * (the viewer's status dot, the camera list) instead of walking `bands`:
7234
+ * - `off` — no band covers the camera (or it is disabled).
7235
+ * - `events` — every band records around triggers only.
7236
+ * - `continuous` — at least one band records continuously.
7237
7237
  *
7238
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
7239
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
7238
+ * NEVER authored: the recorder stamps it from the authoritative `bands` on
7239
+ * every save (`activeModeForConfig`). Writing it has no effect.
7240
7240
  */
7241
7241
  var RecordingStorageModeSchema = _enum([
7242
7242
  "off",
7243
7243
  "events",
7244
7244
  "continuous"
7245
7245
  ]);
7246
- /** Which detectors trigger an `events`-mode recording. */
7246
+ /** Which detectors trigger an `events`-mode band. */
7247
7247
  var RecordingTriggersSchema = object({
7248
7248
  motion: boolean().optional(),
7249
7249
  audioThresholdDbfs: number().optional()
@@ -7279,18 +7279,6 @@ var RecordingBandSchema = object({
7279
7279
  preBufferSec: number().min(0).optional(),
7280
7280
  postBufferSec: number().min(0).optional()
7281
7281
  });
7282
- var RecordingRuleSchema = object({
7283
- schedule: RecordingScheduleSchema,
7284
- mode: RecordingModeSchema,
7285
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
7286
- preBufferSec: number().min(0).default(0),
7287
- /** Keep recording until this many seconds after the last trigger. */
7288
- postBufferSec: number().min(0).default(0),
7289
- /** Each new trigger restarts the post-buffer window. */
7290
- resetTimeoutOnNewEvent: boolean().default(true),
7291
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
7292
- thresholdDbfs: number().optional()
7293
- });
7294
7282
  /**
7295
7283
  * Per-device retention overrides. Every field is optional; an unset or `0`
7296
7284
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7324,40 +7312,28 @@ var ScrubThumbnailPresetSchema = _enum([
7324
7312
  /**
7325
7313
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7326
7314
  *
7327
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
7328
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
7329
- * only for transition + migration (`migrateRulesToMode`); the policy engine
7330
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
7315
+ * `bands` is the ONLY authored recording intent: what to record, when, and on
7316
+ * which trigger. `mode` is a derived summary the recorder stamps on save; every
7317
+ * other field is a storage knob (profiles, segment length, retention, scrub).
7318
+ *
7319
+ * STRICT on purpose: the legacy authoring surface (`schedule`/`schedules`/
7320
+ * `triggers`/`preBufferSec`/`postBufferSec`/`rules`) was retired 2026-07-30.
7321
+ * A stale caller must fail loudly — silently stripping its legacy intent would
7322
+ * persist a band-less config, i.e. silently stop recording the camera.
7331
7323
  */
7332
7324
  var RecordingConfigSchema = object({
7333
7325
  enabled: boolean(),
7334
- /** Authoritative storage mode. Absent on legacy targets derived once via
7335
- * `migrateRulesToMode`, then persisted. */
7326
+ /** DERIVED summary of `bands`, stamped by the recorder on every save.
7327
+ * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7336
7328
  mode: RecordingStorageModeSchema.optional(),
7337
7329
  profiles: array(CamProfileSchema).optional(),
7338
7330
  segmentSeconds: number().int().positive().optional(),
7339
- /** Shared recording time-bands for `events` & `continuous` — record only when
7340
- * the wall-clock falls inside one of these windows. Omit or empty = always.
7341
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
7342
- schedules: array(RecordingScheduleSchema).optional(),
7343
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
7344
- * normalized into `schedules` on read and never written going forward. (Not
7345
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
7346
- schedule: RecordingScheduleSchema.optional(),
7347
- /** `events`-mode only — which detectors trigger a recording. */
7348
- triggers: RecordingTriggersSchema.optional(),
7349
- /** `events`-mode only — seconds retained before / after a trigger. */
7350
- preBufferSec: number().min(0).optional(),
7351
- postBufferSec: number().min(0).optional(),
7352
- /** DEPRECATED authoring input; retained for migration/transition. */
7353
- rules: array(RecordingRuleSchema).optional(),
7354
7331
  /**
7355
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
7356
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
7357
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
7358
- * derived into bands once via `migrateConfigToBands`.
7332
+ * AUTHORITATIVE mode-per-band recording model the single source of truth
7333
+ * the recorder's band engine consumes. An empty array = record nothing;
7334
+ * "off" is the absence of a covering band, never a band value.
7359
7335
  */
7360
- bands: array(RecordingBandSchema).optional(),
7336
+ bands: array(RecordingBandSchema).default([]),
7361
7337
  retention: RecordingRetentionSchema.optional(),
7362
7338
  /**
7363
7339
  * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
@@ -7365,8 +7341,15 @@ var RecordingConfigSchema = object({
7365
7341
  * windows only — existing sheets are immutable, and each window's index
7366
7342
  * carries its own tile dims so mixed-preset history renders correctly.
7367
7343
  */
7368
- scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7369
- });
7344
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional(),
7345
+ /**
7346
+ * OPT-IN thumbnail-strip generation for this camera: every keyframe of the
7347
+ * low recording saved as a JPEG (the fast-drag scrub depth), a derived
7348
+ * cache that eviction reclaims with the footage. Absent/false = no strips
7349
+ * are written and scrub reads exact keyframes at every velocity.
7350
+ */
7351
+ stripsEnabled: boolean().optional()
7352
+ }).strict();
7370
7353
  /**
7371
7354
  * Ops-log — the durable, append-only operations audit shared by the
7372
7355
  * recordings and events management surfaces.
@@ -7385,7 +7368,8 @@ var OpsLogOpSchema = _enum([
7385
7368
  "prune",
7386
7369
  "manual-delete",
7387
7370
  "rescan",
7388
- "retention-run"
7371
+ "retention-run",
7372
+ "relocate"
7389
7373
  ]);
7390
7374
  /** Why the operation ran. */
7391
7375
  var OpsLogReasonSchema = _enum([
@@ -7424,6 +7408,55 @@ var OpsLogQueryInputSchema = object({
7424
7408
  limit: number().int().min(1).max(1e3).optional()
7425
7409
  });
7426
7410
  /**
7411
+ * Entity-relocation job state (storage entity-routing spec, Phase 4).
7412
+ *
7413
+ * One shape shared by the recorder's `relocateFootage` (segments + strips) and
7414
+ * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7415
+ * page renders both movers with one component. Jobs are in-RAM (a restart
7416
+ * forgets them — re-running is safe by construction: copy-if-absent, delete
7417
+ * after verify) and each completed/failed run also lands one durable ops-log
7418
+ * row on the owning addon's surface.
7419
+ */
7420
+ var RelocateJobStateSchema = _enum([
7421
+ "running",
7422
+ "done",
7423
+ "failed",
7424
+ "cancelled"
7425
+ ]);
7426
+ var RelocateJobSchema = object({
7427
+ jobId: string(),
7428
+ state: RelocateJobStateSchema,
7429
+ /** Source location — for media relocation this is informational ('*': rows
7430
+ * move from wherever they are to the target). */
7431
+ fromLocationId: string(),
7432
+ toLocationId: string(),
7433
+ /** Scoped device, or null = every device. */
7434
+ deviceId: number().nullable(),
7435
+ /** What the job moves (owner-addon specific: segments/strips or media). */
7436
+ entities: array(string()),
7437
+ filesMoved: number().int(),
7438
+ bytesMoved: number().int(),
7439
+ /** Total files discovered up front; null while (or when) unknown. */
7440
+ filesTotal: number().int().nullable(),
7441
+ startedAt: number(),
7442
+ finishedAt: number().nullable(),
7443
+ error: string().nullable()
7444
+ });
7445
+ var RelocateFootageInputSchema = object({
7446
+ deviceId: number().optional(),
7447
+ fromLocationId: string(),
7448
+ toLocationId: string(),
7449
+ entities: array(_enum(["segments", "strips"])).optional(),
7450
+ /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7451
+ * never allowed to starve live writers. */
7452
+ throttleMbps: number().min(1).max(1e3).optional()
7453
+ });
7454
+ var RelocateMediaInputSchema = object({
7455
+ deviceId: number().optional(),
7456
+ toLocationId: string(),
7457
+ throttleMbps: number().min(1).max(1e3).optional()
7458
+ });
7459
+ /**
7427
7460
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7428
7461
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7429
7462
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -7473,6 +7506,13 @@ var StorageLocationSchema = object({
7473
7506
  nodeId: string().optional(),
7474
7507
  isDefault: boolean().default(false),
7475
7508
  isSystem: boolean().default(false),
7509
+ /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7510
+ * for node-local locations it can reach) — never persisted, absent when the
7511
+ * volume is remote/unreachable. The single capacity truth every UI reads. */
7512
+ capacity: object({
7513
+ totalBytes: number(),
7514
+ availableBytes: number()
7515
+ }).nullable().optional(),
7476
7516
  createdAt: number(),
7477
7517
  updatedAt: number()
7478
7518
  });
@@ -8240,7 +8280,8 @@ var NcTaxonomyEntrySchema = object({
8240
8280
  /** Macro/category parent for grouping ('car' → 'vehicle'); null for a top. */
8241
8281
  parentKind: string().nullable()
8242
8282
  });
8243
- object({
8283
+ /** The complete NC picker taxonomy — three grouped buckets. */
8284
+ var NcTaxonomySchema = object({
8244
8285
  videoClasses: array(NcTaxonomyEntrySchema),
8245
8286
  audioKinds: array(NcTaxonomyEntrySchema),
8246
8287
  labels: array(NcTaxonomyEntrySchema)
@@ -9143,6 +9184,7 @@ function shallowEqual(a, b) {
9143
9184
  for (const k of ak) if (a[k] !== b[k]) return false;
9144
9185
  return true;
9145
9186
  }
9187
+ new Set(["devices", "classes"]);
9146
9188
  /**
9147
9189
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
9148
9190
  * motion-zones, and the detection zones/lines editor all speak this one
@@ -9301,6 +9343,29 @@ var NcOccupancyConditionSchema = object({
9301
9343
  count: number().int().min(0).default(1),
9302
9344
  sustainSeconds: number().int().min(0).max(3600).default(15)
9303
9345
  });
9346
+ /**
9347
+ * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
9348
+ *
9349
+ * The values are not symmetric, and deliberately so — the absent value has to
9350
+ * mean exactly what every rule authored before this condition existed already
9351
+ * does:
9352
+ * - `enter` — entries and every NON-crossing record (movement state,
9353
+ * package, sensor). Exits are rejected. **This is the absent behaviour**:
9354
+ * an operator who never asked for exits must not start receiving them.
9355
+ * - `exit` — ONLY an exit crossing. A record that is not a crossing at all
9356
+ * fails closed, because "the car left the drive" is a question about a
9357
+ * boundary, not about a detection.
9358
+ * - `any` — no direction filter; entries, exits and non-crossings alike.
9359
+ *
9360
+ * A rule asking for a direction should normally also scope `zones`, which the
9361
+ * engine evaluates against the crossed zone as well as the current membership
9362
+ * (an exit's membership no longer contains the zone it just left).
9363
+ */
9364
+ var NcCrossingSchema = _enum([
9365
+ "enter",
9366
+ "exit",
9367
+ "any"
9368
+ ]);
9304
9369
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
9305
9370
  var NcZoneConditionSchema = object({
9306
9371
  ids: array(string().min(1)).min(1),
@@ -9325,6 +9390,13 @@ var NcConditionsSchema = object({
9325
9390
  /** Veto zones — any hit fails the rule. */
9326
9391
  zonesExclude: array(string().min(1)).optional(),
9327
9392
  /**
9393
+ * Zone-crossing direction. IMMEDIATE only — a crossing is a per-event fact
9394
+ * and a closed track carries none, so a `track-end` rule asking for one
9395
+ * fails closed (use `zones`, which tests `zonesVisited`). ABSENT = `enter`,
9396
+ * which is exactly today's behaviour. See {@link NcCrossingSchema}.
9397
+ */
9398
+ crossing: NcCrossingSchema.optional(),
9399
+ /**
9328
9400
  * Exact (case-insensitive) match on the record's collapsed `label`
9329
9401
  * (identity name / plate text / subclass).
9330
9402
  */
@@ -9459,17 +9531,85 @@ var NcRuleTargetSchema = object({
9459
9531
  * - `keyFrame` — the clean scene frame (no subject box).
9460
9532
  * - `none` — no attachment.
9461
9533
  */
9462
- var NcMediaPolicySchema = object({ attach: _enum([
9463
- "best",
9464
- "best-matching",
9465
- "keyFrame",
9466
- "none"
9467
- ]).default("best") });
9534
+ /**
9535
+ * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
9536
+ * conflate it with the selection strategy and betray the request: asking for
9537
+ * the clean scene frame on an object-event owner used to start at
9538
+ * `fullFrameBoxed`, i.e. the annotated frame (2026-07-30).
9539
+ * - `cropped` — the subject, tight. What "who is at the door" wants.
9540
+ * - `full` — the clean scene, no annotation. What "what is going on" wants.
9541
+ * - `boxed` — the scene WITH the detection boxes drawn, for verifying what
9542
+ * the pipeline actually saw.
9543
+ */
9544
+ var NcMediaFrameSchema = _enum([
9545
+ "cropped",
9546
+ "full",
9547
+ "boxed"
9548
+ ]);
9549
+ var NcMediaPolicySchema = object({
9550
+ attach: _enum([
9551
+ "best",
9552
+ "best-matching",
9553
+ "keyFrame",
9554
+ "none"
9555
+ ]).default("best"),
9556
+ /** What the still shows. Absent = `cropped` (the historical `best` shape). */
9557
+ frame: NcMediaFrameSchema.optional(),
9558
+ /** Crop the attached still to the rule's condition-zone bbox (padded) —
9559
+ * "show me the ZONE", not the whole scene or the subject crop. */
9560
+ zoneCrop: boolean().optional(),
9561
+ /**
9562
+ * Also attach a short GIF cut from the stream broker's clip ring around the
9563
+ * event — NOT from the recording, so the camera does not have to be
9564
+ * recording, and the window sits AROUND the moment instead of a segment
9565
+ * behind it. Fail-closed: a window the ring does not cover contributes no
9566
+ * gif, never a failed notification.
9567
+ */
9568
+ gif: boolean().optional(),
9569
+ /**
9570
+ * Also attach a short MP4 CLIP of the same cut. Same source and the same
9571
+ * fail-closed rule as `gif`. Prefer it where the backend takes video
9572
+ * (telegram, discord, zentik, webhook); backends that do not are handled by
9573
+ * the degrade engine, which drops the video and keeps the still.
9574
+ */
9575
+ clip: boolean().optional(),
9576
+ /** Seconds of footage BEFORE / AFTER the event instant. Defaults 3 / 7. */
9577
+ clipPreRollSec: number().int().min(0).max(30).optional(),
9578
+ clipPostRollSec: number().int().min(0).max(30).optional(),
9579
+ /**
9580
+ * Which stream profile the footage is cut from. Absent = the CHEAPEST
9581
+ * assigned profile: a notification is watched on a phone, so the 4K
9582
+ * rendition would burn CPU to produce a file the client downscales anyway.
9583
+ * A profile that is not assigned falls back to the cheapest, and the render
9584
+ * reports which one actually ran.
9585
+ */
9586
+ profile: CamProfileSchema.optional()
9587
+ });
9588
+ /**
9589
+ * Cooldown GRANULARITY over the subject's class — how much a fired
9590
+ * notification suppresses.
9591
+ * - `shared` (default, and the absent value) — one window for the whole
9592
+ * rule/scope: a cat silences the next dog for `cooldownSec`.
9593
+ * - `per-class` — an independent window per detected class, so cat→dog fires
9594
+ * at once and cat→cat still waits.
9595
+ *
9596
+ * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
9597
+ * must not be swallowed by a bark's window (the precedent this generalizes —
9598
+ * see `cooldownKey` in the rule engine).
9599
+ */
9600
+ var NcThrottleGranularitySchema = _enum(["shared", "per-class"]);
9468
9601
  /** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
9469
9602
  var NcThrottleSchema = object({
9470
9603
  cooldownSec: number().int().min(0).max(86400).default(60),
9471
9604
  /** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
9472
- scope: _enum(["rule", "rule-device"]).default("rule-device")
9605
+ scope: _enum(["rule", "rule-device"]).default("rule-device"),
9606
+ /**
9607
+ * Class granularity of the cooldown key. Optional rather than defaulted:
9608
+ * a Zod default does NOT run on the addon→addon cap path, so a persisted
9609
+ * rule authored before this field simply carries none — and the engine
9610
+ * reads absent as `shared`, the pre-existing behaviour.
9611
+ */
9612
+ granularity: NcThrottleGranularitySchema.optional()
9473
9613
  });
9474
9614
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
9475
9615
  var NcRuleInputSchema = object({
@@ -9478,7 +9618,19 @@ var NcRuleInputSchema = object({
9478
9618
  delivery: NcDeliverySchema,
9479
9619
  conditions: NcConditionsSchema.default({}),
9480
9620
  schedule: NcScheduleSchema.optional(),
9481
- targets: array(NcRuleTargetSchema).min(1),
9621
+ /** May be empty when `targetUsers` addresses at least one user — the
9622
+ * "at least one addressee" invariant is enforced by the provider, because
9623
+ * a cross-field refine here would break `NcRulePatchSchema.partial()`. */
9624
+ targets: array(NcRuleTargetSchema),
9625
+ /**
9626
+ * USERS this rule addresses in addition to `targets` (Phase 4). At fire
9627
+ * time each user fans out to the personal targets they own
9628
+ * (`config.ownerUserId`), filtered by that user's `allowedDevices` for the
9629
+ * firing camera — a user is never notified about a device they cannot open.
9630
+ * Per-user opt-outs (`disabledTargetIds`) still apply to the fanned-out
9631
+ * targets.
9632
+ */
9633
+ targetUsers: array(string()).optional(),
9482
9634
  media: NcMediaPolicySchema.default({ attach: "best" }),
9483
9635
  throttle: NcThrottleSchema.default({
9484
9636
  cooldownSec: 60,
@@ -9565,6 +9717,7 @@ var NcConditionDescriptorSchema = object({
9565
9717
  "schedule",
9566
9718
  "plateMatcher",
9567
9719
  "packagePhase",
9720
+ "crossingSelect",
9568
9721
  "polygonDraw",
9569
9722
  "occupancy"
9570
9723
  ]),
@@ -9691,7 +9844,10 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
9691
9844
  }), object({ results: array(NcTestResultSchema) }), {
9692
9845
  kind: "mutation",
9693
9846
  auth: "admin"
9694
- }), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9847
+ }), method(object({}), object({
9848
+ catalog: array(NcConditionDescriptorSchema),
9849
+ taxonomy: NcTaxonomySchema.optional()
9850
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9695
9851
  /**
9696
9852
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
9697
9853
  *
@@ -10700,6 +10856,28 @@ method(object({
10700
10856
  }), object({ success: literal(true) }), {
10701
10857
  kind: "mutation",
10702
10858
  auth: "admin"
10859
+ }), method(object({
10860
+ deviceId: number(),
10861
+ /** Absent = the LOWEST assigned profile — a notification attachment is
10862
+ * watched on a phone, and the cheap rendition is the right default. */
10863
+ profile: CamProfileSchema.optional(),
10864
+ aroundMs: number(),
10865
+ preRollSec: number().min(0).max(20).default(3),
10866
+ postRollSec: number().min(0).max(20).default(5),
10867
+ format: _enum(["gif", "mp4"]).default("gif"),
10868
+ maxWidth: number().int().min(120).max(1920).default(480),
10869
+ /** GIF only — MP4 keeps the source cadence. */
10870
+ fps: number().int().min(1).max(15).default(5)
10871
+ }), object({
10872
+ base64: string(),
10873
+ mime: string(),
10874
+ bytes: number().int(),
10875
+ /** The profile actually rendered (what the default resolved to). */
10876
+ profile: CamProfileSchema,
10877
+ durationMs: number()
10878
+ }), {
10879
+ kind: "mutation",
10880
+ auth: "admin"
10703
10881
  }), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string() }), BrokerStatsSchema), method(object({ brokerId: string() }), object({
10704
10882
  probed: boolean(),
10705
10883
  summary: string()
@@ -18762,7 +18940,10 @@ method(object({
18762
18940
  }), method(object({
18763
18941
  deviceId: number(),
18764
18942
  caps: array(string()).readonly().optional()
18765
- }), record(string(), unknown().nullable()));
18943
+ }), record(string(), unknown().nullable())), method(object({
18944
+ deviceIds: array(number()).readonly(),
18945
+ caps: array(string()).readonly().optional()
18946
+ }), record(string(), record(string(), unknown().nullable())));
18766
18947
  method(object({ deviceId: number() }), record(string(), record(string(), unknown()))), method(object({
18767
18948
  deviceId: number(),
18768
18949
  capName: string()
@@ -19693,6 +19874,36 @@ var TargetKindSchema = object({
19693
19874
  icon: string(),
19694
19875
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
19695
19876
  addonId: string(),
19877
+ /**
19878
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
19879
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
19880
+ * when the addon bundles no icon for that kind — the client then falls back
19881
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
19882
+ *
19883
+ * Root-relative on purpose: it resolves against whatever origin serves a web
19884
+ * client, and a native client joins it onto its own hub base.
19885
+ *
19886
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
19887
+ * field that survived only because the runtime cap-router forwards provider
19888
+ * output verbatim — so every consumer had to re-declare it by hand to stop
19889
+ * its own Zod parse from stripping it, and the whole arrangement would have
19890
+ * broken silently the moment output validation was tightened anywhere.
19891
+ */
19892
+ iconUrl: string().optional(),
19893
+ /**
19894
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
19895
+ *
19896
+ * The server knows this and therefore says it, because the client cannot
19897
+ * safely guess: a React-Native client renders SVG and raster through two
19898
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
19899
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
19900
+ * placeholder glyph for every vector icon while the web build looked fine.
19901
+ *
19902
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
19903
+ * not been updated — a client that cannot determine the type should prefer
19904
+ * its raster path, which is the safe default for an unknown image.
19905
+ */
19906
+ iconMediaType: string().optional(),
19696
19907
  configSchema: ConfigSchemaPassthrough,
19697
19908
  supportsDiscovery: boolean(),
19698
19909
  caps: TargetKindCapsSchema
@@ -20140,6 +20351,29 @@ var MotionEventSchema = object({
20140
20351
  * Absent on legacy rows ⇒ treat as `pipeline`.
20141
20352
  */
20142
20353
  var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
20354
+ /**
20355
+ * The confirmed zone crossing that produced an object event. Present ONLY on
20356
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
20357
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
20358
+ * appearance event carry none, so a rule asking for a direction fails closed
20359
+ * on them.
20360
+ *
20361
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
20362
+ * into its own event, so a frame in which a track enters A while leaving B
20363
+ * produces two events with two directions — never one ambiguous row.
20364
+ *
20365
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
20366
+ * membership the box has NOW, and by definition it no longer contains the zone
20367
+ * that was just left. Without the id here, a zone-scoped rule could never match
20368
+ * the exit it asked for.
20369
+ */
20370
+ var ZoneCrossingSchema = object({
20371
+ direction: _enum(["enter", "exit"]),
20372
+ /** Admin zone id crossed. */
20373
+ zoneId: string(),
20374
+ /** Zone display name at crossing time (falls back to the id). */
20375
+ zoneName: string().optional()
20376
+ });
20143
20377
  var ObjectEventSchema = object({
20144
20378
  ...BaseEventFields,
20145
20379
  kind: literal("object"),
@@ -20166,6 +20400,12 @@ var ObjectEventSchema = object({
20166
20400
  zones: array(string()).readonly().optional(),
20167
20401
  /** Omitted in slim projection. */
20168
20402
  state: TrackStateSchema.optional(),
20403
+ /**
20404
+ * The zone crossing this event IS, when it is one. Absent on every other
20405
+ * event kind (movement state, appearance, package) — see
20406
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
20407
+ */
20408
+ zoneCrossing: ZoneCrossingSchema.optional(),
20169
20409
  /** Detection-frame dimensions in pixels — let consumers normalize the
20170
20410
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
20171
20411
  frameWidth: number().optional(),
@@ -20424,6 +20664,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20424
20664
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
20425
20665
  kind: "mutation",
20426
20666
  auth: "admin"
20667
+ }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
20668
+ kind: "mutation",
20669
+ auth: "admin"
20670
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
20671
+ kind: "query",
20672
+ auth: "admin"
20673
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
20674
+ kind: "mutation",
20675
+ auth: "admin"
20427
20676
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
20428
20677
  kind: "query",
20429
20678
  auth: "admin"
@@ -22903,6 +23152,17 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
22903
23152
  */
22904
23153
  priority: number()
22905
23154
  })).readonly() });
23155
+ /**
23156
+ * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
23157
+ * AUTO (resolved from the candidate ranking at send time); `resolved` reports
23158
+ * what AUTO currently picks, so the UI can show the effective value either way.
23159
+ */
23160
+ var NotificationEndpointSchema = object({
23161
+ /** The operator's explicit choice, or null for AUTO. */
23162
+ baseUrl: string().nullable(),
23163
+ /** What the ranking currently resolves to (null when nothing is reachable). */
23164
+ resolved: string().nullable()
23165
+ });
22906
23166
  var AllowedAddressesSchema = object({
22907
23167
  /**
22908
23168
  * Allowlist of interface addresses operators have explicitly opted
@@ -22925,7 +23185,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
22925
23185
  * to avoid mixed-content blocks in the browser. The public
22926
23186
  * tunnel always emits `https://` regardless. */
22927
23187
  scheme: _enum(["http", "https"]).optional()
22928
- }), GetConnectionEndpointsResultSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
23188
+ }), 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" });
22929
23189
  /**
22930
23190
  * mesh-network — collection cap for mesh-VPN providers.
22931
23191
  *
@@ -23724,7 +23984,12 @@ var RecordingDeviceUsageSchema = object({
23724
23984
  var RecordingLocationUsageSchema = object({
23725
23985
  /** StorageLocation id; null for the legacy/degraded single-root fallback. */
23726
23986
  locationId: string().nullable(),
23727
- /** Bytes of recordings stored on this location. */
23987
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
23988
+ * is emitted per physical disk (2026-07-29): two locations on one root
23989
+ * previously rendered as two identical "disks" with a nonsensical used
23990
+ * split — hydrate attribution across aliases is arbitrary by nature. */
23991
+ locationIds: array(string()).optional(),
23992
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). */
23728
23993
  usedBytes: number(),
23729
23994
  /** Free bytes on the location's volume; null when capacity is unknown (remote). */
23730
23995
  availableBytes: number().nullable(),
@@ -23836,6 +24101,44 @@ method(object({
23836
24101
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
23837
24102
  kind: "query",
23838
24103
  auth: "admin"
24104
+ }), method(object({
24105
+ deviceId: number(),
24106
+ aroundMs: number(),
24107
+ preRollSec: number().min(0).max(30).default(2),
24108
+ postRollSec: number().min(0).max(30).default(5),
24109
+ maxWidth: number().int().min(120).max(1280).default(480),
24110
+ fps: number().int().min(1).max(15).default(5)
24111
+ }), object({
24112
+ gifBase64: string(),
24113
+ fromMs: number(),
24114
+ toMs: number()
24115
+ }), {
24116
+ kind: "mutation",
24117
+ auth: "admin"
24118
+ }), method(object({
24119
+ deviceId: number(),
24120
+ aroundMs: number(),
24121
+ preRollSec: number().min(0).max(30).default(3),
24122
+ postRollSec: number().min(0).max(30).default(7),
24123
+ maxWidth: number().int().min(160).max(1920).default(640)
24124
+ }), object({
24125
+ clipBase64: string(),
24126
+ mime: string(),
24127
+ fromMs: number(),
24128
+ toMs: number(),
24129
+ bytes: number().int()
24130
+ }), {
24131
+ kind: "mutation",
24132
+ auth: "admin"
24133
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
24134
+ kind: "mutation",
24135
+ auth: "admin"
24136
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
24137
+ kind: "query",
24138
+ auth: "admin"
24139
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
24140
+ kind: "mutation",
24141
+ auth: "admin"
23839
24142
  });
23840
24143
  /**
23841
24144
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -25427,6 +25730,12 @@ Object.freeze({
25427
25730
  addonId: null,
25428
25731
  access: "view"
25429
25732
  },
25733
+ "deviceManager.getDeviceStatusAggregateBatch": {
25734
+ capName: "device-manager",
25735
+ capScope: "system",
25736
+ addonId: null,
25737
+ access: "view"
25738
+ },
25430
25739
  "deviceManager.getLinkedDevices": {
25431
25740
  capName: "device-manager",
25432
25741
  capScope: "system",
@@ -26321,6 +26630,12 @@ Object.freeze({
26321
26630
  addonId: null,
26322
26631
  access: "view"
26323
26632
  },
26633
+ "localNetwork.getNotificationEndpoint": {
26634
+ capName: "local-network",
26635
+ capScope: "system",
26636
+ addonId: null,
26637
+ access: "view"
26638
+ },
26324
26639
  "localNetwork.getPreferred": {
26325
26640
  capName: "local-network",
26326
26641
  capScope: "system",
@@ -26345,6 +26660,12 @@ Object.freeze({
26345
26660
  addonId: null,
26346
26661
  access: "create"
26347
26662
  },
26663
+ "localNetwork.setNotificationEndpoint": {
26664
+ capName: "local-network",
26665
+ capScope: "system",
26666
+ addonId: null,
26667
+ access: "create"
26668
+ },
26348
26669
  "lockControl.lock": {
26349
26670
  capName: "lock-control",
26350
26671
  capScope: "device",
@@ -26987,6 +27308,12 @@ Object.freeze({
26987
27308
  addonId: null,
26988
27309
  access: "create"
26989
27310
  },
27311
+ "pipelineAnalytics.cancelMediaRelocate": {
27312
+ capName: "pipeline-analytics",
27313
+ capScope: "device",
27314
+ addonId: null,
27315
+ access: "create"
27316
+ },
26990
27317
  "pipelineAnalytics.clearTracks": {
26991
27318
  capName: "pipeline-analytics",
26992
27319
  capScope: "device",
@@ -27041,6 +27368,12 @@ Object.freeze({
27041
27368
  addonId: null,
27042
27369
  access: "view"
27043
27370
  },
27371
+ "pipelineAnalytics.getMediaRelocateStatus": {
27372
+ capName: "pipeline-analytics",
27373
+ capScope: "device",
27374
+ addonId: null,
27375
+ access: "view"
27376
+ },
27044
27377
  "pipelineAnalytics.getMotionEvents": {
27045
27378
  capName: "pipeline-analytics",
27046
27379
  capScope: "device",
@@ -27113,6 +27446,12 @@ Object.freeze({
27113
27446
  addonId: null,
27114
27447
  access: "create"
27115
27448
  },
27449
+ "pipelineAnalytics.relocateMedia": {
27450
+ capName: "pipeline-analytics",
27451
+ capScope: "device",
27452
+ addonId: null,
27453
+ access: "create"
27454
+ },
27116
27455
  "pipelineAnalytics.searchObjectEvents": {
27117
27456
  capName: "pipeline-analytics",
27118
27457
  capScope: "device",
@@ -27875,6 +28214,12 @@ Object.freeze({
27875
28214
  addonId: null,
27876
28215
  access: "create"
27877
28216
  },
28217
+ "recording.cancelRelocate": {
28218
+ capName: "recording",
28219
+ capScope: "system",
28220
+ addonId: null,
28221
+ access: "create"
28222
+ },
27878
28223
  "recording.deleteFootprint": {
27879
28224
  capName: "recording",
27880
28225
  capScope: "system",
@@ -27905,6 +28250,12 @@ Object.freeze({
27905
28250
  addonId: null,
27906
28251
  access: "view"
27907
28252
  },
28253
+ "recording.getRelocateStatus": {
28254
+ capName: "recording",
28255
+ capScope: "system",
28256
+ addonId: null,
28257
+ access: "view"
28258
+ },
27908
28259
  "recording.getStorageUsage": {
27909
28260
  capName: "recording",
27910
28261
  capScope: "system",
@@ -27935,6 +28286,24 @@ Object.freeze({
27935
28286
  addonId: null,
27936
28287
  access: "view"
27937
28288
  },
28289
+ "recording.relocateFootage": {
28290
+ capName: "recording",
28291
+ capScope: "system",
28292
+ addonId: null,
28293
+ access: "create"
28294
+ },
28295
+ "recording.renderClip": {
28296
+ capName: "recording",
28297
+ capScope: "system",
28298
+ addonId: null,
28299
+ access: "create"
28300
+ },
28301
+ "recording.renderGif": {
28302
+ capName: "recording",
28303
+ capScope: "system",
28304
+ addonId: null,
28305
+ access: "create"
28306
+ },
27938
28307
  "recording.rescanStorage": {
27939
28308
  capName: "recording",
27940
28309
  capScope: "system",
@@ -28529,6 +28898,12 @@ Object.freeze({
28529
28898
  addonId: null,
28530
28899
  access: "create"
28531
28900
  },
28901
+ "streamBroker.renderPreBufferClip": {
28902
+ capName: "stream-broker",
28903
+ capScope: "system",
28904
+ addonId: null,
28905
+ access: "create"
28906
+ },
28532
28907
  "streamBroker.restartProfile": {
28533
28908
  capName: "stream-broker",
28534
28909
  capScope: "system",