@camstack/addon-terminal 0.1.3 → 0.1.5

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