@camstack/addon-matter-broker 0.2.47 → 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.
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
@@ -8030,6 +8030,20 @@ var RelocateJobSchema = object({
8030
8030
  * in its row, not in its name, so `MediaRelocateEngine` never reconciles one.
8031
8031
  */
8032
8032
  rowsReconciled: number().int().nonnegative().optional(),
8033
+ /**
8034
+ * Rows this run FORGOT because the file they name is not on disk.
8035
+ *
8036
+ * The mover derived the path from the row's own fields and `stat`ed it; an
8037
+ * ENOENT there is a per-path confirmation that the segment is gone (D296),
8038
+ * and the durable row is dropped through the same channel eviction uses. It
8039
+ * is reported for the same reason `rowsReconciled` is: this is a durable
8040
+ * mutation nobody asked for, and a migration that quietly erases hour rows is
8041
+ * the same failure as one that quietly skips them (D295).
8042
+ *
8043
+ * The production drain of 2026-08-30 would have reported 11 074 here — the
8044
+ * ledger claimed 5.65 GB of footage that no longer existed.
8045
+ */
8046
+ rowsForgotten: number().int().nonnegative().optional(),
8033
8047
  startedAt: number(),
8034
8048
  finishedAt: number().nullable(),
8035
8049
  error: string$2().nullable()
@@ -8094,6 +8108,13 @@ var MediaRelocateModeSchema = _enum([
8094
8108
  ]);
8095
8109
  var RelocateMediaInputSchema = object({
8096
8110
  toLocationId: string$2(),
8111
+ /**
8112
+ * Restrict the pass to rows currently on this location. Omitted / `'*'` =
8113
+ * every row that is not already on `toLocationId` (the historical
8114
+ * behaviour). A named source is what a from→to migration needs: without it
8115
+ * "move events off disk 2" also emptied disk 1.
8116
+ */
8117
+ fromLocationId: string$2().optional(),
8097
8118
  throttleMbps: number().min(1).max(1e3).optional(),
8098
8119
  /** Omitted = `move`, the pre-existing behaviour. */
8099
8120
  mode: MediaRelocateModeSchema.optional()
@@ -8161,6 +8182,19 @@ var StorageMigrationDestinationsSchema = object({
8161
8182
  galleryMedia: string$2().min(1).optional()
8162
8183
  }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
8163
8184
  /**
8185
+ * Optional named source per class. Omitted = the class's current default
8186
+ * (the historical behaviour). A named source that is NOT the default is a
8187
+ * drain of that disk: bytes move, the default stays, and the source is
8188
+ * disabled when the move finishes.
8189
+ */
8190
+ var StorageMigrationSourcesSchema = object({
8191
+ recordings: string$2().min(1).optional(),
8192
+ recordingsLow: string$2().min(1).optional(),
8193
+ eventMedia: string$2().min(1).optional(),
8194
+ backups: string$2().min(1).optional(),
8195
+ galleryMedia: string$2().min(1).optional()
8196
+ }).optional();
8197
+ /**
8164
8198
  * How a migration sequences the cutover against the byte move.
8165
8199
  *
8166
8200
  * - `blocking` — the historical order: pause, move every byte, repoint,
@@ -8182,6 +8216,8 @@ var StorageMigrationModeSchema = _enum(["blocking", "nonBlocking"]);
8182
8216
  /** Shared input for planning and starting an orchestrated storage migration. */
8183
8217
  var StorageMigrationInputSchema = object({
8184
8218
  destinations: StorageMigrationDestinationsSchema,
8219
+ /** Omitted = each class's current default. */
8220
+ sources: StorageMigrationSourcesSchema,
8185
8221
  throttleMbps: number().min(1).max(1e3).optional(),
8186
8222
  /** Omitted = `blocking`, which stays the default. */
8187
8223
  mode: StorageMigrationModeSchema.optional()
@@ -8261,6 +8297,13 @@ var StorageMigrationMoveSchema = object({
8261
8297
  storageClass: StorageMigrationClassSchema,
8262
8298
  fromLocationId: string$2(),
8263
8299
  toLocationId: string$2(),
8300
+ /**
8301
+ * True when `from` was NOT the class default at plan time. The move still
8302
+ * copies bytes, but the default is left alone and the source is disabled
8303
+ * once the copy verifies. Absent on jobs planned before this field existed
8304
+ * — those jobs always repointed, which is `false`.
8305
+ */
8306
+ freezeSource: boolean().optional(),
8264
8307
  moverJobId: string$2().nullable(),
8265
8308
  state: RelocateJobStateSchema.nullable(),
8266
8309
  error: string$2().nullable(),
@@ -8274,6 +8317,7 @@ var StorageMigrationJobSchema = object({
8274
8317
  * can tell a seconds-long cutover from a thirty-hour one. */
8275
8318
  mode: StorageMigrationModeSchema,
8276
8319
  destinations: StorageMigrationDestinationsSchema,
8320
+ sources: StorageMigrationSourcesSchema,
8277
8321
  throttleMbps: number(),
8278
8322
  moves: array(StorageMigrationMoveSchema),
8279
8323
  pauseLeaseId: string$2().nullable(),
@@ -8299,6 +8343,7 @@ var StorageMigrationFindingSchema = object({
8299
8343
  });
8300
8344
  var StorageMigrationPlanSchema = object({
8301
8345
  destinations: StorageMigrationDestinationsSchema,
8346
+ sources: StorageMigrationSourcesSchema,
8302
8347
  /** The mode this plan was built for. A plan is only valid for its mode: the
8303
8348
  * `eventMedia` seal gate and the single-cardinality refusal both depend on
8304
8349
  * it. */
@@ -8306,7 +8351,8 @@ var StorageMigrationPlanSchema = object({
8306
8351
  moves: array(object({
8307
8352
  storageClass: StorageMigrationClassSchema,
8308
8353
  fromLocationId: string$2(),
8309
- toLocationId: string$2()
8354
+ toLocationId: string$2(),
8355
+ freezeSource: boolean().optional()
8310
8356
  })),
8311
8357
  findings: array(StorageMigrationFindingSchema)
8312
8358
  });
@@ -8393,16 +8439,142 @@ var RelocateResidueSchema = object({
8393
8439
  segments: number().int().nonnegative(),
8394
8440
  bytes: number().int().nonnegative()
8395
8441
  }).nullable();
8442
+ /**
8443
+ * Ask one location whether its durable hour rows describe the disk — the walk
8444
+ * (D319).
8445
+ *
8446
+ * `apply` DEFAULTS TO FALSE and that default is the product: the operator's
8447
+ * missing tool is the question, and the dry run is how they sanity-check the
8448
+ * destructive run before authorising it.
8449
+ */
8450
+ var LedgerWalkInputSchema = object({
8451
+ locationId: string$2().min(1),
8452
+ /** Forget the confirmed-absent rows, rather than only counting them. */
8453
+ apply: boolean().optional(),
8454
+ /** Narrow to one camera. */
8455
+ deviceId: number().int().positive().optional(),
8456
+ /** Narrow to these recording profiles; empty/absent = every profile. */
8457
+ profiles: array(string$2().min(1)).optional()
8458
+ });
8459
+ /** Why a whole walk did nothing. Every one leaves the ledger untouched. */
8460
+ var LedgerWalkRefusalSchema = _enum([
8461
+ "location-unknown",
8462
+ "source-writable",
8463
+ "no-ledger",
8464
+ "archive-unreadable",
8465
+ "anchor-absent",
8466
+ "anchor-unreadable",
8467
+ "anchor-moved"
8468
+ ]);
8469
+ _enum([
8470
+ "live-tail",
8471
+ "listing-error",
8472
+ "path-mismatch",
8473
+ "durable-refused"
8474
+ ]);
8475
+ /** Every skip reason, always present, always a number — so a reason that never
8476
+ * fired reports as zero rather than absent and the report shape is constant
8477
+ * between passes. Spelled out rather than `z.record` for exactly that. */
8478
+ var LedgerWalkSkipCountsSchema = object({
8479
+ "live-tail": number().int().nonnegative(),
8480
+ "listing-error": number().int().nonnegative(),
8481
+ "path-mismatch": number().int().nonnegative(),
8482
+ "durable-refused": number().int().nonnegative()
8483
+ });
8484
+ /** One camera's share of a walk, so a report names cameras and not rows. */
8485
+ var LedgerWalkDeviceReportSchema = object({
8486
+ deviceId: number().int(),
8487
+ hoursWalked: number().int().nonnegative(),
8488
+ hoursMissing: number().int().nonnegative(),
8489
+ ghostSegments: number().int().nonnegative(),
8490
+ ghostBytes: number().int().nonnegative(),
8491
+ forgottenSegments: number().int().nonnegative(),
8492
+ orphanFiles: number().int().nonnegative()
8493
+ });
8494
+ /**
8495
+ * What one walk claimed, listed, found and (only when armed) forgot.
8496
+ *
8497
+ * `archiveSegments` is the **M** and `segmentsClaimed` the **N** (D295), so a
8498
+ * walk that saw a fraction of the location is visible in its own report rather
8499
+ * than in the absence of one.
8500
+ */
8501
+ var LedgerWalkReportSchema = object({
8502
+ locationId: string$2(),
8503
+ applied: boolean(),
8504
+ refused: LedgerWalkRefusalSchema.nullable(),
8505
+ archiveSegments: number().int().nonnegative().nullable(),
8506
+ archiveBytes: number().int().nonnegative().nullable(),
8507
+ hoursClaimed: number().int().nonnegative(),
8508
+ hoursWalked: number().int().nonnegative(),
8509
+ hoursMissing: number().int().nonnegative(),
8510
+ /** `readdir` calls issued — the cost, stated in the unit that is paid. */
8511
+ listings: number().int().nonnegative(),
8512
+ segmentsClaimed: number().int().nonnegative(),
8513
+ ghostSegments: number().int().nonnegative(),
8514
+ ghostBytes: number().int().nonnegative(),
8515
+ ghostHoursWhole: number().int().nonnegative(),
8516
+ forgottenSegments: number().int().nonnegative(),
8517
+ forgottenBytes: number().int().nonnegative(),
8518
+ /** Files under a claimed hour that no durable row names. Never deleted. */
8519
+ orphanFiles: number().int().nonnegative(),
8520
+ orphanSample: array(string$2()).readonly(),
8521
+ hoursSkipped: number().int().nonnegative(),
8522
+ skippedByReason: LedgerWalkSkipCountsSchema,
8523
+ /** The walk stopped at its per-pass hour bound with claims unwalked. */
8524
+ bounded: boolean(),
8525
+ byDevice: array(LedgerWalkDeviceReportSchema).readonly()
8526
+ });
8396
8527
  /** How many rows a media pass would still act on against a given target — the
8397
8528
  * media lane's denominator AND its residue, from ONE derivation so the two can
8398
8529
  * never disagree. `null` = the count could not be taken. */
8399
8530
  var RelocatableMediaCountSchema = object({ rows: number().int().nonnegative() }).nullable();
8400
8531
  var RelocatableMediaCountInputSchema = object({
8401
8532
  toLocationId: string$2().min(1),
8533
+ /** Restrict the count to one source; omitted / `'*'` = every non-target row. */
8534
+ fromLocationId: string$2().optional(),
8402
8535
  /** Omitted = `move`. */
8403
8536
  mode: MediaRelocateModeSchema.optional()
8404
8537
  });
8405
8538
  /**
8539
+ * Operator cleanup of leftover analytics rows, optional debug media, and
8540
+ * ghost ledger entries on frozen footage locations.
8541
+ *
8542
+ * A pass is tens of minutes on a standing backlog. The hub method RETURNS
8543
+ * `{ jobId }` immediately; progress is `cleanupStatus`. Awaiting the work
8544
+ * is how `addons.custom` hit the 60 s UDS deadline while reclaim continued
8545
+ * with no operator-visible status.
8546
+ */
8547
+ var StorageCleanupPhaseSchema = _enum([
8548
+ "orphans",
8549
+ "debug-media",
8550
+ "ghost-ledger",
8551
+ "done",
8552
+ "failed",
8553
+ "cancelled"
8554
+ ]);
8555
+ var StorageCleanupInputSchema = object({
8556
+ /** Also walk motion stills / track filmstrips. Off by default. */
8557
+ includeDebugMedia: boolean().optional() });
8558
+ var StorageCleanupJobSchema = object({
8559
+ jobId: string$2(),
8560
+ phase: StorageCleanupPhaseSchema,
8561
+ includeDebugMedia: boolean(),
8562
+ orphansReclaimed: number().int().nonnegative(),
8563
+ orphanBytesReclaimed: number().int().nonnegative(),
8564
+ debugMediaReclaimed: number().int().nonnegative(),
8565
+ debugMediaBytesReclaimed: number().int().nonnegative(),
8566
+ ghostsForgotten: number().int().nonnegative(),
8567
+ ghostBytesForgotten: number().int().nonnegative(),
8568
+ /** Short operator-facing line: current collection, pass, or location. */
8569
+ detail: string$2().nullable(),
8570
+ cancelRequested: boolean(),
8571
+ startedAt: number(),
8572
+ updatedAt: number(),
8573
+ finishedAt: number().nullable(),
8574
+ error: string$2().nullable()
8575
+ });
8576
+ var StorageCleanupStatusInputSchema = object({ jobId: string$2().optional() });
8577
+ /**
8406
8578
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8407
8579
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8408
8580
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8430,11 +8602,10 @@ var StorageLocationTypeSchema = string$2().regex(/^[a-z][a-zA-Z0-9-]*$/);
8430
8602
  * The default location for a type uses `id === <type>:default` by
8431
8603
  * convention (the bare type ref like `'backups'` resolves to it).
8432
8604
  *
8433
- * `isSystem: true` marks a location as orchestrator-seeded and
8434
- * undeletable. The bootstrap-installed defaults (one per type) carry
8435
- * this flag; operator-added locations don't. Editing the config of
8436
- * a system location is allowed (path migration, provider swap) but
8437
- * deleting it is rejected at the cap level.
8605
+ * `isSystem` is a legacy persisted flag. Seed still creates the initial
8606
+ * `<type>:default` locations; the flag is no longer a lock, a badge, or a
8607
+ * prune selector. New writes leave it false. Deletion is gated on uniqueness
8608
+ * / last-enabled, not on this bit.
8438
8609
  */
8439
8610
  var StorageLocationSchema = object({
8440
8611
  id: string$2().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),
@@ -13026,6 +13197,12 @@ method(object({
13026
13197
  }), _void(), {
13027
13198
  kind: "mutation",
13028
13199
  auth: "admin"
13200
+ }), method(object({
13201
+ from: string$2(),
13202
+ to: string$2()
13203
+ }), object({ moved: number() }), {
13204
+ kind: "mutation",
13205
+ auth: "admin"
13029
13206
  }), method(object({
13030
13207
  deviceId: number(),
13031
13208
  disabled: boolean()
@@ -19034,53 +19211,15 @@ var RecentTracksPageSchema = object({
19034
19211
  /** Cursor for the next page, or null when this page is the last. */
19035
19212
  nextCursor: string$2().nullable()
19036
19213
  });
19037
- var LIST_GROUPS_DEFAULT_LIMIT = 40;
19038
- var LIST_GROUPS_MAX_LIMIT = 100;
19039
- var AnalyticsGroupRecordSchema = object({
19040
- id: string$2(),
19041
- deviceId: number().int(),
19042
- openedAt: number().int(),
19043
- closedAt: number().int(),
19044
- timestamp: number().int(),
19045
- memberCount: number().int(),
19046
- memberTrackIds: array(string$2()).readonly(),
19047
- className: string$2(),
19048
- classes: array(string$2()).readonly(),
19049
- /** Relative event-media path, or null when the group has no picture yet. */
19050
- mediaUrl: string$2().nullable(),
19051
- singleton: boolean()
19052
- });
19053
- var AnalyticsGroupMemberSchema = object({
19054
- trackId: string$2(),
19055
- deviceId: number().int(),
19056
- className: string$2(),
19057
- firstSeen: number().int(),
19058
- lastSeen: number().int(),
19059
- mediaUrl: string$2().nullable()
19060
- });
19061
- var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
19062
- var ListGroupsQueryInput = object({
19063
- /** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
19064
- deviceIds: array(number()),
19065
- /** Window lower bound on `closedAt` (inclusive). */
19066
- since: number().optional(),
19067
- /** Window upper bound on `openedAt` (inclusive). */
19068
- until: number().optional(),
19069
- limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
19070
- /** Opaque continuation cursor from a previous page's `nextCursor`. */
19071
- cursor: string$2().optional()
19072
- });
19073
- var ListGroupsPageSchema = object({
19074
- groups: array(AnalyticsGroupRecordSchema).readonly(),
19075
- nextCursor: string$2().nullable()
19076
- });
19214
+ var KEY_EVENTS_DEFAULT_LIMIT = 50;
19215
+ var KEY_EVENTS_MAX_LIMIT = 200;
19077
19216
  var KeyEventQueryInput = object({
19078
19217
  deviceId: number(),
19079
19218
  /** Window lower bound (track firstSeen ≥ since). */
19080
19219
  since: number(),
19081
19220
  /** Window upper bound (track firstSeen ≤ until). */
19082
19221
  until: number(),
19083
- limit: number().int().min(1).max(200).default(50),
19222
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
19084
19223
  /** Drop tracks scoring below this importance. */
19085
19224
  minImportance: number().min(0).max(1).optional(),
19086
19225
  /** Restrict to a single class (e.g. 'person'). */
@@ -19102,6 +19241,32 @@ var KeyEventSchema = object({
19102
19241
  ...TrackFlagFields,
19103
19242
  ...TrackRetrainFields
19104
19243
  });
19244
+ /** `getKeyEvents`' window and filters, asked of a SET of cameras at once. */
19245
+ var KeyEventBatchQueryInput = object({
19246
+ deviceIds: array(number()).min(1).max(200),
19247
+ since: number(),
19248
+ until: number(),
19249
+ /** Applied PER CAMERA, exactly as `getKeyEvents.limit` is — never a total
19250
+ * across the set, which would let a busy camera starve a quiet one of its
19251
+ * rows and change what the merged feed contains. */
19252
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
19253
+ minImportance: number().min(0).max(1).optional(),
19254
+ classFilter: string$2().optional()
19255
+ });
19256
+ /**
19257
+ * One camera's key events in a batch answer.
19258
+ *
19259
+ * The row exists for every requested id. `getKeyEvents` degrades to `[]` on
19260
+ * error rather than throwing, so a camera whose store read failed and one with
19261
+ * no events in the window were ALREADY indistinguishable per camera — the
19262
+ * batch does not make that worse, and the row keeps the deviceId the single
19263
+ * method's output never carried (the caller used to stamp it from the fan-out
19264
+ * key, which only worked because there was one query per camera).
19265
+ */
19266
+ var KeyEventsForDeviceSchema = object({
19267
+ deviceId: number(),
19268
+ events: array(KeyEventSchema).readonly()
19269
+ });
19105
19270
  object({
19106
19271
  trackId: string$2(),
19107
19272
  className: string$2(),
@@ -19149,9 +19314,7 @@ var TrackCascadeCountsSchema = object({
19149
19314
  /** Unassigned plate reads removed (best-effort; plate leg deferred to plate-intelligence). */
19150
19315
  plates: number().int(),
19151
19316
  /** Per-track CLIP search vectors removed (best-effort). */
19152
- embeddings: number().int(),
19153
- /** Group membership + group rows removed with their last member (best-effort). */
19154
- groups: number().int()
19317
+ embeddings: number().int()
19155
19318
  });
19156
19319
  /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
19157
19320
  var DiskReconcileCountsSchema = object({
@@ -19321,6 +19484,47 @@ var RebuildStatusSchema = object({
19321
19484
  /** Present when the pass ended by throwing. */
19322
19485
  error: string$2().nullable()
19323
19486
  });
19487
+ /**
19488
+ * Acknowledgement that a debug-media reclaim STARTED.
19489
+ *
19490
+ * The pass is paced at ~2 MB/s over a standing 100 GB — tens of minutes — so
19491
+ * it runs detached and this returns immediately. Awaiting it is how the
19492
+ * `addons.custom` door hit the 60 s UDS deadline while the walk carried on
19493
+ * with no status. Poll {@link pipelineAnalyticsCapability.methods.getMediaReclaimStatus}.
19494
+ */
19495
+ var MediaReclaimStartResultSchema = object({
19496
+ started: boolean(),
19497
+ /** True when a pass was already running; the new request is ignored. */
19498
+ alreadyRunning: boolean()
19499
+ });
19500
+ var MediaReclaimInputSchema = object({
19501
+ mode: _enum(["report", "reclaim"]).default("report"),
19502
+ scopes: array(_enum(["motion-still", "track-filmstrip"])).min(1).optional(),
19503
+ deviceIds: array(number().int()).min(1).optional(),
19504
+ restart: boolean().optional(),
19505
+ pageSize: number().int().min(50).max(5e3).optional(),
19506
+ maxRowsPerDevice: number().int().min(1).max(5e5).optional(),
19507
+ maxReclaimPerDevice: number().int().min(1).max(5e5).optional(),
19508
+ maxBytesPerRun: number().int().min(1).optional(),
19509
+ budgetMinutes: number().int().min(1).max(720).optional(),
19510
+ throttleBytesPerSec: number().int().min(64 * 1024).optional(),
19511
+ graceMinutes: number().int().min(1).max(10080).optional()
19512
+ });
19513
+ var MediaReclaimStatusSchema = object({
19514
+ running: boolean(),
19515
+ mode: _enum(["report", "reclaim"]).nullable(),
19516
+ totalExamined: number(),
19517
+ totalEligible: number(),
19518
+ totalReclaimed: number(),
19519
+ totalBytesReclaimed: number(),
19520
+ totalRefused: number(),
19521
+ /** Device+scope windows finished in this pass. */
19522
+ devicesDone: number(),
19523
+ complete: boolean().nullable(),
19524
+ startedAtMs: number().nullable(),
19525
+ finishedAtMs: number().nullable(),
19526
+ error: string$2().nullable()
19527
+ });
19324
19528
  var ReplayFrameInputSchema = object({
19325
19529
  timestamp: number(),
19326
19530
  frame: PipelineRunResultBridge
@@ -19359,10 +19563,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19359
19563
  * stationary registry). Default false: the timeline lists passages,
19360
19564
  * not parking records (operator decision, 2026-08-15). */
19361
19565
  includeStationary: boolean().optional()
19362
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(ListGroupsQueryInput, ListGroupsPageSchema), method(object({
19363
- deviceId: number(),
19364
- groupId: string$2().min(1)
19365
- }), AnalyticsGroupDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
19566
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
19366
19567
  kind: "mutation",
19367
19568
  auth: "admin"
19368
19569
  }), 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({
@@ -19371,7 +19572,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19371
19572
  until: number().optional(),
19372
19573
  kinds: array(string$2()).optional(),
19373
19574
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
19374
- }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
19575
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
19375
19576
  deviceId: number(),
19376
19577
  since: number(),
19377
19578
  until: number(),
@@ -19462,6 +19663,12 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19462
19663
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
19463
19664
  kind: "query",
19464
19665
  auth: "admin"
19666
+ }), method(MediaReclaimInputSchema, MediaReclaimStartResultSchema, {
19667
+ kind: "mutation",
19668
+ auth: "admin"
19669
+ }), method(object({}), MediaReclaimStatusSchema, {
19670
+ kind: "query",
19671
+ auth: "admin"
19465
19672
  }), method(object({ deviceIds: array(number()).optional() }), TrainingExportSummarySchema, {
19466
19673
  kind: "query",
19467
19674
  auth: "admin"
@@ -21432,7 +21639,13 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
21432
21639
  }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string$2() }), {
21433
21640
  kind: "mutation",
21434
21641
  auth: "admin"
21435
- });
21642
+ }), method(StorageCleanupInputSchema, object({ jobId: string$2() }), {
21643
+ kind: "mutation",
21644
+ auth: "admin"
21645
+ }), method(StorageCleanupStatusInputSchema, StorageCleanupJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string$2() }), object({ cancelled: boolean() }), {
21646
+ kind: "mutation",
21647
+ auth: "admin"
21648
+ }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
21436
21649
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
21437
21650
  providerId: string$2().min(1),
21438
21651
  displayName: string$2().min(1),
@@ -28542,6 +28755,33 @@ var RecordingRebalanceInputSchema = object({
28542
28755
  minMoveGb: number().min(0).optional()
28543
28756
  });
28544
28757
  /**
28758
+ * Operator-facing placement of one camera onto a recordings location.
28759
+ *
28760
+ * `pinLocationId` is the operator instruction: a location id, or `null` for
28761
+ * Auto (the planner may move this camera). `locationId` is where high/mid
28762
+ * currently write — the plan, which may disagree with the pin when Auto.
28763
+ */
28764
+ var RecordingDevicePlacementSchema = object({
28765
+ deviceId: number().int(),
28766
+ profile: string$2(),
28767
+ locationId: string$2()
28768
+ });
28769
+ var RecordingDevicePinSchema = object({
28770
+ deviceId: number().int(),
28771
+ /** Recordings-class location this camera is pinned to. */
28772
+ locationId: string$2()
28773
+ });
28774
+ var RecordingPlacementViewSchema = object({
28775
+ assignments: array(RecordingDevicePlacementSchema),
28776
+ pins: array(RecordingDevicePinSchema),
28777
+ defaultLocations: record(string$2(), string$2())
28778
+ });
28779
+ var RecordingSetDevicePlacementInputSchema = object({
28780
+ deviceId: number().int(),
28781
+ /** `null` = Auto. Otherwise a `recordings:*` location id. */
28782
+ locationId: string$2().nullable()
28783
+ });
28784
+ /**
28545
28785
  * Result of locating footage at a wall-clock instant for one device/profile.
28546
28786
  * `segment` carries the covering segment's window; `gap` reports the forward
28547
28787
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -28755,6 +28995,9 @@ method(object({
28755
28995
  }), method(RelocateResidueInputSchema, RelocateResidueSchema, {
28756
28996
  kind: "query",
28757
28997
  auth: "admin"
28998
+ }), method(LedgerWalkInputSchema, LedgerWalkReportSchema, {
28999
+ kind: "mutation",
29000
+ auth: "admin"
28758
29001
  }), method(object({ jobId: string$2() }), object({ cancelled: boolean() }), {
28759
29002
  kind: "mutation",
28760
29003
  auth: "admin"
@@ -28764,6 +29007,12 @@ method(object({
28764
29007
  }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
28765
29008
  kind: "mutation",
28766
29009
  auth: "admin"
29010
+ }), method(object({}), RecordingPlacementViewSchema, {
29011
+ kind: "query",
29012
+ auth: "admin"
29013
+ }), method(RecordingSetDevicePlacementInputSchema, object({ ok: literal(true) }), {
29014
+ kind: "mutation",
29015
+ auth: "admin"
28767
29016
  });
28768
29017
  /**
28769
29018
  * `recording-export` cap — render a footage time range into a single downloadable
@@ -29146,6 +29395,25 @@ var SceneMonitorStatusSchema = object({
29146
29395
  monitors: array(SceneMonitorSchema),
29147
29396
  lastFetchedAt: number()
29148
29397
  });
29398
+ /**
29399
+ * One camera's row in a `listScenesBatch` answer.
29400
+ *
29401
+ * `status` is NULLABLE and the nullability is the whole point. `scene-monitor`
29402
+ * is a `defaultActive` wrapper, so every camera is asked; a camera whose
29403
+ * provider is absent (pipeline-analytics not deployed, the post-processing node
29404
+ * down) cannot answer, and that is not the same fact as a camera with no scenes
29405
+ * configured. Fanned out per camera the difference was visible — one query
29406
+ * errored while the others resolved — and a batch that returned only the rows
29407
+ * it managed would have destroyed it, silently, by making an unreachable camera
29408
+ * indistinguishable from one that answered `monitors: []`.
29409
+ *
29410
+ * So: EVERY requested deviceId gets a row. `status: null` means "this camera
29411
+ * could not be read"; `status.monitors: []` means "read, and it has none".
29412
+ */
29413
+ var SceneMonitorStatusForDeviceSchema = object({
29414
+ deviceId: number(),
29415
+ status: SceneMonitorStatusSchema.nullable()
29416
+ });
29149
29417
  var sceneMonitorCapability = {
29150
29418
  name: "scene-monitor",
29151
29419
  scope: "device",
@@ -29155,6 +29423,22 @@ var sceneMonitorCapability = {
29155
29423
  deviceTypes: [DeviceType.Camera],
29156
29424
  methods: {
29157
29425
  listScenes: method(object({ deviceId: number() }), SceneMonitorStatusSchema),
29426
+ /**
29427
+ * The same answer, for a SET of cameras, in one round trip.
29428
+ *
29429
+ * `/scenes` renders every camera and re-reads them on a 30s safety-net
29430
+ * poll behind the push slice. Fanned out client-side that was one query
29431
+ * per camera — 29 round trips through the browser, the hub and the
29432
+ * post-analysis runner every 30 seconds to read an in-memory map the
29433
+ * owner had already merged. The work is unchanged (`statusFor` per
29434
+ * device, all in-process at the owner); what collapses is the transport.
29435
+ *
29436
+ * A camera that cannot answer still gets a row, with `status: null` —
29437
+ * see {@link SceneMonitorStatusForDeviceSchema}. Never fewer rows than
29438
+ * ids: a caller that asked for twenty-nine and got twenty-seven cannot
29439
+ * tell which two are missing, or that any are.
29440
+ */
29441
+ listScenesBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(SceneMonitorStatusForDeviceSchema).readonly()),
29158
29442
  createScene: method(object({
29159
29443
  deviceId: number(),
29160
29444
  label: string$2(),
@@ -30990,6 +31274,27 @@ var CameraOccupancySnapshotSchema = object({
30990
31274
  stationaryObjects: array(StationaryObjectSchema).readonly().optional()
30991
31275
  });
30992
31276
  /**
31277
+ * One camera's row in a `getCurrentSnapshotBatch` answer.
31278
+ *
31279
+ * THREE outcomes, and the single-camera method could only express two of them
31280
+ * because `snapshot: null` was already spoken for:
31281
+ *
31282
+ * - `read: 'read'`, `snapshot` present — the live occupancy reading.
31283
+ * - `read: 'read'`, `snapshot: null` — read, and this camera has no reading
31284
+ * yet: no frame since boot, and no parked-object registry to hydrate from.
31285
+ * - `read: 'unreadable'` — the owner could not answer for this
31286
+ * camera. `snapshot` is null, and it does NOT mean "nothing parked here".
31287
+ *
31288
+ * Collapsing the last two is the failure this field exists to prevent: a
31289
+ * hydration that threw would otherwise render as an empty Stationary section,
31290
+ * which is a definite claim about a camera nobody could read.
31291
+ */
31292
+ var CameraOccupancySnapshotForDeviceSchema = object({
31293
+ deviceId: number(),
31294
+ read: _enum(["read", "unreadable"]),
31295
+ snapshot: CameraOccupancySnapshotSchema.nullable()
31296
+ });
31297
+ /**
30993
31298
  * Time-series resolution. The history methods return one bucket per
30994
31299
  * step over the requested range. Smaller resolutions cost more
30995
31300
  * memory + bandwidth; bound to discrete steps so caller cannot ask
@@ -31046,6 +31351,20 @@ var zoneAnalyticsCapability = {
31046
31351
  * (no inference result emitted since boot or since binding was
31047
31352
  * activated). */
31048
31353
  getCurrentSnapshot: method(object({ deviceId: number() }), CameraOccupancySnapshotSchema.nullable()),
31354
+ /**
31355
+ * The same snapshot, for a SET of cameras, in one round trip.
31356
+ *
31357
+ * The Events page's Stationary section polls this every 15s for every
31358
+ * selected camera. Fanned out client-side that is one query per camera to
31359
+ * read a `Map.get` at the owner — the answer costs nothing, the round trip
31360
+ * costs everything. Batched, N transports become one and the per-device
31361
+ * work is unchanged.
31362
+ *
31363
+ * Every requested deviceId gets a row, tagged `read` — see
31364
+ * {@link CameraOccupancySnapshotForDeviceSchema}. A camera the owner could
31365
+ * not answer for is `'unreadable'`, never an empty reading.
31366
+ */
31367
+ getCurrentSnapshotBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(CameraOccupancySnapshotForDeviceSchema).readonly()),
31049
31368
  /** Time-series object count inside one zone. `className` optional —
31050
31369
  * omit to count every class in the zone. */
31051
31370
  getZoneHistory: method(object({
@@ -33763,6 +34082,12 @@ Object.freeze({
33763
34082
  addonId: null,
33764
34083
  access: "delete"
33765
34084
  },
34085
+ "deviceManager.renameLocation": {
34086
+ capName: "device-manager",
34087
+ capScope: "system",
34088
+ addonId: null,
34089
+ access: "create"
34090
+ },
33766
34091
  "deviceManager.runDeviceAction": {
33767
34092
  capName: "device-manager",
33768
34093
  capScope: "system",
@@ -35455,13 +35780,19 @@ Object.freeze({
35455
35780
  addonId: null,
35456
35781
  access: "view"
35457
35782
  },
35458
- "pipelineAnalytics.getGroup": {
35783
+ "pipelineAnalytics.getKeyEvents": {
35459
35784
  capName: "pipeline-analytics",
35460
35785
  capScope: "device",
35461
35786
  addonId: null,
35462
35787
  access: "view"
35463
35788
  },
35464
- "pipelineAnalytics.getKeyEvents": {
35789
+ "pipelineAnalytics.getKeyEventsBatch": {
35790
+ capName: "pipeline-analytics",
35791
+ capScope: "device",
35792
+ addonId: null,
35793
+ access: "view"
35794
+ },
35795
+ "pipelineAnalytics.getMediaReclaimStatus": {
35465
35796
  capName: "pipeline-analytics",
35466
35797
  capScope: "device",
35467
35798
  addonId: null,
@@ -35551,12 +35882,6 @@ Object.freeze({
35551
35882
  addonId: null,
35552
35883
  access: "view"
35553
35884
  },
35554
- "pipelineAnalytics.listGroups": {
35555
- capName: "pipeline-analytics",
35556
- capScope: "device",
35557
- addonId: null,
35558
- access: "view"
35559
- },
35560
35885
  "pipelineAnalytics.listOpsLog": {
35561
35886
  capName: "pipeline-analytics",
35562
35887
  capScope: "device",
@@ -35641,6 +35966,12 @@ Object.freeze({
35641
35966
  addonId: null,
35642
35967
  access: "create"
35643
35968
  },
35969
+ "pipelineAnalytics.reclaimDebugMedia": {
35970
+ capName: "pipeline-analytics",
35971
+ capScope: "device",
35972
+ addonId: null,
35973
+ access: "create"
35974
+ },
35644
35975
  "pipelineAnalytics.reconcileFromDisk": {
35645
35976
  capName: "pipeline-analytics",
35646
35977
  capScope: "device",
@@ -36565,6 +36896,12 @@ Object.freeze({
36565
36896
  addonId: null,
36566
36897
  access: "view"
36567
36898
  },
36899
+ "recording.getPlacement": {
36900
+ capName: "recording",
36901
+ capScope: "system",
36902
+ addonId: null,
36903
+ access: "view"
36904
+ },
36568
36905
  "recording.getPlaybackManifest": {
36569
36906
  capName: "recording",
36570
36907
  capScope: "system",
@@ -36643,6 +36980,12 @@ Object.freeze({
36643
36980
  addonId: null,
36644
36981
  access: "view"
36645
36982
  },
36983
+ "recording.reconcileLedgerAgainstDisk": {
36984
+ capName: "recording",
36985
+ capScope: "system",
36986
+ addonId: null,
36987
+ access: "create"
36988
+ },
36646
36989
  "recording.refreshStorageLocationsForMigration": {
36647
36990
  capName: "recording",
36648
36991
  capScope: "system",
@@ -36685,6 +37028,12 @@ Object.freeze({
36685
37028
  addonId: null,
36686
37029
  access: "create"
36687
37030
  },
37031
+ "recording.setDevicePlacement": {
37032
+ capName: "recording",
37033
+ capScope: "system",
37034
+ addonId: null,
37035
+ access: "create"
37036
+ },
36688
37037
  "recording.startStorageMigrationMove": {
36689
37038
  capName: "recording",
36690
37039
  capScope: "system",
@@ -36769,6 +37118,12 @@ Object.freeze({
36769
37118
  addonId: null,
36770
37119
  access: "view"
36771
37120
  },
37121
+ "sceneMonitor.listScenesBatch": {
37122
+ capName: "scene-monitor",
37123
+ capScope: "device",
37124
+ addonId: null,
37125
+ access: "view"
37126
+ },
36772
37127
  "sceneMonitor.recheckNow": {
36773
37128
  capName: "scene-monitor",
36774
37129
  capScope: "device",
@@ -37123,12 +37478,36 @@ Object.freeze({
37123
37478
  addonId: null,
37124
37479
  access: "create"
37125
37480
  },
37481
+ "storageMigration.cleanupCancel": {
37482
+ capName: "storage-migration",
37483
+ capScope: "system",
37484
+ addonId: null,
37485
+ access: "create"
37486
+ },
37487
+ "storageMigration.cleanupStart": {
37488
+ capName: "storage-migration",
37489
+ capScope: "system",
37490
+ addonId: null,
37491
+ access: "create"
37492
+ },
37493
+ "storageMigration.cleanupStatus": {
37494
+ capName: "storage-migration",
37495
+ capScope: "system",
37496
+ addonId: null,
37497
+ access: "view"
37498
+ },
37126
37499
  "storageMigration.drain": {
37127
37500
  capName: "storage-migration",
37128
37501
  capScope: "system",
37129
37502
  addonId: null,
37130
37503
  access: "create"
37131
37504
  },
37505
+ "storageMigration.history": {
37506
+ capName: "storage-migration",
37507
+ capScope: "system",
37508
+ addonId: null,
37509
+ access: "view"
37510
+ },
37132
37511
  "storageMigration.movers": {
37133
37512
  capName: "storage-migration",
37134
37513
  capScope: "system",
@@ -38125,6 +38504,12 @@ Object.freeze({
38125
38504
  addonId: null,
38126
38505
  access: "view"
38127
38506
  },
38507
+ "zoneAnalytics.getCurrentSnapshotBatch": {
38508
+ capName: "zone-analytics",
38509
+ capScope: "device",
38510
+ addonId: null,
38511
+ access: "view"
38512
+ },
38128
38513
  "zoneAnalytics.getUnzonedHistory": {
38129
38514
  capName: "zone-analytics",
38130
38515
  capScope: "device",
@@ -39119,14 +39504,14 @@ Object.freeze({
39119
39504
  form: "single",
39120
39505
  optional: true
39121
39506
  }],
39122
- "pipelineAnalytics.getGroup": [{
39507
+ "pipelineAnalytics.getKeyEvents": [{
39123
39508
  name: "deviceId",
39124
39509
  form: "single",
39125
39510
  optional: false
39126
39511
  }],
39127
- "pipelineAnalytics.getKeyEvents": [{
39128
- name: "deviceId",
39129
- form: "single",
39512
+ "pipelineAnalytics.getKeyEventsBatch": [{
39513
+ name: "deviceIds",
39514
+ form: "array",
39130
39515
  optional: false
39131
39516
  }],
39132
39517
  "pipelineAnalytics.getMotionEvents": [{
@@ -39184,11 +39569,6 @@ Object.freeze({
39184
39569
  form: "single",
39185
39570
  optional: false
39186
39571
  }],
39187
- "pipelineAnalytics.listGroups": [{
39188
- name: "deviceIds",
39189
- form: "array",
39190
- optional: false
39191
- }],
39192
39572
  "pipelineAnalytics.listOpsLog": [{
39193
39573
  name: "deviceId",
39194
39574
  form: "single",
@@ -39234,6 +39614,11 @@ Object.freeze({
39234
39614
  form: "single",
39235
39615
  optional: true
39236
39616
  }],
39617
+ "pipelineAnalytics.reclaimDebugMedia": [{
39618
+ name: "deviceIds",
39619
+ form: "array",
39620
+ optional: true
39621
+ }],
39237
39622
  "pipelineAnalytics.reconcileFromDisk": [{
39238
39623
  name: "deviceId",
39239
39624
  form: "single",
@@ -39569,6 +39954,11 @@ Object.freeze({
39569
39954
  form: "single",
39570
39955
  optional: false
39571
39956
  }],
39957
+ "recording.reconcileLedgerAgainstDisk": [{
39958
+ name: "deviceId",
39959
+ form: "single",
39960
+ optional: true
39961
+ }],
39572
39962
  "recording.relocateFootage": [{
39573
39963
  name: "deviceId",
39574
39964
  form: "single",
@@ -39594,6 +39984,11 @@ Object.freeze({
39594
39984
  form: "single",
39595
39985
  optional: false
39596
39986
  }],
39987
+ "recording.setDevicePlacement": [{
39988
+ name: "deviceId",
39989
+ form: "single",
39990
+ optional: false
39991
+ }],
39597
39992
  "recording.startStorageMigrationMove": [{
39598
39993
  name: "deviceId",
39599
39994
  form: "single",
@@ -39634,6 +40029,11 @@ Object.freeze({
39634
40029
  form: "single",
39635
40030
  optional: false
39636
40031
  }],
40032
+ "sceneMonitor.listScenesBatch": [{
40033
+ name: "deviceIds",
40034
+ form: "array",
40035
+ optional: false
40036
+ }],
39637
40037
  "sceneMonitor.recheckNow": [{
39638
40038
  name: "deviceId",
39639
40039
  form: "single",
@@ -39895,6 +40295,11 @@ Object.freeze({
39895
40295
  form: "single",
39896
40296
  optional: false
39897
40297
  }],
40298
+ "zoneAnalytics.getCurrentSnapshotBatch": [{
40299
+ name: "deviceIds",
40300
+ form: "array",
40301
+ optional: false
40302
+ }],
39898
40303
  "zoneAnalytics.getUnzonedHistory": [{
39899
40304
  name: "deviceId",
39900
40305
  form: "single",