@camstack/addon-mqtt-broker 1.2.20 → 1.2.22

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.
@@ -44,7 +44,7 @@ let crypto$10 = __toESM(crypto$1, 1);
44
44
  crypto$1 = __toESM(crypto$1);
45
45
  let node_fs = require("node:fs");
46
46
  let node_path = require("node:path");
47
- //#region ../types/dist/event-category-Bxo5yJjt.mjs
47
+ //#region ../types/dist/event-category-XfKNtfCc.mjs
48
48
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
49
49
  EventCategory["SystemBoot"] = "system.boot";
50
50
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -61,9 +61,10 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
61
61
  EventCategory["SystemRestartCompleted"] = "system.restart-completed";
62
62
  /**
63
63
  * A newer addon or server-root package version was found by the
64
- * authoritative registry check. Emitted once per
65
- * `(target, packageName, currentVersion, latestVersion)` transition; repeated
66
- * polling of the same result is deduplicated by the checker.
64
+ * authoritative registry check. Emitted once when any observed
65
+ * `latestVersion` changes (or a package/node first appears behind);
66
+ * the payload carries the full currently-available list. Repeated
67
+ * polling of the same latests is silent.
67
68
  */
68
69
  EventCategory["UpdateAvailable"] = "update.available";
69
70
  /**
@@ -82,6 +83,22 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
82
83
  EventCategory["AddonInstalled"] = "addon.installed";
83
84
  EventCategory["AddonUninstalled"] = "addon.uninstalled";
84
85
  EventCategory["AddonCrashed"] = "addon.crashed";
86
+ /**
87
+ * A RUNNER the D6 crash circuit-breaker gave up on — terminal.
88
+ *
89
+ * `AddonCrashed` is the routine, self-healing fact ("it crashed; it is being
90
+ * respawned"); this is the one that never resolves itself. Emitted exactly
91
+ * once per trip, by `process-service.ts`, carrying the node, the runner, the
92
+ * addons it hosted and the crash count that tripped the breaker.
93
+ *
94
+ * It exists because a runner marked terminally `failed` used to be SILENT:
95
+ * on 2026-08-18 the `recorder` runner died of three unhandled ffmpeg spawn
96
+ * errors, the breaker stopped respawning it (correctly), `/health` kept
97
+ * returning 200, and fleet-wide recording was gone for 3h15 before the
98
+ * operator's phone told him. The Notification Center's system-event intake
99
+ * consumes this category and maps it to the `addon-crash-loop` kind.
100
+ */
101
+ EventCategory["AddonRunnerFailed"] = "addon.runner-failed";
85
102
  EventCategory["AddonError"] = "addon.error";
86
103
  EventCategory["AddonPageReady"] = "addon.page-ready";
87
104
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -7577,6 +7594,10 @@ var RecordingBandSchema = object({
7577
7594
  preBufferSec: number().min(0).optional(),
7578
7595
  postBufferSec: number().min(0).optional()
7579
7596
  });
7597
+ ({
7598
+ preBufferSec: 10,
7599
+ postBufferSec: 30
7600
+ }).postBufferSec * 1e3;
7580
7601
  /**
7581
7602
  * Per-device retention overrides. Every field is optional; an unset or `0`
7582
7603
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7624,6 +7645,12 @@ var RecordingConfigSchema = object({
7624
7645
  /** DERIVED summary of `bands`, stamped by the recorder on every save.
7625
7646
  * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7626
7647
  mode: RecordingStorageModeSchema.optional(),
7648
+ /**
7649
+ * Which assigned broker slots to record. Absent / empty = {@link
7650
+ * DEFAULT_RECORDING_PROFILES} (`high`+`low`) intersected with the
7651
+ * camera's currently assigned slots — never `mid` unless the operator
7652
+ * picks it, and never a slot the broker has not assigned.
7653
+ */
7627
7654
  profiles: array(CamProfileSchema).optional(),
7628
7655
  segmentSeconds: number().int().positive().optional(),
7629
7656
  /**
@@ -7704,7 +7731,11 @@ var RelocateFootageInputSchema = object({
7704
7731
  profiles: array(string()).optional(),
7705
7732
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7706
7733
  * never allowed to starve live writers. */
7707
- throttleMbps: number().min(1).max(1e3).optional()
7734
+ throttleMbps: number().min(1).max(1e3).optional(),
7735
+ /** Move only segments whose startMs is >= this. Absent = the whole source
7736
+ * pile. Used when a full drain is too expensive and the operator only
7737
+ * wants the recent window on the new disk. */
7738
+ sinceMs: number().int().optional()
7708
7739
  });
7709
7740
  /** Internal, lease-scoped participant operation. It is intentionally separate
7710
7741
  * from persistent recording settings: a migration never changes
@@ -14335,6 +14366,7 @@ var NcSystemEventKindSchema = _enum([
14335
14366
  "node-offline",
14336
14367
  "node-inference-unavailable",
14337
14368
  "detection-blind",
14369
+ "addon-crash-loop",
14338
14370
  "addon-update-available",
14339
14371
  "server-update-available",
14340
14372
  "alarm-triggered",
@@ -14342,6 +14374,9 @@ var NcSystemEventKindSchema = _enum([
14342
14374
  "alarm-disarmed",
14343
14375
  "alarm-arming",
14344
14376
  "alarm-arm-refused",
14377
+ "addon-updated",
14378
+ "server-updated",
14379
+ "export-completed",
14345
14380
  "camera-online",
14346
14381
  "camera-offline",
14347
14382
  "camera-disabled",
@@ -16235,13 +16270,19 @@ var RetrainStatusSchema = _enum([
16235
16270
  * "never marked" from "already trained" must read `retrainStatus`.
16236
16271
  *
16237
16272
  * `debug` does NOT pin; it is attention, not durability.
16273
+ *
16274
+ * `favourited` IS a BOOLEAN pin (durability bit), not a retrain lifecycle.
16275
+ * A favourited track is skipped by retention the same way `staging` is, but
16276
+ * it does not enter `none|staging|trained` and has no staging budget.
16238
16277
  */
16239
16278
  var TrackFlagFields = {
16240
16279
  /** Operator marked this track as training material — i.e. `retrainStatus` is
16241
16280
  * `'staging'`. */
16242
16281
  markForTrain: boolean().optional(),
16243
16282
  /** Operator marked this track for diagnostic attention. */
16244
- debug: boolean().optional()
16283
+ debug: boolean().optional(),
16284
+ /** Operator favourited this track. Pins it against pruning. */
16285
+ favourited: boolean().optional()
16245
16286
  };
16246
16287
  /**
16247
16288
  * The lifecycle field itself, on the READ surfaces only (`Track`, `KeyEvent`).
@@ -16266,6 +16307,7 @@ var TrackFlagsSchema = object({
16266
16307
  trackId: string(),
16267
16308
  markForTrain: boolean(),
16268
16309
  debug: boolean(),
16310
+ favourited: boolean(),
16269
16311
  /** The lifecycle state the boolean was derived from. Required here (unlike on
16270
16312
  * a track row) because this shape is only ever produced by the write body,
16271
16313
  * which always knows it — and a surface that has just written needs to render
@@ -16898,6 +16940,12 @@ var TrackCascadeCountsSchema = object({
16898
16940
  /** Per-track CLIP search vectors removed (best-effort). */
16899
16941
  embeddings: number().int()
16900
16942
  });
16943
+ /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
16944
+ var DiskReconcileCountsSchema = object({
16945
+ mediaDropped: number().int(),
16946
+ tracks: number().int(),
16947
+ events: number().int()
16948
+ });
16901
16949
  /** Event-store footprint for one camera. */
16902
16950
  var EventStoreDeviceFootprintSchema = object({
16903
16951
  deviceId: number(),
@@ -17074,6 +17122,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17074
17122
  }), method(object({ deviceId: number() }), TrackCascadeCountsSchema, {
17075
17123
  kind: "mutation",
17076
17124
  auth: "admin"
17125
+ }), method(object({ deviceId: number() }), DiskReconcileCountsSchema, {
17126
+ kind: "mutation",
17127
+ auth: "admin"
17077
17128
  }), method(object({
17078
17129
  deviceId: number(),
17079
17130
  trackIds: array(string()).min(1)
@@ -18584,6 +18635,24 @@ var CameraStatusDegradationSchema = object({
18584
18635
  *
18585
18636
  * See spec: `docs/superpowers/specs/2026-06-24-camera-status-aggregator-cap.md`
18586
18637
  */
18638
+ var DiskReconcileJobSchema = object({
18639
+ state: _enum([
18640
+ "idle",
18641
+ "running",
18642
+ "done",
18643
+ "error"
18644
+ ]),
18645
+ total: number().int().nonnegative(),
18646
+ completed: number().int().nonnegative(),
18647
+ currentDeviceId: number().int().nullable(),
18648
+ failed: array(number().int()).readonly(),
18649
+ mediaDropped: number().int().nonnegative(),
18650
+ tracks: number().int().nonnegative(),
18651
+ events: number().int().nonnegative(),
18652
+ startedAtMs: number().int().nullable(),
18653
+ finishedAtMs: number().int().nullable(),
18654
+ error: string().nullable()
18655
+ });
18587
18656
  var CameraStatusSchema = object({
18588
18657
  deviceId: number(),
18589
18658
  assignment: CameraAssignmentStatusSchema,
@@ -18815,7 +18884,10 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
18815
18884
  }), CameraSwitchGroupSchema, {
18816
18885
  kind: "mutation",
18817
18886
  auth: "admin"
18818
- }), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
18887
+ }), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), DiskReconcileJobSchema, {
18888
+ kind: "mutation",
18889
+ auth: "admin"
18890
+ }), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
18819
18891
  name: string(),
18820
18892
  description: string().optional(),
18821
18893
  config: CameraPipelineConfigSchema
@@ -19888,20 +19960,6 @@ var VectorStatsResultSchema = object({
19888
19960
  exact: boolean()
19889
19961
  });
19890
19962
  method(VectorDeclareIndexInputSchema, _void(), { kind: "mutation" }), method(VectorUpsertInputSchema, VectorUpsertResultSchema, { kind: "mutation" }), method(VectorQueryInputSchema, VectorQueryResultSchema), method(VectorGetInputSchema, VectorGetResultSchema), method(VectorDeleteInputSchema, VectorDeleteResultSchema, { kind: "mutation" }), method(VectorDeleteByFilterInputSchema, VectorDeleteResultSchema, { kind: "mutation" }), method(VectorStatsInputSchema, VectorStatsResultSchema);
19891
- /**
19892
- * `videoclips` — the unified, navigable-clip surface for a camera.
19893
- *
19894
- * A device-scoped WRAPPER cap (like `pipeline-analytics`): exactly one active
19895
- * provider per device, substitutable. The DEFAULT provider (registered by
19896
- * `addon-post-analysis`, `defaultActive: true`) composes the analytics event
19897
- * log (markers + thumbnails) with the recorder's `getPlaybackManifest` — a clip
19898
- * is a time-WINDOW over existing footage, never a separate file. A camera that
19899
- * exposes NATIVE onboard clips (Reolink/Hikvision NVR) can later substitute the
19900
- * wrapper provider for its device and serve its own clip catalog + URLs.
19901
- *
19902
- * A `Clip` is purely time-based (subtree-blind): playback resolves segments by
19903
- * temporal overlap, so the API never decides `continuous` vs `events`.
19904
- */
19905
19963
  var ClipSchema = object({
19906
19964
  /** Opaque, provider-namespaced id. The default provider encodes the time
19907
19965
  * window so `getClipPlayback` is self-contained (no event re-query). */
@@ -19918,8 +19976,65 @@ var ClipSchema = object({
19918
19976
  startMs: number(),
19919
19977
  endMs: number()
19920
19978
  }),
19921
- /** Thumbnail URL (lazy; e.g. analytics `getEventMedia`). Never inlined. */
19922
- thumbnail: string().optional()
19979
+ /**
19980
+ * Distinct object classes attached to this visit (`person`, `car`, …),
19981
+ * dominant first, capped at {@link MAX_CLIP_LABELS}. The ribbon renders these
19982
+ * instead of the bare kind — "Object" tells the operator nothing a colour bar
19983
+ * did not. Absent (never empty) when the visit attached no classified object
19984
+ * event, so a motion/audio-only visit keeps its kind label.
19985
+ */
19986
+ labels: array(string()).max(3).optional(),
19987
+ /**
19988
+ * Lazy thumbnail URL, never inlined.
19989
+ *
19990
+ * Recording-derived clips (events-mode keep-window, and the prepared
19991
+ * continuous event+fragment visit) MUST use the snapshot of the **main
19992
+ * event of the interval** — `getEventMedia({ eventId, kind: 'snapshot' })`
19993
+ * of the event that owns `kind` (object > motion > audio). Do not extract
19994
+ * a keyframe from the recorded segments. Other providers (onboard, HKSV)
19995
+ * mint their own stills.
19996
+ *
19997
+ * **VOUCHED, never fabricated.** A provider emits this only for an event it
19998
+ * has CONFIRMED owns at least one media row (its own, or its owning track's).
19999
+ * Absent is meaningful — "this visit has no event still" — never "we did not
20000
+ * look". Stamping it from a URL template made 35% of one camera's clips point
20001
+ * at a 404 (device 3836, 2026-08-17: 64 of 179 clips dead, 63 of them motion).
20002
+ * A read that FAILS drops the claim; it never invents it.
20003
+ */
20004
+ thumbnail: string().optional(),
20005
+ /**
20006
+ * An instant INSIDE this visit's footage, hole-safe, where a recorded still
20007
+ * can be decoded. Present whenever the visit came from recorded availability;
20008
+ * absent on a per-event padded window (there is no footage to promise).
20009
+ *
20010
+ * This is not a thumbnail and not a second byte path: it is the argument to
20011
+ * the recorder's existing still route. The surface — never the provider —
20012
+ * decides whether to use it. It is the midpoint of the visit's LONGEST
20013
+ * contiguous range, not of the visit: a visit spans its holes by
20014
+ * construction, so a naive midpoint lands in dead air.
20015
+ */
20016
+ stillAtMs: number().optional(),
20017
+ /**
20018
+ * Analytics event ids that overlap this visit — a BOUNDED sample, newest
20019
+ * first within kind (object → motion → audio), capped at
20020
+ * {@link MAX_CLIP_EVENT_IDS}. Empty on footage-only clips.
20021
+ *
20022
+ * Bounded because it is not a payload the surface pages through: one visit on
20023
+ * device 615 carried 2 345 ids, and `eventIds` was 99% of a 153 KB
20024
+ * camera-day. Read {@link eventCount} for the true total.
20025
+ */
20026
+ eventIds: array(string()).optional(),
20027
+ /** How many analytics events actually overlap this visit. Differs from
20028
+ * `eventIds.length` exactly when the sample was capped — so a truncated
20029
+ * list is never mistaken for a quiet visit. */
20030
+ eventCount: number().int().nonnegative().optional(),
20031
+ /** Intra-visit footage holes (GOP rolls, discarded segments) still shorter
20032
+ * than `VISIT_MERGE_GAP_MS`. Playback concatenates around them; the timeline
20033
+ * bar keeps showing them via `recording.getAvailability`. */
20034
+ holes: array(object({
20035
+ startMs: number(),
20036
+ endMs: number()
20037
+ })).optional()
19923
20038
  });
19924
20039
  var ClipPlaybackSchema = object({
19925
20040
  /** HLS master URL through the hub data-plane (Range + token in path). */
@@ -20383,7 +20498,14 @@ var SearchResultSchema = object({
20383
20498
  });
20384
20499
  var AutoUpdateSettingsSchema = object({
20385
20500
  channel: ChannelSchema,
20386
- intervalSeconds: number()
20501
+ intervalSeconds: number(),
20502
+ /**
20503
+ * Cadence of the "an update exists" POLLER, in seconds. Independent of
20504
+ * `channel`: the poller runs while auto-apply is `off`, because being told
20505
+ * about a publish and installing it are different decisions. Clamped
20506
+ * server-side to 900 s … 604800 s; defaults to 21600 s (6 h).
20507
+ */
20508
+ updateCheckIntervalSeconds: number()
20387
20509
  });
20388
20510
  var AddonAutoUpdateSchema = ChannelWithInheritSchema;
20389
20511
  var RestartAddonResultSchema = unknown();
@@ -20524,7 +20646,9 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
20524
20646
  auth: "admin"
20525
20647
  }), method(_void(), AutoUpdateSettingsSchema, { auth: "admin" }), method(object({
20526
20648
  channel: ChannelSchema,
20527
- intervalSeconds: number().min(300).max(86400).optional()
20649
+ intervalSeconds: number().min(300).max(86400).optional(),
20650
+ /** Availability-poll cadence; see AutoUpdateSettingsSchema. */
20651
+ updateCheckIntervalSeconds: number().min(900).max(604800).optional()
20528
20652
  }), unknown(), {
20529
20653
  kind: "mutation",
20530
20654
  auth: "admin"
@@ -24517,7 +24641,9 @@ var ExportOptionsSchema = object({
24517
24641
  includeAudio: boolean(),
24518
24642
  maxLifeMs: number().int().positive(),
24519
24643
  deleteAfterDownload: boolean(),
24520
- title: string().max(200).optional()
24644
+ title: string().max(200).optional(),
24645
+ /** Notification-output target ids to ping when this export becomes ready. */
24646
+ notifyTargetIds: array(string().min(1)).max(20).optional()
24521
24647
  }).superRefine((v, ctx) => {
24522
24648
  if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
24523
24649
  code: ZodIssueCode.custom,
@@ -24576,10 +24702,18 @@ var ExportBytesSchema = object({
24576
24702
  });
24577
24703
  method(object({
24578
24704
  deviceId: number(),
24579
- profile: string(),
24705
+ /** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
24706
+ profile: string().optional(),
24707
+ profiles: array(string()).min(1).optional(),
24580
24708
  fromMs: number(),
24581
24709
  toMs: number(),
24582
24710
  options: ExportOptionsSchema
24711
+ }).superRefine((v, ctx) => {
24712
+ if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
24713
+ code: ZodIssueCode.custom,
24714
+ message: "pass profiles[] (min 1) or legacy profile",
24715
+ path: ["profiles"]
24716
+ });
24583
24717
  }), ExportRecordSchema, {
24584
24718
  kind: "mutation",
24585
24719
  auth: "protected"
@@ -29179,6 +29313,12 @@ Object.freeze({
29179
29313
  addonId: null,
29180
29314
  access: "create"
29181
29315
  },
29316
+ "pipelineAnalytics.reconcileFromDisk": {
29317
+ capName: "pipeline-analytics",
29318
+ capScope: "device",
29319
+ addonId: null,
29320
+ access: "create"
29321
+ },
29182
29322
  "pipelineAnalytics.refreshStorageLocationsForMigration": {
29183
29323
  capName: "pipeline-analytics",
29184
29324
  capScope: "device",
@@ -29581,6 +29721,12 @@ Object.freeze({
29581
29721
  addonId: null,
29582
29722
  access: "view"
29583
29723
  },
29724
+ "pipelineOrchestrator.getReconcileFromDiskStatus": {
29725
+ capName: "pipeline-orchestrator",
29726
+ capScope: "system",
29727
+ addonId: null,
29728
+ access: "view"
29729
+ },
29584
29730
  "pipelineOrchestrator.listAgentSettings": {
29585
29731
  capName: "pipeline-orchestrator",
29586
29732
  capScope: "system",
@@ -29605,6 +29751,12 @@ Object.freeze({
29605
29751
  addonId: null,
29606
29752
  access: "create"
29607
29753
  },
29754
+ "pipelineOrchestrator.reconcileFromDisk": {
29755
+ capName: "pipeline-orchestrator",
29756
+ capScope: "system",
29757
+ addonId: null,
29758
+ access: "create"
29759
+ },
29608
29760
  "pipelineOrchestrator.removeAgentSettings": {
29609
29761
  capName: "pipeline-orchestrator",
29610
29762
  capScope: "system",
@@ -32596,6 +32748,11 @@ Object.freeze({
32596
32748
  form: "single",
32597
32749
  optional: true
32598
32750
  }],
32751
+ "pipelineAnalytics.reconcileFromDisk": [{
32752
+ name: "deviceId",
32753
+ form: "single",
32754
+ optional: false
32755
+ }],
32599
32756
  "pipelineAnalytics.restageRetrainTrack": [{
32600
32757
  name: "deviceId",
32601
32758
  form: "single",
@@ -33661,6 +33818,8 @@ DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
33661
33818
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
33662
33819
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
33663
33820
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
33821
+ var MB = 1024 * 1024;
33822
+ 1024 * MB, 3072 * MB;
33664
33823
  //#endregion
33665
33824
  //#region ../../node_modules/xtend/immutable.js
33666
33825
  var require_immutable = /* @__PURE__ */ __commonJSMin(((exports, module) => {
@@ -39,7 +39,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
39
39
  var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
40
40
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
41
41
  //#endregion
42
- //#region ../types/dist/event-category-Bxo5yJjt.mjs
42
+ //#region ../types/dist/event-category-XfKNtfCc.mjs
43
43
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
44
44
  EventCategory["SystemBoot"] = "system.boot";
45
45
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -56,9 +56,10 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
56
56
  EventCategory["SystemRestartCompleted"] = "system.restart-completed";
57
57
  /**
58
58
  * A newer addon or server-root package version was found by the
59
- * authoritative registry check. Emitted once per
60
- * `(target, packageName, currentVersion, latestVersion)` transition; repeated
61
- * polling of the same result is deduplicated by the checker.
59
+ * authoritative registry check. Emitted once when any observed
60
+ * `latestVersion` changes (or a package/node first appears behind);
61
+ * the payload carries the full currently-available list. Repeated
62
+ * polling of the same latests is silent.
62
63
  */
63
64
  EventCategory["UpdateAvailable"] = "update.available";
64
65
  /**
@@ -77,6 +78,22 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
77
78
  EventCategory["AddonInstalled"] = "addon.installed";
78
79
  EventCategory["AddonUninstalled"] = "addon.uninstalled";
79
80
  EventCategory["AddonCrashed"] = "addon.crashed";
81
+ /**
82
+ * A RUNNER the D6 crash circuit-breaker gave up on — terminal.
83
+ *
84
+ * `AddonCrashed` is the routine, self-healing fact ("it crashed; it is being
85
+ * respawned"); this is the one that never resolves itself. Emitted exactly
86
+ * once per trip, by `process-service.ts`, carrying the node, the runner, the
87
+ * addons it hosted and the crash count that tripped the breaker.
88
+ *
89
+ * It exists because a runner marked terminally `failed` used to be SILENT:
90
+ * on 2026-08-18 the `recorder` runner died of three unhandled ffmpeg spawn
91
+ * errors, the breaker stopped respawning it (correctly), `/health` kept
92
+ * returning 200, and fleet-wide recording was gone for 3h15 before the
93
+ * operator's phone told him. The Notification Center's system-event intake
94
+ * consumes this category and maps it to the `addon-crash-loop` kind.
95
+ */
96
+ EventCategory["AddonRunnerFailed"] = "addon.runner-failed";
80
97
  EventCategory["AddonError"] = "addon.error";
81
98
  EventCategory["AddonPageReady"] = "addon.page-ready";
82
99
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -7572,6 +7589,10 @@ var RecordingBandSchema = object({
7572
7589
  preBufferSec: number().min(0).optional(),
7573
7590
  postBufferSec: number().min(0).optional()
7574
7591
  });
7592
+ ({
7593
+ preBufferSec: 10,
7594
+ postBufferSec: 30
7595
+ }).postBufferSec * 1e3;
7575
7596
  /**
7576
7597
  * Per-device retention overrides. Every field is optional; an unset or `0`
7577
7598
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7619,6 +7640,12 @@ var RecordingConfigSchema = object({
7619
7640
  /** DERIVED summary of `bands`, stamped by the recorder on every save.
7620
7641
  * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7621
7642
  mode: RecordingStorageModeSchema.optional(),
7643
+ /**
7644
+ * Which assigned broker slots to record. Absent / empty = {@link
7645
+ * DEFAULT_RECORDING_PROFILES} (`high`+`low`) intersected with the
7646
+ * camera's currently assigned slots — never `mid` unless the operator
7647
+ * picks it, and never a slot the broker has not assigned.
7648
+ */
7622
7649
  profiles: array(CamProfileSchema).optional(),
7623
7650
  segmentSeconds: number().int().positive().optional(),
7624
7651
  /**
@@ -7699,7 +7726,11 @@ var RelocateFootageInputSchema = object({
7699
7726
  profiles: array(string()).optional(),
7700
7727
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7701
7728
  * never allowed to starve live writers. */
7702
- throttleMbps: number().min(1).max(1e3).optional()
7729
+ throttleMbps: number().min(1).max(1e3).optional(),
7730
+ /** Move only segments whose startMs is >= this. Absent = the whole source
7731
+ * pile. Used when a full drain is too expensive and the operator only
7732
+ * wants the recent window on the new disk. */
7733
+ sinceMs: number().int().optional()
7703
7734
  });
7704
7735
  /** Internal, lease-scoped participant operation. It is intentionally separate
7705
7736
  * from persistent recording settings: a migration never changes
@@ -14330,6 +14361,7 @@ var NcSystemEventKindSchema = _enum([
14330
14361
  "node-offline",
14331
14362
  "node-inference-unavailable",
14332
14363
  "detection-blind",
14364
+ "addon-crash-loop",
14333
14365
  "addon-update-available",
14334
14366
  "server-update-available",
14335
14367
  "alarm-triggered",
@@ -14337,6 +14369,9 @@ var NcSystemEventKindSchema = _enum([
14337
14369
  "alarm-disarmed",
14338
14370
  "alarm-arming",
14339
14371
  "alarm-arm-refused",
14372
+ "addon-updated",
14373
+ "server-updated",
14374
+ "export-completed",
14340
14375
  "camera-online",
14341
14376
  "camera-offline",
14342
14377
  "camera-disabled",
@@ -16230,13 +16265,19 @@ var RetrainStatusSchema = _enum([
16230
16265
  * "never marked" from "already trained" must read `retrainStatus`.
16231
16266
  *
16232
16267
  * `debug` does NOT pin; it is attention, not durability.
16268
+ *
16269
+ * `favourited` IS a BOOLEAN pin (durability bit), not a retrain lifecycle.
16270
+ * A favourited track is skipped by retention the same way `staging` is, but
16271
+ * it does not enter `none|staging|trained` and has no staging budget.
16233
16272
  */
16234
16273
  var TrackFlagFields = {
16235
16274
  /** Operator marked this track as training material — i.e. `retrainStatus` is
16236
16275
  * `'staging'`. */
16237
16276
  markForTrain: boolean().optional(),
16238
16277
  /** Operator marked this track for diagnostic attention. */
16239
- debug: boolean().optional()
16278
+ debug: boolean().optional(),
16279
+ /** Operator favourited this track. Pins it against pruning. */
16280
+ favourited: boolean().optional()
16240
16281
  };
16241
16282
  /**
16242
16283
  * The lifecycle field itself, on the READ surfaces only (`Track`, `KeyEvent`).
@@ -16261,6 +16302,7 @@ var TrackFlagsSchema = object({
16261
16302
  trackId: string(),
16262
16303
  markForTrain: boolean(),
16263
16304
  debug: boolean(),
16305
+ favourited: boolean(),
16264
16306
  /** The lifecycle state the boolean was derived from. Required here (unlike on
16265
16307
  * a track row) because this shape is only ever produced by the write body,
16266
16308
  * which always knows it — and a surface that has just written needs to render
@@ -16893,6 +16935,12 @@ var TrackCascadeCountsSchema = object({
16893
16935
  /** Per-track CLIP search vectors removed (best-effort). */
16894
16936
  embeddings: number().int()
16895
16937
  });
16938
+ /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
16939
+ var DiskReconcileCountsSchema = object({
16940
+ mediaDropped: number().int(),
16941
+ tracks: number().int(),
16942
+ events: number().int()
16943
+ });
16896
16944
  /** Event-store footprint for one camera. */
16897
16945
  var EventStoreDeviceFootprintSchema = object({
16898
16946
  deviceId: number(),
@@ -17069,6 +17117,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17069
17117
  }), method(object({ deviceId: number() }), TrackCascadeCountsSchema, {
17070
17118
  kind: "mutation",
17071
17119
  auth: "admin"
17120
+ }), method(object({ deviceId: number() }), DiskReconcileCountsSchema, {
17121
+ kind: "mutation",
17122
+ auth: "admin"
17072
17123
  }), method(object({
17073
17124
  deviceId: number(),
17074
17125
  trackIds: array(string()).min(1)
@@ -18579,6 +18630,24 @@ var CameraStatusDegradationSchema = object({
18579
18630
  *
18580
18631
  * See spec: `docs/superpowers/specs/2026-06-24-camera-status-aggregator-cap.md`
18581
18632
  */
18633
+ var DiskReconcileJobSchema = object({
18634
+ state: _enum([
18635
+ "idle",
18636
+ "running",
18637
+ "done",
18638
+ "error"
18639
+ ]),
18640
+ total: number().int().nonnegative(),
18641
+ completed: number().int().nonnegative(),
18642
+ currentDeviceId: number().int().nullable(),
18643
+ failed: array(number().int()).readonly(),
18644
+ mediaDropped: number().int().nonnegative(),
18645
+ tracks: number().int().nonnegative(),
18646
+ events: number().int().nonnegative(),
18647
+ startedAtMs: number().int().nullable(),
18648
+ finishedAtMs: number().int().nullable(),
18649
+ error: string().nullable()
18650
+ });
18582
18651
  var CameraStatusSchema = object({
18583
18652
  deviceId: number(),
18584
18653
  assignment: CameraAssignmentStatusSchema,
@@ -18810,7 +18879,10 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
18810
18879
  }), CameraSwitchGroupSchema, {
18811
18880
  kind: "mutation",
18812
18881
  auth: "admin"
18813
- }), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
18882
+ }), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), DiskReconcileJobSchema, {
18883
+ kind: "mutation",
18884
+ auth: "admin"
18885
+ }), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
18814
18886
  name: string(),
18815
18887
  description: string().optional(),
18816
18888
  config: CameraPipelineConfigSchema
@@ -19883,20 +19955,6 @@ var VectorStatsResultSchema = object({
19883
19955
  exact: boolean()
19884
19956
  });
19885
19957
  method(VectorDeclareIndexInputSchema, _void(), { kind: "mutation" }), method(VectorUpsertInputSchema, VectorUpsertResultSchema, { kind: "mutation" }), method(VectorQueryInputSchema, VectorQueryResultSchema), method(VectorGetInputSchema, VectorGetResultSchema), method(VectorDeleteInputSchema, VectorDeleteResultSchema, { kind: "mutation" }), method(VectorDeleteByFilterInputSchema, VectorDeleteResultSchema, { kind: "mutation" }), method(VectorStatsInputSchema, VectorStatsResultSchema);
19886
- /**
19887
- * `videoclips` — the unified, navigable-clip surface for a camera.
19888
- *
19889
- * A device-scoped WRAPPER cap (like `pipeline-analytics`): exactly one active
19890
- * provider per device, substitutable. The DEFAULT provider (registered by
19891
- * `addon-post-analysis`, `defaultActive: true`) composes the analytics event
19892
- * log (markers + thumbnails) with the recorder's `getPlaybackManifest` — a clip
19893
- * is a time-WINDOW over existing footage, never a separate file. A camera that
19894
- * exposes NATIVE onboard clips (Reolink/Hikvision NVR) can later substitute the
19895
- * wrapper provider for its device and serve its own clip catalog + URLs.
19896
- *
19897
- * A `Clip` is purely time-based (subtree-blind): playback resolves segments by
19898
- * temporal overlap, so the API never decides `continuous` vs `events`.
19899
- */
19900
19958
  var ClipSchema = object({
19901
19959
  /** Opaque, provider-namespaced id. The default provider encodes the time
19902
19960
  * window so `getClipPlayback` is self-contained (no event re-query). */
@@ -19913,8 +19971,65 @@ var ClipSchema = object({
19913
19971
  startMs: number(),
19914
19972
  endMs: number()
19915
19973
  }),
19916
- /** Thumbnail URL (lazy; e.g. analytics `getEventMedia`). Never inlined. */
19917
- thumbnail: string().optional()
19974
+ /**
19975
+ * Distinct object classes attached to this visit (`person`, `car`, …),
19976
+ * dominant first, capped at {@link MAX_CLIP_LABELS}. The ribbon renders these
19977
+ * instead of the bare kind — "Object" tells the operator nothing a colour bar
19978
+ * did not. Absent (never empty) when the visit attached no classified object
19979
+ * event, so a motion/audio-only visit keeps its kind label.
19980
+ */
19981
+ labels: array(string()).max(3).optional(),
19982
+ /**
19983
+ * Lazy thumbnail URL, never inlined.
19984
+ *
19985
+ * Recording-derived clips (events-mode keep-window, and the prepared
19986
+ * continuous event+fragment visit) MUST use the snapshot of the **main
19987
+ * event of the interval** — `getEventMedia({ eventId, kind: 'snapshot' })`
19988
+ * of the event that owns `kind` (object > motion > audio). Do not extract
19989
+ * a keyframe from the recorded segments. Other providers (onboard, HKSV)
19990
+ * mint their own stills.
19991
+ *
19992
+ * **VOUCHED, never fabricated.** A provider emits this only for an event it
19993
+ * has CONFIRMED owns at least one media row (its own, or its owning track's).
19994
+ * Absent is meaningful — "this visit has no event still" — never "we did not
19995
+ * look". Stamping it from a URL template made 35% of one camera's clips point
19996
+ * at a 404 (device 3836, 2026-08-17: 64 of 179 clips dead, 63 of them motion).
19997
+ * A read that FAILS drops the claim; it never invents it.
19998
+ */
19999
+ thumbnail: string().optional(),
20000
+ /**
20001
+ * An instant INSIDE this visit's footage, hole-safe, where a recorded still
20002
+ * can be decoded. Present whenever the visit came from recorded availability;
20003
+ * absent on a per-event padded window (there is no footage to promise).
20004
+ *
20005
+ * This is not a thumbnail and not a second byte path: it is the argument to
20006
+ * the recorder's existing still route. The surface — never the provider —
20007
+ * decides whether to use it. It is the midpoint of the visit's LONGEST
20008
+ * contiguous range, not of the visit: a visit spans its holes by
20009
+ * construction, so a naive midpoint lands in dead air.
20010
+ */
20011
+ stillAtMs: number().optional(),
20012
+ /**
20013
+ * Analytics event ids that overlap this visit — a BOUNDED sample, newest
20014
+ * first within kind (object → motion → audio), capped at
20015
+ * {@link MAX_CLIP_EVENT_IDS}. Empty on footage-only clips.
20016
+ *
20017
+ * Bounded because it is not a payload the surface pages through: one visit on
20018
+ * device 615 carried 2 345 ids, and `eventIds` was 99% of a 153 KB
20019
+ * camera-day. Read {@link eventCount} for the true total.
20020
+ */
20021
+ eventIds: array(string()).optional(),
20022
+ /** How many analytics events actually overlap this visit. Differs from
20023
+ * `eventIds.length` exactly when the sample was capped — so a truncated
20024
+ * list is never mistaken for a quiet visit. */
20025
+ eventCount: number().int().nonnegative().optional(),
20026
+ /** Intra-visit footage holes (GOP rolls, discarded segments) still shorter
20027
+ * than `VISIT_MERGE_GAP_MS`. Playback concatenates around them; the timeline
20028
+ * bar keeps showing them via `recording.getAvailability`. */
20029
+ holes: array(object({
20030
+ startMs: number(),
20031
+ endMs: number()
20032
+ })).optional()
19918
20033
  });
19919
20034
  var ClipPlaybackSchema = object({
19920
20035
  /** HLS master URL through the hub data-plane (Range + token in path). */
@@ -20378,7 +20493,14 @@ var SearchResultSchema = object({
20378
20493
  });
20379
20494
  var AutoUpdateSettingsSchema = object({
20380
20495
  channel: ChannelSchema,
20381
- intervalSeconds: number()
20496
+ intervalSeconds: number(),
20497
+ /**
20498
+ * Cadence of the "an update exists" POLLER, in seconds. Independent of
20499
+ * `channel`: the poller runs while auto-apply is `off`, because being told
20500
+ * about a publish and installing it are different decisions. Clamped
20501
+ * server-side to 900 s … 604800 s; defaults to 21600 s (6 h).
20502
+ */
20503
+ updateCheckIntervalSeconds: number()
20382
20504
  });
20383
20505
  var AddonAutoUpdateSchema = ChannelWithInheritSchema;
20384
20506
  var RestartAddonResultSchema = unknown();
@@ -20519,7 +20641,9 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
20519
20641
  auth: "admin"
20520
20642
  }), method(_void(), AutoUpdateSettingsSchema, { auth: "admin" }), method(object({
20521
20643
  channel: ChannelSchema,
20522
- intervalSeconds: number().min(300).max(86400).optional()
20644
+ intervalSeconds: number().min(300).max(86400).optional(),
20645
+ /** Availability-poll cadence; see AutoUpdateSettingsSchema. */
20646
+ updateCheckIntervalSeconds: number().min(900).max(604800).optional()
20523
20647
  }), unknown(), {
20524
20648
  kind: "mutation",
20525
20649
  auth: "admin"
@@ -24512,7 +24636,9 @@ var ExportOptionsSchema = object({
24512
24636
  includeAudio: boolean(),
24513
24637
  maxLifeMs: number().int().positive(),
24514
24638
  deleteAfterDownload: boolean(),
24515
- title: string().max(200).optional()
24639
+ title: string().max(200).optional(),
24640
+ /** Notification-output target ids to ping when this export becomes ready. */
24641
+ notifyTargetIds: array(string().min(1)).max(20).optional()
24516
24642
  }).superRefine((v, ctx) => {
24517
24643
  if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
24518
24644
  code: ZodIssueCode.custom,
@@ -24571,10 +24697,18 @@ var ExportBytesSchema = object({
24571
24697
  });
24572
24698
  method(object({
24573
24699
  deviceId: number(),
24574
- profile: string(),
24700
+ /** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
24701
+ profile: string().optional(),
24702
+ profiles: array(string()).min(1).optional(),
24575
24703
  fromMs: number(),
24576
24704
  toMs: number(),
24577
24705
  options: ExportOptionsSchema
24706
+ }).superRefine((v, ctx) => {
24707
+ if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
24708
+ code: ZodIssueCode.custom,
24709
+ message: "pass profiles[] (min 1) or legacy profile",
24710
+ path: ["profiles"]
24711
+ });
24578
24712
  }), ExportRecordSchema, {
24579
24713
  kind: "mutation",
24580
24714
  auth: "protected"
@@ -29174,6 +29308,12 @@ Object.freeze({
29174
29308
  addonId: null,
29175
29309
  access: "create"
29176
29310
  },
29311
+ "pipelineAnalytics.reconcileFromDisk": {
29312
+ capName: "pipeline-analytics",
29313
+ capScope: "device",
29314
+ addonId: null,
29315
+ access: "create"
29316
+ },
29177
29317
  "pipelineAnalytics.refreshStorageLocationsForMigration": {
29178
29318
  capName: "pipeline-analytics",
29179
29319
  capScope: "device",
@@ -29576,6 +29716,12 @@ Object.freeze({
29576
29716
  addonId: null,
29577
29717
  access: "view"
29578
29718
  },
29719
+ "pipelineOrchestrator.getReconcileFromDiskStatus": {
29720
+ capName: "pipeline-orchestrator",
29721
+ capScope: "system",
29722
+ addonId: null,
29723
+ access: "view"
29724
+ },
29579
29725
  "pipelineOrchestrator.listAgentSettings": {
29580
29726
  capName: "pipeline-orchestrator",
29581
29727
  capScope: "system",
@@ -29600,6 +29746,12 @@ Object.freeze({
29600
29746
  addonId: null,
29601
29747
  access: "create"
29602
29748
  },
29749
+ "pipelineOrchestrator.reconcileFromDisk": {
29750
+ capName: "pipeline-orchestrator",
29751
+ capScope: "system",
29752
+ addonId: null,
29753
+ access: "create"
29754
+ },
29603
29755
  "pipelineOrchestrator.removeAgentSettings": {
29604
29756
  capName: "pipeline-orchestrator",
29605
29757
  capScope: "system",
@@ -32591,6 +32743,11 @@ Object.freeze({
32591
32743
  form: "single",
32592
32744
  optional: true
32593
32745
  }],
32746
+ "pipelineAnalytics.reconcileFromDisk": [{
32747
+ name: "deviceId",
32748
+ form: "single",
32749
+ optional: false
32750
+ }],
32594
32751
  "pipelineAnalytics.restageRetrainTrack": [{
32595
32752
  name: "deviceId",
32596
32753
  form: "single",
@@ -33656,6 +33813,8 @@ DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
33656
33813
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
33657
33814
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
33658
33815
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
33816
+ var MB = 1024 * 1024;
33817
+ 1024 * MB, 3072 * MB;
33659
33818
  //#endregion
33660
33819
  //#region ../../node_modules/xtend/immutable.js
33661
33820
  var require_immutable = /* @__PURE__ */ __commonJSMin(((exports, module) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-mqtt-broker",
3
- "version": "1.2.20",
3
+ "version": "1.2.22",
4
4
  "description": "MQTT broker registry addon for CamStack — manages external broker entries + an optional embedded aedes broker. Consumers spin up their own `mqtt.js` clients via the `mqtt-broker` cap.",
5
5
  "keywords": [
6
6
  "camstack",