@camstack/addon-notifiers 1.2.24 → 1.2.26

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 +186 -27
  2. package/dist/addon.mjs +186 -27
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -29,7 +29,7 @@ let node_fs = require("node:fs");
29
29
  let node_path = require("node:path");
30
30
  node_path = __toESM(node_path);
31
31
  let node_url = require("node:url");
32
- //#region ../types/dist/event-category-Bxo5yJjt.mjs
32
+ //#region ../types/dist/event-category-XfKNtfCc.mjs
33
33
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
34
34
  EventCategory["SystemBoot"] = "system.boot";
35
35
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -46,9 +46,10 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
46
46
  EventCategory["SystemRestartCompleted"] = "system.restart-completed";
47
47
  /**
48
48
  * A newer addon or server-root package version was found by the
49
- * authoritative registry check. Emitted once per
50
- * `(target, packageName, currentVersion, latestVersion)` transition; repeated
51
- * polling of the same result is deduplicated by the checker.
49
+ * authoritative registry check. Emitted once when any observed
50
+ * `latestVersion` changes (or a package/node first appears behind);
51
+ * the payload carries the full currently-available list. Repeated
52
+ * polling of the same latests is silent.
52
53
  */
53
54
  EventCategory["UpdateAvailable"] = "update.available";
54
55
  /**
@@ -67,6 +68,22 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
67
68
  EventCategory["AddonInstalled"] = "addon.installed";
68
69
  EventCategory["AddonUninstalled"] = "addon.uninstalled";
69
70
  EventCategory["AddonCrashed"] = "addon.crashed";
71
+ /**
72
+ * A RUNNER the D6 crash circuit-breaker gave up on — terminal.
73
+ *
74
+ * `AddonCrashed` is the routine, self-healing fact ("it crashed; it is being
75
+ * respawned"); this is the one that never resolves itself. Emitted exactly
76
+ * once per trip, by `process-service.ts`, carrying the node, the runner, the
77
+ * addons it hosted and the crash count that tripped the breaker.
78
+ *
79
+ * It exists because a runner marked terminally `failed` used to be SILENT:
80
+ * on 2026-08-18 the `recorder` runner died of three unhandled ffmpeg spawn
81
+ * errors, the breaker stopped respawning it (correctly), `/health` kept
82
+ * returning 200, and fleet-wide recording was gone for 3h15 before the
83
+ * operator's phone told him. The Notification Center's system-event intake
84
+ * consumes this category and maps it to the `addon-crash-loop` kind.
85
+ */
86
+ EventCategory["AddonRunnerFailed"] = "addon.runner-failed";
70
87
  EventCategory["AddonError"] = "addon.error";
71
88
  EventCategory["AddonPageReady"] = "addon.page-ready";
72
89
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -7681,6 +7698,10 @@ var RecordingBandSchema = object({
7681
7698
  preBufferSec: number().min(0).optional(),
7682
7699
  postBufferSec: number().min(0).optional()
7683
7700
  });
7701
+ ({
7702
+ preBufferSec: 10,
7703
+ postBufferSec: 30
7704
+ }).postBufferSec * 1e3;
7684
7705
  /**
7685
7706
  * Per-device retention overrides. Every field is optional; an unset or `0`
7686
7707
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7728,6 +7749,12 @@ var RecordingConfigSchema = object({
7728
7749
  /** DERIVED summary of `bands`, stamped by the recorder on every save.
7729
7750
  * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7730
7751
  mode: RecordingStorageModeSchema.optional(),
7752
+ /**
7753
+ * Which assigned broker slots to record. Absent / empty = {@link
7754
+ * DEFAULT_RECORDING_PROFILES} (`high`+`low`) intersected with the
7755
+ * camera's currently assigned slots — never `mid` unless the operator
7756
+ * picks it, and never a slot the broker has not assigned.
7757
+ */
7731
7758
  profiles: array(CamProfileSchema).optional(),
7732
7759
  segmentSeconds: number().int().positive().optional(),
7733
7760
  /**
@@ -7808,7 +7835,11 @@ var RelocateFootageInputSchema = object({
7808
7835
  profiles: array(string()).optional(),
7809
7836
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7810
7837
  * never allowed to starve live writers. */
7811
- throttleMbps: number().min(1).max(1e3).optional()
7838
+ throttleMbps: number().min(1).max(1e3).optional(),
7839
+ /** Move only segments whose startMs is >= this. Absent = the whole source
7840
+ * pile. Used when a full drain is too expensive and the operator only
7841
+ * wants the recent window on the new disk. */
7842
+ sinceMs: number().int().optional()
7812
7843
  });
7813
7844
  /** Internal, lease-scoped participant operation. It is intentionally separate
7814
7845
  * from persistent recording settings: a migration never changes
@@ -14426,6 +14457,7 @@ var NcSystemEventKindSchema = _enum([
14426
14457
  "node-offline",
14427
14458
  "node-inference-unavailable",
14428
14459
  "detection-blind",
14460
+ "addon-crash-loop",
14429
14461
  "addon-update-available",
14430
14462
  "server-update-available",
14431
14463
  "alarm-triggered",
@@ -14433,6 +14465,9 @@ var NcSystemEventKindSchema = _enum([
14433
14465
  "alarm-disarmed",
14434
14466
  "alarm-arming",
14435
14467
  "alarm-arm-refused",
14468
+ "addon-updated",
14469
+ "server-updated",
14470
+ "export-completed",
14436
14471
  "camera-online",
14437
14472
  "camera-offline",
14438
14473
  "camera-disabled",
@@ -16326,13 +16361,19 @@ var RetrainStatusSchema = _enum([
16326
16361
  * "never marked" from "already trained" must read `retrainStatus`.
16327
16362
  *
16328
16363
  * `debug` does NOT pin; it is attention, not durability.
16364
+ *
16365
+ * `favourited` IS a BOOLEAN pin (durability bit), not a retrain lifecycle.
16366
+ * A favourited track is skipped by retention the same way `staging` is, but
16367
+ * it does not enter `none|staging|trained` and has no staging budget.
16329
16368
  */
16330
16369
  var TrackFlagFields = {
16331
16370
  /** Operator marked this track as training material — i.e. `retrainStatus` is
16332
16371
  * `'staging'`. */
16333
16372
  markForTrain: boolean().optional(),
16334
16373
  /** Operator marked this track for diagnostic attention. */
16335
- debug: boolean().optional()
16374
+ debug: boolean().optional(),
16375
+ /** Operator favourited this track. Pins it against pruning. */
16376
+ favourited: boolean().optional()
16336
16377
  };
16337
16378
  /**
16338
16379
  * The lifecycle field itself, on the READ surfaces only (`Track`, `KeyEvent`).
@@ -16357,6 +16398,7 @@ var TrackFlagsSchema = object({
16357
16398
  trackId: string(),
16358
16399
  markForTrain: boolean(),
16359
16400
  debug: boolean(),
16401
+ favourited: boolean(),
16360
16402
  /** The lifecycle state the boolean was derived from. Required here (unlike on
16361
16403
  * a track row) because this shape is only ever produced by the write body,
16362
16404
  * which always knows it — and a surface that has just written needs to render
@@ -16989,6 +17031,12 @@ var TrackCascadeCountsSchema = object({
16989
17031
  /** Per-track CLIP search vectors removed (best-effort). */
16990
17032
  embeddings: number().int()
16991
17033
  });
17034
+ /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
17035
+ var DiskReconcileCountsSchema = object({
17036
+ mediaDropped: number().int(),
17037
+ tracks: number().int(),
17038
+ events: number().int()
17039
+ });
16992
17040
  /** Event-store footprint for one camera. */
16993
17041
  var EventStoreDeviceFootprintSchema = object({
16994
17042
  deviceId: number(),
@@ -17165,6 +17213,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17165
17213
  }), method(object({ deviceId: number() }), TrackCascadeCountsSchema, {
17166
17214
  kind: "mutation",
17167
17215
  auth: "admin"
17216
+ }), method(object({ deviceId: number() }), DiskReconcileCountsSchema, {
17217
+ kind: "mutation",
17218
+ auth: "admin"
17168
17219
  }), method(object({
17169
17220
  deviceId: number(),
17170
17221
  trackIds: array(string()).min(1)
@@ -18675,6 +18726,24 @@ var CameraStatusDegradationSchema = object({
18675
18726
  *
18676
18727
  * See spec: `docs/superpowers/specs/2026-06-24-camera-status-aggregator-cap.md`
18677
18728
  */
18729
+ var DiskReconcileJobSchema = object({
18730
+ state: _enum([
18731
+ "idle",
18732
+ "running",
18733
+ "done",
18734
+ "error"
18735
+ ]),
18736
+ total: number().int().nonnegative(),
18737
+ completed: number().int().nonnegative(),
18738
+ currentDeviceId: number().int().nullable(),
18739
+ failed: array(number().int()).readonly(),
18740
+ mediaDropped: number().int().nonnegative(),
18741
+ tracks: number().int().nonnegative(),
18742
+ events: number().int().nonnegative(),
18743
+ startedAtMs: number().int().nullable(),
18744
+ finishedAtMs: number().int().nullable(),
18745
+ error: string().nullable()
18746
+ });
18678
18747
  var CameraStatusSchema = object({
18679
18748
  deviceId: number(),
18680
18749
  assignment: CameraAssignmentStatusSchema,
@@ -18906,7 +18975,10 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
18906
18975
  }), CameraSwitchGroupSchema, {
18907
18976
  kind: "mutation",
18908
18977
  auth: "admin"
18909
- }), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
18978
+ }), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), DiskReconcileJobSchema, {
18979
+ kind: "mutation",
18980
+ auth: "admin"
18981
+ }), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
18910
18982
  name: string(),
18911
18983
  description: string().optional(),
18912
18984
  config: CameraPipelineConfigSchema
@@ -19979,20 +20051,6 @@ var VectorStatsResultSchema = object({
19979
20051
  exact: boolean()
19980
20052
  });
19981
20053
  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);
19982
- /**
19983
- * `videoclips` — the unified, navigable-clip surface for a camera.
19984
- *
19985
- * A device-scoped WRAPPER cap (like `pipeline-analytics`): exactly one active
19986
- * provider per device, substitutable. The DEFAULT provider (registered by
19987
- * `addon-post-analysis`, `defaultActive: true`) composes the analytics event
19988
- * log (markers + thumbnails) with the recorder's `getPlaybackManifest` — a clip
19989
- * is a time-WINDOW over existing footage, never a separate file. A camera that
19990
- * exposes NATIVE onboard clips (Reolink/Hikvision NVR) can later substitute the
19991
- * wrapper provider for its device and serve its own clip catalog + URLs.
19992
- *
19993
- * A `Clip` is purely time-based (subtree-blind): playback resolves segments by
19994
- * temporal overlap, so the API never decides `continuous` vs `events`.
19995
- */
19996
20054
  var ClipSchema = object({
19997
20055
  /** Opaque, provider-namespaced id. The default provider encodes the time
19998
20056
  * window so `getClipPlayback` is self-contained (no event re-query). */
@@ -20009,8 +20067,65 @@ var ClipSchema = object({
20009
20067
  startMs: number(),
20010
20068
  endMs: number()
20011
20069
  }),
20012
- /** Thumbnail URL (lazy; e.g. analytics `getEventMedia`). Never inlined. */
20013
- thumbnail: string().optional()
20070
+ /**
20071
+ * Distinct object classes attached to this visit (`person`, `car`, …),
20072
+ * dominant first, capped at {@link MAX_CLIP_LABELS}. The ribbon renders these
20073
+ * instead of the bare kind — "Object" tells the operator nothing a colour bar
20074
+ * did not. Absent (never empty) when the visit attached no classified object
20075
+ * event, so a motion/audio-only visit keeps its kind label.
20076
+ */
20077
+ labels: array(string()).max(3).optional(),
20078
+ /**
20079
+ * Lazy thumbnail URL, never inlined.
20080
+ *
20081
+ * Recording-derived clips (events-mode keep-window, and the prepared
20082
+ * continuous event+fragment visit) MUST use the snapshot of the **main
20083
+ * event of the interval** — `getEventMedia({ eventId, kind: 'snapshot' })`
20084
+ * of the event that owns `kind` (object > motion > audio). Do not extract
20085
+ * a keyframe from the recorded segments. Other providers (onboard, HKSV)
20086
+ * mint their own stills.
20087
+ *
20088
+ * **VOUCHED, never fabricated.** A provider emits this only for an event it
20089
+ * has CONFIRMED owns at least one media row (its own, or its owning track's).
20090
+ * Absent is meaningful — "this visit has no event still" — never "we did not
20091
+ * look". Stamping it from a URL template made 35% of one camera's clips point
20092
+ * at a 404 (device 3836, 2026-08-17: 64 of 179 clips dead, 63 of them motion).
20093
+ * A read that FAILS drops the claim; it never invents it.
20094
+ */
20095
+ thumbnail: string().optional(),
20096
+ /**
20097
+ * An instant INSIDE this visit's footage, hole-safe, where a recorded still
20098
+ * can be decoded. Present whenever the visit came from recorded availability;
20099
+ * absent on a per-event padded window (there is no footage to promise).
20100
+ *
20101
+ * This is not a thumbnail and not a second byte path: it is the argument to
20102
+ * the recorder's existing still route. The surface — never the provider —
20103
+ * decides whether to use it. It is the midpoint of the visit's LONGEST
20104
+ * contiguous range, not of the visit: a visit spans its holes by
20105
+ * construction, so a naive midpoint lands in dead air.
20106
+ */
20107
+ stillAtMs: number().optional(),
20108
+ /**
20109
+ * Analytics event ids that overlap this visit — a BOUNDED sample, newest
20110
+ * first within kind (object → motion → audio), capped at
20111
+ * {@link MAX_CLIP_EVENT_IDS}. Empty on footage-only clips.
20112
+ *
20113
+ * Bounded because it is not a payload the surface pages through: one visit on
20114
+ * device 615 carried 2 345 ids, and `eventIds` was 99% of a 153 KB
20115
+ * camera-day. Read {@link eventCount} for the true total.
20116
+ */
20117
+ eventIds: array(string()).optional(),
20118
+ /** How many analytics events actually overlap this visit. Differs from
20119
+ * `eventIds.length` exactly when the sample was capped — so a truncated
20120
+ * list is never mistaken for a quiet visit. */
20121
+ eventCount: number().int().nonnegative().optional(),
20122
+ /** Intra-visit footage holes (GOP rolls, discarded segments) still shorter
20123
+ * than `VISIT_MERGE_GAP_MS`. Playback concatenates around them; the timeline
20124
+ * bar keeps showing them via `recording.getAvailability`. */
20125
+ holes: array(object({
20126
+ startMs: number(),
20127
+ endMs: number()
20128
+ })).optional()
20014
20129
  });
20015
20130
  var ClipPlaybackSchema = object({
20016
20131
  /** HLS master URL through the hub data-plane (Range + token in path). */
@@ -20474,7 +20589,14 @@ var SearchResultSchema = object({
20474
20589
  });
20475
20590
  var AutoUpdateSettingsSchema = object({
20476
20591
  channel: ChannelSchema,
20477
- intervalSeconds: number()
20592
+ intervalSeconds: number(),
20593
+ /**
20594
+ * Cadence of the "an update exists" POLLER, in seconds. Independent of
20595
+ * `channel`: the poller runs while auto-apply is `off`, because being told
20596
+ * about a publish and installing it are different decisions. Clamped
20597
+ * server-side to 900 s … 604800 s; defaults to 21600 s (6 h).
20598
+ */
20599
+ updateCheckIntervalSeconds: number()
20478
20600
  });
20479
20601
  var AddonAutoUpdateSchema = ChannelWithInheritSchema;
20480
20602
  var RestartAddonResultSchema = unknown();
@@ -20615,7 +20737,9 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
20615
20737
  auth: "admin"
20616
20738
  }), method(_void(), AutoUpdateSettingsSchema, { auth: "admin" }), method(object({
20617
20739
  channel: ChannelSchema,
20618
- intervalSeconds: number().min(300).max(86400).optional()
20740
+ intervalSeconds: number().min(300).max(86400).optional(),
20741
+ /** Availability-poll cadence; see AutoUpdateSettingsSchema. */
20742
+ updateCheckIntervalSeconds: number().min(900).max(604800).optional()
20619
20743
  }), unknown(), {
20620
20744
  kind: "mutation",
20621
20745
  auth: "admin"
@@ -24608,7 +24732,9 @@ var ExportOptionsSchema = object({
24608
24732
  includeAudio: boolean(),
24609
24733
  maxLifeMs: number().int().positive(),
24610
24734
  deleteAfterDownload: boolean(),
24611
- title: string().max(200).optional()
24735
+ title: string().max(200).optional(),
24736
+ /** Notification-output target ids to ping when this export becomes ready. */
24737
+ notifyTargetIds: array(string().min(1)).max(20).optional()
24612
24738
  }).superRefine((v, ctx) => {
24613
24739
  if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
24614
24740
  code: ZodIssueCode.custom,
@@ -24667,10 +24793,18 @@ var ExportBytesSchema = object({
24667
24793
  });
24668
24794
  method(object({
24669
24795
  deviceId: number(),
24670
- profile: string(),
24796
+ /** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
24797
+ profile: string().optional(),
24798
+ profiles: array(string()).min(1).optional(),
24671
24799
  fromMs: number(),
24672
24800
  toMs: number(),
24673
24801
  options: ExportOptionsSchema
24802
+ }).superRefine((v, ctx) => {
24803
+ if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
24804
+ code: ZodIssueCode.custom,
24805
+ message: "pass profiles[] (min 1) or legacy profile",
24806
+ path: ["profiles"]
24807
+ });
24674
24808
  }), ExportRecordSchema, {
24675
24809
  kind: "mutation",
24676
24810
  auth: "protected"
@@ -29270,6 +29404,12 @@ Object.freeze({
29270
29404
  addonId: null,
29271
29405
  access: "create"
29272
29406
  },
29407
+ "pipelineAnalytics.reconcileFromDisk": {
29408
+ capName: "pipeline-analytics",
29409
+ capScope: "device",
29410
+ addonId: null,
29411
+ access: "create"
29412
+ },
29273
29413
  "pipelineAnalytics.refreshStorageLocationsForMigration": {
29274
29414
  capName: "pipeline-analytics",
29275
29415
  capScope: "device",
@@ -29672,6 +29812,12 @@ Object.freeze({
29672
29812
  addonId: null,
29673
29813
  access: "view"
29674
29814
  },
29815
+ "pipelineOrchestrator.getReconcileFromDiskStatus": {
29816
+ capName: "pipeline-orchestrator",
29817
+ capScope: "system",
29818
+ addonId: null,
29819
+ access: "view"
29820
+ },
29675
29821
  "pipelineOrchestrator.listAgentSettings": {
29676
29822
  capName: "pipeline-orchestrator",
29677
29823
  capScope: "system",
@@ -29696,6 +29842,12 @@ Object.freeze({
29696
29842
  addonId: null,
29697
29843
  access: "create"
29698
29844
  },
29845
+ "pipelineOrchestrator.reconcileFromDisk": {
29846
+ capName: "pipeline-orchestrator",
29847
+ capScope: "system",
29848
+ addonId: null,
29849
+ access: "create"
29850
+ },
29699
29851
  "pipelineOrchestrator.removeAgentSettings": {
29700
29852
  capName: "pipeline-orchestrator",
29701
29853
  capScope: "system",
@@ -32687,6 +32839,11 @@ Object.freeze({
32687
32839
  form: "single",
32688
32840
  optional: true
32689
32841
  }],
32842
+ "pipelineAnalytics.reconcileFromDisk": [{
32843
+ name: "deviceId",
32844
+ form: "single",
32845
+ optional: false
32846
+ }],
32690
32847
  "pipelineAnalytics.restageRetrainTrack": [{
32691
32848
  name: "deviceId",
32692
32849
  form: "single",
@@ -33959,6 +34116,8 @@ DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
33959
34116
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
33960
34117
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
33961
34118
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34119
+ var MB = 1024 * 1024;
34120
+ 1024 * MB, 3072 * MB;
33962
34121
  var NOTIFIER_ICONS = {
33963
34122
  telegram: {
33964
34123
  contentType: "image/svg+xml",
package/dist/addon.mjs CHANGED
@@ -2,7 +2,7 @@ import { brotliCompressSync, deflateSync, gzipSync } from "node:zlib";
2
2
  import { readFileSync } from "node:fs";
3
3
  import path from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
- //#region ../types/dist/event-category-Bxo5yJjt.mjs
5
+ //#region ../types/dist/event-category-XfKNtfCc.mjs
6
6
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
7
7
  EventCategory["SystemBoot"] = "system.boot";
8
8
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -19,9 +19,10 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
19
19
  EventCategory["SystemRestartCompleted"] = "system.restart-completed";
20
20
  /**
21
21
  * A newer addon or server-root package version was found by the
22
- * authoritative registry check. Emitted once per
23
- * `(target, packageName, currentVersion, latestVersion)` transition; repeated
24
- * polling of the same result is deduplicated by the checker.
22
+ * authoritative registry check. Emitted once when any observed
23
+ * `latestVersion` changes (or a package/node first appears behind);
24
+ * the payload carries the full currently-available list. Repeated
25
+ * polling of the same latests is silent.
25
26
  */
26
27
  EventCategory["UpdateAvailable"] = "update.available";
27
28
  /**
@@ -40,6 +41,22 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
40
41
  EventCategory["AddonInstalled"] = "addon.installed";
41
42
  EventCategory["AddonUninstalled"] = "addon.uninstalled";
42
43
  EventCategory["AddonCrashed"] = "addon.crashed";
44
+ /**
45
+ * A RUNNER the D6 crash circuit-breaker gave up on — terminal.
46
+ *
47
+ * `AddonCrashed` is the routine, self-healing fact ("it crashed; it is being
48
+ * respawned"); this is the one that never resolves itself. Emitted exactly
49
+ * once per trip, by `process-service.ts`, carrying the node, the runner, the
50
+ * addons it hosted and the crash count that tripped the breaker.
51
+ *
52
+ * It exists because a runner marked terminally `failed` used to be SILENT:
53
+ * on 2026-08-18 the `recorder` runner died of three unhandled ffmpeg spawn
54
+ * errors, the breaker stopped respawning it (correctly), `/health` kept
55
+ * returning 200, and fleet-wide recording was gone for 3h15 before the
56
+ * operator's phone told him. The Notification Center's system-event intake
57
+ * consumes this category and maps it to the `addon-crash-loop` kind.
58
+ */
59
+ EventCategory["AddonRunnerFailed"] = "addon.runner-failed";
43
60
  EventCategory["AddonError"] = "addon.error";
44
61
  EventCategory["AddonPageReady"] = "addon.page-ready";
45
62
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -7654,6 +7671,10 @@ var RecordingBandSchema = object({
7654
7671
  preBufferSec: number().min(0).optional(),
7655
7672
  postBufferSec: number().min(0).optional()
7656
7673
  });
7674
+ ({
7675
+ preBufferSec: 10,
7676
+ postBufferSec: 30
7677
+ }).postBufferSec * 1e3;
7657
7678
  /**
7658
7679
  * Per-device retention overrides. Every field is optional; an unset or `0`
7659
7680
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7701,6 +7722,12 @@ var RecordingConfigSchema = object({
7701
7722
  /** DERIVED summary of `bands`, stamped by the recorder on every save.
7702
7723
  * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7703
7724
  mode: RecordingStorageModeSchema.optional(),
7725
+ /**
7726
+ * Which assigned broker slots to record. Absent / empty = {@link
7727
+ * DEFAULT_RECORDING_PROFILES} (`high`+`low`) intersected with the
7728
+ * camera's currently assigned slots — never `mid` unless the operator
7729
+ * picks it, and never a slot the broker has not assigned.
7730
+ */
7704
7731
  profiles: array(CamProfileSchema).optional(),
7705
7732
  segmentSeconds: number().int().positive().optional(),
7706
7733
  /**
@@ -7781,7 +7808,11 @@ var RelocateFootageInputSchema = object({
7781
7808
  profiles: array(string()).optional(),
7782
7809
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7783
7810
  * never allowed to starve live writers. */
7784
- throttleMbps: number().min(1).max(1e3).optional()
7811
+ throttleMbps: number().min(1).max(1e3).optional(),
7812
+ /** Move only segments whose startMs is >= this. Absent = the whole source
7813
+ * pile. Used when a full drain is too expensive and the operator only
7814
+ * wants the recent window on the new disk. */
7815
+ sinceMs: number().int().optional()
7785
7816
  });
7786
7817
  /** Internal, lease-scoped participant operation. It is intentionally separate
7787
7818
  * from persistent recording settings: a migration never changes
@@ -14399,6 +14430,7 @@ var NcSystemEventKindSchema = _enum([
14399
14430
  "node-offline",
14400
14431
  "node-inference-unavailable",
14401
14432
  "detection-blind",
14433
+ "addon-crash-loop",
14402
14434
  "addon-update-available",
14403
14435
  "server-update-available",
14404
14436
  "alarm-triggered",
@@ -14406,6 +14438,9 @@ var NcSystemEventKindSchema = _enum([
14406
14438
  "alarm-disarmed",
14407
14439
  "alarm-arming",
14408
14440
  "alarm-arm-refused",
14441
+ "addon-updated",
14442
+ "server-updated",
14443
+ "export-completed",
14409
14444
  "camera-online",
14410
14445
  "camera-offline",
14411
14446
  "camera-disabled",
@@ -16299,13 +16334,19 @@ var RetrainStatusSchema = _enum([
16299
16334
  * "never marked" from "already trained" must read `retrainStatus`.
16300
16335
  *
16301
16336
  * `debug` does NOT pin; it is attention, not durability.
16337
+ *
16338
+ * `favourited` IS a BOOLEAN pin (durability bit), not a retrain lifecycle.
16339
+ * A favourited track is skipped by retention the same way `staging` is, but
16340
+ * it does not enter `none|staging|trained` and has no staging budget.
16302
16341
  */
16303
16342
  var TrackFlagFields = {
16304
16343
  /** Operator marked this track as training material — i.e. `retrainStatus` is
16305
16344
  * `'staging'`. */
16306
16345
  markForTrain: boolean().optional(),
16307
16346
  /** Operator marked this track for diagnostic attention. */
16308
- debug: boolean().optional()
16347
+ debug: boolean().optional(),
16348
+ /** Operator favourited this track. Pins it against pruning. */
16349
+ favourited: boolean().optional()
16309
16350
  };
16310
16351
  /**
16311
16352
  * The lifecycle field itself, on the READ surfaces only (`Track`, `KeyEvent`).
@@ -16330,6 +16371,7 @@ var TrackFlagsSchema = object({
16330
16371
  trackId: string(),
16331
16372
  markForTrain: boolean(),
16332
16373
  debug: boolean(),
16374
+ favourited: boolean(),
16333
16375
  /** The lifecycle state the boolean was derived from. Required here (unlike on
16334
16376
  * a track row) because this shape is only ever produced by the write body,
16335
16377
  * which always knows it — and a surface that has just written needs to render
@@ -16962,6 +17004,12 @@ var TrackCascadeCountsSchema = object({
16962
17004
  /** Per-track CLIP search vectors removed (best-effort). */
16963
17005
  embeddings: number().int()
16964
17006
  });
17007
+ /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
17008
+ var DiskReconcileCountsSchema = object({
17009
+ mediaDropped: number().int(),
17010
+ tracks: number().int(),
17011
+ events: number().int()
17012
+ });
16965
17013
  /** Event-store footprint for one camera. */
16966
17014
  var EventStoreDeviceFootprintSchema = object({
16967
17015
  deviceId: number(),
@@ -17138,6 +17186,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17138
17186
  }), method(object({ deviceId: number() }), TrackCascadeCountsSchema, {
17139
17187
  kind: "mutation",
17140
17188
  auth: "admin"
17189
+ }), method(object({ deviceId: number() }), DiskReconcileCountsSchema, {
17190
+ kind: "mutation",
17191
+ auth: "admin"
17141
17192
  }), method(object({
17142
17193
  deviceId: number(),
17143
17194
  trackIds: array(string()).min(1)
@@ -18648,6 +18699,24 @@ var CameraStatusDegradationSchema = object({
18648
18699
  *
18649
18700
  * See spec: `docs/superpowers/specs/2026-06-24-camera-status-aggregator-cap.md`
18650
18701
  */
18702
+ var DiskReconcileJobSchema = object({
18703
+ state: _enum([
18704
+ "idle",
18705
+ "running",
18706
+ "done",
18707
+ "error"
18708
+ ]),
18709
+ total: number().int().nonnegative(),
18710
+ completed: number().int().nonnegative(),
18711
+ currentDeviceId: number().int().nullable(),
18712
+ failed: array(number().int()).readonly(),
18713
+ mediaDropped: number().int().nonnegative(),
18714
+ tracks: number().int().nonnegative(),
18715
+ events: number().int().nonnegative(),
18716
+ startedAtMs: number().int().nullable(),
18717
+ finishedAtMs: number().int().nullable(),
18718
+ error: string().nullable()
18719
+ });
18651
18720
  var CameraStatusSchema = object({
18652
18721
  deviceId: number(),
18653
18722
  assignment: CameraAssignmentStatusSchema,
@@ -18879,7 +18948,10 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
18879
18948
  }), CameraSwitchGroupSchema, {
18880
18949
  kind: "mutation",
18881
18950
  auth: "admin"
18882
- }), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
18951
+ }), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), DiskReconcileJobSchema, {
18952
+ kind: "mutation",
18953
+ auth: "admin"
18954
+ }), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
18883
18955
  name: string(),
18884
18956
  description: string().optional(),
18885
18957
  config: CameraPipelineConfigSchema
@@ -19952,20 +20024,6 @@ var VectorStatsResultSchema = object({
19952
20024
  exact: boolean()
19953
20025
  });
19954
20026
  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);
19955
- /**
19956
- * `videoclips` — the unified, navigable-clip surface for a camera.
19957
- *
19958
- * A device-scoped WRAPPER cap (like `pipeline-analytics`): exactly one active
19959
- * provider per device, substitutable. The DEFAULT provider (registered by
19960
- * `addon-post-analysis`, `defaultActive: true`) composes the analytics event
19961
- * log (markers + thumbnails) with the recorder's `getPlaybackManifest` — a clip
19962
- * is a time-WINDOW over existing footage, never a separate file. A camera that
19963
- * exposes NATIVE onboard clips (Reolink/Hikvision NVR) can later substitute the
19964
- * wrapper provider for its device and serve its own clip catalog + URLs.
19965
- *
19966
- * A `Clip` is purely time-based (subtree-blind): playback resolves segments by
19967
- * temporal overlap, so the API never decides `continuous` vs `events`.
19968
- */
19969
20027
  var ClipSchema = object({
19970
20028
  /** Opaque, provider-namespaced id. The default provider encodes the time
19971
20029
  * window so `getClipPlayback` is self-contained (no event re-query). */
@@ -19982,8 +20040,65 @@ var ClipSchema = object({
19982
20040
  startMs: number(),
19983
20041
  endMs: number()
19984
20042
  }),
19985
- /** Thumbnail URL (lazy; e.g. analytics `getEventMedia`). Never inlined. */
19986
- thumbnail: string().optional()
20043
+ /**
20044
+ * Distinct object classes attached to this visit (`person`, `car`, …),
20045
+ * dominant first, capped at {@link MAX_CLIP_LABELS}. The ribbon renders these
20046
+ * instead of the bare kind — "Object" tells the operator nothing a colour bar
20047
+ * did not. Absent (never empty) when the visit attached no classified object
20048
+ * event, so a motion/audio-only visit keeps its kind label.
20049
+ */
20050
+ labels: array(string()).max(3).optional(),
20051
+ /**
20052
+ * Lazy thumbnail URL, never inlined.
20053
+ *
20054
+ * Recording-derived clips (events-mode keep-window, and the prepared
20055
+ * continuous event+fragment visit) MUST use the snapshot of the **main
20056
+ * event of the interval** — `getEventMedia({ eventId, kind: 'snapshot' })`
20057
+ * of the event that owns `kind` (object > motion > audio). Do not extract
20058
+ * a keyframe from the recorded segments. Other providers (onboard, HKSV)
20059
+ * mint their own stills.
20060
+ *
20061
+ * **VOUCHED, never fabricated.** A provider emits this only for an event it
20062
+ * has CONFIRMED owns at least one media row (its own, or its owning track's).
20063
+ * Absent is meaningful — "this visit has no event still" — never "we did not
20064
+ * look". Stamping it from a URL template made 35% of one camera's clips point
20065
+ * at a 404 (device 3836, 2026-08-17: 64 of 179 clips dead, 63 of them motion).
20066
+ * A read that FAILS drops the claim; it never invents it.
20067
+ */
20068
+ thumbnail: string().optional(),
20069
+ /**
20070
+ * An instant INSIDE this visit's footage, hole-safe, where a recorded still
20071
+ * can be decoded. Present whenever the visit came from recorded availability;
20072
+ * absent on a per-event padded window (there is no footage to promise).
20073
+ *
20074
+ * This is not a thumbnail and not a second byte path: it is the argument to
20075
+ * the recorder's existing still route. The surface — never the provider —
20076
+ * decides whether to use it. It is the midpoint of the visit's LONGEST
20077
+ * contiguous range, not of the visit: a visit spans its holes by
20078
+ * construction, so a naive midpoint lands in dead air.
20079
+ */
20080
+ stillAtMs: number().optional(),
20081
+ /**
20082
+ * Analytics event ids that overlap this visit — a BOUNDED sample, newest
20083
+ * first within kind (object → motion → audio), capped at
20084
+ * {@link MAX_CLIP_EVENT_IDS}. Empty on footage-only clips.
20085
+ *
20086
+ * Bounded because it is not a payload the surface pages through: one visit on
20087
+ * device 615 carried 2 345 ids, and `eventIds` was 99% of a 153 KB
20088
+ * camera-day. Read {@link eventCount} for the true total.
20089
+ */
20090
+ eventIds: array(string()).optional(),
20091
+ /** How many analytics events actually overlap this visit. Differs from
20092
+ * `eventIds.length` exactly when the sample was capped — so a truncated
20093
+ * list is never mistaken for a quiet visit. */
20094
+ eventCount: number().int().nonnegative().optional(),
20095
+ /** Intra-visit footage holes (GOP rolls, discarded segments) still shorter
20096
+ * than `VISIT_MERGE_GAP_MS`. Playback concatenates around them; the timeline
20097
+ * bar keeps showing them via `recording.getAvailability`. */
20098
+ holes: array(object({
20099
+ startMs: number(),
20100
+ endMs: number()
20101
+ })).optional()
19987
20102
  });
19988
20103
  var ClipPlaybackSchema = object({
19989
20104
  /** HLS master URL through the hub data-plane (Range + token in path). */
@@ -20447,7 +20562,14 @@ var SearchResultSchema = object({
20447
20562
  });
20448
20563
  var AutoUpdateSettingsSchema = object({
20449
20564
  channel: ChannelSchema,
20450
- intervalSeconds: number()
20565
+ intervalSeconds: number(),
20566
+ /**
20567
+ * Cadence of the "an update exists" POLLER, in seconds. Independent of
20568
+ * `channel`: the poller runs while auto-apply is `off`, because being told
20569
+ * about a publish and installing it are different decisions. Clamped
20570
+ * server-side to 900 s … 604800 s; defaults to 21600 s (6 h).
20571
+ */
20572
+ updateCheckIntervalSeconds: number()
20451
20573
  });
20452
20574
  var AddonAutoUpdateSchema = ChannelWithInheritSchema;
20453
20575
  var RestartAddonResultSchema = unknown();
@@ -20588,7 +20710,9 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
20588
20710
  auth: "admin"
20589
20711
  }), method(_void(), AutoUpdateSettingsSchema, { auth: "admin" }), method(object({
20590
20712
  channel: ChannelSchema,
20591
- intervalSeconds: number().min(300).max(86400).optional()
20713
+ intervalSeconds: number().min(300).max(86400).optional(),
20714
+ /** Availability-poll cadence; see AutoUpdateSettingsSchema. */
20715
+ updateCheckIntervalSeconds: number().min(900).max(604800).optional()
20592
20716
  }), unknown(), {
20593
20717
  kind: "mutation",
20594
20718
  auth: "admin"
@@ -24581,7 +24705,9 @@ var ExportOptionsSchema = object({
24581
24705
  includeAudio: boolean(),
24582
24706
  maxLifeMs: number().int().positive(),
24583
24707
  deleteAfterDownload: boolean(),
24584
- title: string().max(200).optional()
24708
+ title: string().max(200).optional(),
24709
+ /** Notification-output target ids to ping when this export becomes ready. */
24710
+ notifyTargetIds: array(string().min(1)).max(20).optional()
24585
24711
  }).superRefine((v, ctx) => {
24586
24712
  if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
24587
24713
  code: ZodIssueCode.custom,
@@ -24640,10 +24766,18 @@ var ExportBytesSchema = object({
24640
24766
  });
24641
24767
  method(object({
24642
24768
  deviceId: number(),
24643
- profile: string(),
24769
+ /** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
24770
+ profile: string().optional(),
24771
+ profiles: array(string()).min(1).optional(),
24644
24772
  fromMs: number(),
24645
24773
  toMs: number(),
24646
24774
  options: ExportOptionsSchema
24775
+ }).superRefine((v, ctx) => {
24776
+ if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
24777
+ code: ZodIssueCode.custom,
24778
+ message: "pass profiles[] (min 1) or legacy profile",
24779
+ path: ["profiles"]
24780
+ });
24647
24781
  }), ExportRecordSchema, {
24648
24782
  kind: "mutation",
24649
24783
  auth: "protected"
@@ -29243,6 +29377,12 @@ Object.freeze({
29243
29377
  addonId: null,
29244
29378
  access: "create"
29245
29379
  },
29380
+ "pipelineAnalytics.reconcileFromDisk": {
29381
+ capName: "pipeline-analytics",
29382
+ capScope: "device",
29383
+ addonId: null,
29384
+ access: "create"
29385
+ },
29246
29386
  "pipelineAnalytics.refreshStorageLocationsForMigration": {
29247
29387
  capName: "pipeline-analytics",
29248
29388
  capScope: "device",
@@ -29645,6 +29785,12 @@ Object.freeze({
29645
29785
  addonId: null,
29646
29786
  access: "view"
29647
29787
  },
29788
+ "pipelineOrchestrator.getReconcileFromDiskStatus": {
29789
+ capName: "pipeline-orchestrator",
29790
+ capScope: "system",
29791
+ addonId: null,
29792
+ access: "view"
29793
+ },
29648
29794
  "pipelineOrchestrator.listAgentSettings": {
29649
29795
  capName: "pipeline-orchestrator",
29650
29796
  capScope: "system",
@@ -29669,6 +29815,12 @@ Object.freeze({
29669
29815
  addonId: null,
29670
29816
  access: "create"
29671
29817
  },
29818
+ "pipelineOrchestrator.reconcileFromDisk": {
29819
+ capName: "pipeline-orchestrator",
29820
+ capScope: "system",
29821
+ addonId: null,
29822
+ access: "create"
29823
+ },
29672
29824
  "pipelineOrchestrator.removeAgentSettings": {
29673
29825
  capName: "pipeline-orchestrator",
29674
29826
  capScope: "system",
@@ -32660,6 +32812,11 @@ Object.freeze({
32660
32812
  form: "single",
32661
32813
  optional: true
32662
32814
  }],
32815
+ "pipelineAnalytics.reconcileFromDisk": [{
32816
+ name: "deviceId",
32817
+ form: "single",
32818
+ optional: false
32819
+ }],
32663
32820
  "pipelineAnalytics.restageRetrainTrack": [{
32664
32821
  name: "deviceId",
32665
32822
  form: "single",
@@ -33932,6 +34089,8 @@ DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
33932
34089
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
33933
34090
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
33934
34091
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34092
+ var MB = 1024 * 1024;
34093
+ 1024 * MB, 3072 * MB;
33935
34094
  var NOTIFIER_ICONS = {
33936
34095
  telegram: {
33937
34096
  contentType: "image/svg+xml",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-notifiers",
3
- "version": "1.2.24",
3
+ "version": "1.2.26",
4
4
  "description": "System notifiers addon for CamStack — a `notification-output` collection provider hosting per-kind notifier adapters (ntfy, pushover, gotify, telegram, discord, webhook, zentik).",
5
5
  "keywords": [
6
6
  "camstack",