@camstack/addon-notifiers 1.2.24 → 1.2.25

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 +178 -27
  2. package/dist/addon.mjs +178 -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,57 @@ 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
+ * Lazy thumbnail URL, never inlined.
20072
+ *
20073
+ * Recording-derived clips (events-mode keep-window, and the prepared
20074
+ * continuous event+fragment visit) MUST use the snapshot of the **main
20075
+ * event of the interval** — `getEventMedia({ eventId, kind: 'snapshot' })`
20076
+ * of the event that owns `kind` (object > motion > audio). Do not extract
20077
+ * a keyframe from the recorded segments. Other providers (onboard, HKSV)
20078
+ * mint their own stills.
20079
+ *
20080
+ * **VOUCHED, never fabricated.** A provider emits this only for an event it
20081
+ * has CONFIRMED owns at least one media row (its own, or its owning track's).
20082
+ * Absent is meaningful — "this visit has no event still" — never "we did not
20083
+ * look". Stamping it from a URL template made 35% of one camera's clips point
20084
+ * at a 404 (device 3836, 2026-08-17: 64 of 179 clips dead, 63 of them motion).
20085
+ * A read that FAILS drops the claim; it never invents it.
20086
+ */
20087
+ thumbnail: string().optional(),
20088
+ /**
20089
+ * An instant INSIDE this visit's footage, hole-safe, where a recorded still
20090
+ * can be decoded. Present whenever the visit came from recorded availability;
20091
+ * absent on a per-event padded window (there is no footage to promise).
20092
+ *
20093
+ * This is not a thumbnail and not a second byte path: it is the argument to
20094
+ * the recorder's existing still route. The surface — never the provider —
20095
+ * decides whether to use it. It is the midpoint of the visit's LONGEST
20096
+ * contiguous range, not of the visit: a visit spans its holes by
20097
+ * construction, so a naive midpoint lands in dead air.
20098
+ */
20099
+ stillAtMs: number().optional(),
20100
+ /**
20101
+ * Analytics event ids that overlap this visit — a BOUNDED sample, newest
20102
+ * first within kind (object → motion → audio), capped at
20103
+ * {@link MAX_CLIP_EVENT_IDS}. Empty on footage-only clips.
20104
+ *
20105
+ * Bounded because it is not a payload the surface pages through: one visit on
20106
+ * device 615 carried 2 345 ids, and `eventIds` was 99% of a 153 KB
20107
+ * camera-day. Read {@link eventCount} for the true total.
20108
+ */
20109
+ eventIds: array(string()).optional(),
20110
+ /** How many analytics events actually overlap this visit. Differs from
20111
+ * `eventIds.length` exactly when the sample was capped — so a truncated
20112
+ * list is never mistaken for a quiet visit. */
20113
+ eventCount: number().int().nonnegative().optional(),
20114
+ /** Intra-visit footage holes (GOP rolls, discarded segments) still shorter
20115
+ * than `VISIT_MERGE_GAP_MS`. Playback concatenates around them; the timeline
20116
+ * bar keeps showing them via `recording.getAvailability`. */
20117
+ holes: array(object({
20118
+ startMs: number(),
20119
+ endMs: number()
20120
+ })).optional()
20014
20121
  });
20015
20122
  var ClipPlaybackSchema = object({
20016
20123
  /** HLS master URL through the hub data-plane (Range + token in path). */
@@ -20474,7 +20581,14 @@ var SearchResultSchema = object({
20474
20581
  });
20475
20582
  var AutoUpdateSettingsSchema = object({
20476
20583
  channel: ChannelSchema,
20477
- intervalSeconds: number()
20584
+ intervalSeconds: number(),
20585
+ /**
20586
+ * Cadence of the "an update exists" POLLER, in seconds. Independent of
20587
+ * `channel`: the poller runs while auto-apply is `off`, because being told
20588
+ * about a publish and installing it are different decisions. Clamped
20589
+ * server-side to 900 s … 604800 s; defaults to 21600 s (6 h).
20590
+ */
20591
+ updateCheckIntervalSeconds: number()
20478
20592
  });
20479
20593
  var AddonAutoUpdateSchema = ChannelWithInheritSchema;
20480
20594
  var RestartAddonResultSchema = unknown();
@@ -20615,7 +20729,9 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
20615
20729
  auth: "admin"
20616
20730
  }), method(_void(), AutoUpdateSettingsSchema, { auth: "admin" }), method(object({
20617
20731
  channel: ChannelSchema,
20618
- intervalSeconds: number().min(300).max(86400).optional()
20732
+ intervalSeconds: number().min(300).max(86400).optional(),
20733
+ /** Availability-poll cadence; see AutoUpdateSettingsSchema. */
20734
+ updateCheckIntervalSeconds: number().min(900).max(604800).optional()
20619
20735
  }), unknown(), {
20620
20736
  kind: "mutation",
20621
20737
  auth: "admin"
@@ -24608,7 +24724,9 @@ var ExportOptionsSchema = object({
24608
24724
  includeAudio: boolean(),
24609
24725
  maxLifeMs: number().int().positive(),
24610
24726
  deleteAfterDownload: boolean(),
24611
- title: string().max(200).optional()
24727
+ title: string().max(200).optional(),
24728
+ /** Notification-output target ids to ping when this export becomes ready. */
24729
+ notifyTargetIds: array(string().min(1)).max(20).optional()
24612
24730
  }).superRefine((v, ctx) => {
24613
24731
  if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
24614
24732
  code: ZodIssueCode.custom,
@@ -24667,10 +24785,18 @@ var ExportBytesSchema = object({
24667
24785
  });
24668
24786
  method(object({
24669
24787
  deviceId: number(),
24670
- profile: string(),
24788
+ /** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
24789
+ profile: string().optional(),
24790
+ profiles: array(string()).min(1).optional(),
24671
24791
  fromMs: number(),
24672
24792
  toMs: number(),
24673
24793
  options: ExportOptionsSchema
24794
+ }).superRefine((v, ctx) => {
24795
+ if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
24796
+ code: ZodIssueCode.custom,
24797
+ message: "pass profiles[] (min 1) or legacy profile",
24798
+ path: ["profiles"]
24799
+ });
24674
24800
  }), ExportRecordSchema, {
24675
24801
  kind: "mutation",
24676
24802
  auth: "protected"
@@ -29270,6 +29396,12 @@ Object.freeze({
29270
29396
  addonId: null,
29271
29397
  access: "create"
29272
29398
  },
29399
+ "pipelineAnalytics.reconcileFromDisk": {
29400
+ capName: "pipeline-analytics",
29401
+ capScope: "device",
29402
+ addonId: null,
29403
+ access: "create"
29404
+ },
29273
29405
  "pipelineAnalytics.refreshStorageLocationsForMigration": {
29274
29406
  capName: "pipeline-analytics",
29275
29407
  capScope: "device",
@@ -29672,6 +29804,12 @@ Object.freeze({
29672
29804
  addonId: null,
29673
29805
  access: "view"
29674
29806
  },
29807
+ "pipelineOrchestrator.getReconcileFromDiskStatus": {
29808
+ capName: "pipeline-orchestrator",
29809
+ capScope: "system",
29810
+ addonId: null,
29811
+ access: "view"
29812
+ },
29675
29813
  "pipelineOrchestrator.listAgentSettings": {
29676
29814
  capName: "pipeline-orchestrator",
29677
29815
  capScope: "system",
@@ -29696,6 +29834,12 @@ Object.freeze({
29696
29834
  addonId: null,
29697
29835
  access: "create"
29698
29836
  },
29837
+ "pipelineOrchestrator.reconcileFromDisk": {
29838
+ capName: "pipeline-orchestrator",
29839
+ capScope: "system",
29840
+ addonId: null,
29841
+ access: "create"
29842
+ },
29699
29843
  "pipelineOrchestrator.removeAgentSettings": {
29700
29844
  capName: "pipeline-orchestrator",
29701
29845
  capScope: "system",
@@ -32687,6 +32831,11 @@ Object.freeze({
32687
32831
  form: "single",
32688
32832
  optional: true
32689
32833
  }],
32834
+ "pipelineAnalytics.reconcileFromDisk": [{
32835
+ name: "deviceId",
32836
+ form: "single",
32837
+ optional: false
32838
+ }],
32690
32839
  "pipelineAnalytics.restageRetrainTrack": [{
32691
32840
  name: "deviceId",
32692
32841
  form: "single",
@@ -33959,6 +34108,8 @@ DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
33959
34108
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
33960
34109
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
33961
34110
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34111
+ var MB = 1024 * 1024;
34112
+ 1024 * MB, 3072 * MB;
33962
34113
  var NOTIFIER_ICONS = {
33963
34114
  telegram: {
33964
34115
  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,57 @@ 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
+ * Lazy thumbnail URL, never inlined.
20045
+ *
20046
+ * Recording-derived clips (events-mode keep-window, and the prepared
20047
+ * continuous event+fragment visit) MUST use the snapshot of the **main
20048
+ * event of the interval** — `getEventMedia({ eventId, kind: 'snapshot' })`
20049
+ * of the event that owns `kind` (object > motion > audio). Do not extract
20050
+ * a keyframe from the recorded segments. Other providers (onboard, HKSV)
20051
+ * mint their own stills.
20052
+ *
20053
+ * **VOUCHED, never fabricated.** A provider emits this only for an event it
20054
+ * has CONFIRMED owns at least one media row (its own, or its owning track's).
20055
+ * Absent is meaningful — "this visit has no event still" — never "we did not
20056
+ * look". Stamping it from a URL template made 35% of one camera's clips point
20057
+ * at a 404 (device 3836, 2026-08-17: 64 of 179 clips dead, 63 of them motion).
20058
+ * A read that FAILS drops the claim; it never invents it.
20059
+ */
20060
+ thumbnail: string().optional(),
20061
+ /**
20062
+ * An instant INSIDE this visit's footage, hole-safe, where a recorded still
20063
+ * can be decoded. Present whenever the visit came from recorded availability;
20064
+ * absent on a per-event padded window (there is no footage to promise).
20065
+ *
20066
+ * This is not a thumbnail and not a second byte path: it is the argument to
20067
+ * the recorder's existing still route. The surface — never the provider —
20068
+ * decides whether to use it. It is the midpoint of the visit's LONGEST
20069
+ * contiguous range, not of the visit: a visit spans its holes by
20070
+ * construction, so a naive midpoint lands in dead air.
20071
+ */
20072
+ stillAtMs: number().optional(),
20073
+ /**
20074
+ * Analytics event ids that overlap this visit — a BOUNDED sample, newest
20075
+ * first within kind (object → motion → audio), capped at
20076
+ * {@link MAX_CLIP_EVENT_IDS}. Empty on footage-only clips.
20077
+ *
20078
+ * Bounded because it is not a payload the surface pages through: one visit on
20079
+ * device 615 carried 2 345 ids, and `eventIds` was 99% of a 153 KB
20080
+ * camera-day. Read {@link eventCount} for the true total.
20081
+ */
20082
+ eventIds: array(string()).optional(),
20083
+ /** How many analytics events actually overlap this visit. Differs from
20084
+ * `eventIds.length` exactly when the sample was capped — so a truncated
20085
+ * list is never mistaken for a quiet visit. */
20086
+ eventCount: number().int().nonnegative().optional(),
20087
+ /** Intra-visit footage holes (GOP rolls, discarded segments) still shorter
20088
+ * than `VISIT_MERGE_GAP_MS`. Playback concatenates around them; the timeline
20089
+ * bar keeps showing them via `recording.getAvailability`. */
20090
+ holes: array(object({
20091
+ startMs: number(),
20092
+ endMs: number()
20093
+ })).optional()
19987
20094
  });
19988
20095
  var ClipPlaybackSchema = object({
19989
20096
  /** HLS master URL through the hub data-plane (Range + token in path). */
@@ -20447,7 +20554,14 @@ var SearchResultSchema = object({
20447
20554
  });
20448
20555
  var AutoUpdateSettingsSchema = object({
20449
20556
  channel: ChannelSchema,
20450
- intervalSeconds: number()
20557
+ intervalSeconds: number(),
20558
+ /**
20559
+ * Cadence of the "an update exists" POLLER, in seconds. Independent of
20560
+ * `channel`: the poller runs while auto-apply is `off`, because being told
20561
+ * about a publish and installing it are different decisions. Clamped
20562
+ * server-side to 900 s … 604800 s; defaults to 21600 s (6 h).
20563
+ */
20564
+ updateCheckIntervalSeconds: number()
20451
20565
  });
20452
20566
  var AddonAutoUpdateSchema = ChannelWithInheritSchema;
20453
20567
  var RestartAddonResultSchema = unknown();
@@ -20588,7 +20702,9 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
20588
20702
  auth: "admin"
20589
20703
  }), method(_void(), AutoUpdateSettingsSchema, { auth: "admin" }), method(object({
20590
20704
  channel: ChannelSchema,
20591
- intervalSeconds: number().min(300).max(86400).optional()
20705
+ intervalSeconds: number().min(300).max(86400).optional(),
20706
+ /** Availability-poll cadence; see AutoUpdateSettingsSchema. */
20707
+ updateCheckIntervalSeconds: number().min(900).max(604800).optional()
20592
20708
  }), unknown(), {
20593
20709
  kind: "mutation",
20594
20710
  auth: "admin"
@@ -24581,7 +24697,9 @@ var ExportOptionsSchema = object({
24581
24697
  includeAudio: boolean(),
24582
24698
  maxLifeMs: number().int().positive(),
24583
24699
  deleteAfterDownload: boolean(),
24584
- title: string().max(200).optional()
24700
+ title: string().max(200).optional(),
24701
+ /** Notification-output target ids to ping when this export becomes ready. */
24702
+ notifyTargetIds: array(string().min(1)).max(20).optional()
24585
24703
  }).superRefine((v, ctx) => {
24586
24704
  if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
24587
24705
  code: ZodIssueCode.custom,
@@ -24640,10 +24758,18 @@ var ExportBytesSchema = object({
24640
24758
  });
24641
24759
  method(object({
24642
24760
  deviceId: number(),
24643
- profile: string(),
24761
+ /** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
24762
+ profile: string().optional(),
24763
+ profiles: array(string()).min(1).optional(),
24644
24764
  fromMs: number(),
24645
24765
  toMs: number(),
24646
24766
  options: ExportOptionsSchema
24767
+ }).superRefine((v, ctx) => {
24768
+ if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
24769
+ code: ZodIssueCode.custom,
24770
+ message: "pass profiles[] (min 1) or legacy profile",
24771
+ path: ["profiles"]
24772
+ });
24647
24773
  }), ExportRecordSchema, {
24648
24774
  kind: "mutation",
24649
24775
  auth: "protected"
@@ -29243,6 +29369,12 @@ Object.freeze({
29243
29369
  addonId: null,
29244
29370
  access: "create"
29245
29371
  },
29372
+ "pipelineAnalytics.reconcileFromDisk": {
29373
+ capName: "pipeline-analytics",
29374
+ capScope: "device",
29375
+ addonId: null,
29376
+ access: "create"
29377
+ },
29246
29378
  "pipelineAnalytics.refreshStorageLocationsForMigration": {
29247
29379
  capName: "pipeline-analytics",
29248
29380
  capScope: "device",
@@ -29645,6 +29777,12 @@ Object.freeze({
29645
29777
  addonId: null,
29646
29778
  access: "view"
29647
29779
  },
29780
+ "pipelineOrchestrator.getReconcileFromDiskStatus": {
29781
+ capName: "pipeline-orchestrator",
29782
+ capScope: "system",
29783
+ addonId: null,
29784
+ access: "view"
29785
+ },
29648
29786
  "pipelineOrchestrator.listAgentSettings": {
29649
29787
  capName: "pipeline-orchestrator",
29650
29788
  capScope: "system",
@@ -29669,6 +29807,12 @@ Object.freeze({
29669
29807
  addonId: null,
29670
29808
  access: "create"
29671
29809
  },
29810
+ "pipelineOrchestrator.reconcileFromDisk": {
29811
+ capName: "pipeline-orchestrator",
29812
+ capScope: "system",
29813
+ addonId: null,
29814
+ access: "create"
29815
+ },
29672
29816
  "pipelineOrchestrator.removeAgentSettings": {
29673
29817
  capName: "pipeline-orchestrator",
29674
29818
  capScope: "system",
@@ -32660,6 +32804,11 @@ Object.freeze({
32660
32804
  form: "single",
32661
32805
  optional: true
32662
32806
  }],
32807
+ "pipelineAnalytics.reconcileFromDisk": [{
32808
+ name: "deviceId",
32809
+ form: "single",
32810
+ optional: false
32811
+ }],
32663
32812
  "pipelineAnalytics.restageRetrainTrack": [{
32664
32813
  name: "deviceId",
32665
32814
  form: "single",
@@ -33932,6 +34081,8 @@ DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
33932
34081
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
33933
34082
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
33934
34083
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34084
+ var MB = 1024 * 1024;
34085
+ 1024 * MB, 3072 * MB;
33935
34086
  var NOTIFIER_ICONS = {
33936
34087
  telegram: {
33937
34088
  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.25",
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",