@camstack/addon-provider-petkit 0.2.48 → 0.2.49

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
@@ -9120,6 +9120,20 @@ var RelocateJobSchema = object({
9120
9120
  * in its row, not in its name, so `MediaRelocateEngine` never reconciles one.
9121
9121
  */
9122
9122
  rowsReconciled: number().int().nonnegative().optional(),
9123
+ /**
9124
+ * Rows this run FORGOT because the file they name is not on disk.
9125
+ *
9126
+ * The mover derived the path from the row's own fields and `stat`ed it; an
9127
+ * ENOENT there is a per-path confirmation that the segment is gone (D296),
9128
+ * and the durable row is dropped through the same channel eviction uses. It
9129
+ * is reported for the same reason `rowsReconciled` is: this is a durable
9130
+ * mutation nobody asked for, and a migration that quietly erases hour rows is
9131
+ * the same failure as one that quietly skips them (D295).
9132
+ *
9133
+ * The production drain of 2026-08-30 would have reported 11 074 here — the
9134
+ * ledger claimed 5.65 GB of footage that no longer existed.
9135
+ */
9136
+ rowsForgotten: number().int().nonnegative().optional(),
9123
9137
  startedAt: number(),
9124
9138
  finishedAt: number().nullable(),
9125
9139
  error: string().nullable()
@@ -9483,6 +9497,91 @@ var RelocateResidueSchema = object({
9483
9497
  segments: number().int().nonnegative(),
9484
9498
  bytes: number().int().nonnegative()
9485
9499
  }).nullable();
9500
+ /**
9501
+ * Ask one location whether its durable hour rows describe the disk — the walk
9502
+ * (D319).
9503
+ *
9504
+ * `apply` DEFAULTS TO FALSE and that default is the product: the operator's
9505
+ * missing tool is the question, and the dry run is how they sanity-check the
9506
+ * destructive run before authorising it.
9507
+ */
9508
+ var LedgerWalkInputSchema = object({
9509
+ locationId: string().min(1),
9510
+ /** Forget the confirmed-absent rows, rather than only counting them. */
9511
+ apply: boolean().optional(),
9512
+ /** Narrow to one camera. */
9513
+ deviceId: number().int().positive().optional(),
9514
+ /** Narrow to these recording profiles; empty/absent = every profile. */
9515
+ profiles: array(string().min(1)).optional()
9516
+ });
9517
+ /** Why a whole walk did nothing. Every one leaves the ledger untouched. */
9518
+ var LedgerWalkRefusalSchema = _enum([
9519
+ "location-unknown",
9520
+ "source-writable",
9521
+ "no-ledger",
9522
+ "archive-unreadable",
9523
+ "anchor-absent",
9524
+ "anchor-unreadable",
9525
+ "anchor-moved"
9526
+ ]);
9527
+ _enum([
9528
+ "live-tail",
9529
+ "listing-error",
9530
+ "path-mismatch",
9531
+ "durable-refused"
9532
+ ]);
9533
+ /** Every skip reason, always present, always a number — so a reason that never
9534
+ * fired reports as zero rather than absent and the report shape is constant
9535
+ * between passes. Spelled out rather than `z.record` for exactly that. */
9536
+ var LedgerWalkSkipCountsSchema = object({
9537
+ "live-tail": number().int().nonnegative(),
9538
+ "listing-error": number().int().nonnegative(),
9539
+ "path-mismatch": number().int().nonnegative(),
9540
+ "durable-refused": number().int().nonnegative()
9541
+ });
9542
+ /** One camera's share of a walk, so a report names cameras and not rows. */
9543
+ var LedgerWalkDeviceReportSchema = object({
9544
+ deviceId: number().int(),
9545
+ hoursWalked: number().int().nonnegative(),
9546
+ hoursMissing: number().int().nonnegative(),
9547
+ ghostSegments: number().int().nonnegative(),
9548
+ ghostBytes: number().int().nonnegative(),
9549
+ forgottenSegments: number().int().nonnegative(),
9550
+ orphanFiles: number().int().nonnegative()
9551
+ });
9552
+ /**
9553
+ * What one walk claimed, listed, found and (only when armed) forgot.
9554
+ *
9555
+ * `archiveSegments` is the **M** and `segmentsClaimed` the **N** (D295), so a
9556
+ * walk that saw a fraction of the location is visible in its own report rather
9557
+ * than in the absence of one.
9558
+ */
9559
+ var LedgerWalkReportSchema = object({
9560
+ locationId: string(),
9561
+ applied: boolean(),
9562
+ refused: LedgerWalkRefusalSchema.nullable(),
9563
+ archiveSegments: number().int().nonnegative().nullable(),
9564
+ archiveBytes: number().int().nonnegative().nullable(),
9565
+ hoursClaimed: number().int().nonnegative(),
9566
+ hoursWalked: number().int().nonnegative(),
9567
+ hoursMissing: number().int().nonnegative(),
9568
+ /** `readdir` calls issued — the cost, stated in the unit that is paid. */
9569
+ listings: number().int().nonnegative(),
9570
+ segmentsClaimed: number().int().nonnegative(),
9571
+ ghostSegments: number().int().nonnegative(),
9572
+ ghostBytes: number().int().nonnegative(),
9573
+ ghostHoursWhole: number().int().nonnegative(),
9574
+ forgottenSegments: number().int().nonnegative(),
9575
+ forgottenBytes: number().int().nonnegative(),
9576
+ /** Files under a claimed hour that no durable row names. Never deleted. */
9577
+ orphanFiles: number().int().nonnegative(),
9578
+ orphanSample: array(string()).readonly(),
9579
+ hoursSkipped: number().int().nonnegative(),
9580
+ skippedByReason: LedgerWalkSkipCountsSchema,
9581
+ /** The walk stopped at its per-pass hour bound with claims unwalked. */
9582
+ bounded: boolean(),
9583
+ byDevice: array(LedgerWalkDeviceReportSchema).readonly()
9584
+ });
9486
9585
  /** How many rows a media pass would still act on against a given target — the
9487
9586
  * media lane's denominator AND its residue, from ONE derivation so the two can
9488
9587
  * never disagree. `null` = the count could not be taken. */
@@ -20115,13 +20214,15 @@ var ListGroupsPageSchema = object({
20115
20214
  groups: array(AnalyticsGroupRecordSchema).readonly(),
20116
20215
  nextCursor: string().nullable()
20117
20216
  });
20217
+ var KEY_EVENTS_DEFAULT_LIMIT = 50;
20218
+ var KEY_EVENTS_MAX_LIMIT = 200;
20118
20219
  var KeyEventQueryInput = object({
20119
20220
  deviceId: number(),
20120
20221
  /** Window lower bound (track firstSeen ≥ since). */
20121
20222
  since: number(),
20122
20223
  /** Window upper bound (track firstSeen ≤ until). */
20123
20224
  until: number(),
20124
- limit: number().int().min(1).max(200).default(50),
20225
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
20125
20226
  /** Drop tracks scoring below this importance. */
20126
20227
  minImportance: number().min(0).max(1).optional(),
20127
20228
  /** Restrict to a single class (e.g. 'person'). */
@@ -20143,6 +20244,32 @@ var KeyEventSchema = object({
20143
20244
  ...TrackFlagFields,
20144
20245
  ...TrackRetrainFields
20145
20246
  });
20247
+ /** `getKeyEvents`' window and filters, asked of a SET of cameras at once. */
20248
+ var KeyEventBatchQueryInput = object({
20249
+ deviceIds: array(number()).min(1).max(200),
20250
+ since: number(),
20251
+ until: number(),
20252
+ /** Applied PER CAMERA, exactly as `getKeyEvents.limit` is — never a total
20253
+ * across the set, which would let a busy camera starve a quiet one of its
20254
+ * rows and change what the merged feed contains. */
20255
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
20256
+ minImportance: number().min(0).max(1).optional(),
20257
+ classFilter: string().optional()
20258
+ });
20259
+ /**
20260
+ * One camera's key events in a batch answer.
20261
+ *
20262
+ * The row exists for every requested id. `getKeyEvents` degrades to `[]` on
20263
+ * error rather than throwing, so a camera whose store read failed and one with
20264
+ * no events in the window were ALREADY indistinguishable per camera — the
20265
+ * batch does not make that worse, and the row keeps the deviceId the single
20266
+ * method's output never carried (the caller used to stamp it from the fan-out
20267
+ * key, which only worked because there was one query per camera).
20268
+ */
20269
+ var KeyEventsForDeviceSchema = object({
20270
+ deviceId: number(),
20271
+ events: array(KeyEventSchema).readonly()
20272
+ });
20146
20273
  object({
20147
20274
  trackId: string(),
20148
20275
  className: string(),
@@ -20412,7 +20539,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20412
20539
  until: number().optional(),
20413
20540
  kinds: array(string()).optional(),
20414
20541
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
20415
- }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
20542
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
20416
20543
  deviceId: number(),
20417
20544
  since: number(),
20418
20545
  until: number(),
@@ -29787,6 +29914,9 @@ method(object({
29787
29914
  }), method(RelocateResidueInputSchema, RelocateResidueSchema, {
29788
29915
  kind: "query",
29789
29916
  auth: "admin"
29917
+ }), method(LedgerWalkInputSchema, LedgerWalkReportSchema, {
29918
+ kind: "mutation",
29919
+ auth: "admin"
29790
29920
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
29791
29921
  kind: "mutation",
29792
29922
  auth: "admin"
@@ -30178,6 +30308,25 @@ var SceneMonitorStatusSchema = object({
30178
30308
  monitors: array(SceneMonitorSchema),
30179
30309
  lastFetchedAt: number()
30180
30310
  });
30311
+ /**
30312
+ * One camera's row in a `listScenesBatch` answer.
30313
+ *
30314
+ * `status` is NULLABLE and the nullability is the whole point. `scene-monitor`
30315
+ * is a `defaultActive` wrapper, so every camera is asked; a camera whose
30316
+ * provider is absent (pipeline-analytics not deployed, the post-processing node
30317
+ * down) cannot answer, and that is not the same fact as a camera with no scenes
30318
+ * configured. Fanned out per camera the difference was visible — one query
30319
+ * errored while the others resolved — and a batch that returned only the rows
30320
+ * it managed would have destroyed it, silently, by making an unreachable camera
30321
+ * indistinguishable from one that answered `monitors: []`.
30322
+ *
30323
+ * So: EVERY requested deviceId gets a row. `status: null` means "this camera
30324
+ * could not be read"; `status.monitors: []` means "read, and it has none".
30325
+ */
30326
+ var SceneMonitorStatusForDeviceSchema = object({
30327
+ deviceId: number(),
30328
+ status: SceneMonitorStatusSchema.nullable()
30329
+ });
30181
30330
  var sceneMonitorCapability = {
30182
30331
  name: "scene-monitor",
30183
30332
  scope: "device",
@@ -30187,6 +30336,22 @@ var sceneMonitorCapability = {
30187
30336
  deviceTypes: [DeviceType.Camera],
30188
30337
  methods: {
30189
30338
  listScenes: method(object({ deviceId: number() }), SceneMonitorStatusSchema),
30339
+ /**
30340
+ * The same answer, for a SET of cameras, in one round trip.
30341
+ *
30342
+ * `/scenes` renders every camera and re-reads them on a 30s safety-net
30343
+ * poll behind the push slice. Fanned out client-side that was one query
30344
+ * per camera — 29 round trips through the browser, the hub and the
30345
+ * post-analysis runner every 30 seconds to read an in-memory map the
30346
+ * owner had already merged. The work is unchanged (`statusFor` per
30347
+ * device, all in-process at the owner); what collapses is the transport.
30348
+ *
30349
+ * A camera that cannot answer still gets a row, with `status: null` —
30350
+ * see {@link SceneMonitorStatusForDeviceSchema}. Never fewer rows than
30351
+ * ids: a caller that asked for twenty-nine and got twenty-seven cannot
30352
+ * tell which two are missing, or that any are.
30353
+ */
30354
+ listScenesBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(SceneMonitorStatusForDeviceSchema).readonly()),
30190
30355
  createScene: method(object({
30191
30356
  deviceId: number(),
30192
30357
  label: string(),
@@ -32022,6 +32187,27 @@ var CameraOccupancySnapshotSchema = object({
32022
32187
  stationaryObjects: array(StationaryObjectSchema).readonly().optional()
32023
32188
  });
32024
32189
  /**
32190
+ * One camera's row in a `getCurrentSnapshotBatch` answer.
32191
+ *
32192
+ * THREE outcomes, and the single-camera method could only express two of them
32193
+ * because `snapshot: null` was already spoken for:
32194
+ *
32195
+ * - `read: 'read'`, `snapshot` present — the live occupancy reading.
32196
+ * - `read: 'read'`, `snapshot: null` — read, and this camera has no reading
32197
+ * yet: no frame since boot, and no parked-object registry to hydrate from.
32198
+ * - `read: 'unreadable'` — the owner could not answer for this
32199
+ * camera. `snapshot` is null, and it does NOT mean "nothing parked here".
32200
+ *
32201
+ * Collapsing the last two is the failure this field exists to prevent: a
32202
+ * hydration that threw would otherwise render as an empty Stationary section,
32203
+ * which is a definite claim about a camera nobody could read.
32204
+ */
32205
+ var CameraOccupancySnapshotForDeviceSchema = object({
32206
+ deviceId: number(),
32207
+ read: _enum(["read", "unreadable"]),
32208
+ snapshot: CameraOccupancySnapshotSchema.nullable()
32209
+ });
32210
+ /**
32025
32211
  * Time-series resolution. The history methods return one bucket per
32026
32212
  * step over the requested range. Smaller resolutions cost more
32027
32213
  * memory + bandwidth; bound to discrete steps so caller cannot ask
@@ -32078,6 +32264,20 @@ var zoneAnalyticsCapability = {
32078
32264
  * (no inference result emitted since boot or since binding was
32079
32265
  * activated). */
32080
32266
  getCurrentSnapshot: method(object({ deviceId: number() }), CameraOccupancySnapshotSchema.nullable()),
32267
+ /**
32268
+ * The same snapshot, for a SET of cameras, in one round trip.
32269
+ *
32270
+ * The Events page's Stationary section polls this every 15s for every
32271
+ * selected camera. Fanned out client-side that is one query per camera to
32272
+ * read a `Map.get` at the owner — the answer costs nothing, the round trip
32273
+ * costs everything. Batched, N transports become one and the per-device
32274
+ * work is unchanged.
32275
+ *
32276
+ * Every requested deviceId gets a row, tagged `read` — see
32277
+ * {@link CameraOccupancySnapshotForDeviceSchema}. A camera the owner could
32278
+ * not answer for is `'unreadable'`, never an empty reading.
32279
+ */
32280
+ getCurrentSnapshotBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(CameraOccupancySnapshotForDeviceSchema).readonly()),
32081
32281
  /** Time-series object count inside one zone. `className` optional —
32082
32282
  * omit to count every class in the zone. */
32083
32283
  getZoneHistory: method(object({
@@ -36499,6 +36699,12 @@ Object.freeze({
36499
36699
  addonId: null,
36500
36700
  access: "view"
36501
36701
  },
36702
+ "pipelineAnalytics.getKeyEventsBatch": {
36703
+ capName: "pipeline-analytics",
36704
+ capScope: "device",
36705
+ addonId: null,
36706
+ access: "view"
36707
+ },
36502
36708
  "pipelineAnalytics.getMotionEvents": {
36503
36709
  capName: "pipeline-analytics",
36504
36710
  capScope: "device",
@@ -37675,6 +37881,12 @@ Object.freeze({
37675
37881
  addonId: null,
37676
37882
  access: "view"
37677
37883
  },
37884
+ "recording.reconcileLedgerAgainstDisk": {
37885
+ capName: "recording",
37886
+ capScope: "system",
37887
+ addonId: null,
37888
+ access: "create"
37889
+ },
37678
37890
  "recording.refreshStorageLocationsForMigration": {
37679
37891
  capName: "recording",
37680
37892
  capScope: "system",
@@ -37801,6 +38013,12 @@ Object.freeze({
37801
38013
  addonId: null,
37802
38014
  access: "view"
37803
38015
  },
38016
+ "sceneMonitor.listScenesBatch": {
38017
+ capName: "scene-monitor",
38018
+ capScope: "device",
38019
+ addonId: null,
38020
+ access: "view"
38021
+ },
37804
38022
  "sceneMonitor.recheckNow": {
37805
38023
  capName: "scene-monitor",
37806
38024
  capScope: "device",
@@ -39157,6 +39375,12 @@ Object.freeze({
39157
39375
  addonId: null,
39158
39376
  access: "view"
39159
39377
  },
39378
+ "zoneAnalytics.getCurrentSnapshotBatch": {
39379
+ capName: "zone-analytics",
39380
+ capScope: "device",
39381
+ addonId: null,
39382
+ access: "view"
39383
+ },
39160
39384
  "zoneAnalytics.getUnzonedHistory": {
39161
39385
  capName: "zone-analytics",
39162
39386
  capScope: "device",
@@ -40161,6 +40385,11 @@ Object.freeze({
40161
40385
  form: "single",
40162
40386
  optional: false
40163
40387
  }],
40388
+ "pipelineAnalytics.getKeyEventsBatch": [{
40389
+ name: "deviceIds",
40390
+ form: "array",
40391
+ optional: false
40392
+ }],
40164
40393
  "pipelineAnalytics.getMotionEvents": [{
40165
40394
  name: "deviceId",
40166
40395
  form: "single",
@@ -40601,6 +40830,11 @@ Object.freeze({
40601
40830
  form: "single",
40602
40831
  optional: false
40603
40832
  }],
40833
+ "recording.reconcileLedgerAgainstDisk": [{
40834
+ name: "deviceId",
40835
+ form: "single",
40836
+ optional: true
40837
+ }],
40604
40838
  "recording.relocateFootage": [{
40605
40839
  name: "deviceId",
40606
40840
  form: "single",
@@ -40666,6 +40900,11 @@ Object.freeze({
40666
40900
  form: "single",
40667
40901
  optional: false
40668
40902
  }],
40903
+ "sceneMonitor.listScenesBatch": [{
40904
+ name: "deviceIds",
40905
+ form: "array",
40906
+ optional: false
40907
+ }],
40669
40908
  "sceneMonitor.recheckNow": [{
40670
40909
  name: "deviceId",
40671
40910
  form: "single",
@@ -40927,6 +41166,11 @@ Object.freeze({
40927
41166
  form: "single",
40928
41167
  optional: false
40929
41168
  }],
41169
+ "zoneAnalytics.getCurrentSnapshotBatch": [{
41170
+ name: "deviceIds",
41171
+ form: "array",
41172
+ optional: false
41173
+ }],
40930
41174
  "zoneAnalytics.getUnzonedHistory": [{
40931
41175
  name: "deviceId",
40932
41176
  form: "single",
package/dist/addon.mjs CHANGED
@@ -9119,6 +9119,20 @@ var RelocateJobSchema = object({
9119
9119
  * in its row, not in its name, so `MediaRelocateEngine` never reconciles one.
9120
9120
  */
9121
9121
  rowsReconciled: number().int().nonnegative().optional(),
9122
+ /**
9123
+ * Rows this run FORGOT because the file they name is not on disk.
9124
+ *
9125
+ * The mover derived the path from the row's own fields and `stat`ed it; an
9126
+ * ENOENT there is a per-path confirmation that the segment is gone (D296),
9127
+ * and the durable row is dropped through the same channel eviction uses. It
9128
+ * is reported for the same reason `rowsReconciled` is: this is a durable
9129
+ * mutation nobody asked for, and a migration that quietly erases hour rows is
9130
+ * the same failure as one that quietly skips them (D295).
9131
+ *
9132
+ * The production drain of 2026-08-30 would have reported 11 074 here — the
9133
+ * ledger claimed 5.65 GB of footage that no longer existed.
9134
+ */
9135
+ rowsForgotten: number().int().nonnegative().optional(),
9122
9136
  startedAt: number(),
9123
9137
  finishedAt: number().nullable(),
9124
9138
  error: string().nullable()
@@ -9482,6 +9496,91 @@ var RelocateResidueSchema = object({
9482
9496
  segments: number().int().nonnegative(),
9483
9497
  bytes: number().int().nonnegative()
9484
9498
  }).nullable();
9499
+ /**
9500
+ * Ask one location whether its durable hour rows describe the disk — the walk
9501
+ * (D319).
9502
+ *
9503
+ * `apply` DEFAULTS TO FALSE and that default is the product: the operator's
9504
+ * missing tool is the question, and the dry run is how they sanity-check the
9505
+ * destructive run before authorising it.
9506
+ */
9507
+ var LedgerWalkInputSchema = object({
9508
+ locationId: string().min(1),
9509
+ /** Forget the confirmed-absent rows, rather than only counting them. */
9510
+ apply: boolean().optional(),
9511
+ /** Narrow to one camera. */
9512
+ deviceId: number().int().positive().optional(),
9513
+ /** Narrow to these recording profiles; empty/absent = every profile. */
9514
+ profiles: array(string().min(1)).optional()
9515
+ });
9516
+ /** Why a whole walk did nothing. Every one leaves the ledger untouched. */
9517
+ var LedgerWalkRefusalSchema = _enum([
9518
+ "location-unknown",
9519
+ "source-writable",
9520
+ "no-ledger",
9521
+ "archive-unreadable",
9522
+ "anchor-absent",
9523
+ "anchor-unreadable",
9524
+ "anchor-moved"
9525
+ ]);
9526
+ _enum([
9527
+ "live-tail",
9528
+ "listing-error",
9529
+ "path-mismatch",
9530
+ "durable-refused"
9531
+ ]);
9532
+ /** Every skip reason, always present, always a number — so a reason that never
9533
+ * fired reports as zero rather than absent and the report shape is constant
9534
+ * between passes. Spelled out rather than `z.record` for exactly that. */
9535
+ var LedgerWalkSkipCountsSchema = object({
9536
+ "live-tail": number().int().nonnegative(),
9537
+ "listing-error": number().int().nonnegative(),
9538
+ "path-mismatch": number().int().nonnegative(),
9539
+ "durable-refused": number().int().nonnegative()
9540
+ });
9541
+ /** One camera's share of a walk, so a report names cameras and not rows. */
9542
+ var LedgerWalkDeviceReportSchema = object({
9543
+ deviceId: number().int(),
9544
+ hoursWalked: number().int().nonnegative(),
9545
+ hoursMissing: number().int().nonnegative(),
9546
+ ghostSegments: number().int().nonnegative(),
9547
+ ghostBytes: number().int().nonnegative(),
9548
+ forgottenSegments: number().int().nonnegative(),
9549
+ orphanFiles: number().int().nonnegative()
9550
+ });
9551
+ /**
9552
+ * What one walk claimed, listed, found and (only when armed) forgot.
9553
+ *
9554
+ * `archiveSegments` is the **M** and `segmentsClaimed` the **N** (D295), so a
9555
+ * walk that saw a fraction of the location is visible in its own report rather
9556
+ * than in the absence of one.
9557
+ */
9558
+ var LedgerWalkReportSchema = object({
9559
+ locationId: string(),
9560
+ applied: boolean(),
9561
+ refused: LedgerWalkRefusalSchema.nullable(),
9562
+ archiveSegments: number().int().nonnegative().nullable(),
9563
+ archiveBytes: number().int().nonnegative().nullable(),
9564
+ hoursClaimed: number().int().nonnegative(),
9565
+ hoursWalked: number().int().nonnegative(),
9566
+ hoursMissing: number().int().nonnegative(),
9567
+ /** `readdir` calls issued — the cost, stated in the unit that is paid. */
9568
+ listings: number().int().nonnegative(),
9569
+ segmentsClaimed: number().int().nonnegative(),
9570
+ ghostSegments: number().int().nonnegative(),
9571
+ ghostBytes: number().int().nonnegative(),
9572
+ ghostHoursWhole: number().int().nonnegative(),
9573
+ forgottenSegments: number().int().nonnegative(),
9574
+ forgottenBytes: number().int().nonnegative(),
9575
+ /** Files under a claimed hour that no durable row names. Never deleted. */
9576
+ orphanFiles: number().int().nonnegative(),
9577
+ orphanSample: array(string()).readonly(),
9578
+ hoursSkipped: number().int().nonnegative(),
9579
+ skippedByReason: LedgerWalkSkipCountsSchema,
9580
+ /** The walk stopped at its per-pass hour bound with claims unwalked. */
9581
+ bounded: boolean(),
9582
+ byDevice: array(LedgerWalkDeviceReportSchema).readonly()
9583
+ });
9485
9584
  /** How many rows a media pass would still act on against a given target — the
9486
9585
  * media lane's denominator AND its residue, from ONE derivation so the two can
9487
9586
  * never disagree. `null` = the count could not be taken. */
@@ -20114,13 +20213,15 @@ var ListGroupsPageSchema = object({
20114
20213
  groups: array(AnalyticsGroupRecordSchema).readonly(),
20115
20214
  nextCursor: string().nullable()
20116
20215
  });
20216
+ var KEY_EVENTS_DEFAULT_LIMIT = 50;
20217
+ var KEY_EVENTS_MAX_LIMIT = 200;
20117
20218
  var KeyEventQueryInput = object({
20118
20219
  deviceId: number(),
20119
20220
  /** Window lower bound (track firstSeen ≥ since). */
20120
20221
  since: number(),
20121
20222
  /** Window upper bound (track firstSeen ≤ until). */
20122
20223
  until: number(),
20123
- limit: number().int().min(1).max(200).default(50),
20224
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
20124
20225
  /** Drop tracks scoring below this importance. */
20125
20226
  minImportance: number().min(0).max(1).optional(),
20126
20227
  /** Restrict to a single class (e.g. 'person'). */
@@ -20142,6 +20243,32 @@ var KeyEventSchema = object({
20142
20243
  ...TrackFlagFields,
20143
20244
  ...TrackRetrainFields
20144
20245
  });
20246
+ /** `getKeyEvents`' window and filters, asked of a SET of cameras at once. */
20247
+ var KeyEventBatchQueryInput = object({
20248
+ deviceIds: array(number()).min(1).max(200),
20249
+ since: number(),
20250
+ until: number(),
20251
+ /** Applied PER CAMERA, exactly as `getKeyEvents.limit` is — never a total
20252
+ * across the set, which would let a busy camera starve a quiet one of its
20253
+ * rows and change what the merged feed contains. */
20254
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
20255
+ minImportance: number().min(0).max(1).optional(),
20256
+ classFilter: string().optional()
20257
+ });
20258
+ /**
20259
+ * One camera's key events in a batch answer.
20260
+ *
20261
+ * The row exists for every requested id. `getKeyEvents` degrades to `[]` on
20262
+ * error rather than throwing, so a camera whose store read failed and one with
20263
+ * no events in the window were ALREADY indistinguishable per camera — the
20264
+ * batch does not make that worse, and the row keeps the deviceId the single
20265
+ * method's output never carried (the caller used to stamp it from the fan-out
20266
+ * key, which only worked because there was one query per camera).
20267
+ */
20268
+ var KeyEventsForDeviceSchema = object({
20269
+ deviceId: number(),
20270
+ events: array(KeyEventSchema).readonly()
20271
+ });
20145
20272
  object({
20146
20273
  trackId: string(),
20147
20274
  className: string(),
@@ -20411,7 +20538,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20411
20538
  until: number().optional(),
20412
20539
  kinds: array(string()).optional(),
20413
20540
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
20414
- }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
20541
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
20415
20542
  deviceId: number(),
20416
20543
  since: number(),
20417
20544
  until: number(),
@@ -29786,6 +29913,9 @@ method(object({
29786
29913
  }), method(RelocateResidueInputSchema, RelocateResidueSchema, {
29787
29914
  kind: "query",
29788
29915
  auth: "admin"
29916
+ }), method(LedgerWalkInputSchema, LedgerWalkReportSchema, {
29917
+ kind: "mutation",
29918
+ auth: "admin"
29789
29919
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
29790
29920
  kind: "mutation",
29791
29921
  auth: "admin"
@@ -30177,6 +30307,25 @@ var SceneMonitorStatusSchema = object({
30177
30307
  monitors: array(SceneMonitorSchema),
30178
30308
  lastFetchedAt: number()
30179
30309
  });
30310
+ /**
30311
+ * One camera's row in a `listScenesBatch` answer.
30312
+ *
30313
+ * `status` is NULLABLE and the nullability is the whole point. `scene-monitor`
30314
+ * is a `defaultActive` wrapper, so every camera is asked; a camera whose
30315
+ * provider is absent (pipeline-analytics not deployed, the post-processing node
30316
+ * down) cannot answer, and that is not the same fact as a camera with no scenes
30317
+ * configured. Fanned out per camera the difference was visible — one query
30318
+ * errored while the others resolved — and a batch that returned only the rows
30319
+ * it managed would have destroyed it, silently, by making an unreachable camera
30320
+ * indistinguishable from one that answered `monitors: []`.
30321
+ *
30322
+ * So: EVERY requested deviceId gets a row. `status: null` means "this camera
30323
+ * could not be read"; `status.monitors: []` means "read, and it has none".
30324
+ */
30325
+ var SceneMonitorStatusForDeviceSchema = object({
30326
+ deviceId: number(),
30327
+ status: SceneMonitorStatusSchema.nullable()
30328
+ });
30180
30329
  var sceneMonitorCapability = {
30181
30330
  name: "scene-monitor",
30182
30331
  scope: "device",
@@ -30186,6 +30335,22 @@ var sceneMonitorCapability = {
30186
30335
  deviceTypes: [DeviceType.Camera],
30187
30336
  methods: {
30188
30337
  listScenes: method(object({ deviceId: number() }), SceneMonitorStatusSchema),
30338
+ /**
30339
+ * The same answer, for a SET of cameras, in one round trip.
30340
+ *
30341
+ * `/scenes` renders every camera and re-reads them on a 30s safety-net
30342
+ * poll behind the push slice. Fanned out client-side that was one query
30343
+ * per camera — 29 round trips through the browser, the hub and the
30344
+ * post-analysis runner every 30 seconds to read an in-memory map the
30345
+ * owner had already merged. The work is unchanged (`statusFor` per
30346
+ * device, all in-process at the owner); what collapses is the transport.
30347
+ *
30348
+ * A camera that cannot answer still gets a row, with `status: null` —
30349
+ * see {@link SceneMonitorStatusForDeviceSchema}. Never fewer rows than
30350
+ * ids: a caller that asked for twenty-nine and got twenty-seven cannot
30351
+ * tell which two are missing, or that any are.
30352
+ */
30353
+ listScenesBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(SceneMonitorStatusForDeviceSchema).readonly()),
30189
30354
  createScene: method(object({
30190
30355
  deviceId: number(),
30191
30356
  label: string(),
@@ -32021,6 +32186,27 @@ var CameraOccupancySnapshotSchema = object({
32021
32186
  stationaryObjects: array(StationaryObjectSchema).readonly().optional()
32022
32187
  });
32023
32188
  /**
32189
+ * One camera's row in a `getCurrentSnapshotBatch` answer.
32190
+ *
32191
+ * THREE outcomes, and the single-camera method could only express two of them
32192
+ * because `snapshot: null` was already spoken for:
32193
+ *
32194
+ * - `read: 'read'`, `snapshot` present — the live occupancy reading.
32195
+ * - `read: 'read'`, `snapshot: null` — read, and this camera has no reading
32196
+ * yet: no frame since boot, and no parked-object registry to hydrate from.
32197
+ * - `read: 'unreadable'` — the owner could not answer for this
32198
+ * camera. `snapshot` is null, and it does NOT mean "nothing parked here".
32199
+ *
32200
+ * Collapsing the last two is the failure this field exists to prevent: a
32201
+ * hydration that threw would otherwise render as an empty Stationary section,
32202
+ * which is a definite claim about a camera nobody could read.
32203
+ */
32204
+ var CameraOccupancySnapshotForDeviceSchema = object({
32205
+ deviceId: number(),
32206
+ read: _enum(["read", "unreadable"]),
32207
+ snapshot: CameraOccupancySnapshotSchema.nullable()
32208
+ });
32209
+ /**
32024
32210
  * Time-series resolution. The history methods return one bucket per
32025
32211
  * step over the requested range. Smaller resolutions cost more
32026
32212
  * memory + bandwidth; bound to discrete steps so caller cannot ask
@@ -32077,6 +32263,20 @@ var zoneAnalyticsCapability = {
32077
32263
  * (no inference result emitted since boot or since binding was
32078
32264
  * activated). */
32079
32265
  getCurrentSnapshot: method(object({ deviceId: number() }), CameraOccupancySnapshotSchema.nullable()),
32266
+ /**
32267
+ * The same snapshot, for a SET of cameras, in one round trip.
32268
+ *
32269
+ * The Events page's Stationary section polls this every 15s for every
32270
+ * selected camera. Fanned out client-side that is one query per camera to
32271
+ * read a `Map.get` at the owner — the answer costs nothing, the round trip
32272
+ * costs everything. Batched, N transports become one and the per-device
32273
+ * work is unchanged.
32274
+ *
32275
+ * Every requested deviceId gets a row, tagged `read` — see
32276
+ * {@link CameraOccupancySnapshotForDeviceSchema}. A camera the owner could
32277
+ * not answer for is `'unreadable'`, never an empty reading.
32278
+ */
32279
+ getCurrentSnapshotBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(CameraOccupancySnapshotForDeviceSchema).readonly()),
32080
32280
  /** Time-series object count inside one zone. `className` optional —
32081
32281
  * omit to count every class in the zone. */
32082
32282
  getZoneHistory: method(object({
@@ -36498,6 +36698,12 @@ Object.freeze({
36498
36698
  addonId: null,
36499
36699
  access: "view"
36500
36700
  },
36701
+ "pipelineAnalytics.getKeyEventsBatch": {
36702
+ capName: "pipeline-analytics",
36703
+ capScope: "device",
36704
+ addonId: null,
36705
+ access: "view"
36706
+ },
36501
36707
  "pipelineAnalytics.getMotionEvents": {
36502
36708
  capName: "pipeline-analytics",
36503
36709
  capScope: "device",
@@ -37674,6 +37880,12 @@ Object.freeze({
37674
37880
  addonId: null,
37675
37881
  access: "view"
37676
37882
  },
37883
+ "recording.reconcileLedgerAgainstDisk": {
37884
+ capName: "recording",
37885
+ capScope: "system",
37886
+ addonId: null,
37887
+ access: "create"
37888
+ },
37677
37889
  "recording.refreshStorageLocationsForMigration": {
37678
37890
  capName: "recording",
37679
37891
  capScope: "system",
@@ -37800,6 +38012,12 @@ Object.freeze({
37800
38012
  addonId: null,
37801
38013
  access: "view"
37802
38014
  },
38015
+ "sceneMonitor.listScenesBatch": {
38016
+ capName: "scene-monitor",
38017
+ capScope: "device",
38018
+ addonId: null,
38019
+ access: "view"
38020
+ },
37803
38021
  "sceneMonitor.recheckNow": {
37804
38022
  capName: "scene-monitor",
37805
38023
  capScope: "device",
@@ -39156,6 +39374,12 @@ Object.freeze({
39156
39374
  addonId: null,
39157
39375
  access: "view"
39158
39376
  },
39377
+ "zoneAnalytics.getCurrentSnapshotBatch": {
39378
+ capName: "zone-analytics",
39379
+ capScope: "device",
39380
+ addonId: null,
39381
+ access: "view"
39382
+ },
39159
39383
  "zoneAnalytics.getUnzonedHistory": {
39160
39384
  capName: "zone-analytics",
39161
39385
  capScope: "device",
@@ -40160,6 +40384,11 @@ Object.freeze({
40160
40384
  form: "single",
40161
40385
  optional: false
40162
40386
  }],
40387
+ "pipelineAnalytics.getKeyEventsBatch": [{
40388
+ name: "deviceIds",
40389
+ form: "array",
40390
+ optional: false
40391
+ }],
40163
40392
  "pipelineAnalytics.getMotionEvents": [{
40164
40393
  name: "deviceId",
40165
40394
  form: "single",
@@ -40600,6 +40829,11 @@ Object.freeze({
40600
40829
  form: "single",
40601
40830
  optional: false
40602
40831
  }],
40832
+ "recording.reconcileLedgerAgainstDisk": [{
40833
+ name: "deviceId",
40834
+ form: "single",
40835
+ optional: true
40836
+ }],
40603
40837
  "recording.relocateFootage": [{
40604
40838
  name: "deviceId",
40605
40839
  form: "single",
@@ -40665,6 +40899,11 @@ Object.freeze({
40665
40899
  form: "single",
40666
40900
  optional: false
40667
40901
  }],
40902
+ "sceneMonitor.listScenesBatch": [{
40903
+ name: "deviceIds",
40904
+ form: "array",
40905
+ optional: false
40906
+ }],
40668
40907
  "sceneMonitor.recheckNow": [{
40669
40908
  name: "deviceId",
40670
40909
  form: "single",
@@ -40926,6 +41165,11 @@ Object.freeze({
40926
41165
  form: "single",
40927
41166
  optional: false
40928
41167
  }],
41168
+ "zoneAnalytics.getCurrentSnapshotBatch": [{
41169
+ name: "deviceIds",
41170
+ form: "array",
41171
+ optional: false
41172
+ }],
40929
41173
  "zoneAnalytics.getUnzonedHistory": [{
40930
41174
  name: "deviceId",
40931
41175
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-petkit",
3
- "version": "0.2.48",
3
+ "version": "0.2.49",
4
4
  "description": "PetKit smart-feeder device-provider addon for CamStack — wraps the @apocaliss92/nodepetkit PetKit cloud client",
5
5
  "keywords": [
6
6
  "camstack",