@camstack/addon-terminal 0.1.3 → 0.1.4

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
@@ -4,7 +4,7 @@ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).expor
4
4
  //#endregion
5
5
  let node_fs = require("node:fs");
6
6
  let node_path = require("node:path");
7
- //#region ../types/dist/event-category-BLcNejAE.mjs
7
+ //#region ../types/dist/event-category-Bz24uP1U.mjs
8
8
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
9
9
  EventCategory["SystemBoot"] = "system.boot";
10
10
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -275,6 +275,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
275
275
  */
276
276
  EventCategory["DeviceStateChanged"] = "device.state-changed";
277
277
  /**
278
+ * Frame occupancy for a camera CHANGED — a tracked object was gained or
279
+ * lost. Carries `{ deviceId, totalObjects, byClass, zones }`.
280
+ *
281
+ * Emitted only on a change, so a steady scene is silent. It exists so a
282
+ * client can stop polling `zoneAnalytics.getCurrentSnapshot`: that was the
283
+ * one live badge with no push signal at all, and it cost a request every
284
+ * four seconds per visible camera.
285
+ *
286
+ * Like every event it is telemetry and may be dropped ([D8]) — a consumer
287
+ * keeps a slow reconcile rather than trusting it alone.
288
+ */
289
+ EventCategory["ZoneAnalyticsOccupancyChanged"] = "zone-analytics.occupancy-changed";
290
+ /**
278
291
  * Cap event fired by every device that registers the `battery`
279
292
  * capability. Mirrors the cap definition's `onStatusChanged`. Carries
280
293
  * `{ deviceId, status: BatteryStatus }`. Subscribers (alert center,
@@ -7188,35 +7201,22 @@ var ConvertResultSchema = object({
7188
7201
  */
7189
7202
  var RecordingWeekdaySchema = number().int().min(0).max(6);
7190
7203
  var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
7191
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
7192
- kind: literal("timeOfDay"),
7193
- start: string().regex(HHMM),
7194
- end: string().regex(HHMM),
7195
- /** Restrict to these weekdays; omit = every day. */
7196
- days: array(RecordingWeekdaySchema).optional()
7197
- })]);
7198
- var RecordingModeSchema = _enum([
7199
- "continuous",
7200
- "onMotion",
7201
- "onAudioThreshold"
7202
- ]);
7203
7204
  /**
7204
- * First-class, authoritative per-camera storage mode — the explicit choice the
7205
- * UI reads directly (never inferred from `rules`):
7206
- * - `off` — not recording.
7207
- * - `events` — record only around triggers (motion / audio threshold),
7208
- * with pre/post-buffer.
7209
- * - `continuous` — record 24/7 within the schedule.
7205
+ * DERIVED per-camera storage summary — the single field cheap consumers read
7206
+ * (the viewer's status dot, the camera list) instead of walking `bands`:
7207
+ * - `off` — no band covers the camera (or it is disabled).
7208
+ * - `events` — every band records around triggers only.
7209
+ * - `continuous` — at least one band records continuously.
7210
7210
  *
7211
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
7212
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
7211
+ * NEVER authored: the recorder stamps it from the authoritative `bands` on
7212
+ * every save (`activeModeForConfig`). Writing it has no effect.
7213
7213
  */
7214
7214
  var RecordingStorageModeSchema = _enum([
7215
7215
  "off",
7216
7216
  "events",
7217
7217
  "continuous"
7218
7218
  ]);
7219
- /** Which detectors trigger an `events`-mode recording. */
7219
+ /** Which detectors trigger an `events`-mode band. */
7220
7220
  var RecordingTriggersSchema = object({
7221
7221
  motion: boolean().optional(),
7222
7222
  audioThresholdDbfs: number().optional()
@@ -7252,18 +7252,6 @@ var RecordingBandSchema = object({
7252
7252
  preBufferSec: number().min(0).optional(),
7253
7253
  postBufferSec: number().min(0).optional()
7254
7254
  });
7255
- var RecordingRuleSchema = object({
7256
- schedule: RecordingScheduleSchema,
7257
- mode: RecordingModeSchema,
7258
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
7259
- preBufferSec: number().min(0).default(0),
7260
- /** Keep recording until this many seconds after the last trigger. */
7261
- postBufferSec: number().min(0).default(0),
7262
- /** Each new trigger restarts the post-buffer window. */
7263
- resetTimeoutOnNewEvent: boolean().default(true),
7264
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
7265
- thresholdDbfs: number().optional()
7266
- });
7267
7255
  /**
7268
7256
  * Per-device retention overrides. Every field is optional; an unset or `0`
7269
7257
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7297,40 +7285,28 @@ var ScrubThumbnailPresetSchema = _enum([
7297
7285
  /**
7298
7286
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7299
7287
  *
7300
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
7301
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
7302
- * only for transition + migration (`migrateRulesToMode`); the policy engine
7303
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
7288
+ * `bands` is the ONLY authored recording intent: what to record, when, and on
7289
+ * which trigger. `mode` is a derived summary the recorder stamps on save; every
7290
+ * other field is a storage knob (profiles, segment length, retention, scrub).
7291
+ *
7292
+ * STRICT on purpose: the legacy authoring surface (`schedule`/`schedules`/
7293
+ * `triggers`/`preBufferSec`/`postBufferSec`/`rules`) was retired 2026-07-30.
7294
+ * A stale caller must fail loudly — silently stripping its legacy intent would
7295
+ * persist a band-less config, i.e. silently stop recording the camera.
7304
7296
  */
7305
7297
  var RecordingConfigSchema = object({
7306
7298
  enabled: boolean(),
7307
- /** Authoritative storage mode. Absent on legacy targets derived once via
7308
- * `migrateRulesToMode`, then persisted. */
7299
+ /** DERIVED summary of `bands`, stamped by the recorder on every save.
7300
+ * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7309
7301
  mode: RecordingStorageModeSchema.optional(),
7310
7302
  profiles: array(CamProfileSchema).optional(),
7311
7303
  segmentSeconds: number().int().positive().optional(),
7312
- /** Shared recording time-bands for `events` & `continuous` — record only when
7313
- * the wall-clock falls inside one of these windows. Omit or empty = always.
7314
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
7315
- schedules: array(RecordingScheduleSchema).optional(),
7316
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
7317
- * normalized into `schedules` on read and never written going forward. (Not
7318
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
7319
- schedule: RecordingScheduleSchema.optional(),
7320
- /** `events`-mode only — which detectors trigger a recording. */
7321
- triggers: RecordingTriggersSchema.optional(),
7322
- /** `events`-mode only — seconds retained before / after a trigger. */
7323
- preBufferSec: number().min(0).optional(),
7324
- postBufferSec: number().min(0).optional(),
7325
- /** DEPRECATED authoring input; retained for migration/transition. */
7326
- rules: array(RecordingRuleSchema).optional(),
7327
7304
  /**
7328
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
7329
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
7330
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
7331
- * derived into bands once via `migrateConfigToBands`.
7305
+ * AUTHORITATIVE mode-per-band recording model the single source of truth
7306
+ * the recorder's band engine consumes. An empty array = record nothing;
7307
+ * "off" is the absence of a covering band, never a band value.
7332
7308
  */
7333
- bands: array(RecordingBandSchema).optional(),
7309
+ bands: array(RecordingBandSchema).default([]),
7334
7310
  retention: RecordingRetentionSchema.optional(),
7335
7311
  /**
7336
7312
  * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
@@ -7338,8 +7314,15 @@ var RecordingConfigSchema = object({
7338
7314
  * windows only — existing sheets are immutable, and each window's index
7339
7315
  * carries its own tile dims so mixed-preset history renders correctly.
7340
7316
  */
7341
- scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7342
- });
7317
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional(),
7318
+ /**
7319
+ * OPT-IN thumbnail-strip generation for this camera: every keyframe of the
7320
+ * low recording saved as a JPEG (the fast-drag scrub depth), a derived
7321
+ * cache that eviction reclaims with the footage. Absent/false = no strips
7322
+ * are written and scrub reads exact keyframes at every velocity.
7323
+ */
7324
+ stripsEnabled: boolean().optional()
7325
+ }).strict();
7343
7326
  /**
7344
7327
  * Ops-log — the durable, append-only operations audit shared by the
7345
7328
  * recordings and events management surfaces.
@@ -7358,7 +7341,8 @@ var OpsLogOpSchema = _enum([
7358
7341
  "prune",
7359
7342
  "manual-delete",
7360
7343
  "rescan",
7361
- "retention-run"
7344
+ "retention-run",
7345
+ "relocate"
7362
7346
  ]);
7363
7347
  /** Why the operation ran. */
7364
7348
  var OpsLogReasonSchema = _enum([
@@ -7397,6 +7381,55 @@ var OpsLogQueryInputSchema = object({
7397
7381
  limit: number().int().min(1).max(1e3).optional()
7398
7382
  });
7399
7383
  /**
7384
+ * Entity-relocation job state (storage entity-routing spec, Phase 4).
7385
+ *
7386
+ * One shape shared by the recorder's `relocateFootage` (segments + strips) and
7387
+ * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7388
+ * page renders both movers with one component. Jobs are in-RAM (a restart
7389
+ * forgets them — re-running is safe by construction: copy-if-absent, delete
7390
+ * after verify) and each completed/failed run also lands one durable ops-log
7391
+ * row on the owning addon's surface.
7392
+ */
7393
+ var RelocateJobStateSchema = _enum([
7394
+ "running",
7395
+ "done",
7396
+ "failed",
7397
+ "cancelled"
7398
+ ]);
7399
+ var RelocateJobSchema = object({
7400
+ jobId: string(),
7401
+ state: RelocateJobStateSchema,
7402
+ /** Source location — for media relocation this is informational ('*': rows
7403
+ * move from wherever they are to the target). */
7404
+ fromLocationId: string(),
7405
+ toLocationId: string(),
7406
+ /** Scoped device, or null = every device. */
7407
+ deviceId: number().nullable(),
7408
+ /** What the job moves (owner-addon specific: segments/strips or media). */
7409
+ entities: array(string()),
7410
+ filesMoved: number().int(),
7411
+ bytesMoved: number().int(),
7412
+ /** Total files discovered up front; null while (or when) unknown. */
7413
+ filesTotal: number().int().nullable(),
7414
+ startedAt: number(),
7415
+ finishedAt: number().nullable(),
7416
+ error: string().nullable()
7417
+ });
7418
+ var RelocateFootageInputSchema = object({
7419
+ deviceId: number().optional(),
7420
+ fromLocationId: string(),
7421
+ toLocationId: string(),
7422
+ entities: array(_enum(["segments", "strips"])).optional(),
7423
+ /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7424
+ * never allowed to starve live writers. */
7425
+ throttleMbps: number().min(1).max(1e3).optional()
7426
+ });
7427
+ var RelocateMediaInputSchema = object({
7428
+ deviceId: number().optional(),
7429
+ toLocationId: string(),
7430
+ throttleMbps: number().min(1).max(1e3).optional()
7431
+ });
7432
+ /**
7400
7433
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7401
7434
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7402
7435
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -7446,6 +7479,13 @@ var StorageLocationSchema = object({
7446
7479
  nodeId: string().optional(),
7447
7480
  isDefault: boolean().default(false),
7448
7481
  isSystem: boolean().default(false),
7482
+ /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7483
+ * for node-local locations it can reach) — never persisted, absent when the
7484
+ * volume is remote/unreachable. The single capacity truth every UI reads. */
7485
+ capacity: object({
7486
+ totalBytes: number(),
7487
+ availableBytes: number()
7488
+ }).nullable().optional(),
7449
7489
  createdAt: number(),
7450
7490
  updatedAt: number()
7451
7491
  });
@@ -8213,7 +8253,8 @@ var NcTaxonomyEntrySchema = object({
8213
8253
  /** Macro/category parent for grouping ('car' → 'vehicle'); null for a top. */
8214
8254
  parentKind: string().nullable()
8215
8255
  });
8216
- object({
8256
+ /** The complete NC picker taxonomy — three grouped buckets. */
8257
+ var NcTaxonomySchema = object({
8217
8258
  videoClasses: array(NcTaxonomyEntrySchema),
8218
8259
  audioKinds: array(NcTaxonomyEntrySchema),
8219
8260
  labels: array(NcTaxonomyEntrySchema)
@@ -8873,6 +8914,7 @@ var AccessoryKind = {
8873
8914
  };
8874
8915
  AccessoryKind.Siren, AccessoryKind.Floodlight, AccessoryKind.Spotlight, AccessoryKind.PirSensor, AccessoryKind.Chime, AccessoryKind.Autotrack, AccessoryKind.Nightvision, AccessoryKind.PrivacyMask;
8875
8916
  DeviceFeature.BatteryOperated;
8917
+ new Set(["devices", "classes"]);
8876
8918
  /**
8877
8919
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
8878
8920
  * motion-zones, and the detection zones/lines editor all speak this one
@@ -9031,6 +9073,29 @@ var NcOccupancyConditionSchema = object({
9031
9073
  count: number().int().min(0).default(1),
9032
9074
  sustainSeconds: number().int().min(0).max(3600).default(15)
9033
9075
  });
9076
+ /**
9077
+ * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
9078
+ *
9079
+ * The values are not symmetric, and deliberately so — the absent value has to
9080
+ * mean exactly what every rule authored before this condition existed already
9081
+ * does:
9082
+ * - `enter` — entries and every NON-crossing record (movement state,
9083
+ * package, sensor). Exits are rejected. **This is the absent behaviour**:
9084
+ * an operator who never asked for exits must not start receiving them.
9085
+ * - `exit` — ONLY an exit crossing. A record that is not a crossing at all
9086
+ * fails closed, because "the car left the drive" is a question about a
9087
+ * boundary, not about a detection.
9088
+ * - `any` — no direction filter; entries, exits and non-crossings alike.
9089
+ *
9090
+ * A rule asking for a direction should normally also scope `zones`, which the
9091
+ * engine evaluates against the crossed zone as well as the current membership
9092
+ * (an exit's membership no longer contains the zone it just left).
9093
+ */
9094
+ var NcCrossingSchema = _enum([
9095
+ "enter",
9096
+ "exit",
9097
+ "any"
9098
+ ]);
9034
9099
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
9035
9100
  var NcZoneConditionSchema = object({
9036
9101
  ids: array(string().min(1)).min(1),
@@ -9055,6 +9120,13 @@ var NcConditionsSchema = object({
9055
9120
  /** Veto zones — any hit fails the rule. */
9056
9121
  zonesExclude: array(string().min(1)).optional(),
9057
9122
  /**
9123
+ * Zone-crossing direction. IMMEDIATE only — a crossing is a per-event fact
9124
+ * and a closed track carries none, so a `track-end` rule asking for one
9125
+ * fails closed (use `zones`, which tests `zonesVisited`). ABSENT = `enter`,
9126
+ * which is exactly today's behaviour. See {@link NcCrossingSchema}.
9127
+ */
9128
+ crossing: NcCrossingSchema.optional(),
9129
+ /**
9058
9130
  * Exact (case-insensitive) match on the record's collapsed `label`
9059
9131
  * (identity name / plate text / subclass).
9060
9132
  */
@@ -9189,17 +9261,85 @@ var NcRuleTargetSchema = object({
9189
9261
  * - `keyFrame` — the clean scene frame (no subject box).
9190
9262
  * - `none` — no attachment.
9191
9263
  */
9192
- var NcMediaPolicySchema = object({ attach: _enum([
9193
- "best",
9194
- "best-matching",
9195
- "keyFrame",
9196
- "none"
9197
- ]).default("best") });
9264
+ /**
9265
+ * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
9266
+ * conflate it with the selection strategy and betray the request: asking for
9267
+ * the clean scene frame on an object-event owner used to start at
9268
+ * `fullFrameBoxed`, i.e. the annotated frame (2026-07-30).
9269
+ * - `cropped` — the subject, tight. What "who is at the door" wants.
9270
+ * - `full` — the clean scene, no annotation. What "what is going on" wants.
9271
+ * - `boxed` — the scene WITH the detection boxes drawn, for verifying what
9272
+ * the pipeline actually saw.
9273
+ */
9274
+ var NcMediaFrameSchema = _enum([
9275
+ "cropped",
9276
+ "full",
9277
+ "boxed"
9278
+ ]);
9279
+ var NcMediaPolicySchema = object({
9280
+ attach: _enum([
9281
+ "best",
9282
+ "best-matching",
9283
+ "keyFrame",
9284
+ "none"
9285
+ ]).default("best"),
9286
+ /** What the still shows. Absent = `cropped` (the historical `best` shape). */
9287
+ frame: NcMediaFrameSchema.optional(),
9288
+ /** Crop the attached still to the rule's condition-zone bbox (padded) —
9289
+ * "show me the ZONE", not the whole scene or the subject crop. */
9290
+ zoneCrop: boolean().optional(),
9291
+ /**
9292
+ * Also attach a short GIF cut from the stream broker's clip ring around the
9293
+ * event — NOT from the recording, so the camera does not have to be
9294
+ * recording, and the window sits AROUND the moment instead of a segment
9295
+ * behind it. Fail-closed: a window the ring does not cover contributes no
9296
+ * gif, never a failed notification.
9297
+ */
9298
+ gif: boolean().optional(),
9299
+ /**
9300
+ * Also attach a short MP4 CLIP of the same cut. Same source and the same
9301
+ * fail-closed rule as `gif`. Prefer it where the backend takes video
9302
+ * (telegram, discord, zentik, webhook); backends that do not are handled by
9303
+ * the degrade engine, which drops the video and keeps the still.
9304
+ */
9305
+ clip: boolean().optional(),
9306
+ /** Seconds of footage BEFORE / AFTER the event instant. Defaults 3 / 7. */
9307
+ clipPreRollSec: number().int().min(0).max(30).optional(),
9308
+ clipPostRollSec: number().int().min(0).max(30).optional(),
9309
+ /**
9310
+ * Which stream profile the footage is cut from. Absent = the CHEAPEST
9311
+ * assigned profile: a notification is watched on a phone, so the 4K
9312
+ * rendition would burn CPU to produce a file the client downscales anyway.
9313
+ * A profile that is not assigned falls back to the cheapest, and the render
9314
+ * reports which one actually ran.
9315
+ */
9316
+ profile: CamProfileSchema.optional()
9317
+ });
9318
+ /**
9319
+ * Cooldown GRANULARITY over the subject's class — how much a fired
9320
+ * notification suppresses.
9321
+ * - `shared` (default, and the absent value) — one window for the whole
9322
+ * rule/scope: a cat silences the next dog for `cooldownSec`.
9323
+ * - `per-class` — an independent window per detected class, so cat→dog fires
9324
+ * at once and cat→cat still waits.
9325
+ *
9326
+ * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
9327
+ * must not be swallowed by a bark's window (the precedent this generalizes —
9328
+ * see `cooldownKey` in the rule engine).
9329
+ */
9330
+ var NcThrottleGranularitySchema = _enum(["shared", "per-class"]);
9198
9331
  /** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
9199
9332
  var NcThrottleSchema = object({
9200
9333
  cooldownSec: number().int().min(0).max(86400).default(60),
9201
9334
  /** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
9202
- scope: _enum(["rule", "rule-device"]).default("rule-device")
9335
+ scope: _enum(["rule", "rule-device"]).default("rule-device"),
9336
+ /**
9337
+ * Class granularity of the cooldown key. Optional rather than defaulted:
9338
+ * a Zod default does NOT run on the addon→addon cap path, so a persisted
9339
+ * rule authored before this field simply carries none — and the engine
9340
+ * reads absent as `shared`, the pre-existing behaviour.
9341
+ */
9342
+ granularity: NcThrottleGranularitySchema.optional()
9203
9343
  });
9204
9344
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
9205
9345
  var NcRuleInputSchema = object({
@@ -9208,7 +9348,19 @@ var NcRuleInputSchema = object({
9208
9348
  delivery: NcDeliverySchema,
9209
9349
  conditions: NcConditionsSchema.default({}),
9210
9350
  schedule: NcScheduleSchema.optional(),
9211
- targets: array(NcRuleTargetSchema).min(1),
9351
+ /** May be empty when `targetUsers` addresses at least one user — the
9352
+ * "at least one addressee" invariant is enforced by the provider, because
9353
+ * a cross-field refine here would break `NcRulePatchSchema.partial()`. */
9354
+ targets: array(NcRuleTargetSchema),
9355
+ /**
9356
+ * USERS this rule addresses in addition to `targets` (Phase 4). At fire
9357
+ * time each user fans out to the personal targets they own
9358
+ * (`config.ownerUserId`), filtered by that user's `allowedDevices` for the
9359
+ * firing camera — a user is never notified about a device they cannot open.
9360
+ * Per-user opt-outs (`disabledTargetIds`) still apply to the fanned-out
9361
+ * targets.
9362
+ */
9363
+ targetUsers: array(string()).optional(),
9212
9364
  media: NcMediaPolicySchema.default({ attach: "best" }),
9213
9365
  throttle: NcThrottleSchema.default({
9214
9366
  cooldownSec: 60,
@@ -9295,6 +9447,7 @@ var NcConditionDescriptorSchema = object({
9295
9447
  "schedule",
9296
9448
  "plateMatcher",
9297
9449
  "packagePhase",
9450
+ "crossingSelect",
9298
9451
  "polygonDraw",
9299
9452
  "occupancy"
9300
9453
  ]),
@@ -9421,7 +9574,10 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
9421
9574
  }), object({ results: array(NcTestResultSchema) }), {
9422
9575
  kind: "mutation",
9423
9576
  auth: "admin"
9424
- }), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9577
+ }), method(object({}), object({
9578
+ catalog: array(NcConditionDescriptorSchema),
9579
+ taxonomy: NcTaxonomySchema.optional()
9580
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
9425
9581
  /**
9426
9582
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
9427
9583
  *
@@ -10158,6 +10314,28 @@ method(object({
10158
10314
  }), object({ success: literal(true) }), {
10159
10315
  kind: "mutation",
10160
10316
  auth: "admin"
10317
+ }), method(object({
10318
+ deviceId: number(),
10319
+ /** Absent = the LOWEST assigned profile — a notification attachment is
10320
+ * watched on a phone, and the cheap rendition is the right default. */
10321
+ profile: CamProfileSchema.optional(),
10322
+ aroundMs: number(),
10323
+ preRollSec: number().min(0).max(20).default(3),
10324
+ postRollSec: number().min(0).max(20).default(5),
10325
+ format: _enum(["gif", "mp4"]).default("gif"),
10326
+ maxWidth: number().int().min(120).max(1920).default(480),
10327
+ /** GIF only — MP4 keeps the source cadence. */
10328
+ fps: number().int().min(1).max(15).default(5)
10329
+ }), object({
10330
+ base64: string(),
10331
+ mime: string(),
10332
+ bytes: number().int(),
10333
+ /** The profile actually rendered (what the default resolved to). */
10334
+ profile: CamProfileSchema,
10335
+ durationMs: number()
10336
+ }), {
10337
+ kind: "mutation",
10338
+ auth: "admin"
10161
10339
  }), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string() }), BrokerStatsSchema), method(object({ brokerId: string() }), object({
10162
10340
  probed: boolean(),
10163
10341
  summary: string()
@@ -15779,7 +15957,10 @@ method(object({
15779
15957
  }), method(object({
15780
15958
  deviceId: number(),
15781
15959
  caps: array(string()).readonly().optional()
15782
- }), record(string(), unknown().nullable()));
15960
+ }), record(string(), unknown().nullable())), method(object({
15961
+ deviceIds: array(number()).readonly(),
15962
+ caps: array(string()).readonly().optional()
15963
+ }), record(string(), record(string(), unknown().nullable())));
15783
15964
  method(object({ deviceId: number() }), record(string(), record(string(), unknown()))), method(object({
15784
15965
  deviceId: number(),
15785
15966
  capName: string()
@@ -16710,6 +16891,36 @@ var TargetKindSchema = object({
16710
16891
  icon: string(),
16711
16892
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
16712
16893
  addonId: string(),
16894
+ /**
16895
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
16896
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
16897
+ * when the addon bundles no icon for that kind — the client then falls back
16898
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
16899
+ *
16900
+ * Root-relative on purpose: it resolves against whatever origin serves a web
16901
+ * client, and a native client joins it onto its own hub base.
16902
+ *
16903
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
16904
+ * field that survived only because the runtime cap-router forwards provider
16905
+ * output verbatim — so every consumer had to re-declare it by hand to stop
16906
+ * its own Zod parse from stripping it, and the whole arrangement would have
16907
+ * broken silently the moment output validation was tightened anywhere.
16908
+ */
16909
+ iconUrl: string().optional(),
16910
+ /**
16911
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
16912
+ *
16913
+ * The server knows this and therefore says it, because the client cannot
16914
+ * safely guess: a React-Native client renders SVG and raster through two
16915
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
16916
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
16917
+ * placeholder glyph for every vector icon while the web build looked fine.
16918
+ *
16919
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
16920
+ * not been updated — a client that cannot determine the type should prefer
16921
+ * its raster path, which is the safe default for an unknown image.
16922
+ */
16923
+ iconMediaType: string().optional(),
16713
16924
  configSchema: ConfigSchemaPassthrough,
16714
16925
  supportsDiscovery: boolean(),
16715
16926
  caps: TargetKindCapsSchema
@@ -17157,6 +17368,29 @@ var MotionEventSchema = object({
17157
17368
  * Absent on legacy rows ⇒ treat as `pipeline`.
17158
17369
  */
17159
17370
  var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
17371
+ /**
17372
+ * The confirmed zone crossing that produced an object event. Present ONLY on
17373
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
17374
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
17375
+ * appearance event carry none, so a rule asking for a direction fails closed
17376
+ * on them.
17377
+ *
17378
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
17379
+ * into its own event, so a frame in which a track enters A while leaving B
17380
+ * produces two events with two directions — never one ambiguous row.
17381
+ *
17382
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
17383
+ * membership the box has NOW, and by definition it no longer contains the zone
17384
+ * that was just left. Without the id here, a zone-scoped rule could never match
17385
+ * the exit it asked for.
17386
+ */
17387
+ var ZoneCrossingSchema = object({
17388
+ direction: _enum(["enter", "exit"]),
17389
+ /** Admin zone id crossed. */
17390
+ zoneId: string(),
17391
+ /** Zone display name at crossing time (falls back to the id). */
17392
+ zoneName: string().optional()
17393
+ });
17160
17394
  var ObjectEventSchema = object({
17161
17395
  ...BaseEventFields,
17162
17396
  kind: literal("object"),
@@ -17183,6 +17417,12 @@ var ObjectEventSchema = object({
17183
17417
  zones: array(string()).readonly().optional(),
17184
17418
  /** Omitted in slim projection. */
17185
17419
  state: TrackStateSchema.optional(),
17420
+ /**
17421
+ * The zone crossing this event IS, when it is one. Absent on every other
17422
+ * event kind (movement state, appearance, package) — see
17423
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
17424
+ */
17425
+ zoneCrossing: ZoneCrossingSchema.optional(),
17186
17426
  /** Detection-frame dimensions in pixels — let consumers normalize the
17187
17427
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
17188
17428
  frameWidth: number().optional(),
@@ -17441,6 +17681,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17441
17681
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
17442
17682
  kind: "mutation",
17443
17683
  auth: "admin"
17684
+ }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
17685
+ kind: "mutation",
17686
+ auth: "admin"
17687
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
17688
+ kind: "query",
17689
+ auth: "admin"
17690
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
17691
+ kind: "mutation",
17692
+ auth: "admin"
17444
17693
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
17445
17694
  kind: "query",
17446
17695
  auth: "admin"
@@ -19920,6 +20169,17 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
19920
20169
  */
19921
20170
  priority: number()
19922
20171
  })).readonly() });
20172
+ /**
20173
+ * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
20174
+ * AUTO (resolved from the candidate ranking at send time); `resolved` reports
20175
+ * what AUTO currently picks, so the UI can show the effective value either way.
20176
+ */
20177
+ var NotificationEndpointSchema = object({
20178
+ /** The operator's explicit choice, or null for AUTO. */
20179
+ baseUrl: string().nullable(),
20180
+ /** What the ranking currently resolves to (null when nothing is reachable). */
20181
+ resolved: string().nullable()
20182
+ });
19923
20183
  var AllowedAddressesSchema = object({
19924
20184
  /**
19925
20185
  * Allowlist of interface addresses operators have explicitly opted
@@ -19942,7 +20202,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
19942
20202
  * to avoid mixed-content blocks in the browser. The public
19943
20203
  * tunnel always emits `https://` regardless. */
19944
20204
  scheme: _enum(["http", "https"]).optional()
19945
- }), GetConnectionEndpointsResultSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
20205
+ }), 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" });
19946
20206
  /**
19947
20207
  * mesh-network — collection cap for mesh-VPN providers.
19948
20208
  *
@@ -20741,7 +21001,12 @@ var RecordingDeviceUsageSchema = object({
20741
21001
  var RecordingLocationUsageSchema = object({
20742
21002
  /** StorageLocation id; null for the legacy/degraded single-root fallback. */
20743
21003
  locationId: string().nullable(),
20744
- /** Bytes of recordings stored on this location. */
21004
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
21005
+ * is emitted per physical disk (2026-07-29): two locations on one root
21006
+ * previously rendered as two identical "disks" with a nonsensical used
21007
+ * split — hydrate attribution across aliases is arbitrary by nature. */
21008
+ locationIds: array(string()).optional(),
21009
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). */
20745
21010
  usedBytes: number(),
20746
21011
  /** Free bytes on the location's volume; null when capacity is unknown (remote). */
20747
21012
  availableBytes: number().nullable(),
@@ -20853,6 +21118,44 @@ method(object({
20853
21118
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
20854
21119
  kind: "query",
20855
21120
  auth: "admin"
21121
+ }), method(object({
21122
+ deviceId: number(),
21123
+ aroundMs: number(),
21124
+ preRollSec: number().min(0).max(30).default(2),
21125
+ postRollSec: number().min(0).max(30).default(5),
21126
+ maxWidth: number().int().min(120).max(1280).default(480),
21127
+ fps: number().int().min(1).max(15).default(5)
21128
+ }), object({
21129
+ gifBase64: string(),
21130
+ fromMs: number(),
21131
+ toMs: number()
21132
+ }), {
21133
+ kind: "mutation",
21134
+ auth: "admin"
21135
+ }), method(object({
21136
+ deviceId: number(),
21137
+ aroundMs: number(),
21138
+ preRollSec: number().min(0).max(30).default(3),
21139
+ postRollSec: number().min(0).max(30).default(7),
21140
+ maxWidth: number().int().min(160).max(1920).default(640)
21141
+ }), object({
21142
+ clipBase64: string(),
21143
+ mime: string(),
21144
+ fromMs: number(),
21145
+ toMs: number(),
21146
+ bytes: number().int()
21147
+ }), {
21148
+ kind: "mutation",
21149
+ auth: "admin"
21150
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
21151
+ kind: "mutation",
21152
+ auth: "admin"
21153
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
21154
+ kind: "query",
21155
+ auth: "admin"
21156
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
21157
+ kind: "mutation",
21158
+ auth: "admin"
20856
21159
  });
20857
21160
  /**
20858
21161
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -22444,6 +22747,12 @@ Object.freeze({
22444
22747
  addonId: null,
22445
22748
  access: "view"
22446
22749
  },
22750
+ "deviceManager.getDeviceStatusAggregateBatch": {
22751
+ capName: "device-manager",
22752
+ capScope: "system",
22753
+ addonId: null,
22754
+ access: "view"
22755
+ },
22447
22756
  "deviceManager.getLinkedDevices": {
22448
22757
  capName: "device-manager",
22449
22758
  capScope: "system",
@@ -23338,6 +23647,12 @@ Object.freeze({
23338
23647
  addonId: null,
23339
23648
  access: "view"
23340
23649
  },
23650
+ "localNetwork.getNotificationEndpoint": {
23651
+ capName: "local-network",
23652
+ capScope: "system",
23653
+ addonId: null,
23654
+ access: "view"
23655
+ },
23341
23656
  "localNetwork.getPreferred": {
23342
23657
  capName: "local-network",
23343
23658
  capScope: "system",
@@ -23362,6 +23677,12 @@ Object.freeze({
23362
23677
  addonId: null,
23363
23678
  access: "create"
23364
23679
  },
23680
+ "localNetwork.setNotificationEndpoint": {
23681
+ capName: "local-network",
23682
+ capScope: "system",
23683
+ addonId: null,
23684
+ access: "create"
23685
+ },
23365
23686
  "lockControl.lock": {
23366
23687
  capName: "lock-control",
23367
23688
  capScope: "device",
@@ -24004,6 +24325,12 @@ Object.freeze({
24004
24325
  addonId: null,
24005
24326
  access: "create"
24006
24327
  },
24328
+ "pipelineAnalytics.cancelMediaRelocate": {
24329
+ capName: "pipeline-analytics",
24330
+ capScope: "device",
24331
+ addonId: null,
24332
+ access: "create"
24333
+ },
24007
24334
  "pipelineAnalytics.clearTracks": {
24008
24335
  capName: "pipeline-analytics",
24009
24336
  capScope: "device",
@@ -24058,6 +24385,12 @@ Object.freeze({
24058
24385
  addonId: null,
24059
24386
  access: "view"
24060
24387
  },
24388
+ "pipelineAnalytics.getMediaRelocateStatus": {
24389
+ capName: "pipeline-analytics",
24390
+ capScope: "device",
24391
+ addonId: null,
24392
+ access: "view"
24393
+ },
24061
24394
  "pipelineAnalytics.getMotionEvents": {
24062
24395
  capName: "pipeline-analytics",
24063
24396
  capScope: "device",
@@ -24130,6 +24463,12 @@ Object.freeze({
24130
24463
  addonId: null,
24131
24464
  access: "create"
24132
24465
  },
24466
+ "pipelineAnalytics.relocateMedia": {
24467
+ capName: "pipeline-analytics",
24468
+ capScope: "device",
24469
+ addonId: null,
24470
+ access: "create"
24471
+ },
24133
24472
  "pipelineAnalytics.searchObjectEvents": {
24134
24473
  capName: "pipeline-analytics",
24135
24474
  capScope: "device",
@@ -24892,6 +25231,12 @@ Object.freeze({
24892
25231
  addonId: null,
24893
25232
  access: "create"
24894
25233
  },
25234
+ "recording.cancelRelocate": {
25235
+ capName: "recording",
25236
+ capScope: "system",
25237
+ addonId: null,
25238
+ access: "create"
25239
+ },
24895
25240
  "recording.deleteFootprint": {
24896
25241
  capName: "recording",
24897
25242
  capScope: "system",
@@ -24922,6 +25267,12 @@ Object.freeze({
24922
25267
  addonId: null,
24923
25268
  access: "view"
24924
25269
  },
25270
+ "recording.getRelocateStatus": {
25271
+ capName: "recording",
25272
+ capScope: "system",
25273
+ addonId: null,
25274
+ access: "view"
25275
+ },
24925
25276
  "recording.getStorageUsage": {
24926
25277
  capName: "recording",
24927
25278
  capScope: "system",
@@ -24952,6 +25303,24 @@ Object.freeze({
24952
25303
  addonId: null,
24953
25304
  access: "view"
24954
25305
  },
25306
+ "recording.relocateFootage": {
25307
+ capName: "recording",
25308
+ capScope: "system",
25309
+ addonId: null,
25310
+ access: "create"
25311
+ },
25312
+ "recording.renderClip": {
25313
+ capName: "recording",
25314
+ capScope: "system",
25315
+ addonId: null,
25316
+ access: "create"
25317
+ },
25318
+ "recording.renderGif": {
25319
+ capName: "recording",
25320
+ capScope: "system",
25321
+ addonId: null,
25322
+ access: "create"
25323
+ },
24955
25324
  "recording.rescanStorage": {
24956
25325
  capName: "recording",
24957
25326
  capScope: "system",
@@ -25546,6 +25915,12 @@ Object.freeze({
25546
25915
  addonId: null,
25547
25916
  access: "create"
25548
25917
  },
25918
+ "streamBroker.renderPreBufferClip": {
25919
+ capName: "stream-broker",
25920
+ capScope: "system",
25921
+ addonId: null,
25922
+ access: "create"
25923
+ },
25549
25924
  "streamBroker.restartProfile": {
25550
25925
  capName: "stream-broker",
25551
25926
  capScope: "system",