@camstack/addon-provider-amcrest 0.2.49 → 0.2.50

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
@@ -8011,6 +8011,20 @@ var RelocateJobSchema = object({
8011
8011
  * in its row, not in its name, so `MediaRelocateEngine` never reconciles one.
8012
8012
  */
8013
8013
  rowsReconciled: number().int().nonnegative().optional(),
8014
+ /**
8015
+ * Rows this run FORGOT because the file they name is not on disk.
8016
+ *
8017
+ * The mover derived the path from the row's own fields and `stat`ed it; an
8018
+ * ENOENT there is a per-path confirmation that the segment is gone (D296),
8019
+ * and the durable row is dropped through the same channel eviction uses. It
8020
+ * is reported for the same reason `rowsReconciled` is: this is a durable
8021
+ * mutation nobody asked for, and a migration that quietly erases hour rows is
8022
+ * the same failure as one that quietly skips them (D295).
8023
+ *
8024
+ * The production drain of 2026-08-30 would have reported 11 074 here — the
8025
+ * ledger claimed 5.65 GB of footage that no longer existed.
8026
+ */
8027
+ rowsForgotten: number().int().nonnegative().optional(),
8014
8028
  startedAt: number(),
8015
8029
  finishedAt: number().nullable(),
8016
8030
  error: string().nullable()
@@ -8374,6 +8388,91 @@ var RelocateResidueSchema = object({
8374
8388
  segments: number().int().nonnegative(),
8375
8389
  bytes: number().int().nonnegative()
8376
8390
  }).nullable();
8391
+ /**
8392
+ * Ask one location whether its durable hour rows describe the disk — the walk
8393
+ * (D319).
8394
+ *
8395
+ * `apply` DEFAULTS TO FALSE and that default is the product: the operator's
8396
+ * missing tool is the question, and the dry run is how they sanity-check the
8397
+ * destructive run before authorising it.
8398
+ */
8399
+ var LedgerWalkInputSchema = object({
8400
+ locationId: string().min(1),
8401
+ /** Forget the confirmed-absent rows, rather than only counting them. */
8402
+ apply: boolean().optional(),
8403
+ /** Narrow to one camera. */
8404
+ deviceId: number().int().positive().optional(),
8405
+ /** Narrow to these recording profiles; empty/absent = every profile. */
8406
+ profiles: array(string().min(1)).optional()
8407
+ });
8408
+ /** Why a whole walk did nothing. Every one leaves the ledger untouched. */
8409
+ var LedgerWalkRefusalSchema = _enum([
8410
+ "location-unknown",
8411
+ "source-writable",
8412
+ "no-ledger",
8413
+ "archive-unreadable",
8414
+ "anchor-absent",
8415
+ "anchor-unreadable",
8416
+ "anchor-moved"
8417
+ ]);
8418
+ _enum([
8419
+ "live-tail",
8420
+ "listing-error",
8421
+ "path-mismatch",
8422
+ "durable-refused"
8423
+ ]);
8424
+ /** Every skip reason, always present, always a number — so a reason that never
8425
+ * fired reports as zero rather than absent and the report shape is constant
8426
+ * between passes. Spelled out rather than `z.record` for exactly that. */
8427
+ var LedgerWalkSkipCountsSchema = object({
8428
+ "live-tail": number().int().nonnegative(),
8429
+ "listing-error": number().int().nonnegative(),
8430
+ "path-mismatch": number().int().nonnegative(),
8431
+ "durable-refused": number().int().nonnegative()
8432
+ });
8433
+ /** One camera's share of a walk, so a report names cameras and not rows. */
8434
+ var LedgerWalkDeviceReportSchema = object({
8435
+ deviceId: number().int(),
8436
+ hoursWalked: number().int().nonnegative(),
8437
+ hoursMissing: number().int().nonnegative(),
8438
+ ghostSegments: number().int().nonnegative(),
8439
+ ghostBytes: number().int().nonnegative(),
8440
+ forgottenSegments: number().int().nonnegative(),
8441
+ orphanFiles: number().int().nonnegative()
8442
+ });
8443
+ /**
8444
+ * What one walk claimed, listed, found and (only when armed) forgot.
8445
+ *
8446
+ * `archiveSegments` is the **M** and `segmentsClaimed` the **N** (D295), so a
8447
+ * walk that saw a fraction of the location is visible in its own report rather
8448
+ * than in the absence of one.
8449
+ */
8450
+ var LedgerWalkReportSchema = object({
8451
+ locationId: string(),
8452
+ applied: boolean(),
8453
+ refused: LedgerWalkRefusalSchema.nullable(),
8454
+ archiveSegments: number().int().nonnegative().nullable(),
8455
+ archiveBytes: number().int().nonnegative().nullable(),
8456
+ hoursClaimed: number().int().nonnegative(),
8457
+ hoursWalked: number().int().nonnegative(),
8458
+ hoursMissing: number().int().nonnegative(),
8459
+ /** `readdir` calls issued — the cost, stated in the unit that is paid. */
8460
+ listings: number().int().nonnegative(),
8461
+ segmentsClaimed: number().int().nonnegative(),
8462
+ ghostSegments: number().int().nonnegative(),
8463
+ ghostBytes: number().int().nonnegative(),
8464
+ ghostHoursWhole: number().int().nonnegative(),
8465
+ forgottenSegments: number().int().nonnegative(),
8466
+ forgottenBytes: number().int().nonnegative(),
8467
+ /** Files under a claimed hour that no durable row names. Never deleted. */
8468
+ orphanFiles: number().int().nonnegative(),
8469
+ orphanSample: array(string()).readonly(),
8470
+ hoursSkipped: number().int().nonnegative(),
8471
+ skippedByReason: LedgerWalkSkipCountsSchema,
8472
+ /** The walk stopped at its per-pass hour bound with claims unwalked. */
8473
+ bounded: boolean(),
8474
+ byDevice: array(LedgerWalkDeviceReportSchema).readonly()
8475
+ });
8377
8476
  /** How many rows a media pass would still act on against a given target — the
8378
8477
  * media lane's denominator AND its residue, from ONE derivation so the two can
8379
8478
  * never disagree. `null` = the count could not be taken. */
@@ -18989,13 +19088,15 @@ var ListGroupsPageSchema = object({
18989
19088
  groups: array(AnalyticsGroupRecordSchema).readonly(),
18990
19089
  nextCursor: string().nullable()
18991
19090
  });
19091
+ var KEY_EVENTS_DEFAULT_LIMIT = 50;
19092
+ var KEY_EVENTS_MAX_LIMIT = 200;
18992
19093
  var KeyEventQueryInput = object({
18993
19094
  deviceId: number(),
18994
19095
  /** Window lower bound (track firstSeen ≥ since). */
18995
19096
  since: number(),
18996
19097
  /** Window upper bound (track firstSeen ≤ until). */
18997
19098
  until: number(),
18998
- limit: number().int().min(1).max(200).default(50),
19099
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
18999
19100
  /** Drop tracks scoring below this importance. */
19000
19101
  minImportance: number().min(0).max(1).optional(),
19001
19102
  /** Restrict to a single class (e.g. 'person'). */
@@ -19017,6 +19118,32 @@ var KeyEventSchema = object({
19017
19118
  ...TrackFlagFields,
19018
19119
  ...TrackRetrainFields
19019
19120
  });
19121
+ /** `getKeyEvents`' window and filters, asked of a SET of cameras at once. */
19122
+ var KeyEventBatchQueryInput = object({
19123
+ deviceIds: array(number()).min(1).max(200),
19124
+ since: number(),
19125
+ until: number(),
19126
+ /** Applied PER CAMERA, exactly as `getKeyEvents.limit` is — never a total
19127
+ * across the set, which would let a busy camera starve a quiet one of its
19128
+ * rows and change what the merged feed contains. */
19129
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
19130
+ minImportance: number().min(0).max(1).optional(),
19131
+ classFilter: string().optional()
19132
+ });
19133
+ /**
19134
+ * One camera's key events in a batch answer.
19135
+ *
19136
+ * The row exists for every requested id. `getKeyEvents` degrades to `[]` on
19137
+ * error rather than throwing, so a camera whose store read failed and one with
19138
+ * no events in the window were ALREADY indistinguishable per camera — the
19139
+ * batch does not make that worse, and the row keeps the deviceId the single
19140
+ * method's output never carried (the caller used to stamp it from the fan-out
19141
+ * key, which only worked because there was one query per camera).
19142
+ */
19143
+ var KeyEventsForDeviceSchema = object({
19144
+ deviceId: number(),
19145
+ events: array(KeyEventSchema).readonly()
19146
+ });
19020
19147
  object({
19021
19148
  trackId: string(),
19022
19149
  className: string(),
@@ -19286,7 +19413,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19286
19413
  until: number().optional(),
19287
19414
  kinds: array(string()).optional(),
19288
19415
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
19289
- }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
19416
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
19290
19417
  deviceId: number(),
19291
19418
  since: number(),
19292
19419
  until: number(),
@@ -28845,6 +28972,9 @@ method(object({
28845
28972
  }), method(RelocateResidueInputSchema, RelocateResidueSchema, {
28846
28973
  kind: "query",
28847
28974
  auth: "admin"
28975
+ }), method(LedgerWalkInputSchema, LedgerWalkReportSchema, {
28976
+ kind: "mutation",
28977
+ auth: "admin"
28848
28978
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
28849
28979
  kind: "mutation",
28850
28980
  auth: "admin"
@@ -29236,6 +29366,25 @@ var SceneMonitorStatusSchema = object({
29236
29366
  monitors: array(SceneMonitorSchema),
29237
29367
  lastFetchedAt: number()
29238
29368
  });
29369
+ /**
29370
+ * One camera's row in a `listScenesBatch` answer.
29371
+ *
29372
+ * `status` is NULLABLE and the nullability is the whole point. `scene-monitor`
29373
+ * is a `defaultActive` wrapper, so every camera is asked; a camera whose
29374
+ * provider is absent (pipeline-analytics not deployed, the post-processing node
29375
+ * down) cannot answer, and that is not the same fact as a camera with no scenes
29376
+ * configured. Fanned out per camera the difference was visible — one query
29377
+ * errored while the others resolved — and a batch that returned only the rows
29378
+ * it managed would have destroyed it, silently, by making an unreachable camera
29379
+ * indistinguishable from one that answered `monitors: []`.
29380
+ *
29381
+ * So: EVERY requested deviceId gets a row. `status: null` means "this camera
29382
+ * could not be read"; `status.monitors: []` means "read, and it has none".
29383
+ */
29384
+ var SceneMonitorStatusForDeviceSchema = object({
29385
+ deviceId: number(),
29386
+ status: SceneMonitorStatusSchema.nullable()
29387
+ });
29239
29388
  var sceneMonitorCapability = {
29240
29389
  name: "scene-monitor",
29241
29390
  scope: "device",
@@ -29245,6 +29394,22 @@ var sceneMonitorCapability = {
29245
29394
  deviceTypes: [DeviceType.Camera],
29246
29395
  methods: {
29247
29396
  listScenes: method(object({ deviceId: number() }), SceneMonitorStatusSchema),
29397
+ /**
29398
+ * The same answer, for a SET of cameras, in one round trip.
29399
+ *
29400
+ * `/scenes` renders every camera and re-reads them on a 30s safety-net
29401
+ * poll behind the push slice. Fanned out client-side that was one query
29402
+ * per camera — 29 round trips through the browser, the hub and the
29403
+ * post-analysis runner every 30 seconds to read an in-memory map the
29404
+ * owner had already merged. The work is unchanged (`statusFor` per
29405
+ * device, all in-process at the owner); what collapses is the transport.
29406
+ *
29407
+ * A camera that cannot answer still gets a row, with `status: null` —
29408
+ * see {@link SceneMonitorStatusForDeviceSchema}. Never fewer rows than
29409
+ * ids: a caller that asked for twenty-nine and got twenty-seven cannot
29410
+ * tell which two are missing, or that any are.
29411
+ */
29412
+ listScenesBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(SceneMonitorStatusForDeviceSchema).readonly()),
29248
29413
  createScene: method(object({
29249
29414
  deviceId: number(),
29250
29415
  label: string(),
@@ -31278,6 +31443,27 @@ var CameraOccupancySnapshotSchema = object({
31278
31443
  stationaryObjects: array(StationaryObjectSchema).readonly().optional()
31279
31444
  });
31280
31445
  /**
31446
+ * One camera's row in a `getCurrentSnapshotBatch` answer.
31447
+ *
31448
+ * THREE outcomes, and the single-camera method could only express two of them
31449
+ * because `snapshot: null` was already spoken for:
31450
+ *
31451
+ * - `read: 'read'`, `snapshot` present — the live occupancy reading.
31452
+ * - `read: 'read'`, `snapshot: null` — read, and this camera has no reading
31453
+ * yet: no frame since boot, and no parked-object registry to hydrate from.
31454
+ * - `read: 'unreadable'` — the owner could not answer for this
31455
+ * camera. `snapshot` is null, and it does NOT mean "nothing parked here".
31456
+ *
31457
+ * Collapsing the last two is the failure this field exists to prevent: a
31458
+ * hydration that threw would otherwise render as an empty Stationary section,
31459
+ * which is a definite claim about a camera nobody could read.
31460
+ */
31461
+ var CameraOccupancySnapshotForDeviceSchema = object({
31462
+ deviceId: number(),
31463
+ read: _enum(["read", "unreadable"]),
31464
+ snapshot: CameraOccupancySnapshotSchema.nullable()
31465
+ });
31466
+ /**
31281
31467
  * Time-series resolution. The history methods return one bucket per
31282
31468
  * step over the requested range. Smaller resolutions cost more
31283
31469
  * memory + bandwidth; bound to discrete steps so caller cannot ask
@@ -31334,6 +31520,20 @@ var zoneAnalyticsCapability = {
31334
31520
  * (no inference result emitted since boot or since binding was
31335
31521
  * activated). */
31336
31522
  getCurrentSnapshot: method(object({ deviceId: number() }), CameraOccupancySnapshotSchema.nullable()),
31523
+ /**
31524
+ * The same snapshot, for a SET of cameras, in one round trip.
31525
+ *
31526
+ * The Events page's Stationary section polls this every 15s for every
31527
+ * selected camera. Fanned out client-side that is one query per camera to
31528
+ * read a `Map.get` at the owner — the answer costs nothing, the round trip
31529
+ * costs everything. Batched, N transports become one and the per-device
31530
+ * work is unchanged.
31531
+ *
31532
+ * Every requested deviceId gets a row, tagged `read` — see
31533
+ * {@link CameraOccupancySnapshotForDeviceSchema}. A camera the owner could
31534
+ * not answer for is `'unreadable'`, never an empty reading.
31535
+ */
31536
+ getCurrentSnapshotBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(CameraOccupancySnapshotForDeviceSchema).readonly()),
31337
31537
  /** Time-series object count inside one zone. `className` optional —
31338
31538
  * omit to count every class in the zone. */
31339
31539
  getZoneHistory: method(object({
@@ -35961,6 +36161,12 @@ Object.freeze({
35961
36161
  addonId: null,
35962
36162
  access: "view"
35963
36163
  },
36164
+ "pipelineAnalytics.getKeyEventsBatch": {
36165
+ capName: "pipeline-analytics",
36166
+ capScope: "device",
36167
+ addonId: null,
36168
+ access: "view"
36169
+ },
35964
36170
  "pipelineAnalytics.getMotionEvents": {
35965
36171
  capName: "pipeline-analytics",
35966
36172
  capScope: "device",
@@ -37137,6 +37343,12 @@ Object.freeze({
37137
37343
  addonId: null,
37138
37344
  access: "view"
37139
37345
  },
37346
+ "recording.reconcileLedgerAgainstDisk": {
37347
+ capName: "recording",
37348
+ capScope: "system",
37349
+ addonId: null,
37350
+ access: "create"
37351
+ },
37140
37352
  "recording.refreshStorageLocationsForMigration": {
37141
37353
  capName: "recording",
37142
37354
  capScope: "system",
@@ -37263,6 +37475,12 @@ Object.freeze({
37263
37475
  addonId: null,
37264
37476
  access: "view"
37265
37477
  },
37478
+ "sceneMonitor.listScenesBatch": {
37479
+ capName: "scene-monitor",
37480
+ capScope: "device",
37481
+ addonId: null,
37482
+ access: "view"
37483
+ },
37266
37484
  "sceneMonitor.recheckNow": {
37267
37485
  capName: "scene-monitor",
37268
37486
  capScope: "device",
@@ -38619,6 +38837,12 @@ Object.freeze({
38619
38837
  addonId: null,
38620
38838
  access: "view"
38621
38839
  },
38840
+ "zoneAnalytics.getCurrentSnapshotBatch": {
38841
+ capName: "zone-analytics",
38842
+ capScope: "device",
38843
+ addonId: null,
38844
+ access: "view"
38845
+ },
38622
38846
  "zoneAnalytics.getUnzonedHistory": {
38623
38847
  capName: "zone-analytics",
38624
38848
  capScope: "device",
@@ -39623,6 +39847,11 @@ Object.freeze({
39623
39847
  form: "single",
39624
39848
  optional: false
39625
39849
  }],
39850
+ "pipelineAnalytics.getKeyEventsBatch": [{
39851
+ name: "deviceIds",
39852
+ form: "array",
39853
+ optional: false
39854
+ }],
39626
39855
  "pipelineAnalytics.getMotionEvents": [{
39627
39856
  name: "deviceId",
39628
39857
  form: "single",
@@ -40063,6 +40292,11 @@ Object.freeze({
40063
40292
  form: "single",
40064
40293
  optional: false
40065
40294
  }],
40295
+ "recording.reconcileLedgerAgainstDisk": [{
40296
+ name: "deviceId",
40297
+ form: "single",
40298
+ optional: true
40299
+ }],
40066
40300
  "recording.relocateFootage": [{
40067
40301
  name: "deviceId",
40068
40302
  form: "single",
@@ -40128,6 +40362,11 @@ Object.freeze({
40128
40362
  form: "single",
40129
40363
  optional: false
40130
40364
  }],
40365
+ "sceneMonitor.listScenesBatch": [{
40366
+ name: "deviceIds",
40367
+ form: "array",
40368
+ optional: false
40369
+ }],
40131
40370
  "sceneMonitor.recheckNow": [{
40132
40371
  name: "deviceId",
40133
40372
  form: "single",
@@ -40389,6 +40628,11 @@ Object.freeze({
40389
40628
  form: "single",
40390
40629
  optional: false
40391
40630
  }],
40631
+ "zoneAnalytics.getCurrentSnapshotBatch": [{
40632
+ name: "deviceIds",
40633
+ form: "array",
40634
+ optional: false
40635
+ }],
40392
40636
  "zoneAnalytics.getUnzonedHistory": [{
40393
40637
  name: "deviceId",
40394
40638
  form: "single",
package/dist/addon.mjs CHANGED
@@ -8012,6 +8012,20 @@ var RelocateJobSchema = object({
8012
8012
  * in its row, not in its name, so `MediaRelocateEngine` never reconciles one.
8013
8013
  */
8014
8014
  rowsReconciled: number().int().nonnegative().optional(),
8015
+ /**
8016
+ * Rows this run FORGOT because the file they name is not on disk.
8017
+ *
8018
+ * The mover derived the path from the row's own fields and `stat`ed it; an
8019
+ * ENOENT there is a per-path confirmation that the segment is gone (D296),
8020
+ * and the durable row is dropped through the same channel eviction uses. It
8021
+ * is reported for the same reason `rowsReconciled` is: this is a durable
8022
+ * mutation nobody asked for, and a migration that quietly erases hour rows is
8023
+ * the same failure as one that quietly skips them (D295).
8024
+ *
8025
+ * The production drain of 2026-08-30 would have reported 11 074 here — the
8026
+ * ledger claimed 5.65 GB of footage that no longer existed.
8027
+ */
8028
+ rowsForgotten: number().int().nonnegative().optional(),
8015
8029
  startedAt: number(),
8016
8030
  finishedAt: number().nullable(),
8017
8031
  error: string().nullable()
@@ -8375,6 +8389,91 @@ var RelocateResidueSchema = object({
8375
8389
  segments: number().int().nonnegative(),
8376
8390
  bytes: number().int().nonnegative()
8377
8391
  }).nullable();
8392
+ /**
8393
+ * Ask one location whether its durable hour rows describe the disk — the walk
8394
+ * (D319).
8395
+ *
8396
+ * `apply` DEFAULTS TO FALSE and that default is the product: the operator's
8397
+ * missing tool is the question, and the dry run is how they sanity-check the
8398
+ * destructive run before authorising it.
8399
+ */
8400
+ var LedgerWalkInputSchema = object({
8401
+ locationId: string().min(1),
8402
+ /** Forget the confirmed-absent rows, rather than only counting them. */
8403
+ apply: boolean().optional(),
8404
+ /** Narrow to one camera. */
8405
+ deviceId: number().int().positive().optional(),
8406
+ /** Narrow to these recording profiles; empty/absent = every profile. */
8407
+ profiles: array(string().min(1)).optional()
8408
+ });
8409
+ /** Why a whole walk did nothing. Every one leaves the ledger untouched. */
8410
+ var LedgerWalkRefusalSchema = _enum([
8411
+ "location-unknown",
8412
+ "source-writable",
8413
+ "no-ledger",
8414
+ "archive-unreadable",
8415
+ "anchor-absent",
8416
+ "anchor-unreadable",
8417
+ "anchor-moved"
8418
+ ]);
8419
+ _enum([
8420
+ "live-tail",
8421
+ "listing-error",
8422
+ "path-mismatch",
8423
+ "durable-refused"
8424
+ ]);
8425
+ /** Every skip reason, always present, always a number — so a reason that never
8426
+ * fired reports as zero rather than absent and the report shape is constant
8427
+ * between passes. Spelled out rather than `z.record` for exactly that. */
8428
+ var LedgerWalkSkipCountsSchema = object({
8429
+ "live-tail": number().int().nonnegative(),
8430
+ "listing-error": number().int().nonnegative(),
8431
+ "path-mismatch": number().int().nonnegative(),
8432
+ "durable-refused": number().int().nonnegative()
8433
+ });
8434
+ /** One camera's share of a walk, so a report names cameras and not rows. */
8435
+ var LedgerWalkDeviceReportSchema = object({
8436
+ deviceId: number().int(),
8437
+ hoursWalked: number().int().nonnegative(),
8438
+ hoursMissing: number().int().nonnegative(),
8439
+ ghostSegments: number().int().nonnegative(),
8440
+ ghostBytes: number().int().nonnegative(),
8441
+ forgottenSegments: number().int().nonnegative(),
8442
+ orphanFiles: number().int().nonnegative()
8443
+ });
8444
+ /**
8445
+ * What one walk claimed, listed, found and (only when armed) forgot.
8446
+ *
8447
+ * `archiveSegments` is the **M** and `segmentsClaimed` the **N** (D295), so a
8448
+ * walk that saw a fraction of the location is visible in its own report rather
8449
+ * than in the absence of one.
8450
+ */
8451
+ var LedgerWalkReportSchema = object({
8452
+ locationId: string(),
8453
+ applied: boolean(),
8454
+ refused: LedgerWalkRefusalSchema.nullable(),
8455
+ archiveSegments: number().int().nonnegative().nullable(),
8456
+ archiveBytes: number().int().nonnegative().nullable(),
8457
+ hoursClaimed: number().int().nonnegative(),
8458
+ hoursWalked: number().int().nonnegative(),
8459
+ hoursMissing: number().int().nonnegative(),
8460
+ /** `readdir` calls issued — the cost, stated in the unit that is paid. */
8461
+ listings: number().int().nonnegative(),
8462
+ segmentsClaimed: number().int().nonnegative(),
8463
+ ghostSegments: number().int().nonnegative(),
8464
+ ghostBytes: number().int().nonnegative(),
8465
+ ghostHoursWhole: number().int().nonnegative(),
8466
+ forgottenSegments: number().int().nonnegative(),
8467
+ forgottenBytes: number().int().nonnegative(),
8468
+ /** Files under a claimed hour that no durable row names. Never deleted. */
8469
+ orphanFiles: number().int().nonnegative(),
8470
+ orphanSample: array(string()).readonly(),
8471
+ hoursSkipped: number().int().nonnegative(),
8472
+ skippedByReason: LedgerWalkSkipCountsSchema,
8473
+ /** The walk stopped at its per-pass hour bound with claims unwalked. */
8474
+ bounded: boolean(),
8475
+ byDevice: array(LedgerWalkDeviceReportSchema).readonly()
8476
+ });
8378
8477
  /** How many rows a media pass would still act on against a given target — the
8379
8478
  * media lane's denominator AND its residue, from ONE derivation so the two can
8380
8479
  * never disagree. `null` = the count could not be taken. */
@@ -18990,13 +19089,15 @@ var ListGroupsPageSchema = object({
18990
19089
  groups: array(AnalyticsGroupRecordSchema).readonly(),
18991
19090
  nextCursor: string().nullable()
18992
19091
  });
19092
+ var KEY_EVENTS_DEFAULT_LIMIT = 50;
19093
+ var KEY_EVENTS_MAX_LIMIT = 200;
18993
19094
  var KeyEventQueryInput = object({
18994
19095
  deviceId: number(),
18995
19096
  /** Window lower bound (track firstSeen ≥ since). */
18996
19097
  since: number(),
18997
19098
  /** Window upper bound (track firstSeen ≤ until). */
18998
19099
  until: number(),
18999
- limit: number().int().min(1).max(200).default(50),
19100
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
19000
19101
  /** Drop tracks scoring below this importance. */
19001
19102
  minImportance: number().min(0).max(1).optional(),
19002
19103
  /** Restrict to a single class (e.g. 'person'). */
@@ -19018,6 +19119,32 @@ var KeyEventSchema = object({
19018
19119
  ...TrackFlagFields,
19019
19120
  ...TrackRetrainFields
19020
19121
  });
19122
+ /** `getKeyEvents`' window and filters, asked of a SET of cameras at once. */
19123
+ var KeyEventBatchQueryInput = object({
19124
+ deviceIds: array(number()).min(1).max(200),
19125
+ since: number(),
19126
+ until: number(),
19127
+ /** Applied PER CAMERA, exactly as `getKeyEvents.limit` is — never a total
19128
+ * across the set, which would let a busy camera starve a quiet one of its
19129
+ * rows and change what the merged feed contains. */
19130
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
19131
+ minImportance: number().min(0).max(1).optional(),
19132
+ classFilter: string().optional()
19133
+ });
19134
+ /**
19135
+ * One camera's key events in a batch answer.
19136
+ *
19137
+ * The row exists for every requested id. `getKeyEvents` degrades to `[]` on
19138
+ * error rather than throwing, so a camera whose store read failed and one with
19139
+ * no events in the window were ALREADY indistinguishable per camera — the
19140
+ * batch does not make that worse, and the row keeps the deviceId the single
19141
+ * method's output never carried (the caller used to stamp it from the fan-out
19142
+ * key, which only worked because there was one query per camera).
19143
+ */
19144
+ var KeyEventsForDeviceSchema = object({
19145
+ deviceId: number(),
19146
+ events: array(KeyEventSchema).readonly()
19147
+ });
19021
19148
  object({
19022
19149
  trackId: string(),
19023
19150
  className: string(),
@@ -19287,7 +19414,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19287
19414
  until: number().optional(),
19288
19415
  kinds: array(string()).optional(),
19289
19416
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
19290
- }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
19417
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
19291
19418
  deviceId: number(),
19292
19419
  since: number(),
19293
19420
  until: number(),
@@ -28846,6 +28973,9 @@ method(object({
28846
28973
  }), method(RelocateResidueInputSchema, RelocateResidueSchema, {
28847
28974
  kind: "query",
28848
28975
  auth: "admin"
28976
+ }), method(LedgerWalkInputSchema, LedgerWalkReportSchema, {
28977
+ kind: "mutation",
28978
+ auth: "admin"
28849
28979
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
28850
28980
  kind: "mutation",
28851
28981
  auth: "admin"
@@ -29237,6 +29367,25 @@ var SceneMonitorStatusSchema = object({
29237
29367
  monitors: array(SceneMonitorSchema),
29238
29368
  lastFetchedAt: number()
29239
29369
  });
29370
+ /**
29371
+ * One camera's row in a `listScenesBatch` answer.
29372
+ *
29373
+ * `status` is NULLABLE and the nullability is the whole point. `scene-monitor`
29374
+ * is a `defaultActive` wrapper, so every camera is asked; a camera whose
29375
+ * provider is absent (pipeline-analytics not deployed, the post-processing node
29376
+ * down) cannot answer, and that is not the same fact as a camera with no scenes
29377
+ * configured. Fanned out per camera the difference was visible — one query
29378
+ * errored while the others resolved — and a batch that returned only the rows
29379
+ * it managed would have destroyed it, silently, by making an unreachable camera
29380
+ * indistinguishable from one that answered `monitors: []`.
29381
+ *
29382
+ * So: EVERY requested deviceId gets a row. `status: null` means "this camera
29383
+ * could not be read"; `status.monitors: []` means "read, and it has none".
29384
+ */
29385
+ var SceneMonitorStatusForDeviceSchema = object({
29386
+ deviceId: number(),
29387
+ status: SceneMonitorStatusSchema.nullable()
29388
+ });
29240
29389
  var sceneMonitorCapability = {
29241
29390
  name: "scene-monitor",
29242
29391
  scope: "device",
@@ -29246,6 +29395,22 @@ var sceneMonitorCapability = {
29246
29395
  deviceTypes: [DeviceType.Camera],
29247
29396
  methods: {
29248
29397
  listScenes: method(object({ deviceId: number() }), SceneMonitorStatusSchema),
29398
+ /**
29399
+ * The same answer, for a SET of cameras, in one round trip.
29400
+ *
29401
+ * `/scenes` renders every camera and re-reads them on a 30s safety-net
29402
+ * poll behind the push slice. Fanned out client-side that was one query
29403
+ * per camera — 29 round trips through the browser, the hub and the
29404
+ * post-analysis runner every 30 seconds to read an in-memory map the
29405
+ * owner had already merged. The work is unchanged (`statusFor` per
29406
+ * device, all in-process at the owner); what collapses is the transport.
29407
+ *
29408
+ * A camera that cannot answer still gets a row, with `status: null` —
29409
+ * see {@link SceneMonitorStatusForDeviceSchema}. Never fewer rows than
29410
+ * ids: a caller that asked for twenty-nine and got twenty-seven cannot
29411
+ * tell which two are missing, or that any are.
29412
+ */
29413
+ listScenesBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(SceneMonitorStatusForDeviceSchema).readonly()),
29249
29414
  createScene: method(object({
29250
29415
  deviceId: number(),
29251
29416
  label: string(),
@@ -31279,6 +31444,27 @@ var CameraOccupancySnapshotSchema = object({
31279
31444
  stationaryObjects: array(StationaryObjectSchema).readonly().optional()
31280
31445
  });
31281
31446
  /**
31447
+ * One camera's row in a `getCurrentSnapshotBatch` answer.
31448
+ *
31449
+ * THREE outcomes, and the single-camera method could only express two of them
31450
+ * because `snapshot: null` was already spoken for:
31451
+ *
31452
+ * - `read: 'read'`, `snapshot` present — the live occupancy reading.
31453
+ * - `read: 'read'`, `snapshot: null` — read, and this camera has no reading
31454
+ * yet: no frame since boot, and no parked-object registry to hydrate from.
31455
+ * - `read: 'unreadable'` — the owner could not answer for this
31456
+ * camera. `snapshot` is null, and it does NOT mean "nothing parked here".
31457
+ *
31458
+ * Collapsing the last two is the failure this field exists to prevent: a
31459
+ * hydration that threw would otherwise render as an empty Stationary section,
31460
+ * which is a definite claim about a camera nobody could read.
31461
+ */
31462
+ var CameraOccupancySnapshotForDeviceSchema = object({
31463
+ deviceId: number(),
31464
+ read: _enum(["read", "unreadable"]),
31465
+ snapshot: CameraOccupancySnapshotSchema.nullable()
31466
+ });
31467
+ /**
31282
31468
  * Time-series resolution. The history methods return one bucket per
31283
31469
  * step over the requested range. Smaller resolutions cost more
31284
31470
  * memory + bandwidth; bound to discrete steps so caller cannot ask
@@ -31335,6 +31521,20 @@ var zoneAnalyticsCapability = {
31335
31521
  * (no inference result emitted since boot or since binding was
31336
31522
  * activated). */
31337
31523
  getCurrentSnapshot: method(object({ deviceId: number() }), CameraOccupancySnapshotSchema.nullable()),
31524
+ /**
31525
+ * The same snapshot, for a SET of cameras, in one round trip.
31526
+ *
31527
+ * The Events page's Stationary section polls this every 15s for every
31528
+ * selected camera. Fanned out client-side that is one query per camera to
31529
+ * read a `Map.get` at the owner — the answer costs nothing, the round trip
31530
+ * costs everything. Batched, N transports become one and the per-device
31531
+ * work is unchanged.
31532
+ *
31533
+ * Every requested deviceId gets a row, tagged `read` — see
31534
+ * {@link CameraOccupancySnapshotForDeviceSchema}. A camera the owner could
31535
+ * not answer for is `'unreadable'`, never an empty reading.
31536
+ */
31537
+ getCurrentSnapshotBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(CameraOccupancySnapshotForDeviceSchema).readonly()),
31338
31538
  /** Time-series object count inside one zone. `className` optional —
31339
31539
  * omit to count every class in the zone. */
31340
31540
  getZoneHistory: method(object({
@@ -35962,6 +36162,12 @@ Object.freeze({
35962
36162
  addonId: null,
35963
36163
  access: "view"
35964
36164
  },
36165
+ "pipelineAnalytics.getKeyEventsBatch": {
36166
+ capName: "pipeline-analytics",
36167
+ capScope: "device",
36168
+ addonId: null,
36169
+ access: "view"
36170
+ },
35965
36171
  "pipelineAnalytics.getMotionEvents": {
35966
36172
  capName: "pipeline-analytics",
35967
36173
  capScope: "device",
@@ -37138,6 +37344,12 @@ Object.freeze({
37138
37344
  addonId: null,
37139
37345
  access: "view"
37140
37346
  },
37347
+ "recording.reconcileLedgerAgainstDisk": {
37348
+ capName: "recording",
37349
+ capScope: "system",
37350
+ addonId: null,
37351
+ access: "create"
37352
+ },
37141
37353
  "recording.refreshStorageLocationsForMigration": {
37142
37354
  capName: "recording",
37143
37355
  capScope: "system",
@@ -37264,6 +37476,12 @@ Object.freeze({
37264
37476
  addonId: null,
37265
37477
  access: "view"
37266
37478
  },
37479
+ "sceneMonitor.listScenesBatch": {
37480
+ capName: "scene-monitor",
37481
+ capScope: "device",
37482
+ addonId: null,
37483
+ access: "view"
37484
+ },
37267
37485
  "sceneMonitor.recheckNow": {
37268
37486
  capName: "scene-monitor",
37269
37487
  capScope: "device",
@@ -38620,6 +38838,12 @@ Object.freeze({
38620
38838
  addonId: null,
38621
38839
  access: "view"
38622
38840
  },
38841
+ "zoneAnalytics.getCurrentSnapshotBatch": {
38842
+ capName: "zone-analytics",
38843
+ capScope: "device",
38844
+ addonId: null,
38845
+ access: "view"
38846
+ },
38623
38847
  "zoneAnalytics.getUnzonedHistory": {
38624
38848
  capName: "zone-analytics",
38625
38849
  capScope: "device",
@@ -39624,6 +39848,11 @@ Object.freeze({
39624
39848
  form: "single",
39625
39849
  optional: false
39626
39850
  }],
39851
+ "pipelineAnalytics.getKeyEventsBatch": [{
39852
+ name: "deviceIds",
39853
+ form: "array",
39854
+ optional: false
39855
+ }],
39627
39856
  "pipelineAnalytics.getMotionEvents": [{
39628
39857
  name: "deviceId",
39629
39858
  form: "single",
@@ -40064,6 +40293,11 @@ Object.freeze({
40064
40293
  form: "single",
40065
40294
  optional: false
40066
40295
  }],
40296
+ "recording.reconcileLedgerAgainstDisk": [{
40297
+ name: "deviceId",
40298
+ form: "single",
40299
+ optional: true
40300
+ }],
40067
40301
  "recording.relocateFootage": [{
40068
40302
  name: "deviceId",
40069
40303
  form: "single",
@@ -40129,6 +40363,11 @@ Object.freeze({
40129
40363
  form: "single",
40130
40364
  optional: false
40131
40365
  }],
40366
+ "sceneMonitor.listScenesBatch": [{
40367
+ name: "deviceIds",
40368
+ form: "array",
40369
+ optional: false
40370
+ }],
40132
40371
  "sceneMonitor.recheckNow": [{
40133
40372
  name: "deviceId",
40134
40373
  form: "single",
@@ -40390,6 +40629,11 @@ Object.freeze({
40390
40629
  form: "single",
40391
40630
  optional: false
40392
40631
  }],
40632
+ "zoneAnalytics.getCurrentSnapshotBatch": [{
40633
+ name: "deviceIds",
40634
+ form: "array",
40635
+ optional: false
40636
+ }],
40393
40637
  "zoneAnalytics.getUnzonedHistory": [{
40394
40638
  name: "deviceId",
40395
40639
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-amcrest",
3
- "version": "0.2.49",
3
+ "version": "0.2.50",
4
4
  "description": "Amcrest/Dahua camera device provider addon for CamStack — Dahua CGI over HTTP(S) with digest auth (snapshot, RTSP catalog, PTZ, image/day-night config)",
5
5
  "keywords": [
6
6
  "camstack",