@camstack/addon-provider-unifi 0.2.48 → 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.
Files changed (3) hide show
  1. package/dist/addon.js +478 -73
  2. package/dist/addon.mjs +478 -73
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -8017,6 +8017,20 @@ var RelocateJobSchema = object({
8017
8017
  * in its row, not in its name, so `MediaRelocateEngine` never reconciles one.
8018
8018
  */
8019
8019
  rowsReconciled: number().int().nonnegative().optional(),
8020
+ /**
8021
+ * Rows this run FORGOT because the file they name is not on disk.
8022
+ *
8023
+ * The mover derived the path from the row's own fields and `stat`ed it; an
8024
+ * ENOENT there is a per-path confirmation that the segment is gone (D296),
8025
+ * and the durable row is dropped through the same channel eviction uses. It
8026
+ * is reported for the same reason `rowsReconciled` is: this is a durable
8027
+ * mutation nobody asked for, and a migration that quietly erases hour rows is
8028
+ * the same failure as one that quietly skips them (D295).
8029
+ *
8030
+ * The production drain of 2026-08-30 would have reported 11 074 here — the
8031
+ * ledger claimed 5.65 GB of footage that no longer existed.
8032
+ */
8033
+ rowsForgotten: number().int().nonnegative().optional(),
8020
8034
  startedAt: number(),
8021
8035
  finishedAt: number().nullable(),
8022
8036
  error: string().nullable()
@@ -8081,6 +8095,13 @@ var MediaRelocateModeSchema = _enum([
8081
8095
  ]);
8082
8096
  var RelocateMediaInputSchema = object({
8083
8097
  toLocationId: string(),
8098
+ /**
8099
+ * Restrict the pass to rows currently on this location. Omitted / `'*'` =
8100
+ * every row that is not already on `toLocationId` (the historical
8101
+ * behaviour). A named source is what a from→to migration needs: without it
8102
+ * "move events off disk 2" also emptied disk 1.
8103
+ */
8104
+ fromLocationId: string().optional(),
8084
8105
  throttleMbps: number().min(1).max(1e3).optional(),
8085
8106
  /** Omitted = `move`, the pre-existing behaviour. */
8086
8107
  mode: MediaRelocateModeSchema.optional()
@@ -8148,6 +8169,19 @@ var StorageMigrationDestinationsSchema = object({
8148
8169
  galleryMedia: string().min(1).optional()
8149
8170
  }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
8150
8171
  /**
8172
+ * Optional named source per class. Omitted = the class's current default
8173
+ * (the historical behaviour). A named source that is NOT the default is a
8174
+ * drain of that disk: bytes move, the default stays, and the source is
8175
+ * disabled when the move finishes.
8176
+ */
8177
+ var StorageMigrationSourcesSchema = object({
8178
+ recordings: string().min(1).optional(),
8179
+ recordingsLow: string().min(1).optional(),
8180
+ eventMedia: string().min(1).optional(),
8181
+ backups: string().min(1).optional(),
8182
+ galleryMedia: string().min(1).optional()
8183
+ }).optional();
8184
+ /**
8151
8185
  * How a migration sequences the cutover against the byte move.
8152
8186
  *
8153
8187
  * - `blocking` — the historical order: pause, move every byte, repoint,
@@ -8169,6 +8203,8 @@ var StorageMigrationModeSchema = _enum(["blocking", "nonBlocking"]);
8169
8203
  /** Shared input for planning and starting an orchestrated storage migration. */
8170
8204
  var StorageMigrationInputSchema = object({
8171
8205
  destinations: StorageMigrationDestinationsSchema,
8206
+ /** Omitted = each class's current default. */
8207
+ sources: StorageMigrationSourcesSchema,
8172
8208
  throttleMbps: number().min(1).max(1e3).optional(),
8173
8209
  /** Omitted = `blocking`, which stays the default. */
8174
8210
  mode: StorageMigrationModeSchema.optional()
@@ -8248,6 +8284,13 @@ var StorageMigrationMoveSchema = object({
8248
8284
  storageClass: StorageMigrationClassSchema,
8249
8285
  fromLocationId: string(),
8250
8286
  toLocationId: string(),
8287
+ /**
8288
+ * True when `from` was NOT the class default at plan time. The move still
8289
+ * copies bytes, but the default is left alone and the source is disabled
8290
+ * once the copy verifies. Absent on jobs planned before this field existed
8291
+ * — those jobs always repointed, which is `false`.
8292
+ */
8293
+ freezeSource: boolean().optional(),
8251
8294
  moverJobId: string().nullable(),
8252
8295
  state: RelocateJobStateSchema.nullable(),
8253
8296
  error: string().nullable(),
@@ -8261,6 +8304,7 @@ var StorageMigrationJobSchema = object({
8261
8304
  * can tell a seconds-long cutover from a thirty-hour one. */
8262
8305
  mode: StorageMigrationModeSchema,
8263
8306
  destinations: StorageMigrationDestinationsSchema,
8307
+ sources: StorageMigrationSourcesSchema,
8264
8308
  throttleMbps: number(),
8265
8309
  moves: array(StorageMigrationMoveSchema),
8266
8310
  pauseLeaseId: string().nullable(),
@@ -8286,6 +8330,7 @@ var StorageMigrationFindingSchema = object({
8286
8330
  });
8287
8331
  var StorageMigrationPlanSchema = object({
8288
8332
  destinations: StorageMigrationDestinationsSchema,
8333
+ sources: StorageMigrationSourcesSchema,
8289
8334
  /** The mode this plan was built for. A plan is only valid for its mode: the
8290
8335
  * `eventMedia` seal gate and the single-cardinality refusal both depend on
8291
8336
  * it. */
@@ -8293,7 +8338,8 @@ var StorageMigrationPlanSchema = object({
8293
8338
  moves: array(object({
8294
8339
  storageClass: StorageMigrationClassSchema,
8295
8340
  fromLocationId: string(),
8296
- toLocationId: string()
8341
+ toLocationId: string(),
8342
+ freezeSource: boolean().optional()
8297
8343
  })),
8298
8344
  findings: array(StorageMigrationFindingSchema)
8299
8345
  });
@@ -8380,16 +8426,142 @@ var RelocateResidueSchema = object({
8380
8426
  segments: number().int().nonnegative(),
8381
8427
  bytes: number().int().nonnegative()
8382
8428
  }).nullable();
8429
+ /**
8430
+ * Ask one location whether its durable hour rows describe the disk — the walk
8431
+ * (D319).
8432
+ *
8433
+ * `apply` DEFAULTS TO FALSE and that default is the product: the operator's
8434
+ * missing tool is the question, and the dry run is how they sanity-check the
8435
+ * destructive run before authorising it.
8436
+ */
8437
+ var LedgerWalkInputSchema = object({
8438
+ locationId: string().min(1),
8439
+ /** Forget the confirmed-absent rows, rather than only counting them. */
8440
+ apply: boolean().optional(),
8441
+ /** Narrow to one camera. */
8442
+ deviceId: number().int().positive().optional(),
8443
+ /** Narrow to these recording profiles; empty/absent = every profile. */
8444
+ profiles: array(string().min(1)).optional()
8445
+ });
8446
+ /** Why a whole walk did nothing. Every one leaves the ledger untouched. */
8447
+ var LedgerWalkRefusalSchema = _enum([
8448
+ "location-unknown",
8449
+ "source-writable",
8450
+ "no-ledger",
8451
+ "archive-unreadable",
8452
+ "anchor-absent",
8453
+ "anchor-unreadable",
8454
+ "anchor-moved"
8455
+ ]);
8456
+ _enum([
8457
+ "live-tail",
8458
+ "listing-error",
8459
+ "path-mismatch",
8460
+ "durable-refused"
8461
+ ]);
8462
+ /** Every skip reason, always present, always a number — so a reason that never
8463
+ * fired reports as zero rather than absent and the report shape is constant
8464
+ * between passes. Spelled out rather than `z.record` for exactly that. */
8465
+ var LedgerWalkSkipCountsSchema = object({
8466
+ "live-tail": number().int().nonnegative(),
8467
+ "listing-error": number().int().nonnegative(),
8468
+ "path-mismatch": number().int().nonnegative(),
8469
+ "durable-refused": number().int().nonnegative()
8470
+ });
8471
+ /** One camera's share of a walk, so a report names cameras and not rows. */
8472
+ var LedgerWalkDeviceReportSchema = object({
8473
+ deviceId: number().int(),
8474
+ hoursWalked: number().int().nonnegative(),
8475
+ hoursMissing: number().int().nonnegative(),
8476
+ ghostSegments: number().int().nonnegative(),
8477
+ ghostBytes: number().int().nonnegative(),
8478
+ forgottenSegments: number().int().nonnegative(),
8479
+ orphanFiles: number().int().nonnegative()
8480
+ });
8481
+ /**
8482
+ * What one walk claimed, listed, found and (only when armed) forgot.
8483
+ *
8484
+ * `archiveSegments` is the **M** and `segmentsClaimed` the **N** (D295), so a
8485
+ * walk that saw a fraction of the location is visible in its own report rather
8486
+ * than in the absence of one.
8487
+ */
8488
+ var LedgerWalkReportSchema = object({
8489
+ locationId: string(),
8490
+ applied: boolean(),
8491
+ refused: LedgerWalkRefusalSchema.nullable(),
8492
+ archiveSegments: number().int().nonnegative().nullable(),
8493
+ archiveBytes: number().int().nonnegative().nullable(),
8494
+ hoursClaimed: number().int().nonnegative(),
8495
+ hoursWalked: number().int().nonnegative(),
8496
+ hoursMissing: number().int().nonnegative(),
8497
+ /** `readdir` calls issued — the cost, stated in the unit that is paid. */
8498
+ listings: number().int().nonnegative(),
8499
+ segmentsClaimed: number().int().nonnegative(),
8500
+ ghostSegments: number().int().nonnegative(),
8501
+ ghostBytes: number().int().nonnegative(),
8502
+ ghostHoursWhole: number().int().nonnegative(),
8503
+ forgottenSegments: number().int().nonnegative(),
8504
+ forgottenBytes: number().int().nonnegative(),
8505
+ /** Files under a claimed hour that no durable row names. Never deleted. */
8506
+ orphanFiles: number().int().nonnegative(),
8507
+ orphanSample: array(string()).readonly(),
8508
+ hoursSkipped: number().int().nonnegative(),
8509
+ skippedByReason: LedgerWalkSkipCountsSchema,
8510
+ /** The walk stopped at its per-pass hour bound with claims unwalked. */
8511
+ bounded: boolean(),
8512
+ byDevice: array(LedgerWalkDeviceReportSchema).readonly()
8513
+ });
8383
8514
  /** How many rows a media pass would still act on against a given target — the
8384
8515
  * media lane's denominator AND its residue, from ONE derivation so the two can
8385
8516
  * never disagree. `null` = the count could not be taken. */
8386
8517
  var RelocatableMediaCountSchema = object({ rows: number().int().nonnegative() }).nullable();
8387
8518
  var RelocatableMediaCountInputSchema = object({
8388
8519
  toLocationId: string().min(1),
8520
+ /** Restrict the count to one source; omitted / `'*'` = every non-target row. */
8521
+ fromLocationId: string().optional(),
8389
8522
  /** Omitted = `move`. */
8390
8523
  mode: MediaRelocateModeSchema.optional()
8391
8524
  });
8392
8525
  /**
8526
+ * Operator cleanup of leftover analytics rows, optional debug media, and
8527
+ * ghost ledger entries on frozen footage locations.
8528
+ *
8529
+ * A pass is tens of minutes on a standing backlog. The hub method RETURNS
8530
+ * `{ jobId }` immediately; progress is `cleanupStatus`. Awaiting the work
8531
+ * is how `addons.custom` hit the 60 s UDS deadline while reclaim continued
8532
+ * with no operator-visible status.
8533
+ */
8534
+ var StorageCleanupPhaseSchema = _enum([
8535
+ "orphans",
8536
+ "debug-media",
8537
+ "ghost-ledger",
8538
+ "done",
8539
+ "failed",
8540
+ "cancelled"
8541
+ ]);
8542
+ var StorageCleanupInputSchema = object({
8543
+ /** Also walk motion stills / track filmstrips. Off by default. */
8544
+ includeDebugMedia: boolean().optional() });
8545
+ var StorageCleanupJobSchema = object({
8546
+ jobId: string(),
8547
+ phase: StorageCleanupPhaseSchema,
8548
+ includeDebugMedia: boolean(),
8549
+ orphansReclaimed: number().int().nonnegative(),
8550
+ orphanBytesReclaimed: number().int().nonnegative(),
8551
+ debugMediaReclaimed: number().int().nonnegative(),
8552
+ debugMediaBytesReclaimed: number().int().nonnegative(),
8553
+ ghostsForgotten: number().int().nonnegative(),
8554
+ ghostBytesForgotten: number().int().nonnegative(),
8555
+ /** Short operator-facing line: current collection, pass, or location. */
8556
+ detail: string().nullable(),
8557
+ cancelRequested: boolean(),
8558
+ startedAt: number(),
8559
+ updatedAt: number(),
8560
+ finishedAt: number().nullable(),
8561
+ error: string().nullable()
8562
+ });
8563
+ var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8564
+ /**
8393
8565
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8394
8566
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8395
8567
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8417,11 +8589,10 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
8417
8589
  * The default location for a type uses `id === <type>:default` by
8418
8590
  * convention (the bare type ref like `'backups'` resolves to it).
8419
8591
  *
8420
- * `isSystem: true` marks a location as orchestrator-seeded and
8421
- * undeletable. The bootstrap-installed defaults (one per type) carry
8422
- * this flag; operator-added locations don't. Editing the config of
8423
- * a system location is allowed (path migration, provider swap) but
8424
- * deleting it is rejected at the cap level.
8592
+ * `isSystem` is a legacy persisted flag. Seed still creates the initial
8593
+ * `<type>:default` locations; the flag is no longer a lock, a badge, or a
8594
+ * prune selector. New writes leave it false. Deletion is gated on uniqueness
8595
+ * / last-enabled, not on this bit.
8425
8596
  */
8426
8597
  var StorageLocationSchema = object({
8427
8598
  id: string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),
@@ -12947,6 +13118,12 @@ method(object({
12947
13118
  }), _void(), {
12948
13119
  kind: "mutation",
12949
13120
  auth: "admin"
13121
+ }), method(object({
13122
+ from: string(),
13123
+ to: string()
13124
+ }), object({ moved: number() }), {
13125
+ kind: "mutation",
13126
+ auth: "admin"
12950
13127
  }), method(object({
12951
13128
  deviceId: number(),
12952
13129
  disabled: boolean()
@@ -18955,53 +19132,15 @@ var RecentTracksPageSchema = object({
18955
19132
  /** Cursor for the next page, or null when this page is the last. */
18956
19133
  nextCursor: string().nullable()
18957
19134
  });
18958
- var LIST_GROUPS_DEFAULT_LIMIT = 40;
18959
- var LIST_GROUPS_MAX_LIMIT = 100;
18960
- var AnalyticsGroupRecordSchema = object({
18961
- id: string(),
18962
- deviceId: number().int(),
18963
- openedAt: number().int(),
18964
- closedAt: number().int(),
18965
- timestamp: number().int(),
18966
- memberCount: number().int(),
18967
- memberTrackIds: array(string()).readonly(),
18968
- className: string(),
18969
- classes: array(string()).readonly(),
18970
- /** Relative event-media path, or null when the group has no picture yet. */
18971
- mediaUrl: string().nullable(),
18972
- singleton: boolean()
18973
- });
18974
- var AnalyticsGroupMemberSchema = object({
18975
- trackId: string(),
18976
- deviceId: number().int(),
18977
- className: string(),
18978
- firstSeen: number().int(),
18979
- lastSeen: number().int(),
18980
- mediaUrl: string().nullable()
18981
- });
18982
- var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
18983
- var ListGroupsQueryInput = object({
18984
- /** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
18985
- deviceIds: array(number()),
18986
- /** Window lower bound on `closedAt` (inclusive). */
18987
- since: number().optional(),
18988
- /** Window upper bound on `openedAt` (inclusive). */
18989
- until: number().optional(),
18990
- limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
18991
- /** Opaque continuation cursor from a previous page's `nextCursor`. */
18992
- cursor: string().optional()
18993
- });
18994
- var ListGroupsPageSchema = object({
18995
- groups: array(AnalyticsGroupRecordSchema).readonly(),
18996
- nextCursor: string().nullable()
18997
- });
19135
+ var KEY_EVENTS_DEFAULT_LIMIT = 50;
19136
+ var KEY_EVENTS_MAX_LIMIT = 200;
18998
19137
  var KeyEventQueryInput = object({
18999
19138
  deviceId: number(),
19000
19139
  /** Window lower bound (track firstSeen ≥ since). */
19001
19140
  since: number(),
19002
19141
  /** Window upper bound (track firstSeen ≤ until). */
19003
19142
  until: number(),
19004
- limit: number().int().min(1).max(200).default(50),
19143
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
19005
19144
  /** Drop tracks scoring below this importance. */
19006
19145
  minImportance: number().min(0).max(1).optional(),
19007
19146
  /** Restrict to a single class (e.g. 'person'). */
@@ -19023,6 +19162,32 @@ var KeyEventSchema = object({
19023
19162
  ...TrackFlagFields,
19024
19163
  ...TrackRetrainFields
19025
19164
  });
19165
+ /** `getKeyEvents`' window and filters, asked of a SET of cameras at once. */
19166
+ var KeyEventBatchQueryInput = object({
19167
+ deviceIds: array(number()).min(1).max(200),
19168
+ since: number(),
19169
+ until: number(),
19170
+ /** Applied PER CAMERA, exactly as `getKeyEvents.limit` is — never a total
19171
+ * across the set, which would let a busy camera starve a quiet one of its
19172
+ * rows and change what the merged feed contains. */
19173
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
19174
+ minImportance: number().min(0).max(1).optional(),
19175
+ classFilter: string().optional()
19176
+ });
19177
+ /**
19178
+ * One camera's key events in a batch answer.
19179
+ *
19180
+ * The row exists for every requested id. `getKeyEvents` degrades to `[]` on
19181
+ * error rather than throwing, so a camera whose store read failed and one with
19182
+ * no events in the window were ALREADY indistinguishable per camera — the
19183
+ * batch does not make that worse, and the row keeps the deviceId the single
19184
+ * method's output never carried (the caller used to stamp it from the fan-out
19185
+ * key, which only worked because there was one query per camera).
19186
+ */
19187
+ var KeyEventsForDeviceSchema = object({
19188
+ deviceId: number(),
19189
+ events: array(KeyEventSchema).readonly()
19190
+ });
19026
19191
  object({
19027
19192
  trackId: string(),
19028
19193
  className: string(),
@@ -19070,9 +19235,7 @@ var TrackCascadeCountsSchema = object({
19070
19235
  /** Unassigned plate reads removed (best-effort; plate leg deferred to plate-intelligence). */
19071
19236
  plates: number().int(),
19072
19237
  /** Per-track CLIP search vectors removed (best-effort). */
19073
- embeddings: number().int(),
19074
- /** Group membership + group rows removed with their last member (best-effort). */
19075
- groups: number().int()
19238
+ embeddings: number().int()
19076
19239
  });
19077
19240
  /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
19078
19241
  var DiskReconcileCountsSchema = object({
@@ -19242,6 +19405,47 @@ var RebuildStatusSchema = object({
19242
19405
  /** Present when the pass ended by throwing. */
19243
19406
  error: string().nullable()
19244
19407
  });
19408
+ /**
19409
+ * Acknowledgement that a debug-media reclaim STARTED.
19410
+ *
19411
+ * The pass is paced at ~2 MB/s over a standing 100 GB — tens of minutes — so
19412
+ * it runs detached and this returns immediately. Awaiting it is how the
19413
+ * `addons.custom` door hit the 60 s UDS deadline while the walk carried on
19414
+ * with no status. Poll {@link pipelineAnalyticsCapability.methods.getMediaReclaimStatus}.
19415
+ */
19416
+ var MediaReclaimStartResultSchema = object({
19417
+ started: boolean(),
19418
+ /** True when a pass was already running; the new request is ignored. */
19419
+ alreadyRunning: boolean()
19420
+ });
19421
+ var MediaReclaimInputSchema = object({
19422
+ mode: _enum(["report", "reclaim"]).default("report"),
19423
+ scopes: array(_enum(["motion-still", "track-filmstrip"])).min(1).optional(),
19424
+ deviceIds: array(number().int()).min(1).optional(),
19425
+ restart: boolean().optional(),
19426
+ pageSize: number().int().min(50).max(5e3).optional(),
19427
+ maxRowsPerDevice: number().int().min(1).max(5e5).optional(),
19428
+ maxReclaimPerDevice: number().int().min(1).max(5e5).optional(),
19429
+ maxBytesPerRun: number().int().min(1).optional(),
19430
+ budgetMinutes: number().int().min(1).max(720).optional(),
19431
+ throttleBytesPerSec: number().int().min(64 * 1024).optional(),
19432
+ graceMinutes: number().int().min(1).max(10080).optional()
19433
+ });
19434
+ var MediaReclaimStatusSchema = object({
19435
+ running: boolean(),
19436
+ mode: _enum(["report", "reclaim"]).nullable(),
19437
+ totalExamined: number(),
19438
+ totalEligible: number(),
19439
+ totalReclaimed: number(),
19440
+ totalBytesReclaimed: number(),
19441
+ totalRefused: number(),
19442
+ /** Device+scope windows finished in this pass. */
19443
+ devicesDone: number(),
19444
+ complete: boolean().nullable(),
19445
+ startedAtMs: number().nullable(),
19446
+ finishedAtMs: number().nullable(),
19447
+ error: string().nullable()
19448
+ });
19245
19449
  var ReplayFrameInputSchema = object({
19246
19450
  timestamp: number(),
19247
19451
  frame: PipelineRunResultBridge
@@ -19280,10 +19484,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19280
19484
  * stationary registry). Default false: the timeline lists passages,
19281
19485
  * not parking records (operator decision, 2026-08-15). */
19282
19486
  includeStationary: boolean().optional()
19283
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(ListGroupsQueryInput, ListGroupsPageSchema), method(object({
19284
- deviceId: number(),
19285
- groupId: string().min(1)
19286
- }), AnalyticsGroupDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
19487
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
19287
19488
  kind: "mutation",
19288
19489
  auth: "admin"
19289
19490
  }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({ deviceIds: array(number()).min(1).max(200) }), array(EventKindsForDeviceSchema).readonly()), method(object({
@@ -19292,7 +19493,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19292
19493
  until: number().optional(),
19293
19494
  kinds: array(string()).optional(),
19294
19495
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
19295
- }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
19496
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
19296
19497
  deviceId: number(),
19297
19498
  since: number(),
19298
19499
  until: number(),
@@ -19383,6 +19584,12 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19383
19584
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
19384
19585
  kind: "query",
19385
19586
  auth: "admin"
19587
+ }), method(MediaReclaimInputSchema, MediaReclaimStartResultSchema, {
19588
+ kind: "mutation",
19589
+ auth: "admin"
19590
+ }), method(object({}), MediaReclaimStatusSchema, {
19591
+ kind: "query",
19592
+ auth: "admin"
19386
19593
  }), method(object({ deviceIds: array(number()).optional() }), TrainingExportSummarySchema, {
19387
19594
  kind: "query",
19388
19595
  auth: "admin"
@@ -21353,7 +21560,13 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
21353
21560
  }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
21354
21561
  kind: "mutation",
21355
21562
  auth: "admin"
21356
- });
21563
+ }), method(StorageCleanupInputSchema, object({ jobId: string() }), {
21564
+ kind: "mutation",
21565
+ auth: "admin"
21566
+ }), method(StorageCleanupStatusInputSchema, StorageCleanupJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
21567
+ kind: "mutation",
21568
+ auth: "admin"
21569
+ }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
21357
21570
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
21358
21571
  providerId: string().min(1),
21359
21572
  displayName: string().min(1),
@@ -28463,6 +28676,33 @@ var RecordingRebalanceInputSchema = object({
28463
28676
  minMoveGb: number().min(0).optional()
28464
28677
  });
28465
28678
  /**
28679
+ * Operator-facing placement of one camera onto a recordings location.
28680
+ *
28681
+ * `pinLocationId` is the operator instruction: a location id, or `null` for
28682
+ * Auto (the planner may move this camera). `locationId` is where high/mid
28683
+ * currently write — the plan, which may disagree with the pin when Auto.
28684
+ */
28685
+ var RecordingDevicePlacementSchema = object({
28686
+ deviceId: number().int(),
28687
+ profile: string(),
28688
+ locationId: string()
28689
+ });
28690
+ var RecordingDevicePinSchema = object({
28691
+ deviceId: number().int(),
28692
+ /** Recordings-class location this camera is pinned to. */
28693
+ locationId: string()
28694
+ });
28695
+ var RecordingPlacementViewSchema = object({
28696
+ assignments: array(RecordingDevicePlacementSchema),
28697
+ pins: array(RecordingDevicePinSchema),
28698
+ defaultLocations: record(string(), string())
28699
+ });
28700
+ var RecordingSetDevicePlacementInputSchema = object({
28701
+ deviceId: number().int(),
28702
+ /** `null` = Auto. Otherwise a `recordings:*` location id. */
28703
+ locationId: string().nullable()
28704
+ });
28705
+ /**
28466
28706
  * Result of locating footage at a wall-clock instant for one device/profile.
28467
28707
  * `segment` carries the covering segment's window; `gap` reports the forward
28468
28708
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -28676,6 +28916,9 @@ method(object({
28676
28916
  }), method(RelocateResidueInputSchema, RelocateResidueSchema, {
28677
28917
  kind: "query",
28678
28918
  auth: "admin"
28919
+ }), method(LedgerWalkInputSchema, LedgerWalkReportSchema, {
28920
+ kind: "mutation",
28921
+ auth: "admin"
28679
28922
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
28680
28923
  kind: "mutation",
28681
28924
  auth: "admin"
@@ -28685,6 +28928,12 @@ method(object({
28685
28928
  }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
28686
28929
  kind: "mutation",
28687
28930
  auth: "admin"
28931
+ }), method(object({}), RecordingPlacementViewSchema, {
28932
+ kind: "query",
28933
+ auth: "admin"
28934
+ }), method(RecordingSetDevicePlacementInputSchema, object({ ok: literal(true) }), {
28935
+ kind: "mutation",
28936
+ auth: "admin"
28688
28937
  });
28689
28938
  /**
28690
28939
  * `recording-export` cap — render a footage time range into a single downloadable
@@ -29067,6 +29316,25 @@ var SceneMonitorStatusSchema = object({
29067
29316
  monitors: array(SceneMonitorSchema),
29068
29317
  lastFetchedAt: number()
29069
29318
  });
29319
+ /**
29320
+ * One camera's row in a `listScenesBatch` answer.
29321
+ *
29322
+ * `status` is NULLABLE and the nullability is the whole point. `scene-monitor`
29323
+ * is a `defaultActive` wrapper, so every camera is asked; a camera whose
29324
+ * provider is absent (pipeline-analytics not deployed, the post-processing node
29325
+ * down) cannot answer, and that is not the same fact as a camera with no scenes
29326
+ * configured. Fanned out per camera the difference was visible — one query
29327
+ * errored while the others resolved — and a batch that returned only the rows
29328
+ * it managed would have destroyed it, silently, by making an unreachable camera
29329
+ * indistinguishable from one that answered `monitors: []`.
29330
+ *
29331
+ * So: EVERY requested deviceId gets a row. `status: null` means "this camera
29332
+ * could not be read"; `status.monitors: []` means "read, and it has none".
29333
+ */
29334
+ var SceneMonitorStatusForDeviceSchema = object({
29335
+ deviceId: number(),
29336
+ status: SceneMonitorStatusSchema.nullable()
29337
+ });
29070
29338
  var sceneMonitorCapability = {
29071
29339
  name: "scene-monitor",
29072
29340
  scope: "device",
@@ -29076,6 +29344,22 @@ var sceneMonitorCapability = {
29076
29344
  deviceTypes: [DeviceType.Camera],
29077
29345
  methods: {
29078
29346
  listScenes: method(object({ deviceId: number() }), SceneMonitorStatusSchema),
29347
+ /**
29348
+ * The same answer, for a SET of cameras, in one round trip.
29349
+ *
29350
+ * `/scenes` renders every camera and re-reads them on a 30s safety-net
29351
+ * poll behind the push slice. Fanned out client-side that was one query
29352
+ * per camera — 29 round trips through the browser, the hub and the
29353
+ * post-analysis runner every 30 seconds to read an in-memory map the
29354
+ * owner had already merged. The work is unchanged (`statusFor` per
29355
+ * device, all in-process at the owner); what collapses is the transport.
29356
+ *
29357
+ * A camera that cannot answer still gets a row, with `status: null` —
29358
+ * see {@link SceneMonitorStatusForDeviceSchema}. Never fewer rows than
29359
+ * ids: a caller that asked for twenty-nine and got twenty-seven cannot
29360
+ * tell which two are missing, or that any are.
29361
+ */
29362
+ listScenesBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(SceneMonitorStatusForDeviceSchema).readonly()),
29079
29363
  createScene: method(object({
29080
29364
  deviceId: number(),
29081
29365
  label: string(),
@@ -30911,6 +31195,27 @@ var CameraOccupancySnapshotSchema = object({
30911
31195
  stationaryObjects: array(StationaryObjectSchema).readonly().optional()
30912
31196
  });
30913
31197
  /**
31198
+ * One camera's row in a `getCurrentSnapshotBatch` answer.
31199
+ *
31200
+ * THREE outcomes, and the single-camera method could only express two of them
31201
+ * because `snapshot: null` was already spoken for:
31202
+ *
31203
+ * - `read: 'read'`, `snapshot` present — the live occupancy reading.
31204
+ * - `read: 'read'`, `snapshot: null` — read, and this camera has no reading
31205
+ * yet: no frame since boot, and no parked-object registry to hydrate from.
31206
+ * - `read: 'unreadable'` — the owner could not answer for this
31207
+ * camera. `snapshot` is null, and it does NOT mean "nothing parked here".
31208
+ *
31209
+ * Collapsing the last two is the failure this field exists to prevent: a
31210
+ * hydration that threw would otherwise render as an empty Stationary section,
31211
+ * which is a definite claim about a camera nobody could read.
31212
+ */
31213
+ var CameraOccupancySnapshotForDeviceSchema = object({
31214
+ deviceId: number(),
31215
+ read: _enum(["read", "unreadable"]),
31216
+ snapshot: CameraOccupancySnapshotSchema.nullable()
31217
+ });
31218
+ /**
30914
31219
  * Time-series resolution. The history methods return one bucket per
30915
31220
  * step over the requested range. Smaller resolutions cost more
30916
31221
  * memory + bandwidth; bound to discrete steps so caller cannot ask
@@ -30967,6 +31272,20 @@ var zoneAnalyticsCapability = {
30967
31272
  * (no inference result emitted since boot or since binding was
30968
31273
  * activated). */
30969
31274
  getCurrentSnapshot: method(object({ deviceId: number() }), CameraOccupancySnapshotSchema.nullable()),
31275
+ /**
31276
+ * The same snapshot, for a SET of cameras, in one round trip.
31277
+ *
31278
+ * The Events page's Stationary section polls this every 15s for every
31279
+ * selected camera. Fanned out client-side that is one query per camera to
31280
+ * read a `Map.get` at the owner — the answer costs nothing, the round trip
31281
+ * costs everything. Batched, N transports become one and the per-device
31282
+ * work is unchanged.
31283
+ *
31284
+ * Every requested deviceId gets a row, tagged `read` — see
31285
+ * {@link CameraOccupancySnapshotForDeviceSchema}. A camera the owner could
31286
+ * not answer for is `'unreadable'`, never an empty reading.
31287
+ */
31288
+ getCurrentSnapshotBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(CameraOccupancySnapshotForDeviceSchema).readonly()),
30970
31289
  /** Time-series object count inside one zone. `className` optional —
30971
31290
  * omit to count every class in the zone. */
30972
31291
  getZoneHistory: method(object({
@@ -33684,6 +34003,12 @@ Object.freeze({
33684
34003
  addonId: null,
33685
34004
  access: "delete"
33686
34005
  },
34006
+ "deviceManager.renameLocation": {
34007
+ capName: "device-manager",
34008
+ capScope: "system",
34009
+ addonId: null,
34010
+ access: "create"
34011
+ },
33687
34012
  "deviceManager.runDeviceAction": {
33688
34013
  capName: "device-manager",
33689
34014
  capScope: "system",
@@ -35376,13 +35701,19 @@ Object.freeze({
35376
35701
  addonId: null,
35377
35702
  access: "view"
35378
35703
  },
35379
- "pipelineAnalytics.getGroup": {
35704
+ "pipelineAnalytics.getKeyEvents": {
35380
35705
  capName: "pipeline-analytics",
35381
35706
  capScope: "device",
35382
35707
  addonId: null,
35383
35708
  access: "view"
35384
35709
  },
35385
- "pipelineAnalytics.getKeyEvents": {
35710
+ "pipelineAnalytics.getKeyEventsBatch": {
35711
+ capName: "pipeline-analytics",
35712
+ capScope: "device",
35713
+ addonId: null,
35714
+ access: "view"
35715
+ },
35716
+ "pipelineAnalytics.getMediaReclaimStatus": {
35386
35717
  capName: "pipeline-analytics",
35387
35718
  capScope: "device",
35388
35719
  addonId: null,
@@ -35472,12 +35803,6 @@ Object.freeze({
35472
35803
  addonId: null,
35473
35804
  access: "view"
35474
35805
  },
35475
- "pipelineAnalytics.listGroups": {
35476
- capName: "pipeline-analytics",
35477
- capScope: "device",
35478
- addonId: null,
35479
- access: "view"
35480
- },
35481
35806
  "pipelineAnalytics.listOpsLog": {
35482
35807
  capName: "pipeline-analytics",
35483
35808
  capScope: "device",
@@ -35562,6 +35887,12 @@ Object.freeze({
35562
35887
  addonId: null,
35563
35888
  access: "create"
35564
35889
  },
35890
+ "pipelineAnalytics.reclaimDebugMedia": {
35891
+ capName: "pipeline-analytics",
35892
+ capScope: "device",
35893
+ addonId: null,
35894
+ access: "create"
35895
+ },
35565
35896
  "pipelineAnalytics.reconcileFromDisk": {
35566
35897
  capName: "pipeline-analytics",
35567
35898
  capScope: "device",
@@ -36486,6 +36817,12 @@ Object.freeze({
36486
36817
  addonId: null,
36487
36818
  access: "view"
36488
36819
  },
36820
+ "recording.getPlacement": {
36821
+ capName: "recording",
36822
+ capScope: "system",
36823
+ addonId: null,
36824
+ access: "view"
36825
+ },
36489
36826
  "recording.getPlaybackManifest": {
36490
36827
  capName: "recording",
36491
36828
  capScope: "system",
@@ -36564,6 +36901,12 @@ Object.freeze({
36564
36901
  addonId: null,
36565
36902
  access: "view"
36566
36903
  },
36904
+ "recording.reconcileLedgerAgainstDisk": {
36905
+ capName: "recording",
36906
+ capScope: "system",
36907
+ addonId: null,
36908
+ access: "create"
36909
+ },
36567
36910
  "recording.refreshStorageLocationsForMigration": {
36568
36911
  capName: "recording",
36569
36912
  capScope: "system",
@@ -36606,6 +36949,12 @@ Object.freeze({
36606
36949
  addonId: null,
36607
36950
  access: "create"
36608
36951
  },
36952
+ "recording.setDevicePlacement": {
36953
+ capName: "recording",
36954
+ capScope: "system",
36955
+ addonId: null,
36956
+ access: "create"
36957
+ },
36609
36958
  "recording.startStorageMigrationMove": {
36610
36959
  capName: "recording",
36611
36960
  capScope: "system",
@@ -36690,6 +37039,12 @@ Object.freeze({
36690
37039
  addonId: null,
36691
37040
  access: "view"
36692
37041
  },
37042
+ "sceneMonitor.listScenesBatch": {
37043
+ capName: "scene-monitor",
37044
+ capScope: "device",
37045
+ addonId: null,
37046
+ access: "view"
37047
+ },
36693
37048
  "sceneMonitor.recheckNow": {
36694
37049
  capName: "scene-monitor",
36695
37050
  capScope: "device",
@@ -37044,12 +37399,36 @@ Object.freeze({
37044
37399
  addonId: null,
37045
37400
  access: "create"
37046
37401
  },
37402
+ "storageMigration.cleanupCancel": {
37403
+ capName: "storage-migration",
37404
+ capScope: "system",
37405
+ addonId: null,
37406
+ access: "create"
37407
+ },
37408
+ "storageMigration.cleanupStart": {
37409
+ capName: "storage-migration",
37410
+ capScope: "system",
37411
+ addonId: null,
37412
+ access: "create"
37413
+ },
37414
+ "storageMigration.cleanupStatus": {
37415
+ capName: "storage-migration",
37416
+ capScope: "system",
37417
+ addonId: null,
37418
+ access: "view"
37419
+ },
37047
37420
  "storageMigration.drain": {
37048
37421
  capName: "storage-migration",
37049
37422
  capScope: "system",
37050
37423
  addonId: null,
37051
37424
  access: "create"
37052
37425
  },
37426
+ "storageMigration.history": {
37427
+ capName: "storage-migration",
37428
+ capScope: "system",
37429
+ addonId: null,
37430
+ access: "view"
37431
+ },
37053
37432
  "storageMigration.movers": {
37054
37433
  capName: "storage-migration",
37055
37434
  capScope: "system",
@@ -38046,6 +38425,12 @@ Object.freeze({
38046
38425
  addonId: null,
38047
38426
  access: "view"
38048
38427
  },
38428
+ "zoneAnalytics.getCurrentSnapshotBatch": {
38429
+ capName: "zone-analytics",
38430
+ capScope: "device",
38431
+ addonId: null,
38432
+ access: "view"
38433
+ },
38049
38434
  "zoneAnalytics.getUnzonedHistory": {
38050
38435
  capName: "zone-analytics",
38051
38436
  capScope: "device",
@@ -39040,14 +39425,14 @@ Object.freeze({
39040
39425
  form: "single",
39041
39426
  optional: true
39042
39427
  }],
39043
- "pipelineAnalytics.getGroup": [{
39428
+ "pipelineAnalytics.getKeyEvents": [{
39044
39429
  name: "deviceId",
39045
39430
  form: "single",
39046
39431
  optional: false
39047
39432
  }],
39048
- "pipelineAnalytics.getKeyEvents": [{
39049
- name: "deviceId",
39050
- form: "single",
39433
+ "pipelineAnalytics.getKeyEventsBatch": [{
39434
+ name: "deviceIds",
39435
+ form: "array",
39051
39436
  optional: false
39052
39437
  }],
39053
39438
  "pipelineAnalytics.getMotionEvents": [{
@@ -39105,11 +39490,6 @@ Object.freeze({
39105
39490
  form: "single",
39106
39491
  optional: false
39107
39492
  }],
39108
- "pipelineAnalytics.listGroups": [{
39109
- name: "deviceIds",
39110
- form: "array",
39111
- optional: false
39112
- }],
39113
39493
  "pipelineAnalytics.listOpsLog": [{
39114
39494
  name: "deviceId",
39115
39495
  form: "single",
@@ -39155,6 +39535,11 @@ Object.freeze({
39155
39535
  form: "single",
39156
39536
  optional: true
39157
39537
  }],
39538
+ "pipelineAnalytics.reclaimDebugMedia": [{
39539
+ name: "deviceIds",
39540
+ form: "array",
39541
+ optional: true
39542
+ }],
39158
39543
  "pipelineAnalytics.reconcileFromDisk": [{
39159
39544
  name: "deviceId",
39160
39545
  form: "single",
@@ -39490,6 +39875,11 @@ Object.freeze({
39490
39875
  form: "single",
39491
39876
  optional: false
39492
39877
  }],
39878
+ "recording.reconcileLedgerAgainstDisk": [{
39879
+ name: "deviceId",
39880
+ form: "single",
39881
+ optional: true
39882
+ }],
39493
39883
  "recording.relocateFootage": [{
39494
39884
  name: "deviceId",
39495
39885
  form: "single",
@@ -39515,6 +39905,11 @@ Object.freeze({
39515
39905
  form: "single",
39516
39906
  optional: false
39517
39907
  }],
39908
+ "recording.setDevicePlacement": [{
39909
+ name: "deviceId",
39910
+ form: "single",
39911
+ optional: false
39912
+ }],
39518
39913
  "recording.startStorageMigrationMove": [{
39519
39914
  name: "deviceId",
39520
39915
  form: "single",
@@ -39555,6 +39950,11 @@ Object.freeze({
39555
39950
  form: "single",
39556
39951
  optional: false
39557
39952
  }],
39953
+ "sceneMonitor.listScenesBatch": [{
39954
+ name: "deviceIds",
39955
+ form: "array",
39956
+ optional: false
39957
+ }],
39558
39958
  "sceneMonitor.recheckNow": [{
39559
39959
  name: "deviceId",
39560
39960
  form: "single",
@@ -39816,6 +40216,11 @@ Object.freeze({
39816
40216
  form: "single",
39817
40217
  optional: false
39818
40218
  }],
40219
+ "zoneAnalytics.getCurrentSnapshotBatch": [{
40220
+ name: "deviceIds",
40221
+ form: "array",
40222
+ optional: false
40223
+ }],
39819
40224
  "zoneAnalytics.getUnzonedHistory": [{
39820
40225
  name: "deviceId",
39821
40226
  form: "single",