@camstack/addon-cloudflare 1.2.6 → 1.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.
@@ -1,4 +1,4 @@
1
- //#region ../types/dist/event-category-BLcNejAE.mjs
1
+ //#region ../types/dist/event-category-Bz24uP1U.mjs
2
2
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
3
3
  EventCategory["SystemBoot"] = "system.boot";
4
4
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -269,6 +269,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
269
269
  */
270
270
  EventCategory["DeviceStateChanged"] = "device.state-changed";
271
271
  /**
272
+ * Frame occupancy for a camera CHANGED — a tracked object was gained or
273
+ * lost. Carries `{ deviceId, totalObjects, byClass, zones }`.
274
+ *
275
+ * Emitted only on a change, so a steady scene is silent. It exists so a
276
+ * client can stop polling `zoneAnalytics.getCurrentSnapshot`: that was the
277
+ * one live badge with no push signal at all, and it cost a request every
278
+ * four seconds per visible camera.
279
+ *
280
+ * Like every event it is telemetry and may be dropped ([D8]) — a consumer
281
+ * keeps a slow reconcile rather than trusting it alone.
282
+ */
283
+ EventCategory["ZoneAnalyticsOccupancyChanged"] = "zone-analytics.occupancy-changed";
284
+ /**
272
285
  * Cap event fired by every device that registers the `battery`
273
286
  * capability. Mirrors the cap definition's `onStatusChanged`. Carries
274
287
  * `{ deviceId, status: BatteryStatus }`. Subscribers (alert center,
@@ -7182,35 +7195,22 @@ var ConvertResultSchema = object({
7182
7195
  */
7183
7196
  var RecordingWeekdaySchema = number().int().min(0).max(6);
7184
7197
  var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
7185
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
7186
- kind: literal("timeOfDay"),
7187
- start: string().regex(HHMM),
7188
- end: string().regex(HHMM),
7189
- /** Restrict to these weekdays; omit = every day. */
7190
- days: array(RecordingWeekdaySchema).optional()
7191
- })]);
7192
- var RecordingModeSchema = _enum([
7193
- "continuous",
7194
- "onMotion",
7195
- "onAudioThreshold"
7196
- ]);
7197
7198
  /**
7198
- * First-class, authoritative per-camera storage mode — the explicit choice the
7199
- * UI reads directly (never inferred from `rules`):
7200
- * - `off` — not recording.
7201
- * - `events` — record only around triggers (motion / audio threshold),
7202
- * with pre/post-buffer.
7203
- * - `continuous` — record 24/7 within the schedule.
7199
+ * DERIVED per-camera storage summary — the single field cheap consumers read
7200
+ * (the viewer's status dot, the camera list) instead of walking `bands`:
7201
+ * - `off` — no band covers the camera (or it is disabled).
7202
+ * - `events` — every band records around triggers only.
7203
+ * - `continuous` — at least one band records continuously.
7204
7204
  *
7205
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
7206
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
7205
+ * NEVER authored: the recorder stamps it from the authoritative `bands` on
7206
+ * every save (`activeModeForConfig`). Writing it has no effect.
7207
7207
  */
7208
7208
  var RecordingStorageModeSchema = _enum([
7209
7209
  "off",
7210
7210
  "events",
7211
7211
  "continuous"
7212
7212
  ]);
7213
- /** Which detectors trigger an `events`-mode recording. */
7213
+ /** Which detectors trigger an `events`-mode band. */
7214
7214
  var RecordingTriggersSchema = object({
7215
7215
  motion: boolean().optional(),
7216
7216
  audioThresholdDbfs: number().optional()
@@ -7246,18 +7246,6 @@ var RecordingBandSchema = object({
7246
7246
  preBufferSec: number().min(0).optional(),
7247
7247
  postBufferSec: number().min(0).optional()
7248
7248
  });
7249
- var RecordingRuleSchema = object({
7250
- schedule: RecordingScheduleSchema,
7251
- mode: RecordingModeSchema,
7252
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
7253
- preBufferSec: number().min(0).default(0),
7254
- /** Keep recording until this many seconds after the last trigger. */
7255
- postBufferSec: number().min(0).default(0),
7256
- /** Each new trigger restarts the post-buffer window. */
7257
- resetTimeoutOnNewEvent: boolean().default(true),
7258
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
7259
- thresholdDbfs: number().optional()
7260
- });
7261
7249
  /**
7262
7250
  * Per-device retention overrides. Every field is optional; an unset or `0`
7263
7251
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7291,40 +7279,28 @@ var ScrubThumbnailPresetSchema = _enum([
7291
7279
  /**
7292
7280
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7293
7281
  *
7294
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
7295
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
7296
- * only for transition + migration (`migrateRulesToMode`); the policy engine
7297
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
7282
+ * `bands` is the ONLY authored recording intent: what to record, when, and on
7283
+ * which trigger. `mode` is a derived summary the recorder stamps on save; every
7284
+ * other field is a storage knob (profiles, segment length, retention, scrub).
7285
+ *
7286
+ * STRICT on purpose: the legacy authoring surface (`schedule`/`schedules`/
7287
+ * `triggers`/`preBufferSec`/`postBufferSec`/`rules`) was retired 2026-07-30.
7288
+ * A stale caller must fail loudly — silently stripping its legacy intent would
7289
+ * persist a band-less config, i.e. silently stop recording the camera.
7298
7290
  */
7299
7291
  var RecordingConfigSchema = object({
7300
7292
  enabled: boolean(),
7301
- /** Authoritative storage mode. Absent on legacy targets derived once via
7302
- * `migrateRulesToMode`, then persisted. */
7293
+ /** DERIVED summary of `bands`, stamped by the recorder on every save.
7294
+ * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7303
7295
  mode: RecordingStorageModeSchema.optional(),
7304
7296
  profiles: array(CamProfileSchema).optional(),
7305
7297
  segmentSeconds: number().int().positive().optional(),
7306
- /** Shared recording time-bands for `events` & `continuous` — record only when
7307
- * the wall-clock falls inside one of these windows. Omit or empty = always.
7308
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
7309
- schedules: array(RecordingScheduleSchema).optional(),
7310
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
7311
- * normalized into `schedules` on read and never written going forward. (Not
7312
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
7313
- schedule: RecordingScheduleSchema.optional(),
7314
- /** `events`-mode only — which detectors trigger a recording. */
7315
- triggers: RecordingTriggersSchema.optional(),
7316
- /** `events`-mode only — seconds retained before / after a trigger. */
7317
- preBufferSec: number().min(0).optional(),
7318
- postBufferSec: number().min(0).optional(),
7319
- /** DEPRECATED authoring input; retained for migration/transition. */
7320
- rules: array(RecordingRuleSchema).optional(),
7321
7298
  /**
7322
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
7323
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
7324
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
7325
- * derived into bands once via `migrateConfigToBands`.
7299
+ * AUTHORITATIVE mode-per-band recording model the single source of truth
7300
+ * the recorder's band engine consumes. An empty array = record nothing;
7301
+ * "off" is the absence of a covering band, never a band value.
7326
7302
  */
7327
- bands: array(RecordingBandSchema).optional(),
7303
+ bands: array(RecordingBandSchema).default([]),
7328
7304
  retention: RecordingRetentionSchema.optional(),
7329
7305
  /**
7330
7306
  * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
@@ -7332,8 +7308,15 @@ var RecordingConfigSchema = object({
7332
7308
  * windows only — existing sheets are immutable, and each window's index
7333
7309
  * carries its own tile dims so mixed-preset history renders correctly.
7334
7310
  */
7335
- scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7336
- });
7311
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional(),
7312
+ /**
7313
+ * OPT-IN thumbnail-strip generation for this camera: every keyframe of the
7314
+ * low recording saved as a JPEG (the fast-drag scrub depth), a derived
7315
+ * cache that eviction reclaims with the footage. Absent/false = no strips
7316
+ * are written and scrub reads exact keyframes at every velocity.
7317
+ */
7318
+ stripsEnabled: boolean().optional()
7319
+ }).strict();
7337
7320
  /**
7338
7321
  * Ops-log — the durable, append-only operations audit shared by the
7339
7322
  * recordings and events management surfaces.
@@ -7352,7 +7335,8 @@ var OpsLogOpSchema = _enum([
7352
7335
  "prune",
7353
7336
  "manual-delete",
7354
7337
  "rescan",
7355
- "retention-run"
7338
+ "retention-run",
7339
+ "relocate"
7356
7340
  ]);
7357
7341
  /** Why the operation ran. */
7358
7342
  var OpsLogReasonSchema = _enum([
@@ -7391,6 +7375,55 @@ var OpsLogQueryInputSchema = object({
7391
7375
  limit: number().int().min(1).max(1e3).optional()
7392
7376
  });
7393
7377
  /**
7378
+ * Entity-relocation job state (storage entity-routing spec, Phase 4).
7379
+ *
7380
+ * One shape shared by the recorder's `relocateFootage` (segments + strips) and
7381
+ * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7382
+ * page renders both movers with one component. Jobs are in-RAM (a restart
7383
+ * forgets them — re-running is safe by construction: copy-if-absent, delete
7384
+ * after verify) and each completed/failed run also lands one durable ops-log
7385
+ * row on the owning addon's surface.
7386
+ */
7387
+ var RelocateJobStateSchema = _enum([
7388
+ "running",
7389
+ "done",
7390
+ "failed",
7391
+ "cancelled"
7392
+ ]);
7393
+ var RelocateJobSchema = object({
7394
+ jobId: string(),
7395
+ state: RelocateJobStateSchema,
7396
+ /** Source location — for media relocation this is informational ('*': rows
7397
+ * move from wherever they are to the target). */
7398
+ fromLocationId: string(),
7399
+ toLocationId: string(),
7400
+ /** Scoped device, or null = every device. */
7401
+ deviceId: number().nullable(),
7402
+ /** What the job moves (owner-addon specific: segments/strips or media). */
7403
+ entities: array(string()),
7404
+ filesMoved: number().int(),
7405
+ bytesMoved: number().int(),
7406
+ /** Total files discovered up front; null while (or when) unknown. */
7407
+ filesTotal: number().int().nullable(),
7408
+ startedAt: number(),
7409
+ finishedAt: number().nullable(),
7410
+ error: string().nullable()
7411
+ });
7412
+ var RelocateFootageInputSchema = object({
7413
+ deviceId: number().optional(),
7414
+ fromLocationId: string(),
7415
+ toLocationId: string(),
7416
+ entities: array(_enum(["segments", "strips"])).optional(),
7417
+ /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7418
+ * never allowed to starve live writers. */
7419
+ throttleMbps: number().min(1).max(1e3).optional()
7420
+ });
7421
+ var RelocateMediaInputSchema = object({
7422
+ deviceId: number().optional(),
7423
+ toLocationId: string(),
7424
+ throttleMbps: number().min(1).max(1e3).optional()
7425
+ });
7426
+ /**
7394
7427
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7395
7428
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7396
7429
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -7440,6 +7473,13 @@ var StorageLocationSchema = object({
7440
7473
  nodeId: string().optional(),
7441
7474
  isDefault: boolean().default(false),
7442
7475
  isSystem: boolean().default(false),
7476
+ /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7477
+ * for node-local locations it can reach) — never persisted, absent when the
7478
+ * volume is remote/unreachable. The single capacity truth every UI reads. */
7479
+ capacity: object({
7480
+ totalBytes: number(),
7481
+ availableBytes: number()
7482
+ }).nullable().optional(),
7443
7483
  createdAt: number(),
7444
7484
  updatedAt: number()
7445
7485
  });
@@ -8207,7 +8247,8 @@ var NcTaxonomyEntrySchema = object({
8207
8247
  /** Macro/category parent for grouping ('car' → 'vehicle'); null for a top. */
8208
8248
  parentKind: string().nullable()
8209
8249
  });
8210
- object({
8250
+ /** The complete NC picker taxonomy — three grouped buckets. */
8251
+ var NcTaxonomySchema = object({
8211
8252
  videoClasses: array(NcTaxonomyEntrySchema),
8212
8253
  audioKinds: array(NcTaxonomyEntrySchema),
8213
8254
  labels: array(NcTaxonomyEntrySchema)
@@ -8867,6 +8908,7 @@ var AccessoryKind = {
8867
8908
  };
8868
8909
  AccessoryKind.Siren, AccessoryKind.Floodlight, AccessoryKind.Spotlight, AccessoryKind.PirSensor, AccessoryKind.Chime, AccessoryKind.Autotrack, AccessoryKind.Nightvision, AccessoryKind.PrivacyMask;
8869
8910
  DeviceFeature.BatteryOperated;
8911
+ new Set(["devices", "classes"]);
8870
8912
  /**
8871
8913
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
8872
8914
  * motion-zones, and the detection zones/lines editor all speak this one
@@ -9025,6 +9067,29 @@ var NcOccupancyConditionSchema = object({
9025
9067
  count: number().int().min(0).default(1),
9026
9068
  sustainSeconds: number().int().min(0).max(3600).default(15)
9027
9069
  });
9070
+ /**
9071
+ * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
9072
+ *
9073
+ * The values are not symmetric, and deliberately so — the absent value has to
9074
+ * mean exactly what every rule authored before this condition existed already
9075
+ * does:
9076
+ * - `enter` — entries and every NON-crossing record (movement state,
9077
+ * package, sensor). Exits are rejected. **This is the absent behaviour**:
9078
+ * an operator who never asked for exits must not start receiving them.
9079
+ * - `exit` — ONLY an exit crossing. A record that is not a crossing at all
9080
+ * fails closed, because "the car left the drive" is a question about a
9081
+ * boundary, not about a detection.
9082
+ * - `any` — no direction filter; entries, exits and non-crossings alike.
9083
+ *
9084
+ * A rule asking for a direction should normally also scope `zones`, which the
9085
+ * engine evaluates against the crossed zone as well as the current membership
9086
+ * (an exit's membership no longer contains the zone it just left).
9087
+ */
9088
+ var NcCrossingSchema = _enum([
9089
+ "enter",
9090
+ "exit",
9091
+ "any"
9092
+ ]);
9028
9093
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
9029
9094
  var NcZoneConditionSchema = object({
9030
9095
  ids: array(string().min(1)).min(1),
@@ -9049,6 +9114,13 @@ var NcConditionsSchema = object({
9049
9114
  /** Veto zones — any hit fails the rule. */
9050
9115
  zonesExclude: array(string().min(1)).optional(),
9051
9116
  /**
9117
+ * Zone-crossing direction. IMMEDIATE only — a crossing is a per-event fact
9118
+ * and a closed track carries none, so a `track-end` rule asking for one
9119
+ * fails closed (use `zones`, which tests `zonesVisited`). ABSENT = `enter`,
9120
+ * which is exactly today's behaviour. See {@link NcCrossingSchema}.
9121
+ */
9122
+ crossing: NcCrossingSchema.optional(),
9123
+ /**
9052
9124
  * Exact (case-insensitive) match on the record's collapsed `label`
9053
9125
  * (identity name / plate text / subclass).
9054
9126
  */
@@ -9183,17 +9255,85 @@ var NcRuleTargetSchema = object({
9183
9255
  * - `keyFrame` — the clean scene frame (no subject box).
9184
9256
  * - `none` — no attachment.
9185
9257
  */
9186
- var NcMediaPolicySchema = object({ attach: _enum([
9187
- "best",
9188
- "best-matching",
9189
- "keyFrame",
9190
- "none"
9191
- ]).default("best") });
9258
+ /**
9259
+ * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
9260
+ * conflate it with the selection strategy and betray the request: asking for
9261
+ * the clean scene frame on an object-event owner used to start at
9262
+ * `fullFrameBoxed`, i.e. the annotated frame (2026-07-30).
9263
+ * - `cropped` — the subject, tight. What "who is at the door" wants.
9264
+ * - `full` — the clean scene, no annotation. What "what is going on" wants.
9265
+ * - `boxed` — the scene WITH the detection boxes drawn, for verifying what
9266
+ * the pipeline actually saw.
9267
+ */
9268
+ var NcMediaFrameSchema = _enum([
9269
+ "cropped",
9270
+ "full",
9271
+ "boxed"
9272
+ ]);
9273
+ var NcMediaPolicySchema = object({
9274
+ attach: _enum([
9275
+ "best",
9276
+ "best-matching",
9277
+ "keyFrame",
9278
+ "none"
9279
+ ]).default("best"),
9280
+ /** What the still shows. Absent = `cropped` (the historical `best` shape). */
9281
+ frame: NcMediaFrameSchema.optional(),
9282
+ /** Crop the attached still to the rule's condition-zone bbox (padded) —
9283
+ * "show me the ZONE", not the whole scene or the subject crop. */
9284
+ zoneCrop: boolean().optional(),
9285
+ /**
9286
+ * Also attach a short GIF cut from the stream broker's clip ring around the
9287
+ * event — NOT from the recording, so the camera does not have to be
9288
+ * recording, and the window sits AROUND the moment instead of a segment
9289
+ * behind it. Fail-closed: a window the ring does not cover contributes no
9290
+ * gif, never a failed notification.
9291
+ */
9292
+ gif: boolean().optional(),
9293
+ /**
9294
+ * Also attach a short MP4 CLIP of the same cut. Same source and the same
9295
+ * fail-closed rule as `gif`. Prefer it where the backend takes video
9296
+ * (telegram, discord, zentik, webhook); backends that do not are handled by
9297
+ * the degrade engine, which drops the video and keeps the still.
9298
+ */
9299
+ clip: boolean().optional(),
9300
+ /** Seconds of footage BEFORE / AFTER the event instant. Defaults 3 / 7. */
9301
+ clipPreRollSec: number().int().min(0).max(30).optional(),
9302
+ clipPostRollSec: number().int().min(0).max(30).optional(),
9303
+ /**
9304
+ * Which stream profile the footage is cut from. Absent = the CHEAPEST
9305
+ * assigned profile: a notification is watched on a phone, so the 4K
9306
+ * rendition would burn CPU to produce a file the client downscales anyway.
9307
+ * A profile that is not assigned falls back to the cheapest, and the render
9308
+ * reports which one actually ran.
9309
+ */
9310
+ profile: CamProfileSchema.optional()
9311
+ });
9312
+ /**
9313
+ * Cooldown GRANULARITY over the subject's class — how much a fired
9314
+ * notification suppresses.
9315
+ * - `shared` (default, and the absent value) — one window for the whole
9316
+ * rule/scope: a cat silences the next dog for `cooldownSec`.
9317
+ * - `per-class` — an independent window per detected class, so cat→dog fires
9318
+ * at once and cat→cat still waits.
9319
+ *
9320
+ * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
9321
+ * must not be swallowed by a bark's window (the precedent this generalizes —
9322
+ * see `cooldownKey` in the rule engine).
9323
+ */
9324
+ var NcThrottleGranularitySchema = _enum(["shared", "per-class"]);
9192
9325
  /** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
9193
9326
  var NcThrottleSchema = object({
9194
9327
  cooldownSec: number().int().min(0).max(86400).default(60),
9195
9328
  /** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
9196
- scope: _enum(["rule", "rule-device"]).default("rule-device")
9329
+ scope: _enum(["rule", "rule-device"]).default("rule-device"),
9330
+ /**
9331
+ * Class granularity of the cooldown key. Optional rather than defaulted:
9332
+ * a Zod default does NOT run on the addon→addon cap path, so a persisted
9333
+ * rule authored before this field simply carries none — and the engine
9334
+ * reads absent as `shared`, the pre-existing behaviour.
9335
+ */
9336
+ granularity: NcThrottleGranularitySchema.optional()
9197
9337
  });
9198
9338
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
9199
9339
  var NcRuleInputSchema = object({
@@ -9202,7 +9342,19 @@ var NcRuleInputSchema = object({
9202
9342
  delivery: NcDeliverySchema,
9203
9343
  conditions: NcConditionsSchema.default({}),
9204
9344
  schedule: NcScheduleSchema.optional(),
9205
- targets: array(NcRuleTargetSchema).min(1),
9345
+ /** May be empty when `targetUsers` addresses at least one user — the
9346
+ * "at least one addressee" invariant is enforced by the provider, because
9347
+ * a cross-field refine here would break `NcRulePatchSchema.partial()`. */
9348
+ targets: array(NcRuleTargetSchema),
9349
+ /**
9350
+ * USERS this rule addresses in addition to `targets` (Phase 4). At fire
9351
+ * time each user fans out to the personal targets they own
9352
+ * (`config.ownerUserId`), filtered by that user's `allowedDevices` for the
9353
+ * firing camera — a user is never notified about a device they cannot open.
9354
+ * Per-user opt-outs (`disabledTargetIds`) still apply to the fanned-out
9355
+ * targets.
9356
+ */
9357
+ targetUsers: array(string()).optional(),
9206
9358
  media: NcMediaPolicySchema.default({ attach: "best" }),
9207
9359
  throttle: NcThrottleSchema.default({
9208
9360
  cooldownSec: 60,
@@ -9289,6 +9441,7 @@ var NcConditionDescriptorSchema = object({
9289
9441
  "schedule",
9290
9442
  "plateMatcher",
9291
9443
  "packagePhase",
9444
+ "crossingSelect",
9292
9445
  "polygonDraw",
9293
9446
  "occupancy"
9294
9447
  ]),
@@ -9415,7 +9568,10 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
9415
9568
  }), object({ results: array(NcTestResultSchema) }), {
9416
9569
  kind: "mutation",
9417
9570
  auth: "admin"
9418
- }), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9571
+ }), method(object({}), object({
9572
+ catalog: array(NcConditionDescriptorSchema),
9573
+ taxonomy: NcTaxonomySchema.optional()
9574
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9419
9575
  /**
9420
9576
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
9421
9577
  *
@@ -10152,6 +10308,28 @@ method(object({
10152
10308
  }), object({ success: literal(true) }), {
10153
10309
  kind: "mutation",
10154
10310
  auth: "admin"
10311
+ }), method(object({
10312
+ deviceId: number(),
10313
+ /** Absent = the LOWEST assigned profile — a notification attachment is
10314
+ * watched on a phone, and the cheap rendition is the right default. */
10315
+ profile: CamProfileSchema.optional(),
10316
+ aroundMs: number(),
10317
+ preRollSec: number().min(0).max(20).default(3),
10318
+ postRollSec: number().min(0).max(20).default(5),
10319
+ format: _enum(["gif", "mp4"]).default("gif"),
10320
+ maxWidth: number().int().min(120).max(1920).default(480),
10321
+ /** GIF only — MP4 keeps the source cadence. */
10322
+ fps: number().int().min(1).max(15).default(5)
10323
+ }), object({
10324
+ base64: string(),
10325
+ mime: string(),
10326
+ bytes: number().int(),
10327
+ /** The profile actually rendered (what the default resolved to). */
10328
+ profile: CamProfileSchema,
10329
+ durationMs: number()
10330
+ }), {
10331
+ kind: "mutation",
10332
+ auth: "admin"
10155
10333
  }), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string() }), BrokerStatsSchema), method(object({ brokerId: string() }), object({
10156
10334
  probed: boolean(),
10157
10335
  summary: string()
@@ -15768,7 +15946,10 @@ method(object({
15768
15946
  }), method(object({
15769
15947
  deviceId: number(),
15770
15948
  caps: array(string()).readonly().optional()
15771
- }), record(string(), unknown().nullable()));
15949
+ }), record(string(), unknown().nullable())), method(object({
15950
+ deviceIds: array(number()).readonly(),
15951
+ caps: array(string()).readonly().optional()
15952
+ }), record(string(), record(string(), unknown().nullable())));
15772
15953
  method(object({ deviceId: number() }), record(string(), record(string(), unknown()))), method(object({
15773
15954
  deviceId: number(),
15774
15955
  capName: string()
@@ -16716,6 +16897,36 @@ var TargetKindSchema = object({
16716
16897
  icon: string(),
16717
16898
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
16718
16899
  addonId: string(),
16900
+ /**
16901
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
16902
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
16903
+ * when the addon bundles no icon for that kind — the client then falls back
16904
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
16905
+ *
16906
+ * Root-relative on purpose: it resolves against whatever origin serves a web
16907
+ * client, and a native client joins it onto its own hub base.
16908
+ *
16909
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
16910
+ * field that survived only because the runtime cap-router forwards provider
16911
+ * output verbatim — so every consumer had to re-declare it by hand to stop
16912
+ * its own Zod parse from stripping it, and the whole arrangement would have
16913
+ * broken silently the moment output validation was tightened anywhere.
16914
+ */
16915
+ iconUrl: string().optional(),
16916
+ /**
16917
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
16918
+ *
16919
+ * The server knows this and therefore says it, because the client cannot
16920
+ * safely guess: a React-Native client renders SVG and raster through two
16921
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
16922
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
16923
+ * placeholder glyph for every vector icon while the web build looked fine.
16924
+ *
16925
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
16926
+ * not been updated — a client that cannot determine the type should prefer
16927
+ * its raster path, which is the safe default for an unknown image.
16928
+ */
16929
+ iconMediaType: string().optional(),
16719
16930
  configSchema: ConfigSchemaPassthrough,
16720
16931
  supportsDiscovery: boolean(),
16721
16932
  caps: TargetKindCapsSchema
@@ -17163,6 +17374,29 @@ var MotionEventSchema = object({
17163
17374
  * Absent on legacy rows ⇒ treat as `pipeline`.
17164
17375
  */
17165
17376
  var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
17377
+ /**
17378
+ * The confirmed zone crossing that produced an object event. Present ONLY on
17379
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
17380
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
17381
+ * appearance event carry none, so a rule asking for a direction fails closed
17382
+ * on them.
17383
+ *
17384
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
17385
+ * into its own event, so a frame in which a track enters A while leaving B
17386
+ * produces two events with two directions — never one ambiguous row.
17387
+ *
17388
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
17389
+ * membership the box has NOW, and by definition it no longer contains the zone
17390
+ * that was just left. Without the id here, a zone-scoped rule could never match
17391
+ * the exit it asked for.
17392
+ */
17393
+ var ZoneCrossingSchema = object({
17394
+ direction: _enum(["enter", "exit"]),
17395
+ /** Admin zone id crossed. */
17396
+ zoneId: string(),
17397
+ /** Zone display name at crossing time (falls back to the id). */
17398
+ zoneName: string().optional()
17399
+ });
17166
17400
  var ObjectEventSchema = object({
17167
17401
  ...BaseEventFields,
17168
17402
  kind: literal("object"),
@@ -17189,6 +17423,12 @@ var ObjectEventSchema = object({
17189
17423
  zones: array(string()).readonly().optional(),
17190
17424
  /** Omitted in slim projection. */
17191
17425
  state: TrackStateSchema.optional(),
17426
+ /**
17427
+ * The zone crossing this event IS, when it is one. Absent on every other
17428
+ * event kind (movement state, appearance, package) — see
17429
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
17430
+ */
17431
+ zoneCrossing: ZoneCrossingSchema.optional(),
17192
17432
  /** Detection-frame dimensions in pixels — let consumers normalize the
17193
17433
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
17194
17434
  frameWidth: number().optional(),
@@ -17447,6 +17687,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17447
17687
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
17448
17688
  kind: "mutation",
17449
17689
  auth: "admin"
17690
+ }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
17691
+ kind: "mutation",
17692
+ auth: "admin"
17693
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
17694
+ kind: "query",
17695
+ auth: "admin"
17696
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
17697
+ kind: "mutation",
17698
+ auth: "admin"
17450
17699
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
17451
17700
  kind: "query",
17452
17701
  auth: "admin"
@@ -19949,6 +20198,17 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
19949
20198
  */
19950
20199
  priority: number()
19951
20200
  })).readonly() });
20201
+ /**
20202
+ * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
20203
+ * AUTO (resolved from the candidate ranking at send time); `resolved` reports
20204
+ * what AUTO currently picks, so the UI can show the effective value either way.
20205
+ */
20206
+ var NotificationEndpointSchema = object({
20207
+ /** The operator's explicit choice, or null for AUTO. */
20208
+ baseUrl: string().nullable(),
20209
+ /** What the ranking currently resolves to (null when nothing is reachable). */
20210
+ resolved: string().nullable()
20211
+ });
19952
20212
  var AllowedAddressesSchema = object({
19953
20213
  /**
19954
20214
  * Allowlist of interface addresses operators have explicitly opted
@@ -19971,7 +20231,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
19971
20231
  * to avoid mixed-content blocks in the browser. The public
19972
20232
  * tunnel always emits `https://` regardless. */
19973
20233
  scheme: _enum(["http", "https"]).optional()
19974
- }), GetConnectionEndpointsResultSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
20234
+ }), 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" });
19975
20235
  /**
19976
20236
  * mesh-network — collection cap for mesh-VPN providers.
19977
20237
  *
@@ -20770,7 +21030,12 @@ var RecordingDeviceUsageSchema = object({
20770
21030
  var RecordingLocationUsageSchema = object({
20771
21031
  /** StorageLocation id; null for the legacy/degraded single-root fallback. */
20772
21032
  locationId: string().nullable(),
20773
- /** Bytes of recordings stored on this location. */
21033
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
21034
+ * is emitted per physical disk (2026-07-29): two locations on one root
21035
+ * previously rendered as two identical "disks" with a nonsensical used
21036
+ * split — hydrate attribution across aliases is arbitrary by nature. */
21037
+ locationIds: array(string()).optional(),
21038
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). */
20774
21039
  usedBytes: number(),
20775
21040
  /** Free bytes on the location's volume; null when capacity is unknown (remote). */
20776
21041
  availableBytes: number().nullable(),
@@ -20882,6 +21147,44 @@ method(object({
20882
21147
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
20883
21148
  kind: "query",
20884
21149
  auth: "admin"
21150
+ }), method(object({
21151
+ deviceId: number(),
21152
+ aroundMs: number(),
21153
+ preRollSec: number().min(0).max(30).default(2),
21154
+ postRollSec: number().min(0).max(30).default(5),
21155
+ maxWidth: number().int().min(120).max(1280).default(480),
21156
+ fps: number().int().min(1).max(15).default(5)
21157
+ }), object({
21158
+ gifBase64: string(),
21159
+ fromMs: number(),
21160
+ toMs: number()
21161
+ }), {
21162
+ kind: "mutation",
21163
+ auth: "admin"
21164
+ }), method(object({
21165
+ deviceId: number(),
21166
+ aroundMs: number(),
21167
+ preRollSec: number().min(0).max(30).default(3),
21168
+ postRollSec: number().min(0).max(30).default(7),
21169
+ maxWidth: number().int().min(160).max(1920).default(640)
21170
+ }), object({
21171
+ clipBase64: string(),
21172
+ mime: string(),
21173
+ fromMs: number(),
21174
+ toMs: number(),
21175
+ bytes: number().int()
21176
+ }), {
21177
+ kind: "mutation",
21178
+ auth: "admin"
21179
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
21180
+ kind: "mutation",
21181
+ auth: "admin"
21182
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
21183
+ kind: "query",
21184
+ auth: "admin"
21185
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
21186
+ kind: "mutation",
21187
+ auth: "admin"
20885
21188
  });
20886
21189
  /**
20887
21190
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -22473,6 +22776,12 @@ Object.freeze({
22473
22776
  addonId: null,
22474
22777
  access: "view"
22475
22778
  },
22779
+ "deviceManager.getDeviceStatusAggregateBatch": {
22780
+ capName: "device-manager",
22781
+ capScope: "system",
22782
+ addonId: null,
22783
+ access: "view"
22784
+ },
22476
22785
  "deviceManager.getLinkedDevices": {
22477
22786
  capName: "device-manager",
22478
22787
  capScope: "system",
@@ -23367,6 +23676,12 @@ Object.freeze({
23367
23676
  addonId: null,
23368
23677
  access: "view"
23369
23678
  },
23679
+ "localNetwork.getNotificationEndpoint": {
23680
+ capName: "local-network",
23681
+ capScope: "system",
23682
+ addonId: null,
23683
+ access: "view"
23684
+ },
23370
23685
  "localNetwork.getPreferred": {
23371
23686
  capName: "local-network",
23372
23687
  capScope: "system",
@@ -23391,6 +23706,12 @@ Object.freeze({
23391
23706
  addonId: null,
23392
23707
  access: "create"
23393
23708
  },
23709
+ "localNetwork.setNotificationEndpoint": {
23710
+ capName: "local-network",
23711
+ capScope: "system",
23712
+ addonId: null,
23713
+ access: "create"
23714
+ },
23394
23715
  "lockControl.lock": {
23395
23716
  capName: "lock-control",
23396
23717
  capScope: "device",
@@ -24033,6 +24354,12 @@ Object.freeze({
24033
24354
  addonId: null,
24034
24355
  access: "create"
24035
24356
  },
24357
+ "pipelineAnalytics.cancelMediaRelocate": {
24358
+ capName: "pipeline-analytics",
24359
+ capScope: "device",
24360
+ addonId: null,
24361
+ access: "create"
24362
+ },
24036
24363
  "pipelineAnalytics.clearTracks": {
24037
24364
  capName: "pipeline-analytics",
24038
24365
  capScope: "device",
@@ -24087,6 +24414,12 @@ Object.freeze({
24087
24414
  addonId: null,
24088
24415
  access: "view"
24089
24416
  },
24417
+ "pipelineAnalytics.getMediaRelocateStatus": {
24418
+ capName: "pipeline-analytics",
24419
+ capScope: "device",
24420
+ addonId: null,
24421
+ access: "view"
24422
+ },
24090
24423
  "pipelineAnalytics.getMotionEvents": {
24091
24424
  capName: "pipeline-analytics",
24092
24425
  capScope: "device",
@@ -24159,6 +24492,12 @@ Object.freeze({
24159
24492
  addonId: null,
24160
24493
  access: "create"
24161
24494
  },
24495
+ "pipelineAnalytics.relocateMedia": {
24496
+ capName: "pipeline-analytics",
24497
+ capScope: "device",
24498
+ addonId: null,
24499
+ access: "create"
24500
+ },
24162
24501
  "pipelineAnalytics.searchObjectEvents": {
24163
24502
  capName: "pipeline-analytics",
24164
24503
  capScope: "device",
@@ -24921,6 +25260,12 @@ Object.freeze({
24921
25260
  addonId: null,
24922
25261
  access: "create"
24923
25262
  },
25263
+ "recording.cancelRelocate": {
25264
+ capName: "recording",
25265
+ capScope: "system",
25266
+ addonId: null,
25267
+ access: "create"
25268
+ },
24924
25269
  "recording.deleteFootprint": {
24925
25270
  capName: "recording",
24926
25271
  capScope: "system",
@@ -24951,6 +25296,12 @@ Object.freeze({
24951
25296
  addonId: null,
24952
25297
  access: "view"
24953
25298
  },
25299
+ "recording.getRelocateStatus": {
25300
+ capName: "recording",
25301
+ capScope: "system",
25302
+ addonId: null,
25303
+ access: "view"
25304
+ },
24954
25305
  "recording.getStorageUsage": {
24955
25306
  capName: "recording",
24956
25307
  capScope: "system",
@@ -24981,6 +25332,24 @@ Object.freeze({
24981
25332
  addonId: null,
24982
25333
  access: "view"
24983
25334
  },
25335
+ "recording.relocateFootage": {
25336
+ capName: "recording",
25337
+ capScope: "system",
25338
+ addonId: null,
25339
+ access: "create"
25340
+ },
25341
+ "recording.renderClip": {
25342
+ capName: "recording",
25343
+ capScope: "system",
25344
+ addonId: null,
25345
+ access: "create"
25346
+ },
25347
+ "recording.renderGif": {
25348
+ capName: "recording",
25349
+ capScope: "system",
25350
+ addonId: null,
25351
+ access: "create"
25352
+ },
24984
25353
  "recording.rescanStorage": {
24985
25354
  capName: "recording",
24986
25355
  capScope: "system",
@@ -25575,6 +25944,12 @@ Object.freeze({
25575
25944
  addonId: null,
25576
25945
  access: "create"
25577
25946
  },
25947
+ "streamBroker.renderPreBufferClip": {
25948
+ capName: "stream-broker",
25949
+ capScope: "system",
25950
+ addonId: null,
25951
+ access: "create"
25952
+ },
25578
25953
  "streamBroker.restartProfile": {
25579
25954
  capName: "stream-broker",
25580
25955
  capScope: "system",