@camstack/addon-ai 0.2.10 → 0.2.11

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.js CHANGED
@@ -43,7 +43,7 @@ let node_fs_promises = require("node:fs/promises");
43
43
  node_fs_promises = __toESM(node_fs_promises);
44
44
  let node_child_process = require("node:child_process");
45
45
  let node_net = require("node:net");
46
- //#region ../types/dist/event-category-BLcNejAE.mjs
46
+ //#region ../types/dist/event-category-Bz24uP1U.mjs
47
47
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
48
48
  EventCategory["SystemBoot"] = "system.boot";
49
49
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -314,6 +314,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
314
314
  */
315
315
  EventCategory["DeviceStateChanged"] = "device.state-changed";
316
316
  /**
317
+ * Frame occupancy for a camera CHANGED — a tracked object was gained or
318
+ * lost. Carries `{ deviceId, totalObjects, byClass, zones }`.
319
+ *
320
+ * Emitted only on a change, so a steady scene is silent. It exists so a
321
+ * client can stop polling `zoneAnalytics.getCurrentSnapshot`: that was the
322
+ * one live badge with no push signal at all, and it cost a request every
323
+ * four seconds per visible camera.
324
+ *
325
+ * Like every event it is telemetry and may be dropped ([D8]) — a consumer
326
+ * keeps a slow reconcile rather than trusting it alone.
327
+ */
328
+ EventCategory["ZoneAnalyticsOccupancyChanged"] = "zone-analytics.occupancy-changed";
329
+ /**
317
330
  * Cap event fired by every device that registers the `battery`
318
331
  * capability. Mirrors the cap definition's `onStatusChanged`. Carries
319
332
  * `{ deviceId, status: BatteryStatus }`. Subscribers (alert center,
@@ -7257,35 +7270,22 @@ var ConvertResultSchema = object({
7257
7270
  */
7258
7271
  var RecordingWeekdaySchema = number().int().min(0).max(6);
7259
7272
  var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
7260
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
7261
- kind: literal("timeOfDay"),
7262
- start: string().regex(HHMM),
7263
- end: string().regex(HHMM),
7264
- /** Restrict to these weekdays; omit = every day. */
7265
- days: array(RecordingWeekdaySchema).optional()
7266
- })]);
7267
- var RecordingModeSchema = _enum([
7268
- "continuous",
7269
- "onMotion",
7270
- "onAudioThreshold"
7271
- ]);
7272
7273
  /**
7273
- * First-class, authoritative per-camera storage mode — the explicit choice the
7274
- * UI reads directly (never inferred from `rules`):
7275
- * - `off` — not recording.
7276
- * - `events` — record only around triggers (motion / audio threshold),
7277
- * with pre/post-buffer.
7278
- * - `continuous` — record 24/7 within the schedule.
7274
+ * DERIVED per-camera storage summary — the single field cheap consumers read
7275
+ * (the viewer's status dot, the camera list) instead of walking `bands`:
7276
+ * - `off` — no band covers the camera (or it is disabled).
7277
+ * - `events` — every band records around triggers only.
7278
+ * - `continuous` — at least one band records continuously.
7279
7279
  *
7280
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
7281
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
7280
+ * NEVER authored: the recorder stamps it from the authoritative `bands` on
7281
+ * every save (`activeModeForConfig`). Writing it has no effect.
7282
7282
  */
7283
7283
  var RecordingStorageModeSchema = _enum([
7284
7284
  "off",
7285
7285
  "events",
7286
7286
  "continuous"
7287
7287
  ]);
7288
- /** Which detectors trigger an `events`-mode recording. */
7288
+ /** Which detectors trigger an `events`-mode band. */
7289
7289
  var RecordingTriggersSchema = object({
7290
7290
  motion: boolean().optional(),
7291
7291
  audioThresholdDbfs: number().optional()
@@ -7321,18 +7321,6 @@ var RecordingBandSchema = object({
7321
7321
  preBufferSec: number().min(0).optional(),
7322
7322
  postBufferSec: number().min(0).optional()
7323
7323
  });
7324
- var RecordingRuleSchema = object({
7325
- schedule: RecordingScheduleSchema,
7326
- mode: RecordingModeSchema,
7327
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
7328
- preBufferSec: number().min(0).default(0),
7329
- /** Keep recording until this many seconds after the last trigger. */
7330
- postBufferSec: number().min(0).default(0),
7331
- /** Each new trigger restarts the post-buffer window. */
7332
- resetTimeoutOnNewEvent: boolean().default(true),
7333
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
7334
- thresholdDbfs: number().optional()
7335
- });
7336
7324
  /**
7337
7325
  * Per-device retention overrides. Every field is optional; an unset or `0`
7338
7326
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7366,40 +7354,28 @@ var ScrubThumbnailPresetSchema = _enum([
7366
7354
  /**
7367
7355
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7368
7356
  *
7369
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
7370
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
7371
- * only for transition + migration (`migrateRulesToMode`); the policy engine
7372
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
7357
+ * `bands` is the ONLY authored recording intent: what to record, when, and on
7358
+ * which trigger. `mode` is a derived summary the recorder stamps on save; every
7359
+ * other field is a storage knob (profiles, segment length, retention, scrub).
7360
+ *
7361
+ * STRICT on purpose: the legacy authoring surface (`schedule`/`schedules`/
7362
+ * `triggers`/`preBufferSec`/`postBufferSec`/`rules`) was retired 2026-07-30.
7363
+ * A stale caller must fail loudly — silently stripping its legacy intent would
7364
+ * persist a band-less config, i.e. silently stop recording the camera.
7373
7365
  */
7374
7366
  var RecordingConfigSchema = object({
7375
7367
  enabled: boolean(),
7376
- /** Authoritative storage mode. Absent on legacy targets derived once via
7377
- * `migrateRulesToMode`, then persisted. */
7368
+ /** DERIVED summary of `bands`, stamped by the recorder on every save.
7369
+ * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7378
7370
  mode: RecordingStorageModeSchema.optional(),
7379
7371
  profiles: array(CamProfileSchema).optional(),
7380
7372
  segmentSeconds: number().int().positive().optional(),
7381
- /** Shared recording time-bands for `events` & `continuous` — record only when
7382
- * the wall-clock falls inside one of these windows. Omit or empty = always.
7383
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
7384
- schedules: array(RecordingScheduleSchema).optional(),
7385
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
7386
- * normalized into `schedules` on read and never written going forward. (Not
7387
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
7388
- schedule: RecordingScheduleSchema.optional(),
7389
- /** `events`-mode only — which detectors trigger a recording. */
7390
- triggers: RecordingTriggersSchema.optional(),
7391
- /** `events`-mode only — seconds retained before / after a trigger. */
7392
- preBufferSec: number().min(0).optional(),
7393
- postBufferSec: number().min(0).optional(),
7394
- /** DEPRECATED authoring input; retained for migration/transition. */
7395
- rules: array(RecordingRuleSchema).optional(),
7396
7373
  /**
7397
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
7398
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
7399
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
7400
- * derived into bands once via `migrateConfigToBands`.
7374
+ * AUTHORITATIVE mode-per-band recording model the single source of truth
7375
+ * the recorder's band engine consumes. An empty array = record nothing;
7376
+ * "off" is the absence of a covering band, never a band value.
7401
7377
  */
7402
- bands: array(RecordingBandSchema).optional(),
7378
+ bands: array(RecordingBandSchema).default([]),
7403
7379
  retention: RecordingRetentionSchema.optional(),
7404
7380
  /**
7405
7381
  * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
@@ -7407,8 +7383,15 @@ var RecordingConfigSchema = object({
7407
7383
  * windows only — existing sheets are immutable, and each window's index
7408
7384
  * carries its own tile dims so mixed-preset history renders correctly.
7409
7385
  */
7410
- scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7411
- });
7386
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional(),
7387
+ /**
7388
+ * OPT-IN thumbnail-strip generation for this camera: every keyframe of the
7389
+ * low recording saved as a JPEG (the fast-drag scrub depth), a derived
7390
+ * cache that eviction reclaims with the footage. Absent/false = no strips
7391
+ * are written and scrub reads exact keyframes at every velocity.
7392
+ */
7393
+ stripsEnabled: boolean().optional()
7394
+ }).strict();
7412
7395
  /**
7413
7396
  * Ops-log — the durable, append-only operations audit shared by the
7414
7397
  * recordings and events management surfaces.
@@ -7427,7 +7410,8 @@ var OpsLogOpSchema = _enum([
7427
7410
  "prune",
7428
7411
  "manual-delete",
7429
7412
  "rescan",
7430
- "retention-run"
7413
+ "retention-run",
7414
+ "relocate"
7431
7415
  ]);
7432
7416
  /** Why the operation ran. */
7433
7417
  var OpsLogReasonSchema = _enum([
@@ -7466,6 +7450,55 @@ var OpsLogQueryInputSchema = object({
7466
7450
  limit: number().int().min(1).max(1e3).optional()
7467
7451
  });
7468
7452
  /**
7453
+ * Entity-relocation job state (storage entity-routing spec, Phase 4).
7454
+ *
7455
+ * One shape shared by the recorder's `relocateFootage` (segments + strips) and
7456
+ * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7457
+ * page renders both movers with one component. Jobs are in-RAM (a restart
7458
+ * forgets them — re-running is safe by construction: copy-if-absent, delete
7459
+ * after verify) and each completed/failed run also lands one durable ops-log
7460
+ * row on the owning addon's surface.
7461
+ */
7462
+ var RelocateJobStateSchema = _enum([
7463
+ "running",
7464
+ "done",
7465
+ "failed",
7466
+ "cancelled"
7467
+ ]);
7468
+ var RelocateJobSchema = object({
7469
+ jobId: string(),
7470
+ state: RelocateJobStateSchema,
7471
+ /** Source location — for media relocation this is informational ('*': rows
7472
+ * move from wherever they are to the target). */
7473
+ fromLocationId: string(),
7474
+ toLocationId: string(),
7475
+ /** Scoped device, or null = every device. */
7476
+ deviceId: number().nullable(),
7477
+ /** What the job moves (owner-addon specific: segments/strips or media). */
7478
+ entities: array(string()),
7479
+ filesMoved: number().int(),
7480
+ bytesMoved: number().int(),
7481
+ /** Total files discovered up front; null while (or when) unknown. */
7482
+ filesTotal: number().int().nullable(),
7483
+ startedAt: number(),
7484
+ finishedAt: number().nullable(),
7485
+ error: string().nullable()
7486
+ });
7487
+ var RelocateFootageInputSchema = object({
7488
+ deviceId: number().optional(),
7489
+ fromLocationId: string(),
7490
+ toLocationId: string(),
7491
+ entities: array(_enum(["segments", "strips"])).optional(),
7492
+ /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7493
+ * never allowed to starve live writers. */
7494
+ throttleMbps: number().min(1).max(1e3).optional()
7495
+ });
7496
+ var RelocateMediaInputSchema = object({
7497
+ deviceId: number().optional(),
7498
+ toLocationId: string(),
7499
+ throttleMbps: number().min(1).max(1e3).optional()
7500
+ });
7501
+ /**
7469
7502
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7470
7503
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7471
7504
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -7515,6 +7548,13 @@ var StorageLocationSchema = object({
7515
7548
  nodeId: string().optional(),
7516
7549
  isDefault: boolean().default(false),
7517
7550
  isSystem: boolean().default(false),
7551
+ /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7552
+ * for node-local locations it can reach) — never persisted, absent when the
7553
+ * volume is remote/unreachable. The single capacity truth every UI reads. */
7554
+ capacity: object({
7555
+ totalBytes: number(),
7556
+ availableBytes: number()
7557
+ }).nullable().optional(),
7518
7558
  createdAt: number(),
7519
7559
  updatedAt: number()
7520
7560
  });
@@ -8282,7 +8322,8 @@ var NcTaxonomyEntrySchema = object({
8282
8322
  /** Macro/category parent for grouping ('car' → 'vehicle'); null for a top. */
8283
8323
  parentKind: string().nullable()
8284
8324
  });
8285
- object({
8325
+ /** The complete NC picker taxonomy — three grouped buckets. */
8326
+ var NcTaxonomySchema = object({
8286
8327
  videoClasses: array(NcTaxonomyEntrySchema),
8287
8328
  audioKinds: array(NcTaxonomyEntrySchema),
8288
8329
  labels: array(NcTaxonomyEntrySchema)
@@ -8942,6 +8983,7 @@ var AccessoryKind = {
8942
8983
  };
8943
8984
  AccessoryKind.Siren, AccessoryKind.Floodlight, AccessoryKind.Spotlight, AccessoryKind.PirSensor, AccessoryKind.Chime, AccessoryKind.Autotrack, AccessoryKind.Nightvision, AccessoryKind.PrivacyMask;
8944
8985
  DeviceFeature.BatteryOperated;
8986
+ new Set(["devices", "classes"]);
8945
8987
  /**
8946
8988
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
8947
8989
  * motion-zones, and the detection zones/lines editor all speak this one
@@ -9100,6 +9142,29 @@ var NcOccupancyConditionSchema = object({
9100
9142
  count: number().int().min(0).default(1),
9101
9143
  sustainSeconds: number().int().min(0).max(3600).default(15)
9102
9144
  });
9145
+ /**
9146
+ * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
9147
+ *
9148
+ * The values are not symmetric, and deliberately so — the absent value has to
9149
+ * mean exactly what every rule authored before this condition existed already
9150
+ * does:
9151
+ * - `enter` — entries and every NON-crossing record (movement state,
9152
+ * package, sensor). Exits are rejected. **This is the absent behaviour**:
9153
+ * an operator who never asked for exits must not start receiving them.
9154
+ * - `exit` — ONLY an exit crossing. A record that is not a crossing at all
9155
+ * fails closed, because "the car left the drive" is a question about a
9156
+ * boundary, not about a detection.
9157
+ * - `any` — no direction filter; entries, exits and non-crossings alike.
9158
+ *
9159
+ * A rule asking for a direction should normally also scope `zones`, which the
9160
+ * engine evaluates against the crossed zone as well as the current membership
9161
+ * (an exit's membership no longer contains the zone it just left).
9162
+ */
9163
+ var NcCrossingSchema = _enum([
9164
+ "enter",
9165
+ "exit",
9166
+ "any"
9167
+ ]);
9103
9168
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
9104
9169
  var NcZoneConditionSchema = object({
9105
9170
  ids: array(string().min(1)).min(1),
@@ -9124,6 +9189,13 @@ var NcConditionsSchema = object({
9124
9189
  /** Veto zones — any hit fails the rule. */
9125
9190
  zonesExclude: array(string().min(1)).optional(),
9126
9191
  /**
9192
+ * Zone-crossing direction. IMMEDIATE only — a crossing is a per-event fact
9193
+ * and a closed track carries none, so a `track-end` rule asking for one
9194
+ * fails closed (use `zones`, which tests `zonesVisited`). ABSENT = `enter`,
9195
+ * which is exactly today's behaviour. See {@link NcCrossingSchema}.
9196
+ */
9197
+ crossing: NcCrossingSchema.optional(),
9198
+ /**
9127
9199
  * Exact (case-insensitive) match on the record's collapsed `label`
9128
9200
  * (identity name / plate text / subclass).
9129
9201
  */
@@ -9258,17 +9330,85 @@ var NcRuleTargetSchema = object({
9258
9330
  * - `keyFrame` — the clean scene frame (no subject box).
9259
9331
  * - `none` — no attachment.
9260
9332
  */
9261
- var NcMediaPolicySchema = object({ attach: _enum([
9262
- "best",
9263
- "best-matching",
9264
- "keyFrame",
9265
- "none"
9266
- ]).default("best") });
9333
+ /**
9334
+ * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
9335
+ * conflate it with the selection strategy and betray the request: asking for
9336
+ * the clean scene frame on an object-event owner used to start at
9337
+ * `fullFrameBoxed`, i.e. the annotated frame (2026-07-30).
9338
+ * - `cropped` — the subject, tight. What "who is at the door" wants.
9339
+ * - `full` — the clean scene, no annotation. What "what is going on" wants.
9340
+ * - `boxed` — the scene WITH the detection boxes drawn, for verifying what
9341
+ * the pipeline actually saw.
9342
+ */
9343
+ var NcMediaFrameSchema = _enum([
9344
+ "cropped",
9345
+ "full",
9346
+ "boxed"
9347
+ ]);
9348
+ var NcMediaPolicySchema = object({
9349
+ attach: _enum([
9350
+ "best",
9351
+ "best-matching",
9352
+ "keyFrame",
9353
+ "none"
9354
+ ]).default("best"),
9355
+ /** What the still shows. Absent = `cropped` (the historical `best` shape). */
9356
+ frame: NcMediaFrameSchema.optional(),
9357
+ /** Crop the attached still to the rule's condition-zone bbox (padded) —
9358
+ * "show me the ZONE", not the whole scene or the subject crop. */
9359
+ zoneCrop: boolean().optional(),
9360
+ /**
9361
+ * Also attach a short GIF cut from the stream broker's clip ring around the
9362
+ * event — NOT from the recording, so the camera does not have to be
9363
+ * recording, and the window sits AROUND the moment instead of a segment
9364
+ * behind it. Fail-closed: a window the ring does not cover contributes no
9365
+ * gif, never a failed notification.
9366
+ */
9367
+ gif: boolean().optional(),
9368
+ /**
9369
+ * Also attach a short MP4 CLIP of the same cut. Same source and the same
9370
+ * fail-closed rule as `gif`. Prefer it where the backend takes video
9371
+ * (telegram, discord, zentik, webhook); backends that do not are handled by
9372
+ * the degrade engine, which drops the video and keeps the still.
9373
+ */
9374
+ clip: boolean().optional(),
9375
+ /** Seconds of footage BEFORE / AFTER the event instant. Defaults 3 / 7. */
9376
+ clipPreRollSec: number().int().min(0).max(30).optional(),
9377
+ clipPostRollSec: number().int().min(0).max(30).optional(),
9378
+ /**
9379
+ * Which stream profile the footage is cut from. Absent = the CHEAPEST
9380
+ * assigned profile: a notification is watched on a phone, so the 4K
9381
+ * rendition would burn CPU to produce a file the client downscales anyway.
9382
+ * A profile that is not assigned falls back to the cheapest, and the render
9383
+ * reports which one actually ran.
9384
+ */
9385
+ profile: CamProfileSchema.optional()
9386
+ });
9387
+ /**
9388
+ * Cooldown GRANULARITY over the subject's class — how much a fired
9389
+ * notification suppresses.
9390
+ * - `shared` (default, and the absent value) — one window for the whole
9391
+ * rule/scope: a cat silences the next dog for `cooldownSec`.
9392
+ * - `per-class` — an independent window per detected class, so cat→dog fires
9393
+ * at once and cat→cat still waits.
9394
+ *
9395
+ * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
9396
+ * must not be swallowed by a bark's window (the precedent this generalizes —
9397
+ * see `cooldownKey` in the rule engine).
9398
+ */
9399
+ var NcThrottleGranularitySchema = _enum(["shared", "per-class"]);
9267
9400
  /** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
9268
9401
  var NcThrottleSchema = object({
9269
9402
  cooldownSec: number().int().min(0).max(86400).default(60),
9270
9403
  /** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
9271
- scope: _enum(["rule", "rule-device"]).default("rule-device")
9404
+ scope: _enum(["rule", "rule-device"]).default("rule-device"),
9405
+ /**
9406
+ * Class granularity of the cooldown key. Optional rather than defaulted:
9407
+ * a Zod default does NOT run on the addon→addon cap path, so a persisted
9408
+ * rule authored before this field simply carries none — and the engine
9409
+ * reads absent as `shared`, the pre-existing behaviour.
9410
+ */
9411
+ granularity: NcThrottleGranularitySchema.optional()
9272
9412
  });
9273
9413
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
9274
9414
  var NcRuleInputSchema = object({
@@ -9277,7 +9417,19 @@ var NcRuleInputSchema = object({
9277
9417
  delivery: NcDeliverySchema,
9278
9418
  conditions: NcConditionsSchema.default({}),
9279
9419
  schedule: NcScheduleSchema.optional(),
9280
- targets: array(NcRuleTargetSchema).min(1),
9420
+ /** May be empty when `targetUsers` addresses at least one user — the
9421
+ * "at least one addressee" invariant is enforced by the provider, because
9422
+ * a cross-field refine here would break `NcRulePatchSchema.partial()`. */
9423
+ targets: array(NcRuleTargetSchema),
9424
+ /**
9425
+ * USERS this rule addresses in addition to `targets` (Phase 4). At fire
9426
+ * time each user fans out to the personal targets they own
9427
+ * (`config.ownerUserId`), filtered by that user's `allowedDevices` for the
9428
+ * firing camera — a user is never notified about a device they cannot open.
9429
+ * Per-user opt-outs (`disabledTargetIds`) still apply to the fanned-out
9430
+ * targets.
9431
+ */
9432
+ targetUsers: array(string()).optional(),
9281
9433
  media: NcMediaPolicySchema.default({ attach: "best" }),
9282
9434
  throttle: NcThrottleSchema.default({
9283
9435
  cooldownSec: 60,
@@ -9364,6 +9516,7 @@ var NcConditionDescriptorSchema = object({
9364
9516
  "schedule",
9365
9517
  "plateMatcher",
9366
9518
  "packagePhase",
9519
+ "crossingSelect",
9367
9520
  "polygonDraw",
9368
9521
  "occupancy"
9369
9522
  ]),
@@ -9490,7 +9643,10 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
9490
9643
  }), object({ results: array(NcTestResultSchema) }), {
9491
9644
  kind: "mutation",
9492
9645
  auth: "admin"
9493
- }), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9646
+ }), method(object({}), object({
9647
+ catalog: array(NcConditionDescriptorSchema),
9648
+ taxonomy: NcTaxonomySchema.optional()
9649
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9494
9650
  /**
9495
9651
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
9496
9652
  *
@@ -10227,6 +10383,28 @@ method(object({
10227
10383
  }), object({ success: literal(true) }), {
10228
10384
  kind: "mutation",
10229
10385
  auth: "admin"
10386
+ }), method(object({
10387
+ deviceId: number(),
10388
+ /** Absent = the LOWEST assigned profile — a notification attachment is
10389
+ * watched on a phone, and the cheap rendition is the right default. */
10390
+ profile: CamProfileSchema.optional(),
10391
+ aroundMs: number(),
10392
+ preRollSec: number().min(0).max(20).default(3),
10393
+ postRollSec: number().min(0).max(20).default(5),
10394
+ format: _enum(["gif", "mp4"]).default("gif"),
10395
+ maxWidth: number().int().min(120).max(1920).default(480),
10396
+ /** GIF only — MP4 keeps the source cadence. */
10397
+ fps: number().int().min(1).max(15).default(5)
10398
+ }), object({
10399
+ base64: string(),
10400
+ mime: string(),
10401
+ bytes: number().int(),
10402
+ /** The profile actually rendered (what the default resolved to). */
10403
+ profile: CamProfileSchema,
10404
+ durationMs: number()
10405
+ }), {
10406
+ kind: "mutation",
10407
+ auth: "admin"
10230
10408
  }), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string() }), BrokerStatsSchema), method(object({ brokerId: string() }), object({
10231
10409
  probed: boolean(),
10232
10410
  summary: string()
@@ -15821,7 +15999,10 @@ method(object({
15821
15999
  }), method(object({
15822
16000
  deviceId: number(),
15823
16001
  caps: array(string()).readonly().optional()
15824
- }), record(string(), unknown().nullable()));
16002
+ }), record(string(), unknown().nullable())), method(object({
16003
+ deviceIds: array(number()).readonly(),
16004
+ caps: array(string()).readonly().optional()
16005
+ }), record(string(), record(string(), unknown().nullable())));
15825
16006
  method(object({ deviceId: number() }), record(string(), record(string(), unknown()))), method(object({
15826
16007
  deviceId: number(),
15827
16008
  capName: string()
@@ -16797,6 +16978,36 @@ var TargetKindSchema = object({
16797
16978
  icon: string(),
16798
16979
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
16799
16980
  addonId: string(),
16981
+ /**
16982
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
16983
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
16984
+ * when the addon bundles no icon for that kind — the client then falls back
16985
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
16986
+ *
16987
+ * Root-relative on purpose: it resolves against whatever origin serves a web
16988
+ * client, and a native client joins it onto its own hub base.
16989
+ *
16990
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
16991
+ * field that survived only because the runtime cap-router forwards provider
16992
+ * output verbatim — so every consumer had to re-declare it by hand to stop
16993
+ * its own Zod parse from stripping it, and the whole arrangement would have
16994
+ * broken silently the moment output validation was tightened anywhere.
16995
+ */
16996
+ iconUrl: string().optional(),
16997
+ /**
16998
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
16999
+ *
17000
+ * The server knows this and therefore says it, because the client cannot
17001
+ * safely guess: a React-Native client renders SVG and raster through two
17002
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
17003
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
17004
+ * placeholder glyph for every vector icon while the web build looked fine.
17005
+ *
17006
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
17007
+ * not been updated — a client that cannot determine the type should prefer
17008
+ * its raster path, which is the safe default for an unknown image.
17009
+ */
17010
+ iconMediaType: string().optional(),
16800
17011
  configSchema: ConfigSchemaPassthrough,
16801
17012
  supportsDiscovery: boolean(),
16802
17013
  caps: TargetKindCapsSchema
@@ -17244,6 +17455,29 @@ var MotionEventSchema = object({
17244
17455
  * Absent on legacy rows ⇒ treat as `pipeline`.
17245
17456
  */
17246
17457
  var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
17458
+ /**
17459
+ * The confirmed zone crossing that produced an object event. Present ONLY on
17460
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
17461
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
17462
+ * appearance event carry none, so a rule asking for a direction fails closed
17463
+ * on them.
17464
+ *
17465
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
17466
+ * into its own event, so a frame in which a track enters A while leaving B
17467
+ * produces two events with two directions — never one ambiguous row.
17468
+ *
17469
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
17470
+ * membership the box has NOW, and by definition it no longer contains the zone
17471
+ * that was just left. Without the id here, a zone-scoped rule could never match
17472
+ * the exit it asked for.
17473
+ */
17474
+ var ZoneCrossingSchema = object({
17475
+ direction: _enum(["enter", "exit"]),
17476
+ /** Admin zone id crossed. */
17477
+ zoneId: string(),
17478
+ /** Zone display name at crossing time (falls back to the id). */
17479
+ zoneName: string().optional()
17480
+ });
17247
17481
  var ObjectEventSchema = object({
17248
17482
  ...BaseEventFields,
17249
17483
  kind: literal("object"),
@@ -17270,6 +17504,12 @@ var ObjectEventSchema = object({
17270
17504
  zones: array(string()).readonly().optional(),
17271
17505
  /** Omitted in slim projection. */
17272
17506
  state: TrackStateSchema.optional(),
17507
+ /**
17508
+ * The zone crossing this event IS, when it is one. Absent on every other
17509
+ * event kind (movement state, appearance, package) — see
17510
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
17511
+ */
17512
+ zoneCrossing: ZoneCrossingSchema.optional(),
17273
17513
  /** Detection-frame dimensions in pixels — let consumers normalize the
17274
17514
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
17275
17515
  frameWidth: number().optional(),
@@ -17528,6 +17768,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17528
17768
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
17529
17769
  kind: "mutation",
17530
17770
  auth: "admin"
17771
+ }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
17772
+ kind: "mutation",
17773
+ auth: "admin"
17774
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
17775
+ kind: "query",
17776
+ auth: "admin"
17777
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
17778
+ kind: "mutation",
17779
+ auth: "admin"
17531
17780
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
17532
17781
  kind: "query",
17533
17782
  auth: "admin"
@@ -20007,6 +20256,17 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
20007
20256
  */
20008
20257
  priority: number()
20009
20258
  })).readonly() });
20259
+ /**
20260
+ * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
20261
+ * AUTO (resolved from the candidate ranking at send time); `resolved` reports
20262
+ * what AUTO currently picks, so the UI can show the effective value either way.
20263
+ */
20264
+ var NotificationEndpointSchema = object({
20265
+ /** The operator's explicit choice, or null for AUTO. */
20266
+ baseUrl: string().nullable(),
20267
+ /** What the ranking currently resolves to (null when nothing is reachable). */
20268
+ resolved: string().nullable()
20269
+ });
20010
20270
  var AllowedAddressesSchema = object({
20011
20271
  /**
20012
20272
  * Allowlist of interface addresses operators have explicitly opted
@@ -20029,7 +20289,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
20029
20289
  * to avoid mixed-content blocks in the browser. The public
20030
20290
  * tunnel always emits `https://` regardless. */
20031
20291
  scheme: _enum(["http", "https"]).optional()
20032
- }), GetConnectionEndpointsResultSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
20292
+ }), 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" });
20033
20293
  /**
20034
20294
  * mesh-network — collection cap for mesh-VPN providers.
20035
20295
  *
@@ -20828,7 +21088,12 @@ var RecordingDeviceUsageSchema = object({
20828
21088
  var RecordingLocationUsageSchema = object({
20829
21089
  /** StorageLocation id; null for the legacy/degraded single-root fallback. */
20830
21090
  locationId: string().nullable(),
20831
- /** Bytes of recordings stored on this location. */
21091
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
21092
+ * is emitted per physical disk (2026-07-29): two locations on one root
21093
+ * previously rendered as two identical "disks" with a nonsensical used
21094
+ * split — hydrate attribution across aliases is arbitrary by nature. */
21095
+ locationIds: array(string()).optional(),
21096
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). */
20832
21097
  usedBytes: number(),
20833
21098
  /** Free bytes on the location's volume; null when capacity is unknown (remote). */
20834
21099
  availableBytes: number().nullable(),
@@ -20940,6 +21205,44 @@ method(object({
20940
21205
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
20941
21206
  kind: "query",
20942
21207
  auth: "admin"
21208
+ }), method(object({
21209
+ deviceId: number(),
21210
+ aroundMs: number(),
21211
+ preRollSec: number().min(0).max(30).default(2),
21212
+ postRollSec: number().min(0).max(30).default(5),
21213
+ maxWidth: number().int().min(120).max(1280).default(480),
21214
+ fps: number().int().min(1).max(15).default(5)
21215
+ }), object({
21216
+ gifBase64: string(),
21217
+ fromMs: number(),
21218
+ toMs: number()
21219
+ }), {
21220
+ kind: "mutation",
21221
+ auth: "admin"
21222
+ }), method(object({
21223
+ deviceId: number(),
21224
+ aroundMs: number(),
21225
+ preRollSec: number().min(0).max(30).default(3),
21226
+ postRollSec: number().min(0).max(30).default(7),
21227
+ maxWidth: number().int().min(160).max(1920).default(640)
21228
+ }), object({
21229
+ clipBase64: string(),
21230
+ mime: string(),
21231
+ fromMs: number(),
21232
+ toMs: number(),
21233
+ bytes: number().int()
21234
+ }), {
21235
+ kind: "mutation",
21236
+ auth: "admin"
21237
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
21238
+ kind: "mutation",
21239
+ auth: "admin"
21240
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
21241
+ kind: "query",
21242
+ auth: "admin"
21243
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
21244
+ kind: "mutation",
21245
+ auth: "admin"
20943
21246
  });
20944
21247
  /**
20945
21248
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -22531,6 +22834,12 @@ Object.freeze({
22531
22834
  addonId: null,
22532
22835
  access: "view"
22533
22836
  },
22837
+ "deviceManager.getDeviceStatusAggregateBatch": {
22838
+ capName: "device-manager",
22839
+ capScope: "system",
22840
+ addonId: null,
22841
+ access: "view"
22842
+ },
22534
22843
  "deviceManager.getLinkedDevices": {
22535
22844
  capName: "device-manager",
22536
22845
  capScope: "system",
@@ -23425,6 +23734,12 @@ Object.freeze({
23425
23734
  addonId: null,
23426
23735
  access: "view"
23427
23736
  },
23737
+ "localNetwork.getNotificationEndpoint": {
23738
+ capName: "local-network",
23739
+ capScope: "system",
23740
+ addonId: null,
23741
+ access: "view"
23742
+ },
23428
23743
  "localNetwork.getPreferred": {
23429
23744
  capName: "local-network",
23430
23745
  capScope: "system",
@@ -23449,6 +23764,12 @@ Object.freeze({
23449
23764
  addonId: null,
23450
23765
  access: "create"
23451
23766
  },
23767
+ "localNetwork.setNotificationEndpoint": {
23768
+ capName: "local-network",
23769
+ capScope: "system",
23770
+ addonId: null,
23771
+ access: "create"
23772
+ },
23452
23773
  "lockControl.lock": {
23453
23774
  capName: "lock-control",
23454
23775
  capScope: "device",
@@ -24091,6 +24412,12 @@ Object.freeze({
24091
24412
  addonId: null,
24092
24413
  access: "create"
24093
24414
  },
24415
+ "pipelineAnalytics.cancelMediaRelocate": {
24416
+ capName: "pipeline-analytics",
24417
+ capScope: "device",
24418
+ addonId: null,
24419
+ access: "create"
24420
+ },
24094
24421
  "pipelineAnalytics.clearTracks": {
24095
24422
  capName: "pipeline-analytics",
24096
24423
  capScope: "device",
@@ -24145,6 +24472,12 @@ Object.freeze({
24145
24472
  addonId: null,
24146
24473
  access: "view"
24147
24474
  },
24475
+ "pipelineAnalytics.getMediaRelocateStatus": {
24476
+ capName: "pipeline-analytics",
24477
+ capScope: "device",
24478
+ addonId: null,
24479
+ access: "view"
24480
+ },
24148
24481
  "pipelineAnalytics.getMotionEvents": {
24149
24482
  capName: "pipeline-analytics",
24150
24483
  capScope: "device",
@@ -24217,6 +24550,12 @@ Object.freeze({
24217
24550
  addonId: null,
24218
24551
  access: "create"
24219
24552
  },
24553
+ "pipelineAnalytics.relocateMedia": {
24554
+ capName: "pipeline-analytics",
24555
+ capScope: "device",
24556
+ addonId: null,
24557
+ access: "create"
24558
+ },
24220
24559
  "pipelineAnalytics.searchObjectEvents": {
24221
24560
  capName: "pipeline-analytics",
24222
24561
  capScope: "device",
@@ -24979,6 +25318,12 @@ Object.freeze({
24979
25318
  addonId: null,
24980
25319
  access: "create"
24981
25320
  },
25321
+ "recording.cancelRelocate": {
25322
+ capName: "recording",
25323
+ capScope: "system",
25324
+ addonId: null,
25325
+ access: "create"
25326
+ },
24982
25327
  "recording.deleteFootprint": {
24983
25328
  capName: "recording",
24984
25329
  capScope: "system",
@@ -25009,6 +25354,12 @@ Object.freeze({
25009
25354
  addonId: null,
25010
25355
  access: "view"
25011
25356
  },
25357
+ "recording.getRelocateStatus": {
25358
+ capName: "recording",
25359
+ capScope: "system",
25360
+ addonId: null,
25361
+ access: "view"
25362
+ },
25012
25363
  "recording.getStorageUsage": {
25013
25364
  capName: "recording",
25014
25365
  capScope: "system",
@@ -25039,6 +25390,24 @@ Object.freeze({
25039
25390
  addonId: null,
25040
25391
  access: "view"
25041
25392
  },
25393
+ "recording.relocateFootage": {
25394
+ capName: "recording",
25395
+ capScope: "system",
25396
+ addonId: null,
25397
+ access: "create"
25398
+ },
25399
+ "recording.renderClip": {
25400
+ capName: "recording",
25401
+ capScope: "system",
25402
+ addonId: null,
25403
+ access: "create"
25404
+ },
25405
+ "recording.renderGif": {
25406
+ capName: "recording",
25407
+ capScope: "system",
25408
+ addonId: null,
25409
+ access: "create"
25410
+ },
25042
25411
  "recording.rescanStorage": {
25043
25412
  capName: "recording",
25044
25413
  capScope: "system",
@@ -25633,6 +26002,12 @@ Object.freeze({
25633
26002
  addonId: null,
25634
26003
  access: "create"
25635
26004
  },
26005
+ "streamBroker.renderPreBufferClip": {
26006
+ capName: "stream-broker",
26007
+ capScope: "system",
26008
+ addonId: null,
26009
+ access: "create"
26010
+ },
25636
26011
  "streamBroker.restartProfile": {
25637
26012
  capName: "stream-broker",
25638
26013
  capScope: "system",