@camstack/addon-provider-dreo 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.js CHANGED
@@ -8054,6 +8054,20 @@ var RelocateJobSchema = object({
8054
8054
  * in its row, not in its name, so `MediaRelocateEngine` never reconciles one.
8055
8055
  */
8056
8056
  rowsReconciled: number().int().nonnegative().optional(),
8057
+ /**
8058
+ * Rows this run FORGOT because the file they name is not on disk.
8059
+ *
8060
+ * The mover derived the path from the row's own fields and `stat`ed it; an
8061
+ * ENOENT there is a per-path confirmation that the segment is gone (D296),
8062
+ * and the durable row is dropped through the same channel eviction uses. It
8063
+ * is reported for the same reason `rowsReconciled` is: this is a durable
8064
+ * mutation nobody asked for, and a migration that quietly erases hour rows is
8065
+ * the same failure as one that quietly skips them (D295).
8066
+ *
8067
+ * The production drain of 2026-08-30 would have reported 11 074 here — the
8068
+ * ledger claimed 5.65 GB of footage that no longer existed.
8069
+ */
8070
+ rowsForgotten: number().int().nonnegative().optional(),
8057
8071
  startedAt: number(),
8058
8072
  finishedAt: number().nullable(),
8059
8073
  error: string().nullable()
@@ -8118,6 +8132,13 @@ var MediaRelocateModeSchema = _enum([
8118
8132
  ]);
8119
8133
  var RelocateMediaInputSchema = object({
8120
8134
  toLocationId: string(),
8135
+ /**
8136
+ * Restrict the pass to rows currently on this location. Omitted / `'*'` =
8137
+ * every row that is not already on `toLocationId` (the historical
8138
+ * behaviour). A named source is what a from→to migration needs: without it
8139
+ * "move events off disk 2" also emptied disk 1.
8140
+ */
8141
+ fromLocationId: string().optional(),
8121
8142
  throttleMbps: number().min(1).max(1e3).optional(),
8122
8143
  /** Omitted = `move`, the pre-existing behaviour. */
8123
8144
  mode: MediaRelocateModeSchema.optional()
@@ -8185,6 +8206,19 @@ var StorageMigrationDestinationsSchema = object({
8185
8206
  galleryMedia: string().min(1).optional()
8186
8207
  }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
8187
8208
  /**
8209
+ * Optional named source per class. Omitted = the class's current default
8210
+ * (the historical behaviour). A named source that is NOT the default is a
8211
+ * drain of that disk: bytes move, the default stays, and the source is
8212
+ * disabled when the move finishes.
8213
+ */
8214
+ var StorageMigrationSourcesSchema = object({
8215
+ recordings: string().min(1).optional(),
8216
+ recordingsLow: string().min(1).optional(),
8217
+ eventMedia: string().min(1).optional(),
8218
+ backups: string().min(1).optional(),
8219
+ galleryMedia: string().min(1).optional()
8220
+ }).optional();
8221
+ /**
8188
8222
  * How a migration sequences the cutover against the byte move.
8189
8223
  *
8190
8224
  * - `blocking` — the historical order: pause, move every byte, repoint,
@@ -8206,6 +8240,8 @@ var StorageMigrationModeSchema = _enum(["blocking", "nonBlocking"]);
8206
8240
  /** Shared input for planning and starting an orchestrated storage migration. */
8207
8241
  var StorageMigrationInputSchema = object({
8208
8242
  destinations: StorageMigrationDestinationsSchema,
8243
+ /** Omitted = each class's current default. */
8244
+ sources: StorageMigrationSourcesSchema,
8209
8245
  throttleMbps: number().min(1).max(1e3).optional(),
8210
8246
  /** Omitted = `blocking`, which stays the default. */
8211
8247
  mode: StorageMigrationModeSchema.optional()
@@ -8285,6 +8321,13 @@ var StorageMigrationMoveSchema = object({
8285
8321
  storageClass: StorageMigrationClassSchema,
8286
8322
  fromLocationId: string(),
8287
8323
  toLocationId: string(),
8324
+ /**
8325
+ * True when `from` was NOT the class default at plan time. The move still
8326
+ * copies bytes, but the default is left alone and the source is disabled
8327
+ * once the copy verifies. Absent on jobs planned before this field existed
8328
+ * — those jobs always repointed, which is `false`.
8329
+ */
8330
+ freezeSource: boolean().optional(),
8288
8331
  moverJobId: string().nullable(),
8289
8332
  state: RelocateJobStateSchema.nullable(),
8290
8333
  error: string().nullable(),
@@ -8298,6 +8341,7 @@ var StorageMigrationJobSchema = object({
8298
8341
  * can tell a seconds-long cutover from a thirty-hour one. */
8299
8342
  mode: StorageMigrationModeSchema,
8300
8343
  destinations: StorageMigrationDestinationsSchema,
8344
+ sources: StorageMigrationSourcesSchema,
8301
8345
  throttleMbps: number(),
8302
8346
  moves: array(StorageMigrationMoveSchema),
8303
8347
  pauseLeaseId: string().nullable(),
@@ -8323,6 +8367,7 @@ var StorageMigrationFindingSchema = object({
8323
8367
  });
8324
8368
  var StorageMigrationPlanSchema = object({
8325
8369
  destinations: StorageMigrationDestinationsSchema,
8370
+ sources: StorageMigrationSourcesSchema,
8326
8371
  /** The mode this plan was built for. A plan is only valid for its mode: the
8327
8372
  * `eventMedia` seal gate and the single-cardinality refusal both depend on
8328
8373
  * it. */
@@ -8330,7 +8375,8 @@ var StorageMigrationPlanSchema = object({
8330
8375
  moves: array(object({
8331
8376
  storageClass: StorageMigrationClassSchema,
8332
8377
  fromLocationId: string(),
8333
- toLocationId: string()
8378
+ toLocationId: string(),
8379
+ freezeSource: boolean().optional()
8334
8380
  })),
8335
8381
  findings: array(StorageMigrationFindingSchema)
8336
8382
  });
@@ -8417,16 +8463,142 @@ var RelocateResidueSchema = object({
8417
8463
  segments: number().int().nonnegative(),
8418
8464
  bytes: number().int().nonnegative()
8419
8465
  }).nullable();
8466
+ /**
8467
+ * Ask one location whether its durable hour rows describe the disk — the walk
8468
+ * (D319).
8469
+ *
8470
+ * `apply` DEFAULTS TO FALSE and that default is the product: the operator's
8471
+ * missing tool is the question, and the dry run is how they sanity-check the
8472
+ * destructive run before authorising it.
8473
+ */
8474
+ var LedgerWalkInputSchema = object({
8475
+ locationId: string().min(1),
8476
+ /** Forget the confirmed-absent rows, rather than only counting them. */
8477
+ apply: boolean().optional(),
8478
+ /** Narrow to one camera. */
8479
+ deviceId: number().int().positive().optional(),
8480
+ /** Narrow to these recording profiles; empty/absent = every profile. */
8481
+ profiles: array(string().min(1)).optional()
8482
+ });
8483
+ /** Why a whole walk did nothing. Every one leaves the ledger untouched. */
8484
+ var LedgerWalkRefusalSchema = _enum([
8485
+ "location-unknown",
8486
+ "source-writable",
8487
+ "no-ledger",
8488
+ "archive-unreadable",
8489
+ "anchor-absent",
8490
+ "anchor-unreadable",
8491
+ "anchor-moved"
8492
+ ]);
8493
+ _enum([
8494
+ "live-tail",
8495
+ "listing-error",
8496
+ "path-mismatch",
8497
+ "durable-refused"
8498
+ ]);
8499
+ /** Every skip reason, always present, always a number — so a reason that never
8500
+ * fired reports as zero rather than absent and the report shape is constant
8501
+ * between passes. Spelled out rather than `z.record` for exactly that. */
8502
+ var LedgerWalkSkipCountsSchema = object({
8503
+ "live-tail": number().int().nonnegative(),
8504
+ "listing-error": number().int().nonnegative(),
8505
+ "path-mismatch": number().int().nonnegative(),
8506
+ "durable-refused": number().int().nonnegative()
8507
+ });
8508
+ /** One camera's share of a walk, so a report names cameras and not rows. */
8509
+ var LedgerWalkDeviceReportSchema = object({
8510
+ deviceId: number().int(),
8511
+ hoursWalked: number().int().nonnegative(),
8512
+ hoursMissing: number().int().nonnegative(),
8513
+ ghostSegments: number().int().nonnegative(),
8514
+ ghostBytes: number().int().nonnegative(),
8515
+ forgottenSegments: number().int().nonnegative(),
8516
+ orphanFiles: number().int().nonnegative()
8517
+ });
8518
+ /**
8519
+ * What one walk claimed, listed, found and (only when armed) forgot.
8520
+ *
8521
+ * `archiveSegments` is the **M** and `segmentsClaimed` the **N** (D295), so a
8522
+ * walk that saw a fraction of the location is visible in its own report rather
8523
+ * than in the absence of one.
8524
+ */
8525
+ var LedgerWalkReportSchema = object({
8526
+ locationId: string(),
8527
+ applied: boolean(),
8528
+ refused: LedgerWalkRefusalSchema.nullable(),
8529
+ archiveSegments: number().int().nonnegative().nullable(),
8530
+ archiveBytes: number().int().nonnegative().nullable(),
8531
+ hoursClaimed: number().int().nonnegative(),
8532
+ hoursWalked: number().int().nonnegative(),
8533
+ hoursMissing: number().int().nonnegative(),
8534
+ /** `readdir` calls issued — the cost, stated in the unit that is paid. */
8535
+ listings: number().int().nonnegative(),
8536
+ segmentsClaimed: number().int().nonnegative(),
8537
+ ghostSegments: number().int().nonnegative(),
8538
+ ghostBytes: number().int().nonnegative(),
8539
+ ghostHoursWhole: number().int().nonnegative(),
8540
+ forgottenSegments: number().int().nonnegative(),
8541
+ forgottenBytes: number().int().nonnegative(),
8542
+ /** Files under a claimed hour that no durable row names. Never deleted. */
8543
+ orphanFiles: number().int().nonnegative(),
8544
+ orphanSample: array(string()).readonly(),
8545
+ hoursSkipped: number().int().nonnegative(),
8546
+ skippedByReason: LedgerWalkSkipCountsSchema,
8547
+ /** The walk stopped at its per-pass hour bound with claims unwalked. */
8548
+ bounded: boolean(),
8549
+ byDevice: array(LedgerWalkDeviceReportSchema).readonly()
8550
+ });
8420
8551
  /** How many rows a media pass would still act on against a given target — the
8421
8552
  * media lane's denominator AND its residue, from ONE derivation so the two can
8422
8553
  * never disagree. `null` = the count could not be taken. */
8423
8554
  var RelocatableMediaCountSchema = object({ rows: number().int().nonnegative() }).nullable();
8424
8555
  var RelocatableMediaCountInputSchema = object({
8425
8556
  toLocationId: string().min(1),
8557
+ /** Restrict the count to one source; omitted / `'*'` = every non-target row. */
8558
+ fromLocationId: string().optional(),
8426
8559
  /** Omitted = `move`. */
8427
8560
  mode: MediaRelocateModeSchema.optional()
8428
8561
  });
8429
8562
  /**
8563
+ * Operator cleanup of leftover analytics rows, optional debug media, and
8564
+ * ghost ledger entries on frozen footage locations.
8565
+ *
8566
+ * A pass is tens of minutes on a standing backlog. The hub method RETURNS
8567
+ * `{ jobId }` immediately; progress is `cleanupStatus`. Awaiting the work
8568
+ * is how `addons.custom` hit the 60 s UDS deadline while reclaim continued
8569
+ * with no operator-visible status.
8570
+ */
8571
+ var StorageCleanupPhaseSchema = _enum([
8572
+ "orphans",
8573
+ "debug-media",
8574
+ "ghost-ledger",
8575
+ "done",
8576
+ "failed",
8577
+ "cancelled"
8578
+ ]);
8579
+ var StorageCleanupInputSchema = object({
8580
+ /** Also walk motion stills / track filmstrips. Off by default. */
8581
+ includeDebugMedia: boolean().optional() });
8582
+ var StorageCleanupJobSchema = object({
8583
+ jobId: string(),
8584
+ phase: StorageCleanupPhaseSchema,
8585
+ includeDebugMedia: boolean(),
8586
+ orphansReclaimed: number().int().nonnegative(),
8587
+ orphanBytesReclaimed: number().int().nonnegative(),
8588
+ debugMediaReclaimed: number().int().nonnegative(),
8589
+ debugMediaBytesReclaimed: number().int().nonnegative(),
8590
+ ghostsForgotten: number().int().nonnegative(),
8591
+ ghostBytesForgotten: number().int().nonnegative(),
8592
+ /** Short operator-facing line: current collection, pass, or location. */
8593
+ detail: string().nullable(),
8594
+ cancelRequested: boolean(),
8595
+ startedAt: number(),
8596
+ updatedAt: number(),
8597
+ finishedAt: number().nullable(),
8598
+ error: string().nullable()
8599
+ });
8600
+ var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8601
+ /**
8430
8602
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8431
8603
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8432
8604
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8454,11 +8626,10 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
8454
8626
  * The default location for a type uses `id === <type>:default` by
8455
8627
  * convention (the bare type ref like `'backups'` resolves to it).
8456
8628
  *
8457
- * `isSystem: true` marks a location as orchestrator-seeded and
8458
- * undeletable. The bootstrap-installed defaults (one per type) carry
8459
- * this flag; operator-added locations don't. Editing the config of
8460
- * a system location is allowed (path migration, provider swap) but
8461
- * deleting it is rejected at the cap level.
8629
+ * `isSystem` is a legacy persisted flag. Seed still creates the initial
8630
+ * `<type>:default` locations; the flag is no longer a lock, a badge, or a
8631
+ * prune selector. New writes leave it false. Deletion is gated on uniqueness
8632
+ * / last-enabled, not on this bit.
8462
8633
  */
8463
8634
  var StorageLocationSchema = object({
8464
8635
  id: string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),
@@ -13001,6 +13172,12 @@ method(object({
13001
13172
  }), _void(), {
13002
13173
  kind: "mutation",
13003
13174
  auth: "admin"
13175
+ }), method(object({
13176
+ from: string(),
13177
+ to: string()
13178
+ }), object({ moved: number() }), {
13179
+ kind: "mutation",
13180
+ auth: "admin"
13004
13181
  }), method(object({
13005
13182
  deviceId: number(),
13006
13183
  disabled: boolean()
@@ -19009,53 +19186,15 @@ var RecentTracksPageSchema = object({
19009
19186
  /** Cursor for the next page, or null when this page is the last. */
19010
19187
  nextCursor: string().nullable()
19011
19188
  });
19012
- var LIST_GROUPS_DEFAULT_LIMIT = 40;
19013
- var LIST_GROUPS_MAX_LIMIT = 100;
19014
- var AnalyticsGroupRecordSchema = object({
19015
- id: string(),
19016
- deviceId: number().int(),
19017
- openedAt: number().int(),
19018
- closedAt: number().int(),
19019
- timestamp: number().int(),
19020
- memberCount: number().int(),
19021
- memberTrackIds: array(string()).readonly(),
19022
- className: string(),
19023
- classes: array(string()).readonly(),
19024
- /** Relative event-media path, or null when the group has no picture yet. */
19025
- mediaUrl: string().nullable(),
19026
- singleton: boolean()
19027
- });
19028
- var AnalyticsGroupMemberSchema = object({
19029
- trackId: string(),
19030
- deviceId: number().int(),
19031
- className: string(),
19032
- firstSeen: number().int(),
19033
- lastSeen: number().int(),
19034
- mediaUrl: string().nullable()
19035
- });
19036
- var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
19037
- var ListGroupsQueryInput = object({
19038
- /** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
19039
- deviceIds: array(number()),
19040
- /** Window lower bound on `closedAt` (inclusive). */
19041
- since: number().optional(),
19042
- /** Window upper bound on `openedAt` (inclusive). */
19043
- until: number().optional(),
19044
- limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
19045
- /** Opaque continuation cursor from a previous page's `nextCursor`. */
19046
- cursor: string().optional()
19047
- });
19048
- var ListGroupsPageSchema = object({
19049
- groups: array(AnalyticsGroupRecordSchema).readonly(),
19050
- nextCursor: string().nullable()
19051
- });
19189
+ var KEY_EVENTS_DEFAULT_LIMIT = 50;
19190
+ var KEY_EVENTS_MAX_LIMIT = 200;
19052
19191
  var KeyEventQueryInput = object({
19053
19192
  deviceId: number(),
19054
19193
  /** Window lower bound (track firstSeen ≥ since). */
19055
19194
  since: number(),
19056
19195
  /** Window upper bound (track firstSeen ≤ until). */
19057
19196
  until: number(),
19058
- limit: number().int().min(1).max(200).default(50),
19197
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
19059
19198
  /** Drop tracks scoring below this importance. */
19060
19199
  minImportance: number().min(0).max(1).optional(),
19061
19200
  /** Restrict to a single class (e.g. 'person'). */
@@ -19077,6 +19216,32 @@ var KeyEventSchema = object({
19077
19216
  ...TrackFlagFields,
19078
19217
  ...TrackRetrainFields
19079
19218
  });
19219
+ /** `getKeyEvents`' window and filters, asked of a SET of cameras at once. */
19220
+ var KeyEventBatchQueryInput = object({
19221
+ deviceIds: array(number()).min(1).max(200),
19222
+ since: number(),
19223
+ until: number(),
19224
+ /** Applied PER CAMERA, exactly as `getKeyEvents.limit` is — never a total
19225
+ * across the set, which would let a busy camera starve a quiet one of its
19226
+ * rows and change what the merged feed contains. */
19227
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
19228
+ minImportance: number().min(0).max(1).optional(),
19229
+ classFilter: string().optional()
19230
+ });
19231
+ /**
19232
+ * One camera's key events in a batch answer.
19233
+ *
19234
+ * The row exists for every requested id. `getKeyEvents` degrades to `[]` on
19235
+ * error rather than throwing, so a camera whose store read failed and one with
19236
+ * no events in the window were ALREADY indistinguishable per camera — the
19237
+ * batch does not make that worse, and the row keeps the deviceId the single
19238
+ * method's output never carried (the caller used to stamp it from the fan-out
19239
+ * key, which only worked because there was one query per camera).
19240
+ */
19241
+ var KeyEventsForDeviceSchema = object({
19242
+ deviceId: number(),
19243
+ events: array(KeyEventSchema).readonly()
19244
+ });
19080
19245
  object({
19081
19246
  trackId: string(),
19082
19247
  className: string(),
@@ -19124,9 +19289,7 @@ var TrackCascadeCountsSchema = object({
19124
19289
  /** Unassigned plate reads removed (best-effort; plate leg deferred to plate-intelligence). */
19125
19290
  plates: number().int(),
19126
19291
  /** Per-track CLIP search vectors removed (best-effort). */
19127
- embeddings: number().int(),
19128
- /** Group membership + group rows removed with their last member (best-effort). */
19129
- groups: number().int()
19292
+ embeddings: number().int()
19130
19293
  });
19131
19294
  /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
19132
19295
  var DiskReconcileCountsSchema = object({
@@ -19296,6 +19459,47 @@ var RebuildStatusSchema = object({
19296
19459
  /** Present when the pass ended by throwing. */
19297
19460
  error: string().nullable()
19298
19461
  });
19462
+ /**
19463
+ * Acknowledgement that a debug-media reclaim STARTED.
19464
+ *
19465
+ * The pass is paced at ~2 MB/s over a standing 100 GB — tens of minutes — so
19466
+ * it runs detached and this returns immediately. Awaiting it is how the
19467
+ * `addons.custom` door hit the 60 s UDS deadline while the walk carried on
19468
+ * with no status. Poll {@link pipelineAnalyticsCapability.methods.getMediaReclaimStatus}.
19469
+ */
19470
+ var MediaReclaimStartResultSchema = object({
19471
+ started: boolean(),
19472
+ /** True when a pass was already running; the new request is ignored. */
19473
+ alreadyRunning: boolean()
19474
+ });
19475
+ var MediaReclaimInputSchema = object({
19476
+ mode: _enum(["report", "reclaim"]).default("report"),
19477
+ scopes: array(_enum(["motion-still", "track-filmstrip"])).min(1).optional(),
19478
+ deviceIds: array(number().int()).min(1).optional(),
19479
+ restart: boolean().optional(),
19480
+ pageSize: number().int().min(50).max(5e3).optional(),
19481
+ maxRowsPerDevice: number().int().min(1).max(5e5).optional(),
19482
+ maxReclaimPerDevice: number().int().min(1).max(5e5).optional(),
19483
+ maxBytesPerRun: number().int().min(1).optional(),
19484
+ budgetMinutes: number().int().min(1).max(720).optional(),
19485
+ throttleBytesPerSec: number().int().min(64 * 1024).optional(),
19486
+ graceMinutes: number().int().min(1).max(10080).optional()
19487
+ });
19488
+ var MediaReclaimStatusSchema = object({
19489
+ running: boolean(),
19490
+ mode: _enum(["report", "reclaim"]).nullable(),
19491
+ totalExamined: number(),
19492
+ totalEligible: number(),
19493
+ totalReclaimed: number(),
19494
+ totalBytesReclaimed: number(),
19495
+ totalRefused: number(),
19496
+ /** Device+scope windows finished in this pass. */
19497
+ devicesDone: number(),
19498
+ complete: boolean().nullable(),
19499
+ startedAtMs: number().nullable(),
19500
+ finishedAtMs: number().nullable(),
19501
+ error: string().nullable()
19502
+ });
19299
19503
  var ReplayFrameInputSchema = object({
19300
19504
  timestamp: number(),
19301
19505
  frame: PipelineRunResultBridge
@@ -19334,10 +19538,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19334
19538
  * stationary registry). Default false: the timeline lists passages,
19335
19539
  * not parking records (operator decision, 2026-08-15). */
19336
19540
  includeStationary: boolean().optional()
19337
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(ListGroupsQueryInput, ListGroupsPageSchema), method(object({
19338
- deviceId: number(),
19339
- groupId: string().min(1)
19340
- }), AnalyticsGroupDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
19541
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
19341
19542
  kind: "mutation",
19342
19543
  auth: "admin"
19343
19544
  }), 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({
@@ -19346,7 +19547,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19346
19547
  until: number().optional(),
19347
19548
  kinds: array(string()).optional(),
19348
19549
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
19349
- }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
19550
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
19350
19551
  deviceId: number(),
19351
19552
  since: number(),
19352
19553
  until: number(),
@@ -19437,6 +19638,12 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19437
19638
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
19438
19639
  kind: "query",
19439
19640
  auth: "admin"
19641
+ }), method(MediaReclaimInputSchema, MediaReclaimStartResultSchema, {
19642
+ kind: "mutation",
19643
+ auth: "admin"
19644
+ }), method(object({}), MediaReclaimStatusSchema, {
19645
+ kind: "query",
19646
+ auth: "admin"
19440
19647
  }), method(object({ deviceIds: array(number()).optional() }), TrainingExportSummarySchema, {
19441
19648
  kind: "query",
19442
19649
  auth: "admin"
@@ -21407,7 +21614,13 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
21407
21614
  }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
21408
21615
  kind: "mutation",
21409
21616
  auth: "admin"
21410
- });
21617
+ }), method(StorageCleanupInputSchema, object({ jobId: string() }), {
21618
+ kind: "mutation",
21619
+ auth: "admin"
21620
+ }), method(StorageCleanupStatusInputSchema, StorageCleanupJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
21621
+ kind: "mutation",
21622
+ auth: "admin"
21623
+ }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
21411
21624
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
21412
21625
  providerId: string().min(1),
21413
21626
  displayName: string().min(1),
@@ -28508,6 +28721,33 @@ var RecordingRebalanceInputSchema = object({
28508
28721
  minMoveGb: number().min(0).optional()
28509
28722
  });
28510
28723
  /**
28724
+ * Operator-facing placement of one camera onto a recordings location.
28725
+ *
28726
+ * `pinLocationId` is the operator instruction: a location id, or `null` for
28727
+ * Auto (the planner may move this camera). `locationId` is where high/mid
28728
+ * currently write — the plan, which may disagree with the pin when Auto.
28729
+ */
28730
+ var RecordingDevicePlacementSchema = object({
28731
+ deviceId: number().int(),
28732
+ profile: string(),
28733
+ locationId: string()
28734
+ });
28735
+ var RecordingDevicePinSchema = object({
28736
+ deviceId: number().int(),
28737
+ /** Recordings-class location this camera is pinned to. */
28738
+ locationId: string()
28739
+ });
28740
+ var RecordingPlacementViewSchema = object({
28741
+ assignments: array(RecordingDevicePlacementSchema),
28742
+ pins: array(RecordingDevicePinSchema),
28743
+ defaultLocations: record(string(), string())
28744
+ });
28745
+ var RecordingSetDevicePlacementInputSchema = object({
28746
+ deviceId: number().int(),
28747
+ /** `null` = Auto. Otherwise a `recordings:*` location id. */
28748
+ locationId: string().nullable()
28749
+ });
28750
+ /**
28511
28751
  * Result of locating footage at a wall-clock instant for one device/profile.
28512
28752
  * `segment` carries the covering segment's window; `gap` reports the forward
28513
28753
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -28721,6 +28961,9 @@ method(object({
28721
28961
  }), method(RelocateResidueInputSchema, RelocateResidueSchema, {
28722
28962
  kind: "query",
28723
28963
  auth: "admin"
28964
+ }), method(LedgerWalkInputSchema, LedgerWalkReportSchema, {
28965
+ kind: "mutation",
28966
+ auth: "admin"
28724
28967
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
28725
28968
  kind: "mutation",
28726
28969
  auth: "admin"
@@ -28730,6 +28973,12 @@ method(object({
28730
28973
  }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
28731
28974
  kind: "mutation",
28732
28975
  auth: "admin"
28976
+ }), method(object({}), RecordingPlacementViewSchema, {
28977
+ kind: "query",
28978
+ auth: "admin"
28979
+ }), method(RecordingSetDevicePlacementInputSchema, object({ ok: literal(true) }), {
28980
+ kind: "mutation",
28981
+ auth: "admin"
28733
28982
  });
28734
28983
  /**
28735
28984
  * `recording-export` cap — render a footage time range into a single downloadable
@@ -29112,6 +29361,25 @@ var SceneMonitorStatusSchema = object({
29112
29361
  monitors: array(SceneMonitorSchema),
29113
29362
  lastFetchedAt: number()
29114
29363
  });
29364
+ /**
29365
+ * One camera's row in a `listScenesBatch` answer.
29366
+ *
29367
+ * `status` is NULLABLE and the nullability is the whole point. `scene-monitor`
29368
+ * is a `defaultActive` wrapper, so every camera is asked; a camera whose
29369
+ * provider is absent (pipeline-analytics not deployed, the post-processing node
29370
+ * down) cannot answer, and that is not the same fact as a camera with no scenes
29371
+ * configured. Fanned out per camera the difference was visible — one query
29372
+ * errored while the others resolved — and a batch that returned only the rows
29373
+ * it managed would have destroyed it, silently, by making an unreachable camera
29374
+ * indistinguishable from one that answered `monitors: []`.
29375
+ *
29376
+ * So: EVERY requested deviceId gets a row. `status: null` means "this camera
29377
+ * could not be read"; `status.monitors: []` means "read, and it has none".
29378
+ */
29379
+ var SceneMonitorStatusForDeviceSchema = object({
29380
+ deviceId: number(),
29381
+ status: SceneMonitorStatusSchema.nullable()
29382
+ });
29115
29383
  var sceneMonitorCapability = {
29116
29384
  name: "scene-monitor",
29117
29385
  scope: "device",
@@ -29121,6 +29389,22 @@ var sceneMonitorCapability = {
29121
29389
  deviceTypes: [DeviceType.Camera],
29122
29390
  methods: {
29123
29391
  listScenes: method(object({ deviceId: number() }), SceneMonitorStatusSchema),
29392
+ /**
29393
+ * The same answer, for a SET of cameras, in one round trip.
29394
+ *
29395
+ * `/scenes` renders every camera and re-reads them on a 30s safety-net
29396
+ * poll behind the push slice. Fanned out client-side that was one query
29397
+ * per camera — 29 round trips through the browser, the hub and the
29398
+ * post-analysis runner every 30 seconds to read an in-memory map the
29399
+ * owner had already merged. The work is unchanged (`statusFor` per
29400
+ * device, all in-process at the owner); what collapses is the transport.
29401
+ *
29402
+ * A camera that cannot answer still gets a row, with `status: null` —
29403
+ * see {@link SceneMonitorStatusForDeviceSchema}. Never fewer rows than
29404
+ * ids: a caller that asked for twenty-nine and got twenty-seven cannot
29405
+ * tell which two are missing, or that any are.
29406
+ */
29407
+ listScenesBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(SceneMonitorStatusForDeviceSchema).readonly()),
29124
29408
  createScene: method(object({
29125
29409
  deviceId: number(),
29126
29410
  label: string(),
@@ -30956,6 +31240,27 @@ var CameraOccupancySnapshotSchema = object({
30956
31240
  stationaryObjects: array(StationaryObjectSchema).readonly().optional()
30957
31241
  });
30958
31242
  /**
31243
+ * One camera's row in a `getCurrentSnapshotBatch` answer.
31244
+ *
31245
+ * THREE outcomes, and the single-camera method could only express two of them
31246
+ * because `snapshot: null` was already spoken for:
31247
+ *
31248
+ * - `read: 'read'`, `snapshot` present — the live occupancy reading.
31249
+ * - `read: 'read'`, `snapshot: null` — read, and this camera has no reading
31250
+ * yet: no frame since boot, and no parked-object registry to hydrate from.
31251
+ * - `read: 'unreadable'` — the owner could not answer for this
31252
+ * camera. `snapshot` is null, and it does NOT mean "nothing parked here".
31253
+ *
31254
+ * Collapsing the last two is the failure this field exists to prevent: a
31255
+ * hydration that threw would otherwise render as an empty Stationary section,
31256
+ * which is a definite claim about a camera nobody could read.
31257
+ */
31258
+ var CameraOccupancySnapshotForDeviceSchema = object({
31259
+ deviceId: number(),
31260
+ read: _enum(["read", "unreadable"]),
31261
+ snapshot: CameraOccupancySnapshotSchema.nullable()
31262
+ });
31263
+ /**
30959
31264
  * Time-series resolution. The history methods return one bucket per
30960
31265
  * step over the requested range. Smaller resolutions cost more
30961
31266
  * memory + bandwidth; bound to discrete steps so caller cannot ask
@@ -31012,6 +31317,20 @@ var zoneAnalyticsCapability = {
31012
31317
  * (no inference result emitted since boot or since binding was
31013
31318
  * activated). */
31014
31319
  getCurrentSnapshot: method(object({ deviceId: number() }), CameraOccupancySnapshotSchema.nullable()),
31320
+ /**
31321
+ * The same snapshot, for a SET of cameras, in one round trip.
31322
+ *
31323
+ * The Events page's Stationary section polls this every 15s for every
31324
+ * selected camera. Fanned out client-side that is one query per camera to
31325
+ * read a `Map.get` at the owner — the answer costs nothing, the round trip
31326
+ * costs everything. Batched, N transports become one and the per-device
31327
+ * work is unchanged.
31328
+ *
31329
+ * Every requested deviceId gets a row, tagged `read` — see
31330
+ * {@link CameraOccupancySnapshotForDeviceSchema}. A camera the owner could
31331
+ * not answer for is `'unreadable'`, never an empty reading.
31332
+ */
31333
+ getCurrentSnapshotBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(CameraOccupancySnapshotForDeviceSchema).readonly()),
31015
31334
  /** Time-series object count inside one zone. `className` optional —
31016
31335
  * omit to count every class in the zone. */
31017
31336
  getZoneHistory: method(object({
@@ -33729,6 +34048,12 @@ Object.freeze({
33729
34048
  addonId: null,
33730
34049
  access: "delete"
33731
34050
  },
34051
+ "deviceManager.renameLocation": {
34052
+ capName: "device-manager",
34053
+ capScope: "system",
34054
+ addonId: null,
34055
+ access: "create"
34056
+ },
33732
34057
  "deviceManager.runDeviceAction": {
33733
34058
  capName: "device-manager",
33734
34059
  capScope: "system",
@@ -35421,13 +35746,19 @@ Object.freeze({
35421
35746
  addonId: null,
35422
35747
  access: "view"
35423
35748
  },
35424
- "pipelineAnalytics.getGroup": {
35749
+ "pipelineAnalytics.getKeyEvents": {
35425
35750
  capName: "pipeline-analytics",
35426
35751
  capScope: "device",
35427
35752
  addonId: null,
35428
35753
  access: "view"
35429
35754
  },
35430
- "pipelineAnalytics.getKeyEvents": {
35755
+ "pipelineAnalytics.getKeyEventsBatch": {
35756
+ capName: "pipeline-analytics",
35757
+ capScope: "device",
35758
+ addonId: null,
35759
+ access: "view"
35760
+ },
35761
+ "pipelineAnalytics.getMediaReclaimStatus": {
35431
35762
  capName: "pipeline-analytics",
35432
35763
  capScope: "device",
35433
35764
  addonId: null,
@@ -35517,12 +35848,6 @@ Object.freeze({
35517
35848
  addonId: null,
35518
35849
  access: "view"
35519
35850
  },
35520
- "pipelineAnalytics.listGroups": {
35521
- capName: "pipeline-analytics",
35522
- capScope: "device",
35523
- addonId: null,
35524
- access: "view"
35525
- },
35526
35851
  "pipelineAnalytics.listOpsLog": {
35527
35852
  capName: "pipeline-analytics",
35528
35853
  capScope: "device",
@@ -35607,6 +35932,12 @@ Object.freeze({
35607
35932
  addonId: null,
35608
35933
  access: "create"
35609
35934
  },
35935
+ "pipelineAnalytics.reclaimDebugMedia": {
35936
+ capName: "pipeline-analytics",
35937
+ capScope: "device",
35938
+ addonId: null,
35939
+ access: "create"
35940
+ },
35610
35941
  "pipelineAnalytics.reconcileFromDisk": {
35611
35942
  capName: "pipeline-analytics",
35612
35943
  capScope: "device",
@@ -36531,6 +36862,12 @@ Object.freeze({
36531
36862
  addonId: null,
36532
36863
  access: "view"
36533
36864
  },
36865
+ "recording.getPlacement": {
36866
+ capName: "recording",
36867
+ capScope: "system",
36868
+ addonId: null,
36869
+ access: "view"
36870
+ },
36534
36871
  "recording.getPlaybackManifest": {
36535
36872
  capName: "recording",
36536
36873
  capScope: "system",
@@ -36609,6 +36946,12 @@ Object.freeze({
36609
36946
  addonId: null,
36610
36947
  access: "view"
36611
36948
  },
36949
+ "recording.reconcileLedgerAgainstDisk": {
36950
+ capName: "recording",
36951
+ capScope: "system",
36952
+ addonId: null,
36953
+ access: "create"
36954
+ },
36612
36955
  "recording.refreshStorageLocationsForMigration": {
36613
36956
  capName: "recording",
36614
36957
  capScope: "system",
@@ -36651,6 +36994,12 @@ Object.freeze({
36651
36994
  addonId: null,
36652
36995
  access: "create"
36653
36996
  },
36997
+ "recording.setDevicePlacement": {
36998
+ capName: "recording",
36999
+ capScope: "system",
37000
+ addonId: null,
37001
+ access: "create"
37002
+ },
36654
37003
  "recording.startStorageMigrationMove": {
36655
37004
  capName: "recording",
36656
37005
  capScope: "system",
@@ -36735,6 +37084,12 @@ Object.freeze({
36735
37084
  addonId: null,
36736
37085
  access: "view"
36737
37086
  },
37087
+ "sceneMonitor.listScenesBatch": {
37088
+ capName: "scene-monitor",
37089
+ capScope: "device",
37090
+ addonId: null,
37091
+ access: "view"
37092
+ },
36738
37093
  "sceneMonitor.recheckNow": {
36739
37094
  capName: "scene-monitor",
36740
37095
  capScope: "device",
@@ -37089,12 +37444,36 @@ Object.freeze({
37089
37444
  addonId: null,
37090
37445
  access: "create"
37091
37446
  },
37447
+ "storageMigration.cleanupCancel": {
37448
+ capName: "storage-migration",
37449
+ capScope: "system",
37450
+ addonId: null,
37451
+ access: "create"
37452
+ },
37453
+ "storageMigration.cleanupStart": {
37454
+ capName: "storage-migration",
37455
+ capScope: "system",
37456
+ addonId: null,
37457
+ access: "create"
37458
+ },
37459
+ "storageMigration.cleanupStatus": {
37460
+ capName: "storage-migration",
37461
+ capScope: "system",
37462
+ addonId: null,
37463
+ access: "view"
37464
+ },
37092
37465
  "storageMigration.drain": {
37093
37466
  capName: "storage-migration",
37094
37467
  capScope: "system",
37095
37468
  addonId: null,
37096
37469
  access: "create"
37097
37470
  },
37471
+ "storageMigration.history": {
37472
+ capName: "storage-migration",
37473
+ capScope: "system",
37474
+ addonId: null,
37475
+ access: "view"
37476
+ },
37098
37477
  "storageMigration.movers": {
37099
37478
  capName: "storage-migration",
37100
37479
  capScope: "system",
@@ -38091,6 +38470,12 @@ Object.freeze({
38091
38470
  addonId: null,
38092
38471
  access: "view"
38093
38472
  },
38473
+ "zoneAnalytics.getCurrentSnapshotBatch": {
38474
+ capName: "zone-analytics",
38475
+ capScope: "device",
38476
+ addonId: null,
38477
+ access: "view"
38478
+ },
38094
38479
  "zoneAnalytics.getUnzonedHistory": {
38095
38480
  capName: "zone-analytics",
38096
38481
  capScope: "device",
@@ -39085,14 +39470,14 @@ Object.freeze({
39085
39470
  form: "single",
39086
39471
  optional: true
39087
39472
  }],
39088
- "pipelineAnalytics.getGroup": [{
39473
+ "pipelineAnalytics.getKeyEvents": [{
39089
39474
  name: "deviceId",
39090
39475
  form: "single",
39091
39476
  optional: false
39092
39477
  }],
39093
- "pipelineAnalytics.getKeyEvents": [{
39094
- name: "deviceId",
39095
- form: "single",
39478
+ "pipelineAnalytics.getKeyEventsBatch": [{
39479
+ name: "deviceIds",
39480
+ form: "array",
39096
39481
  optional: false
39097
39482
  }],
39098
39483
  "pipelineAnalytics.getMotionEvents": [{
@@ -39150,11 +39535,6 @@ Object.freeze({
39150
39535
  form: "single",
39151
39536
  optional: false
39152
39537
  }],
39153
- "pipelineAnalytics.listGroups": [{
39154
- name: "deviceIds",
39155
- form: "array",
39156
- optional: false
39157
- }],
39158
39538
  "pipelineAnalytics.listOpsLog": [{
39159
39539
  name: "deviceId",
39160
39540
  form: "single",
@@ -39200,6 +39580,11 @@ Object.freeze({
39200
39580
  form: "single",
39201
39581
  optional: true
39202
39582
  }],
39583
+ "pipelineAnalytics.reclaimDebugMedia": [{
39584
+ name: "deviceIds",
39585
+ form: "array",
39586
+ optional: true
39587
+ }],
39203
39588
  "pipelineAnalytics.reconcileFromDisk": [{
39204
39589
  name: "deviceId",
39205
39590
  form: "single",
@@ -39535,6 +39920,11 @@ Object.freeze({
39535
39920
  form: "single",
39536
39921
  optional: false
39537
39922
  }],
39923
+ "recording.reconcileLedgerAgainstDisk": [{
39924
+ name: "deviceId",
39925
+ form: "single",
39926
+ optional: true
39927
+ }],
39538
39928
  "recording.relocateFootage": [{
39539
39929
  name: "deviceId",
39540
39930
  form: "single",
@@ -39560,6 +39950,11 @@ Object.freeze({
39560
39950
  form: "single",
39561
39951
  optional: false
39562
39952
  }],
39953
+ "recording.setDevicePlacement": [{
39954
+ name: "deviceId",
39955
+ form: "single",
39956
+ optional: false
39957
+ }],
39563
39958
  "recording.startStorageMigrationMove": [{
39564
39959
  name: "deviceId",
39565
39960
  form: "single",
@@ -39600,6 +39995,11 @@ Object.freeze({
39600
39995
  form: "single",
39601
39996
  optional: false
39602
39997
  }],
39998
+ "sceneMonitor.listScenesBatch": [{
39999
+ name: "deviceIds",
40000
+ form: "array",
40001
+ optional: false
40002
+ }],
39603
40003
  "sceneMonitor.recheckNow": [{
39604
40004
  name: "deviceId",
39605
40005
  form: "single",
@@ -39861,6 +40261,11 @@ Object.freeze({
39861
40261
  form: "single",
39862
40262
  optional: false
39863
40263
  }],
40264
+ "zoneAnalytics.getCurrentSnapshotBatch": [{
40265
+ name: "deviceIds",
40266
+ form: "array",
40267
+ optional: false
40268
+ }],
39864
40269
  "zoneAnalytics.getUnzonedHistory": [{
39865
40270
  name: "deviceId",
39866
40271
  form: "single",