@camstack/addon-notifiers 1.2.51 → 1.2.53

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.
package/dist/addon.js CHANGED
@@ -8151,6 +8151,20 @@ var RelocateJobSchema = object({
8151
8151
  * in its row, not in its name, so `MediaRelocateEngine` never reconciles one.
8152
8152
  */
8153
8153
  rowsReconciled: number().int().nonnegative().optional(),
8154
+ /**
8155
+ * Rows this run FORGOT because the file they name is not on disk.
8156
+ *
8157
+ * The mover derived the path from the row's own fields and `stat`ed it; an
8158
+ * ENOENT there is a per-path confirmation that the segment is gone (D296),
8159
+ * and the durable row is dropped through the same channel eviction uses. It
8160
+ * is reported for the same reason `rowsReconciled` is: this is a durable
8161
+ * mutation nobody asked for, and a migration that quietly erases hour rows is
8162
+ * the same failure as one that quietly skips them (D295).
8163
+ *
8164
+ * The production drain of 2026-08-30 would have reported 11 074 here — the
8165
+ * ledger claimed 5.65 GB of footage that no longer existed.
8166
+ */
8167
+ rowsForgotten: number().int().nonnegative().optional(),
8154
8168
  startedAt: number(),
8155
8169
  finishedAt: number().nullable(),
8156
8170
  error: string().nullable()
@@ -8514,6 +8528,91 @@ var RelocateResidueSchema = object({
8514
8528
  segments: number().int().nonnegative(),
8515
8529
  bytes: number().int().nonnegative()
8516
8530
  }).nullable();
8531
+ /**
8532
+ * Ask one location whether its durable hour rows describe the disk — the walk
8533
+ * (D319).
8534
+ *
8535
+ * `apply` DEFAULTS TO FALSE and that default is the product: the operator's
8536
+ * missing tool is the question, and the dry run is how they sanity-check the
8537
+ * destructive run before authorising it.
8538
+ */
8539
+ var LedgerWalkInputSchema = object({
8540
+ locationId: string().min(1),
8541
+ /** Forget the confirmed-absent rows, rather than only counting them. */
8542
+ apply: boolean().optional(),
8543
+ /** Narrow to one camera. */
8544
+ deviceId: number().int().positive().optional(),
8545
+ /** Narrow to these recording profiles; empty/absent = every profile. */
8546
+ profiles: array(string().min(1)).optional()
8547
+ });
8548
+ /** Why a whole walk did nothing. Every one leaves the ledger untouched. */
8549
+ var LedgerWalkRefusalSchema = _enum([
8550
+ "location-unknown",
8551
+ "source-writable",
8552
+ "no-ledger",
8553
+ "archive-unreadable",
8554
+ "anchor-absent",
8555
+ "anchor-unreadable",
8556
+ "anchor-moved"
8557
+ ]);
8558
+ _enum([
8559
+ "live-tail",
8560
+ "listing-error",
8561
+ "path-mismatch",
8562
+ "durable-refused"
8563
+ ]);
8564
+ /** Every skip reason, always present, always a number — so a reason that never
8565
+ * fired reports as zero rather than absent and the report shape is constant
8566
+ * between passes. Spelled out rather than `z.record` for exactly that. */
8567
+ var LedgerWalkSkipCountsSchema = object({
8568
+ "live-tail": number().int().nonnegative(),
8569
+ "listing-error": number().int().nonnegative(),
8570
+ "path-mismatch": number().int().nonnegative(),
8571
+ "durable-refused": number().int().nonnegative()
8572
+ });
8573
+ /** One camera's share of a walk, so a report names cameras and not rows. */
8574
+ var LedgerWalkDeviceReportSchema = object({
8575
+ deviceId: number().int(),
8576
+ hoursWalked: number().int().nonnegative(),
8577
+ hoursMissing: number().int().nonnegative(),
8578
+ ghostSegments: number().int().nonnegative(),
8579
+ ghostBytes: number().int().nonnegative(),
8580
+ forgottenSegments: number().int().nonnegative(),
8581
+ orphanFiles: number().int().nonnegative()
8582
+ });
8583
+ /**
8584
+ * What one walk claimed, listed, found and (only when armed) forgot.
8585
+ *
8586
+ * `archiveSegments` is the **M** and `segmentsClaimed` the **N** (D295), so a
8587
+ * walk that saw a fraction of the location is visible in its own report rather
8588
+ * than in the absence of one.
8589
+ */
8590
+ var LedgerWalkReportSchema = object({
8591
+ locationId: string(),
8592
+ applied: boolean(),
8593
+ refused: LedgerWalkRefusalSchema.nullable(),
8594
+ archiveSegments: number().int().nonnegative().nullable(),
8595
+ archiveBytes: number().int().nonnegative().nullable(),
8596
+ hoursClaimed: number().int().nonnegative(),
8597
+ hoursWalked: number().int().nonnegative(),
8598
+ hoursMissing: number().int().nonnegative(),
8599
+ /** `readdir` calls issued — the cost, stated in the unit that is paid. */
8600
+ listings: number().int().nonnegative(),
8601
+ segmentsClaimed: number().int().nonnegative(),
8602
+ ghostSegments: number().int().nonnegative(),
8603
+ ghostBytes: number().int().nonnegative(),
8604
+ ghostHoursWhole: number().int().nonnegative(),
8605
+ forgottenSegments: number().int().nonnegative(),
8606
+ forgottenBytes: number().int().nonnegative(),
8607
+ /** Files under a claimed hour that no durable row names. Never deleted. */
8608
+ orphanFiles: number().int().nonnegative(),
8609
+ orphanSample: array(string()).readonly(),
8610
+ hoursSkipped: number().int().nonnegative(),
8611
+ skippedByReason: LedgerWalkSkipCountsSchema,
8612
+ /** The walk stopped at its per-pass hour bound with claims unwalked. */
8613
+ bounded: boolean(),
8614
+ byDevice: array(LedgerWalkDeviceReportSchema).readonly()
8615
+ });
8517
8616
  /** How many rows a media pass would still act on against a given target — the
8518
8617
  * media lane's denominator AND its residue, from ONE derivation so the two can
8519
8618
  * never disagree. `null` = the count could not be taken. */
@@ -18842,13 +18941,15 @@ var ListGroupsPageSchema = object({
18842
18941
  groups: array(AnalyticsGroupRecordSchema).readonly(),
18843
18942
  nextCursor: string().nullable()
18844
18943
  });
18944
+ var KEY_EVENTS_DEFAULT_LIMIT = 50;
18945
+ var KEY_EVENTS_MAX_LIMIT = 200;
18845
18946
  var KeyEventQueryInput = object({
18846
18947
  deviceId: number(),
18847
18948
  /** Window lower bound (track firstSeen ≥ since). */
18848
18949
  since: number(),
18849
18950
  /** Window upper bound (track firstSeen ≤ until). */
18850
18951
  until: number(),
18851
- limit: number().int().min(1).max(200).default(50),
18952
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
18852
18953
  /** Drop tracks scoring below this importance. */
18853
18954
  minImportance: number().min(0).max(1).optional(),
18854
18955
  /** Restrict to a single class (e.g. 'person'). */
@@ -18870,6 +18971,32 @@ var KeyEventSchema = object({
18870
18971
  ...TrackFlagFields,
18871
18972
  ...TrackRetrainFields
18872
18973
  });
18974
+ /** `getKeyEvents`' window and filters, asked of a SET of cameras at once. */
18975
+ var KeyEventBatchQueryInput = object({
18976
+ deviceIds: array(number()).min(1).max(200),
18977
+ since: number(),
18978
+ until: number(),
18979
+ /** Applied PER CAMERA, exactly as `getKeyEvents.limit` is — never a total
18980
+ * across the set, which would let a busy camera starve a quiet one of its
18981
+ * rows and change what the merged feed contains. */
18982
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
18983
+ minImportance: number().min(0).max(1).optional(),
18984
+ classFilter: string().optional()
18985
+ });
18986
+ /**
18987
+ * One camera's key events in a batch answer.
18988
+ *
18989
+ * The row exists for every requested id. `getKeyEvents` degrades to `[]` on
18990
+ * error rather than throwing, so a camera whose store read failed and one with
18991
+ * no events in the window were ALREADY indistinguishable per camera — the
18992
+ * batch does not make that worse, and the row keeps the deviceId the single
18993
+ * method's output never carried (the caller used to stamp it from the fan-out
18994
+ * key, which only worked because there was one query per camera).
18995
+ */
18996
+ var KeyEventsForDeviceSchema = object({
18997
+ deviceId: number(),
18998
+ events: array(KeyEventSchema).readonly()
18999
+ });
18873
19000
  object({
18874
19001
  trackId: string(),
18875
19002
  className: string(),
@@ -18941,6 +19068,50 @@ var EventStoreFootprintSchema = object({
18941
19068
  totalBytes: number().int(),
18942
19069
  devices: array(EventStoreDeviceFootprintSchema).readonly()
18943
19070
  });
19071
+ /** Event-media footprint for one {@link MediaFileKind}. */
19072
+ var EventMediaKindFootprintSchema = object({
19073
+ kind: MediaFileKindEnum,
19074
+ /** Media rows of this kind. */
19075
+ rows: number().int(),
19076
+ /** Bytes on disk held by those rows. */
19077
+ bytes: number().int()
19078
+ });
19079
+ /**
19080
+ * The media footprint broken down by KIND — the axis a deletion decision
19081
+ * actually turns on.
19082
+ *
19083
+ * A byte total says how much there is; it cannot say what is safe to remove.
19084
+ * The deletable set (the periodic `snapshot` filmstrip, the surplus per-edge
19085
+ * motion stills) and the keep set (`firstFrame`, rolling `lastFrame`,
19086
+ * `thumbnail`/`thumbnailSmall`, `keyFrame`/`keyFrameSmall`, the face/plate
19087
+ * buffers, gallery media, the CLIP `crop`) are distinguished by `kind` and by
19088
+ * nothing else, so sizing a deletion means summing per kind.
19089
+ *
19090
+ * ## Why `unaccounted*` exists
19091
+ *
19092
+ * `kinds` is enumerated from {@link MediaFileKindEnum} — the closed set the
19093
+ * writers use — and summed one kind at a time. `totalRows` / `totalBytes` come
19094
+ * from a SEPARATE unfiltered aggregate over the same rows, never from adding
19095
+ * `kinds` up. A row whose stored `kind` is not in the enum (written by a
19096
+ * retired code path, or by a version that knew a kind this one does not) would
19097
+ * otherwise vanish from the total silently, and an operator would delete
19098
+ * against a denominator smaller than the disk.
19099
+ *
19100
+ * `unaccountedRows` / `unaccountedBytes` are the difference. They are normally
19101
+ * zero; a non-zero value is a real finding and must be shown, not rounded away.
19102
+ */
19103
+ var EventMediaKindBreakdownSchema = object({
19104
+ /** Every media row in scope, from one unfiltered aggregate. */
19105
+ totalRows: number().int(),
19106
+ /** Every media byte in scope, from that same aggregate. */
19107
+ totalBytes: number().int(),
19108
+ /** Per-kind footprint, ordered by bytes descending. */
19109
+ kinds: array(EventMediaKindFootprintSchema).readonly(),
19110
+ /** `totalRows` minus the summed `kinds` rows — see the schema note. */
19111
+ unaccountedRows: number().int(),
19112
+ /** `totalBytes` minus the summed `kinds` bytes — see the schema note. */
19113
+ unaccountedBytes: number().int()
19114
+ });
18944
19115
  /** Per-kind counts returned by the event-prune / device-delete mutations. */
18945
19116
  var EventPruneCountsSchema = object({
18946
19117
  motion: number().int(),
@@ -19095,7 +19266,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19095
19266
  until: number().optional(),
19096
19267
  kinds: array(string()).optional(),
19097
19268
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
19098
- }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
19269
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
19099
19270
  deviceId: number(),
19100
19271
  since: number(),
19101
19272
  until: number(),
@@ -19144,6 +19315,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19144
19315
  }), TrackFlagsSchema, { kind: "mutation" }), method(object({}), EventStoreFootprintSchema, {
19145
19316
  kind: "query",
19146
19317
  auth: "admin"
19318
+ }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
19319
+ kind: "query",
19320
+ auth: "admin"
19147
19321
  }), method(object({
19148
19322
  olderThanMs: number(),
19149
19323
  reason: OpsLogReasonSchema.optional()
@@ -21095,6 +21269,20 @@ method(object({
21095
21269
  error: string().optional()
21096
21270
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
21097
21271
  providerId: string(),
21272
+ /**
21273
+ * The location this config is an UNSAVED edit of, when there is one.
21274
+ *
21275
+ * `listLocations` replaces every declared secret with the redaction
21276
+ * sentinel, so the edit modal's form state holds the sentinel for any
21277
+ * credential the operator did not retype — and posting that here
21278
+ * without a way to resolve it makes the provider try to authenticate
21279
+ * as `__camstack_redacted__` and report the operator's own working
21280
+ * password as wrong. Given this id, the orchestrator restores each
21281
+ * sentinel from the stored config (same rule as `upsertLocation`)
21282
+ * before dispatching. Omitted by the "Add location" wizard, where
21283
+ * every value was typed just now and nothing is stored yet.
21284
+ */
21285
+ locationId: string().optional(),
21098
21286
  config: record(string(), unknown())
21099
21287
  }), object({
21100
21288
  ok: boolean(),
@@ -26730,6 +26918,9 @@ method(object({
26730
26918
  }), method(RelocateResidueInputSchema, RelocateResidueSchema, {
26731
26919
  kind: "query",
26732
26920
  auth: "admin"
26921
+ }), method(LedgerWalkInputSchema, LedgerWalkReportSchema, {
26922
+ kind: "mutation",
26923
+ auth: "admin"
26733
26924
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
26734
26925
  kind: "mutation",
26735
26926
  auth: "admin"
@@ -27121,7 +27312,26 @@ var SceneMonitorStatusSchema = object({
27121
27312
  monitors: array(SceneMonitorSchema),
27122
27313
  lastFetchedAt: number()
27123
27314
  });
27124
- DeviceType.Camera, method(object({ deviceId: number() }), SceneMonitorStatusSchema), method(object({
27315
+ /**
27316
+ * One camera's row in a `listScenesBatch` answer.
27317
+ *
27318
+ * `status` is NULLABLE and the nullability is the whole point. `scene-monitor`
27319
+ * is a `defaultActive` wrapper, so every camera is asked; a camera whose
27320
+ * provider is absent (pipeline-analytics not deployed, the post-processing node
27321
+ * down) cannot answer, and that is not the same fact as a camera with no scenes
27322
+ * configured. Fanned out per camera the difference was visible — one query
27323
+ * errored while the others resolved — and a batch that returned only the rows
27324
+ * it managed would have destroyed it, silently, by making an unreachable camera
27325
+ * indistinguishable from one that answered `monitors: []`.
27326
+ *
27327
+ * So: EVERY requested deviceId gets a row. `status: null` means "this camera
27328
+ * could not be read"; `status.monitors: []` means "read, and it has none".
27329
+ */
27330
+ var SceneMonitorStatusForDeviceSchema = object({
27331
+ deviceId: number(),
27332
+ status: SceneMonitorStatusSchema.nullable()
27333
+ });
27334
+ DeviceType.Camera, method(object({ deviceId: number() }), SceneMonitorStatusSchema), method(object({ deviceIds: array(number()).min(1).max(200) }), array(SceneMonitorStatusForDeviceSchema).readonly()), method(object({
27125
27335
  deviceId: number(),
27126
27336
  label: string(),
27127
27337
  roi: MaskRectShapeSchema,
@@ -28445,6 +28655,27 @@ var CameraOccupancySnapshotSchema = object({
28445
28655
  stationaryObjects: array(StationaryObjectSchema).readonly().optional()
28446
28656
  });
28447
28657
  /**
28658
+ * One camera's row in a `getCurrentSnapshotBatch` answer.
28659
+ *
28660
+ * THREE outcomes, and the single-camera method could only express two of them
28661
+ * because `snapshot: null` was already spoken for:
28662
+ *
28663
+ * - `read: 'read'`, `snapshot` present — the live occupancy reading.
28664
+ * - `read: 'read'`, `snapshot: null` — read, and this camera has no reading
28665
+ * yet: no frame since boot, and no parked-object registry to hydrate from.
28666
+ * - `read: 'unreadable'` — the owner could not answer for this
28667
+ * camera. `snapshot` is null, and it does NOT mean "nothing parked here".
28668
+ *
28669
+ * Collapsing the last two is the failure this field exists to prevent: a
28670
+ * hydration that threw would otherwise render as an empty Stationary section,
28671
+ * which is a definite claim about a camera nobody could read.
28672
+ */
28673
+ var CameraOccupancySnapshotForDeviceSchema = object({
28674
+ deviceId: number(),
28675
+ read: _enum(["read", "unreadable"]),
28676
+ snapshot: CameraOccupancySnapshotSchema.nullable()
28677
+ });
28678
+ /**
28448
28679
  * Time-series resolution. The history methods return one bucket per
28449
28680
  * step over the requested range. Smaller resolutions cost more
28450
28681
  * memory + bandwidth; bound to discrete steps so caller cannot ask
@@ -28468,7 +28699,7 @@ var HistoryPointSchema = object({
28468
28699
  /** Object count averaged over the bucket (rounded to nearest integer). */
28469
28700
  count: number().int().nonnegative()
28470
28701
  });
28471
- DeviceType.Camera, method(object({ deviceId: number() }), CameraOccupancySnapshotSchema.nullable()), method(object({
28702
+ DeviceType.Camera, method(object({ deviceId: number() }), CameraOccupancySnapshotSchema.nullable()), method(object({ deviceIds: array(number()).min(1).max(200) }), array(CameraOccupancySnapshotForDeviceSchema).readonly()), method(object({
28472
28703
  deviceId: number(),
28473
28704
  zoneId: string(),
28474
28705
  className: string().optional()
@@ -31749,6 +31980,12 @@ Object.freeze({
31749
31980
  addonId: null,
31750
31981
  access: "view"
31751
31982
  },
31983
+ "pipelineAnalytics.getEventMediaFootprintByKind": {
31984
+ capName: "pipeline-analytics",
31985
+ capScope: "device",
31986
+ addonId: null,
31987
+ access: "view"
31988
+ },
31752
31989
  "pipelineAnalytics.getEventStoreFootprint": {
31753
31990
  capName: "pipeline-analytics",
31754
31991
  capScope: "device",
@@ -31767,6 +32004,12 @@ Object.freeze({
31767
32004
  addonId: null,
31768
32005
  access: "view"
31769
32006
  },
32007
+ "pipelineAnalytics.getKeyEventsBatch": {
32008
+ capName: "pipeline-analytics",
32009
+ capScope: "device",
32010
+ addonId: null,
32011
+ access: "view"
32012
+ },
31770
32013
  "pipelineAnalytics.getMotionEvents": {
31771
32014
  capName: "pipeline-analytics",
31772
32015
  capScope: "device",
@@ -32943,6 +33186,12 @@ Object.freeze({
32943
33186
  addonId: null,
32944
33187
  access: "view"
32945
33188
  },
33189
+ "recording.reconcileLedgerAgainstDisk": {
33190
+ capName: "recording",
33191
+ capScope: "system",
33192
+ addonId: null,
33193
+ access: "create"
33194
+ },
32946
33195
  "recording.refreshStorageLocationsForMigration": {
32947
33196
  capName: "recording",
32948
33197
  capScope: "system",
@@ -33069,6 +33318,12 @@ Object.freeze({
33069
33318
  addonId: null,
33070
33319
  access: "view"
33071
33320
  },
33321
+ "sceneMonitor.listScenesBatch": {
33322
+ capName: "scene-monitor",
33323
+ capScope: "device",
33324
+ addonId: null,
33325
+ access: "view"
33326
+ },
33072
33327
  "sceneMonitor.recheckNow": {
33073
33328
  capName: "scene-monitor",
33074
33329
  capScope: "device",
@@ -34425,6 +34680,12 @@ Object.freeze({
34425
34680
  addonId: null,
34426
34681
  access: "view"
34427
34682
  },
34683
+ "zoneAnalytics.getCurrentSnapshotBatch": {
34684
+ capName: "zone-analytics",
34685
+ capScope: "device",
34686
+ addonId: null,
34687
+ access: "view"
34688
+ },
34428
34689
  "zoneAnalytics.getUnzonedHistory": {
34429
34690
  capName: "zone-analytics",
34430
34691
  capScope: "device",
@@ -35414,6 +35675,11 @@ Object.freeze({
35414
35675
  form: "single",
35415
35676
  optional: false
35416
35677
  }],
35678
+ "pipelineAnalytics.getEventMediaFootprintByKind": [{
35679
+ name: "deviceId",
35680
+ form: "single",
35681
+ optional: true
35682
+ }],
35417
35683
  "pipelineAnalytics.getGroup": [{
35418
35684
  name: "deviceId",
35419
35685
  form: "single",
@@ -35424,6 +35690,11 @@ Object.freeze({
35424
35690
  form: "single",
35425
35691
  optional: false
35426
35692
  }],
35693
+ "pipelineAnalytics.getKeyEventsBatch": [{
35694
+ name: "deviceIds",
35695
+ form: "array",
35696
+ optional: false
35697
+ }],
35427
35698
  "pipelineAnalytics.getMotionEvents": [{
35428
35699
  name: "deviceId",
35429
35700
  form: "single",
@@ -35864,6 +36135,11 @@ Object.freeze({
35864
36135
  form: "single",
35865
36136
  optional: false
35866
36137
  }],
36138
+ "recording.reconcileLedgerAgainstDisk": [{
36139
+ name: "deviceId",
36140
+ form: "single",
36141
+ optional: true
36142
+ }],
35867
36143
  "recording.relocateFootage": [{
35868
36144
  name: "deviceId",
35869
36145
  form: "single",
@@ -35929,6 +36205,11 @@ Object.freeze({
35929
36205
  form: "single",
35930
36206
  optional: false
35931
36207
  }],
36208
+ "sceneMonitor.listScenesBatch": [{
36209
+ name: "deviceIds",
36210
+ form: "array",
36211
+ optional: false
36212
+ }],
35932
36213
  "sceneMonitor.recheckNow": [{
35933
36214
  name: "deviceId",
35934
36215
  form: "single",
@@ -36190,6 +36471,11 @@ Object.freeze({
36190
36471
  form: "single",
36191
36472
  optional: false
36192
36473
  }],
36474
+ "zoneAnalytics.getCurrentSnapshotBatch": [{
36475
+ name: "deviceIds",
36476
+ form: "array",
36477
+ optional: false
36478
+ }],
36193
36479
  "zoneAnalytics.getUnzonedHistory": [{
36194
36480
  name: "deviceId",
36195
36481
  form: "single",
package/dist/addon.mjs CHANGED
@@ -8124,6 +8124,20 @@ var RelocateJobSchema = object({
8124
8124
  * in its row, not in its name, so `MediaRelocateEngine` never reconciles one.
8125
8125
  */
8126
8126
  rowsReconciled: number().int().nonnegative().optional(),
8127
+ /**
8128
+ * Rows this run FORGOT because the file they name is not on disk.
8129
+ *
8130
+ * The mover derived the path from the row's own fields and `stat`ed it; an
8131
+ * ENOENT there is a per-path confirmation that the segment is gone (D296),
8132
+ * and the durable row is dropped through the same channel eviction uses. It
8133
+ * is reported for the same reason `rowsReconciled` is: this is a durable
8134
+ * mutation nobody asked for, and a migration that quietly erases hour rows is
8135
+ * the same failure as one that quietly skips them (D295).
8136
+ *
8137
+ * The production drain of 2026-08-30 would have reported 11 074 here — the
8138
+ * ledger claimed 5.65 GB of footage that no longer existed.
8139
+ */
8140
+ rowsForgotten: number().int().nonnegative().optional(),
8127
8141
  startedAt: number(),
8128
8142
  finishedAt: number().nullable(),
8129
8143
  error: string().nullable()
@@ -8487,6 +8501,91 @@ var RelocateResidueSchema = object({
8487
8501
  segments: number().int().nonnegative(),
8488
8502
  bytes: number().int().nonnegative()
8489
8503
  }).nullable();
8504
+ /**
8505
+ * Ask one location whether its durable hour rows describe the disk — the walk
8506
+ * (D319).
8507
+ *
8508
+ * `apply` DEFAULTS TO FALSE and that default is the product: the operator's
8509
+ * missing tool is the question, and the dry run is how they sanity-check the
8510
+ * destructive run before authorising it.
8511
+ */
8512
+ var LedgerWalkInputSchema = object({
8513
+ locationId: string().min(1),
8514
+ /** Forget the confirmed-absent rows, rather than only counting them. */
8515
+ apply: boolean().optional(),
8516
+ /** Narrow to one camera. */
8517
+ deviceId: number().int().positive().optional(),
8518
+ /** Narrow to these recording profiles; empty/absent = every profile. */
8519
+ profiles: array(string().min(1)).optional()
8520
+ });
8521
+ /** Why a whole walk did nothing. Every one leaves the ledger untouched. */
8522
+ var LedgerWalkRefusalSchema = _enum([
8523
+ "location-unknown",
8524
+ "source-writable",
8525
+ "no-ledger",
8526
+ "archive-unreadable",
8527
+ "anchor-absent",
8528
+ "anchor-unreadable",
8529
+ "anchor-moved"
8530
+ ]);
8531
+ _enum([
8532
+ "live-tail",
8533
+ "listing-error",
8534
+ "path-mismatch",
8535
+ "durable-refused"
8536
+ ]);
8537
+ /** Every skip reason, always present, always a number — so a reason that never
8538
+ * fired reports as zero rather than absent and the report shape is constant
8539
+ * between passes. Spelled out rather than `z.record` for exactly that. */
8540
+ var LedgerWalkSkipCountsSchema = object({
8541
+ "live-tail": number().int().nonnegative(),
8542
+ "listing-error": number().int().nonnegative(),
8543
+ "path-mismatch": number().int().nonnegative(),
8544
+ "durable-refused": number().int().nonnegative()
8545
+ });
8546
+ /** One camera's share of a walk, so a report names cameras and not rows. */
8547
+ var LedgerWalkDeviceReportSchema = object({
8548
+ deviceId: number().int(),
8549
+ hoursWalked: number().int().nonnegative(),
8550
+ hoursMissing: number().int().nonnegative(),
8551
+ ghostSegments: number().int().nonnegative(),
8552
+ ghostBytes: number().int().nonnegative(),
8553
+ forgottenSegments: number().int().nonnegative(),
8554
+ orphanFiles: number().int().nonnegative()
8555
+ });
8556
+ /**
8557
+ * What one walk claimed, listed, found and (only when armed) forgot.
8558
+ *
8559
+ * `archiveSegments` is the **M** and `segmentsClaimed` the **N** (D295), so a
8560
+ * walk that saw a fraction of the location is visible in its own report rather
8561
+ * than in the absence of one.
8562
+ */
8563
+ var LedgerWalkReportSchema = object({
8564
+ locationId: string(),
8565
+ applied: boolean(),
8566
+ refused: LedgerWalkRefusalSchema.nullable(),
8567
+ archiveSegments: number().int().nonnegative().nullable(),
8568
+ archiveBytes: number().int().nonnegative().nullable(),
8569
+ hoursClaimed: number().int().nonnegative(),
8570
+ hoursWalked: number().int().nonnegative(),
8571
+ hoursMissing: number().int().nonnegative(),
8572
+ /** `readdir` calls issued — the cost, stated in the unit that is paid. */
8573
+ listings: number().int().nonnegative(),
8574
+ segmentsClaimed: number().int().nonnegative(),
8575
+ ghostSegments: number().int().nonnegative(),
8576
+ ghostBytes: number().int().nonnegative(),
8577
+ ghostHoursWhole: number().int().nonnegative(),
8578
+ forgottenSegments: number().int().nonnegative(),
8579
+ forgottenBytes: number().int().nonnegative(),
8580
+ /** Files under a claimed hour that no durable row names. Never deleted. */
8581
+ orphanFiles: number().int().nonnegative(),
8582
+ orphanSample: array(string()).readonly(),
8583
+ hoursSkipped: number().int().nonnegative(),
8584
+ skippedByReason: LedgerWalkSkipCountsSchema,
8585
+ /** The walk stopped at its per-pass hour bound with claims unwalked. */
8586
+ bounded: boolean(),
8587
+ byDevice: array(LedgerWalkDeviceReportSchema).readonly()
8588
+ });
8490
8589
  /** How many rows a media pass would still act on against a given target — the
8491
8590
  * media lane's denominator AND its residue, from ONE derivation so the two can
8492
8591
  * never disagree. `null` = the count could not be taken. */
@@ -18815,13 +18914,15 @@ var ListGroupsPageSchema = object({
18815
18914
  groups: array(AnalyticsGroupRecordSchema).readonly(),
18816
18915
  nextCursor: string().nullable()
18817
18916
  });
18917
+ var KEY_EVENTS_DEFAULT_LIMIT = 50;
18918
+ var KEY_EVENTS_MAX_LIMIT = 200;
18818
18919
  var KeyEventQueryInput = object({
18819
18920
  deviceId: number(),
18820
18921
  /** Window lower bound (track firstSeen ≥ since). */
18821
18922
  since: number(),
18822
18923
  /** Window upper bound (track firstSeen ≤ until). */
18823
18924
  until: number(),
18824
- limit: number().int().min(1).max(200).default(50),
18925
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
18825
18926
  /** Drop tracks scoring below this importance. */
18826
18927
  minImportance: number().min(0).max(1).optional(),
18827
18928
  /** Restrict to a single class (e.g. 'person'). */
@@ -18843,6 +18944,32 @@ var KeyEventSchema = object({
18843
18944
  ...TrackFlagFields,
18844
18945
  ...TrackRetrainFields
18845
18946
  });
18947
+ /** `getKeyEvents`' window and filters, asked of a SET of cameras at once. */
18948
+ var KeyEventBatchQueryInput = object({
18949
+ deviceIds: array(number()).min(1).max(200),
18950
+ since: number(),
18951
+ until: number(),
18952
+ /** Applied PER CAMERA, exactly as `getKeyEvents.limit` is — never a total
18953
+ * across the set, which would let a busy camera starve a quiet one of its
18954
+ * rows and change what the merged feed contains. */
18955
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
18956
+ minImportance: number().min(0).max(1).optional(),
18957
+ classFilter: string().optional()
18958
+ });
18959
+ /**
18960
+ * One camera's key events in a batch answer.
18961
+ *
18962
+ * The row exists for every requested id. `getKeyEvents` degrades to `[]` on
18963
+ * error rather than throwing, so a camera whose store read failed and one with
18964
+ * no events in the window were ALREADY indistinguishable per camera — the
18965
+ * batch does not make that worse, and the row keeps the deviceId the single
18966
+ * method's output never carried (the caller used to stamp it from the fan-out
18967
+ * key, which only worked because there was one query per camera).
18968
+ */
18969
+ var KeyEventsForDeviceSchema = object({
18970
+ deviceId: number(),
18971
+ events: array(KeyEventSchema).readonly()
18972
+ });
18846
18973
  object({
18847
18974
  trackId: string(),
18848
18975
  className: string(),
@@ -18914,6 +19041,50 @@ var EventStoreFootprintSchema = object({
18914
19041
  totalBytes: number().int(),
18915
19042
  devices: array(EventStoreDeviceFootprintSchema).readonly()
18916
19043
  });
19044
+ /** Event-media footprint for one {@link MediaFileKind}. */
19045
+ var EventMediaKindFootprintSchema = object({
19046
+ kind: MediaFileKindEnum,
19047
+ /** Media rows of this kind. */
19048
+ rows: number().int(),
19049
+ /** Bytes on disk held by those rows. */
19050
+ bytes: number().int()
19051
+ });
19052
+ /**
19053
+ * The media footprint broken down by KIND — the axis a deletion decision
19054
+ * actually turns on.
19055
+ *
19056
+ * A byte total says how much there is; it cannot say what is safe to remove.
19057
+ * The deletable set (the periodic `snapshot` filmstrip, the surplus per-edge
19058
+ * motion stills) and the keep set (`firstFrame`, rolling `lastFrame`,
19059
+ * `thumbnail`/`thumbnailSmall`, `keyFrame`/`keyFrameSmall`, the face/plate
19060
+ * buffers, gallery media, the CLIP `crop`) are distinguished by `kind` and by
19061
+ * nothing else, so sizing a deletion means summing per kind.
19062
+ *
19063
+ * ## Why `unaccounted*` exists
19064
+ *
19065
+ * `kinds` is enumerated from {@link MediaFileKindEnum} — the closed set the
19066
+ * writers use — and summed one kind at a time. `totalRows` / `totalBytes` come
19067
+ * from a SEPARATE unfiltered aggregate over the same rows, never from adding
19068
+ * `kinds` up. A row whose stored `kind` is not in the enum (written by a
19069
+ * retired code path, or by a version that knew a kind this one does not) would
19070
+ * otherwise vanish from the total silently, and an operator would delete
19071
+ * against a denominator smaller than the disk.
19072
+ *
19073
+ * `unaccountedRows` / `unaccountedBytes` are the difference. They are normally
19074
+ * zero; a non-zero value is a real finding and must be shown, not rounded away.
19075
+ */
19076
+ var EventMediaKindBreakdownSchema = object({
19077
+ /** Every media row in scope, from one unfiltered aggregate. */
19078
+ totalRows: number().int(),
19079
+ /** Every media byte in scope, from that same aggregate. */
19080
+ totalBytes: number().int(),
19081
+ /** Per-kind footprint, ordered by bytes descending. */
19082
+ kinds: array(EventMediaKindFootprintSchema).readonly(),
19083
+ /** `totalRows` minus the summed `kinds` rows — see the schema note. */
19084
+ unaccountedRows: number().int(),
19085
+ /** `totalBytes` minus the summed `kinds` bytes — see the schema note. */
19086
+ unaccountedBytes: number().int()
19087
+ });
18917
19088
  /** Per-kind counts returned by the event-prune / device-delete mutations. */
18918
19089
  var EventPruneCountsSchema = object({
18919
19090
  motion: number().int(),
@@ -19068,7 +19239,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19068
19239
  until: number().optional(),
19069
19240
  kinds: array(string()).optional(),
19070
19241
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
19071
- }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
19242
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
19072
19243
  deviceId: number(),
19073
19244
  since: number(),
19074
19245
  until: number(),
@@ -19117,6 +19288,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19117
19288
  }), TrackFlagsSchema, { kind: "mutation" }), method(object({}), EventStoreFootprintSchema, {
19118
19289
  kind: "query",
19119
19290
  auth: "admin"
19291
+ }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
19292
+ kind: "query",
19293
+ auth: "admin"
19120
19294
  }), method(object({
19121
19295
  olderThanMs: number(),
19122
19296
  reason: OpsLogReasonSchema.optional()
@@ -21068,6 +21242,20 @@ method(object({
21068
21242
  error: string().optional()
21069
21243
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
21070
21244
  providerId: string(),
21245
+ /**
21246
+ * The location this config is an UNSAVED edit of, when there is one.
21247
+ *
21248
+ * `listLocations` replaces every declared secret with the redaction
21249
+ * sentinel, so the edit modal's form state holds the sentinel for any
21250
+ * credential the operator did not retype — and posting that here
21251
+ * without a way to resolve it makes the provider try to authenticate
21252
+ * as `__camstack_redacted__` and report the operator's own working
21253
+ * password as wrong. Given this id, the orchestrator restores each
21254
+ * sentinel from the stored config (same rule as `upsertLocation`)
21255
+ * before dispatching. Omitted by the "Add location" wizard, where
21256
+ * every value was typed just now and nothing is stored yet.
21257
+ */
21258
+ locationId: string().optional(),
21071
21259
  config: record(string(), unknown())
21072
21260
  }), object({
21073
21261
  ok: boolean(),
@@ -26703,6 +26891,9 @@ method(object({
26703
26891
  }), method(RelocateResidueInputSchema, RelocateResidueSchema, {
26704
26892
  kind: "query",
26705
26893
  auth: "admin"
26894
+ }), method(LedgerWalkInputSchema, LedgerWalkReportSchema, {
26895
+ kind: "mutation",
26896
+ auth: "admin"
26706
26897
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
26707
26898
  kind: "mutation",
26708
26899
  auth: "admin"
@@ -27094,7 +27285,26 @@ var SceneMonitorStatusSchema = object({
27094
27285
  monitors: array(SceneMonitorSchema),
27095
27286
  lastFetchedAt: number()
27096
27287
  });
27097
- DeviceType.Camera, method(object({ deviceId: number() }), SceneMonitorStatusSchema), method(object({
27288
+ /**
27289
+ * One camera's row in a `listScenesBatch` answer.
27290
+ *
27291
+ * `status` is NULLABLE and the nullability is the whole point. `scene-monitor`
27292
+ * is a `defaultActive` wrapper, so every camera is asked; a camera whose
27293
+ * provider is absent (pipeline-analytics not deployed, the post-processing node
27294
+ * down) cannot answer, and that is not the same fact as a camera with no scenes
27295
+ * configured. Fanned out per camera the difference was visible — one query
27296
+ * errored while the others resolved — and a batch that returned only the rows
27297
+ * it managed would have destroyed it, silently, by making an unreachable camera
27298
+ * indistinguishable from one that answered `monitors: []`.
27299
+ *
27300
+ * So: EVERY requested deviceId gets a row. `status: null` means "this camera
27301
+ * could not be read"; `status.monitors: []` means "read, and it has none".
27302
+ */
27303
+ var SceneMonitorStatusForDeviceSchema = object({
27304
+ deviceId: number(),
27305
+ status: SceneMonitorStatusSchema.nullable()
27306
+ });
27307
+ DeviceType.Camera, method(object({ deviceId: number() }), SceneMonitorStatusSchema), method(object({ deviceIds: array(number()).min(1).max(200) }), array(SceneMonitorStatusForDeviceSchema).readonly()), method(object({
27098
27308
  deviceId: number(),
27099
27309
  label: string(),
27100
27310
  roi: MaskRectShapeSchema,
@@ -28418,6 +28628,27 @@ var CameraOccupancySnapshotSchema = object({
28418
28628
  stationaryObjects: array(StationaryObjectSchema).readonly().optional()
28419
28629
  });
28420
28630
  /**
28631
+ * One camera's row in a `getCurrentSnapshotBatch` answer.
28632
+ *
28633
+ * THREE outcomes, and the single-camera method could only express two of them
28634
+ * because `snapshot: null` was already spoken for:
28635
+ *
28636
+ * - `read: 'read'`, `snapshot` present — the live occupancy reading.
28637
+ * - `read: 'read'`, `snapshot: null` — read, and this camera has no reading
28638
+ * yet: no frame since boot, and no parked-object registry to hydrate from.
28639
+ * - `read: 'unreadable'` — the owner could not answer for this
28640
+ * camera. `snapshot` is null, and it does NOT mean "nothing parked here".
28641
+ *
28642
+ * Collapsing the last two is the failure this field exists to prevent: a
28643
+ * hydration that threw would otherwise render as an empty Stationary section,
28644
+ * which is a definite claim about a camera nobody could read.
28645
+ */
28646
+ var CameraOccupancySnapshotForDeviceSchema = object({
28647
+ deviceId: number(),
28648
+ read: _enum(["read", "unreadable"]),
28649
+ snapshot: CameraOccupancySnapshotSchema.nullable()
28650
+ });
28651
+ /**
28421
28652
  * Time-series resolution. The history methods return one bucket per
28422
28653
  * step over the requested range. Smaller resolutions cost more
28423
28654
  * memory + bandwidth; bound to discrete steps so caller cannot ask
@@ -28441,7 +28672,7 @@ var HistoryPointSchema = object({
28441
28672
  /** Object count averaged over the bucket (rounded to nearest integer). */
28442
28673
  count: number().int().nonnegative()
28443
28674
  });
28444
- DeviceType.Camera, method(object({ deviceId: number() }), CameraOccupancySnapshotSchema.nullable()), method(object({
28675
+ DeviceType.Camera, method(object({ deviceId: number() }), CameraOccupancySnapshotSchema.nullable()), method(object({ deviceIds: array(number()).min(1).max(200) }), array(CameraOccupancySnapshotForDeviceSchema).readonly()), method(object({
28445
28676
  deviceId: number(),
28446
28677
  zoneId: string(),
28447
28678
  className: string().optional()
@@ -31722,6 +31953,12 @@ Object.freeze({
31722
31953
  addonId: null,
31723
31954
  access: "view"
31724
31955
  },
31956
+ "pipelineAnalytics.getEventMediaFootprintByKind": {
31957
+ capName: "pipeline-analytics",
31958
+ capScope: "device",
31959
+ addonId: null,
31960
+ access: "view"
31961
+ },
31725
31962
  "pipelineAnalytics.getEventStoreFootprint": {
31726
31963
  capName: "pipeline-analytics",
31727
31964
  capScope: "device",
@@ -31740,6 +31977,12 @@ Object.freeze({
31740
31977
  addonId: null,
31741
31978
  access: "view"
31742
31979
  },
31980
+ "pipelineAnalytics.getKeyEventsBatch": {
31981
+ capName: "pipeline-analytics",
31982
+ capScope: "device",
31983
+ addonId: null,
31984
+ access: "view"
31985
+ },
31743
31986
  "pipelineAnalytics.getMotionEvents": {
31744
31987
  capName: "pipeline-analytics",
31745
31988
  capScope: "device",
@@ -32916,6 +33159,12 @@ Object.freeze({
32916
33159
  addonId: null,
32917
33160
  access: "view"
32918
33161
  },
33162
+ "recording.reconcileLedgerAgainstDisk": {
33163
+ capName: "recording",
33164
+ capScope: "system",
33165
+ addonId: null,
33166
+ access: "create"
33167
+ },
32919
33168
  "recording.refreshStorageLocationsForMigration": {
32920
33169
  capName: "recording",
32921
33170
  capScope: "system",
@@ -33042,6 +33291,12 @@ Object.freeze({
33042
33291
  addonId: null,
33043
33292
  access: "view"
33044
33293
  },
33294
+ "sceneMonitor.listScenesBatch": {
33295
+ capName: "scene-monitor",
33296
+ capScope: "device",
33297
+ addonId: null,
33298
+ access: "view"
33299
+ },
33045
33300
  "sceneMonitor.recheckNow": {
33046
33301
  capName: "scene-monitor",
33047
33302
  capScope: "device",
@@ -34398,6 +34653,12 @@ Object.freeze({
34398
34653
  addonId: null,
34399
34654
  access: "view"
34400
34655
  },
34656
+ "zoneAnalytics.getCurrentSnapshotBatch": {
34657
+ capName: "zone-analytics",
34658
+ capScope: "device",
34659
+ addonId: null,
34660
+ access: "view"
34661
+ },
34401
34662
  "zoneAnalytics.getUnzonedHistory": {
34402
34663
  capName: "zone-analytics",
34403
34664
  capScope: "device",
@@ -35387,6 +35648,11 @@ Object.freeze({
35387
35648
  form: "single",
35388
35649
  optional: false
35389
35650
  }],
35651
+ "pipelineAnalytics.getEventMediaFootprintByKind": [{
35652
+ name: "deviceId",
35653
+ form: "single",
35654
+ optional: true
35655
+ }],
35390
35656
  "pipelineAnalytics.getGroup": [{
35391
35657
  name: "deviceId",
35392
35658
  form: "single",
@@ -35397,6 +35663,11 @@ Object.freeze({
35397
35663
  form: "single",
35398
35664
  optional: false
35399
35665
  }],
35666
+ "pipelineAnalytics.getKeyEventsBatch": [{
35667
+ name: "deviceIds",
35668
+ form: "array",
35669
+ optional: false
35670
+ }],
35400
35671
  "pipelineAnalytics.getMotionEvents": [{
35401
35672
  name: "deviceId",
35402
35673
  form: "single",
@@ -35837,6 +36108,11 @@ Object.freeze({
35837
36108
  form: "single",
35838
36109
  optional: false
35839
36110
  }],
36111
+ "recording.reconcileLedgerAgainstDisk": [{
36112
+ name: "deviceId",
36113
+ form: "single",
36114
+ optional: true
36115
+ }],
35840
36116
  "recording.relocateFootage": [{
35841
36117
  name: "deviceId",
35842
36118
  form: "single",
@@ -35902,6 +36178,11 @@ Object.freeze({
35902
36178
  form: "single",
35903
36179
  optional: false
35904
36180
  }],
36181
+ "sceneMonitor.listScenesBatch": [{
36182
+ name: "deviceIds",
36183
+ form: "array",
36184
+ optional: false
36185
+ }],
35905
36186
  "sceneMonitor.recheckNow": [{
35906
36187
  name: "deviceId",
35907
36188
  form: "single",
@@ -36163,6 +36444,11 @@ Object.freeze({
36163
36444
  form: "single",
36164
36445
  optional: false
36165
36446
  }],
36447
+ "zoneAnalytics.getCurrentSnapshotBatch": [{
36448
+ name: "deviceIds",
36449
+ form: "array",
36450
+ optional: false
36451
+ }],
36166
36452
  "zoneAnalytics.getUnzonedHistory": [{
36167
36453
  name: "deviceId",
36168
36454
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-notifiers",
3
- "version": "1.2.51",
3
+ "version": "1.2.53",
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",