@camstack/addon-provider-wyze 0.2.52 → 0.2.54

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
@@ -8050,6 +8050,20 @@ var RelocateJobSchema = object({
8050
8050
  * in its row, not in its name, so `MediaRelocateEngine` never reconciles one.
8051
8051
  */
8052
8052
  rowsReconciled: number().int().nonnegative().optional(),
8053
+ /**
8054
+ * Rows this run FORGOT because the file they name is not on disk.
8055
+ *
8056
+ * The mover derived the path from the row's own fields and `stat`ed it; an
8057
+ * ENOENT there is a per-path confirmation that the segment is gone (D296),
8058
+ * and the durable row is dropped through the same channel eviction uses. It
8059
+ * is reported for the same reason `rowsReconciled` is: this is a durable
8060
+ * mutation nobody asked for, and a migration that quietly erases hour rows is
8061
+ * the same failure as one that quietly skips them (D295).
8062
+ *
8063
+ * The production drain of 2026-08-30 would have reported 11 074 here — the
8064
+ * ledger claimed 5.65 GB of footage that no longer existed.
8065
+ */
8066
+ rowsForgotten: number().int().nonnegative().optional(),
8053
8067
  startedAt: number(),
8054
8068
  finishedAt: number().nullable(),
8055
8069
  error: string().nullable()
@@ -8114,6 +8128,13 @@ var MediaRelocateModeSchema = _enum([
8114
8128
  ]);
8115
8129
  var RelocateMediaInputSchema = object({
8116
8130
  toLocationId: string(),
8131
+ /**
8132
+ * Restrict the pass to rows currently on this location. Omitted / `'*'` =
8133
+ * every row that is not already on `toLocationId` (the historical
8134
+ * behaviour). A named source is what a from→to migration needs: without it
8135
+ * "move events off disk 2" also emptied disk 1.
8136
+ */
8137
+ fromLocationId: string().optional(),
8117
8138
  throttleMbps: number().min(1).max(1e3).optional(),
8118
8139
  /** Omitted = `move`, the pre-existing behaviour. */
8119
8140
  mode: MediaRelocateModeSchema.optional()
@@ -8181,6 +8202,19 @@ var StorageMigrationDestinationsSchema = object({
8181
8202
  galleryMedia: string().min(1).optional()
8182
8203
  }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
8183
8204
  /**
8205
+ * Optional named source per class. Omitted = the class's current default
8206
+ * (the historical behaviour). A named source that is NOT the default is a
8207
+ * drain of that disk: bytes move, the default stays, and the source is
8208
+ * disabled when the move finishes.
8209
+ */
8210
+ var StorageMigrationSourcesSchema = object({
8211
+ recordings: string().min(1).optional(),
8212
+ recordingsLow: string().min(1).optional(),
8213
+ eventMedia: string().min(1).optional(),
8214
+ backups: string().min(1).optional(),
8215
+ galleryMedia: string().min(1).optional()
8216
+ }).optional();
8217
+ /**
8184
8218
  * How a migration sequences the cutover against the byte move.
8185
8219
  *
8186
8220
  * - `blocking` — the historical order: pause, move every byte, repoint,
@@ -8202,6 +8236,8 @@ var StorageMigrationModeSchema = _enum(["blocking", "nonBlocking"]);
8202
8236
  /** Shared input for planning and starting an orchestrated storage migration. */
8203
8237
  var StorageMigrationInputSchema = object({
8204
8238
  destinations: StorageMigrationDestinationsSchema,
8239
+ /** Omitted = each class's current default. */
8240
+ sources: StorageMigrationSourcesSchema,
8205
8241
  throttleMbps: number().min(1).max(1e3).optional(),
8206
8242
  /** Omitted = `blocking`, which stays the default. */
8207
8243
  mode: StorageMigrationModeSchema.optional()
@@ -8281,6 +8317,13 @@ var StorageMigrationMoveSchema = object({
8281
8317
  storageClass: StorageMigrationClassSchema,
8282
8318
  fromLocationId: string(),
8283
8319
  toLocationId: string(),
8320
+ /**
8321
+ * True when `from` was NOT the class default at plan time. The move still
8322
+ * copies bytes, but the default is left alone and the source is disabled
8323
+ * once the copy verifies. Absent on jobs planned before this field existed
8324
+ * — those jobs always repointed, which is `false`.
8325
+ */
8326
+ freezeSource: boolean().optional(),
8284
8327
  moverJobId: string().nullable(),
8285
8328
  state: RelocateJobStateSchema.nullable(),
8286
8329
  error: string().nullable(),
@@ -8294,6 +8337,7 @@ var StorageMigrationJobSchema = object({
8294
8337
  * can tell a seconds-long cutover from a thirty-hour one. */
8295
8338
  mode: StorageMigrationModeSchema,
8296
8339
  destinations: StorageMigrationDestinationsSchema,
8340
+ sources: StorageMigrationSourcesSchema,
8297
8341
  throttleMbps: number(),
8298
8342
  moves: array(StorageMigrationMoveSchema),
8299
8343
  pauseLeaseId: string().nullable(),
@@ -8319,6 +8363,7 @@ var StorageMigrationFindingSchema = object({
8319
8363
  });
8320
8364
  var StorageMigrationPlanSchema = object({
8321
8365
  destinations: StorageMigrationDestinationsSchema,
8366
+ sources: StorageMigrationSourcesSchema,
8322
8367
  /** The mode this plan was built for. A plan is only valid for its mode: the
8323
8368
  * `eventMedia` seal gate and the single-cardinality refusal both depend on
8324
8369
  * it. */
@@ -8326,7 +8371,8 @@ var StorageMigrationPlanSchema = object({
8326
8371
  moves: array(object({
8327
8372
  storageClass: StorageMigrationClassSchema,
8328
8373
  fromLocationId: string(),
8329
- toLocationId: string()
8374
+ toLocationId: string(),
8375
+ freezeSource: boolean().optional()
8330
8376
  })),
8331
8377
  findings: array(StorageMigrationFindingSchema)
8332
8378
  });
@@ -8413,16 +8459,142 @@ var RelocateResidueSchema = object({
8413
8459
  segments: number().int().nonnegative(),
8414
8460
  bytes: number().int().nonnegative()
8415
8461
  }).nullable();
8462
+ /**
8463
+ * Ask one location whether its durable hour rows describe the disk — the walk
8464
+ * (D319).
8465
+ *
8466
+ * `apply` DEFAULTS TO FALSE and that default is the product: the operator's
8467
+ * missing tool is the question, and the dry run is how they sanity-check the
8468
+ * destructive run before authorising it.
8469
+ */
8470
+ var LedgerWalkInputSchema = object({
8471
+ locationId: string().min(1),
8472
+ /** Forget the confirmed-absent rows, rather than only counting them. */
8473
+ apply: boolean().optional(),
8474
+ /** Narrow to one camera. */
8475
+ deviceId: number().int().positive().optional(),
8476
+ /** Narrow to these recording profiles; empty/absent = every profile. */
8477
+ profiles: array(string().min(1)).optional()
8478
+ });
8479
+ /** Why a whole walk did nothing. Every one leaves the ledger untouched. */
8480
+ var LedgerWalkRefusalSchema = _enum([
8481
+ "location-unknown",
8482
+ "source-writable",
8483
+ "no-ledger",
8484
+ "archive-unreadable",
8485
+ "anchor-absent",
8486
+ "anchor-unreadable",
8487
+ "anchor-moved"
8488
+ ]);
8489
+ _enum([
8490
+ "live-tail",
8491
+ "listing-error",
8492
+ "path-mismatch",
8493
+ "durable-refused"
8494
+ ]);
8495
+ /** Every skip reason, always present, always a number — so a reason that never
8496
+ * fired reports as zero rather than absent and the report shape is constant
8497
+ * between passes. Spelled out rather than `z.record` for exactly that. */
8498
+ var LedgerWalkSkipCountsSchema = object({
8499
+ "live-tail": number().int().nonnegative(),
8500
+ "listing-error": number().int().nonnegative(),
8501
+ "path-mismatch": number().int().nonnegative(),
8502
+ "durable-refused": number().int().nonnegative()
8503
+ });
8504
+ /** One camera's share of a walk, so a report names cameras and not rows. */
8505
+ var LedgerWalkDeviceReportSchema = object({
8506
+ deviceId: number().int(),
8507
+ hoursWalked: number().int().nonnegative(),
8508
+ hoursMissing: number().int().nonnegative(),
8509
+ ghostSegments: number().int().nonnegative(),
8510
+ ghostBytes: number().int().nonnegative(),
8511
+ forgottenSegments: number().int().nonnegative(),
8512
+ orphanFiles: number().int().nonnegative()
8513
+ });
8514
+ /**
8515
+ * What one walk claimed, listed, found and (only when armed) forgot.
8516
+ *
8517
+ * `archiveSegments` is the **M** and `segmentsClaimed` the **N** (D295), so a
8518
+ * walk that saw a fraction of the location is visible in its own report rather
8519
+ * than in the absence of one.
8520
+ */
8521
+ var LedgerWalkReportSchema = object({
8522
+ locationId: string(),
8523
+ applied: boolean(),
8524
+ refused: LedgerWalkRefusalSchema.nullable(),
8525
+ archiveSegments: number().int().nonnegative().nullable(),
8526
+ archiveBytes: number().int().nonnegative().nullable(),
8527
+ hoursClaimed: number().int().nonnegative(),
8528
+ hoursWalked: number().int().nonnegative(),
8529
+ hoursMissing: number().int().nonnegative(),
8530
+ /** `readdir` calls issued — the cost, stated in the unit that is paid. */
8531
+ listings: number().int().nonnegative(),
8532
+ segmentsClaimed: number().int().nonnegative(),
8533
+ ghostSegments: number().int().nonnegative(),
8534
+ ghostBytes: number().int().nonnegative(),
8535
+ ghostHoursWhole: number().int().nonnegative(),
8536
+ forgottenSegments: number().int().nonnegative(),
8537
+ forgottenBytes: number().int().nonnegative(),
8538
+ /** Files under a claimed hour that no durable row names. Never deleted. */
8539
+ orphanFiles: number().int().nonnegative(),
8540
+ orphanSample: array(string()).readonly(),
8541
+ hoursSkipped: number().int().nonnegative(),
8542
+ skippedByReason: LedgerWalkSkipCountsSchema,
8543
+ /** The walk stopped at its per-pass hour bound with claims unwalked. */
8544
+ bounded: boolean(),
8545
+ byDevice: array(LedgerWalkDeviceReportSchema).readonly()
8546
+ });
8416
8547
  /** How many rows a media pass would still act on against a given target — the
8417
8548
  * media lane's denominator AND its residue, from ONE derivation so the two can
8418
8549
  * never disagree. `null` = the count could not be taken. */
8419
8550
  var RelocatableMediaCountSchema = object({ rows: number().int().nonnegative() }).nullable();
8420
8551
  var RelocatableMediaCountInputSchema = object({
8421
8552
  toLocationId: string().min(1),
8553
+ /** Restrict the count to one source; omitted / `'*'` = every non-target row. */
8554
+ fromLocationId: string().optional(),
8422
8555
  /** Omitted = `move`. */
8423
8556
  mode: MediaRelocateModeSchema.optional()
8424
8557
  });
8425
8558
  /**
8559
+ * Operator cleanup of leftover analytics rows, optional debug media, and
8560
+ * ghost ledger entries on frozen footage locations.
8561
+ *
8562
+ * A pass is tens of minutes on a standing backlog. The hub method RETURNS
8563
+ * `{ jobId }` immediately; progress is `cleanupStatus`. Awaiting the work
8564
+ * is how `addons.custom` hit the 60 s UDS deadline while reclaim continued
8565
+ * with no operator-visible status.
8566
+ */
8567
+ var StorageCleanupPhaseSchema = _enum([
8568
+ "orphans",
8569
+ "debug-media",
8570
+ "ghost-ledger",
8571
+ "done",
8572
+ "failed",
8573
+ "cancelled"
8574
+ ]);
8575
+ var StorageCleanupInputSchema = object({
8576
+ /** Also walk motion stills / track filmstrips. Off by default. */
8577
+ includeDebugMedia: boolean().optional() });
8578
+ var StorageCleanupJobSchema = object({
8579
+ jobId: string(),
8580
+ phase: StorageCleanupPhaseSchema,
8581
+ includeDebugMedia: boolean(),
8582
+ orphansReclaimed: number().int().nonnegative(),
8583
+ orphanBytesReclaimed: number().int().nonnegative(),
8584
+ debugMediaReclaimed: number().int().nonnegative(),
8585
+ debugMediaBytesReclaimed: number().int().nonnegative(),
8586
+ ghostsForgotten: number().int().nonnegative(),
8587
+ ghostBytesForgotten: number().int().nonnegative(),
8588
+ /** Short operator-facing line: current collection, pass, or location. */
8589
+ detail: string().nullable(),
8590
+ cancelRequested: boolean(),
8591
+ startedAt: number(),
8592
+ updatedAt: number(),
8593
+ finishedAt: number().nullable(),
8594
+ error: string().nullable()
8595
+ });
8596
+ var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8597
+ /**
8426
8598
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8427
8599
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8428
8600
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8450,11 +8622,10 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
8450
8622
  * The default location for a type uses `id === <type>:default` by
8451
8623
  * convention (the bare type ref like `'backups'` resolves to it).
8452
8624
  *
8453
- * `isSystem: true` marks a location as orchestrator-seeded and
8454
- * undeletable. The bootstrap-installed defaults (one per type) carry
8455
- * this flag; operator-added locations don't. Editing the config of
8456
- * a system location is allowed (path migration, provider swap) but
8457
- * deleting it is rejected at the cap level.
8625
+ * `isSystem` is a legacy persisted flag. Seed still creates the initial
8626
+ * `<type>:default` locations; the flag is no longer a lock, a badge, or a
8627
+ * prune selector. New writes leave it false. Deletion is gated on uniqueness
8628
+ * / last-enabled, not on this bit.
8458
8629
  */
8459
8630
  var StorageLocationSchema = object({
8460
8631
  id: string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),
@@ -12997,6 +13168,12 @@ method(object({
12997
13168
  }), _void(), {
12998
13169
  kind: "mutation",
12999
13170
  auth: "admin"
13171
+ }), method(object({
13172
+ from: string(),
13173
+ to: string()
13174
+ }), object({ moved: number() }), {
13175
+ kind: "mutation",
13176
+ auth: "admin"
13000
13177
  }), method(object({
13001
13178
  deviceId: number(),
13002
13179
  disabled: boolean()
@@ -19005,53 +19182,15 @@ var RecentTracksPageSchema = object({
19005
19182
  /** Cursor for the next page, or null when this page is the last. */
19006
19183
  nextCursor: string().nullable()
19007
19184
  });
19008
- var LIST_GROUPS_DEFAULT_LIMIT = 40;
19009
- var LIST_GROUPS_MAX_LIMIT = 100;
19010
- var AnalyticsGroupRecordSchema = object({
19011
- id: string(),
19012
- deviceId: number().int(),
19013
- openedAt: number().int(),
19014
- closedAt: number().int(),
19015
- timestamp: number().int(),
19016
- memberCount: number().int(),
19017
- memberTrackIds: array(string()).readonly(),
19018
- className: string(),
19019
- classes: array(string()).readonly(),
19020
- /** Relative event-media path, or null when the group has no picture yet. */
19021
- mediaUrl: string().nullable(),
19022
- singleton: boolean()
19023
- });
19024
- var AnalyticsGroupMemberSchema = object({
19025
- trackId: string(),
19026
- deviceId: number().int(),
19027
- className: string(),
19028
- firstSeen: number().int(),
19029
- lastSeen: number().int(),
19030
- mediaUrl: string().nullable()
19031
- });
19032
- var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
19033
- var ListGroupsQueryInput = object({
19034
- /** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
19035
- deviceIds: array(number()),
19036
- /** Window lower bound on `closedAt` (inclusive). */
19037
- since: number().optional(),
19038
- /** Window upper bound on `openedAt` (inclusive). */
19039
- until: number().optional(),
19040
- limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
19041
- /** Opaque continuation cursor from a previous page's `nextCursor`. */
19042
- cursor: string().optional()
19043
- });
19044
- var ListGroupsPageSchema = object({
19045
- groups: array(AnalyticsGroupRecordSchema).readonly(),
19046
- nextCursor: string().nullable()
19047
- });
19185
+ var KEY_EVENTS_DEFAULT_LIMIT = 50;
19186
+ var KEY_EVENTS_MAX_LIMIT = 200;
19048
19187
  var KeyEventQueryInput = object({
19049
19188
  deviceId: number(),
19050
19189
  /** Window lower bound (track firstSeen ≥ since). */
19051
19190
  since: number(),
19052
19191
  /** Window upper bound (track firstSeen ≤ until). */
19053
19192
  until: number(),
19054
- limit: number().int().min(1).max(200).default(50),
19193
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
19055
19194
  /** Drop tracks scoring below this importance. */
19056
19195
  minImportance: number().min(0).max(1).optional(),
19057
19196
  /** Restrict to a single class (e.g. 'person'). */
@@ -19073,6 +19212,32 @@ var KeyEventSchema = object({
19073
19212
  ...TrackFlagFields,
19074
19213
  ...TrackRetrainFields
19075
19214
  });
19215
+ /** `getKeyEvents`' window and filters, asked of a SET of cameras at once. */
19216
+ var KeyEventBatchQueryInput = object({
19217
+ deviceIds: array(number()).min(1).max(200),
19218
+ since: number(),
19219
+ until: number(),
19220
+ /** Applied PER CAMERA, exactly as `getKeyEvents.limit` is — never a total
19221
+ * across the set, which would let a busy camera starve a quiet one of its
19222
+ * rows and change what the merged feed contains. */
19223
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
19224
+ minImportance: number().min(0).max(1).optional(),
19225
+ classFilter: string().optional()
19226
+ });
19227
+ /**
19228
+ * One camera's key events in a batch answer.
19229
+ *
19230
+ * The row exists for every requested id. `getKeyEvents` degrades to `[]` on
19231
+ * error rather than throwing, so a camera whose store read failed and one with
19232
+ * no events in the window were ALREADY indistinguishable per camera — the
19233
+ * batch does not make that worse, and the row keeps the deviceId the single
19234
+ * method's output never carried (the caller used to stamp it from the fan-out
19235
+ * key, which only worked because there was one query per camera).
19236
+ */
19237
+ var KeyEventsForDeviceSchema = object({
19238
+ deviceId: number(),
19239
+ events: array(KeyEventSchema).readonly()
19240
+ });
19076
19241
  object({
19077
19242
  trackId: string(),
19078
19243
  className: string(),
@@ -19120,9 +19285,7 @@ var TrackCascadeCountsSchema = object({
19120
19285
  /** Unassigned plate reads removed (best-effort; plate leg deferred to plate-intelligence). */
19121
19286
  plates: number().int(),
19122
19287
  /** Per-track CLIP search vectors removed (best-effort). */
19123
- embeddings: number().int(),
19124
- /** Group membership + group rows removed with their last member (best-effort). */
19125
- groups: number().int()
19288
+ embeddings: number().int()
19126
19289
  });
19127
19290
  /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
19128
19291
  var DiskReconcileCountsSchema = object({
@@ -19292,6 +19455,47 @@ var RebuildStatusSchema = object({
19292
19455
  /** Present when the pass ended by throwing. */
19293
19456
  error: string().nullable()
19294
19457
  });
19458
+ /**
19459
+ * Acknowledgement that a debug-media reclaim STARTED.
19460
+ *
19461
+ * The pass is paced at ~2 MB/s over a standing 100 GB — tens of minutes — so
19462
+ * it runs detached and this returns immediately. Awaiting it is how the
19463
+ * `addons.custom` door hit the 60 s UDS deadline while the walk carried on
19464
+ * with no status. Poll {@link pipelineAnalyticsCapability.methods.getMediaReclaimStatus}.
19465
+ */
19466
+ var MediaReclaimStartResultSchema = object({
19467
+ started: boolean(),
19468
+ /** True when a pass was already running; the new request is ignored. */
19469
+ alreadyRunning: boolean()
19470
+ });
19471
+ var MediaReclaimInputSchema = object({
19472
+ mode: _enum(["report", "reclaim"]).default("report"),
19473
+ scopes: array(_enum(["motion-still", "track-filmstrip"])).min(1).optional(),
19474
+ deviceIds: array(number().int()).min(1).optional(),
19475
+ restart: boolean().optional(),
19476
+ pageSize: number().int().min(50).max(5e3).optional(),
19477
+ maxRowsPerDevice: number().int().min(1).max(5e5).optional(),
19478
+ maxReclaimPerDevice: number().int().min(1).max(5e5).optional(),
19479
+ maxBytesPerRun: number().int().min(1).optional(),
19480
+ budgetMinutes: number().int().min(1).max(720).optional(),
19481
+ throttleBytesPerSec: number().int().min(64 * 1024).optional(),
19482
+ graceMinutes: number().int().min(1).max(10080).optional()
19483
+ });
19484
+ var MediaReclaimStatusSchema = object({
19485
+ running: boolean(),
19486
+ mode: _enum(["report", "reclaim"]).nullable(),
19487
+ totalExamined: number(),
19488
+ totalEligible: number(),
19489
+ totalReclaimed: number(),
19490
+ totalBytesReclaimed: number(),
19491
+ totalRefused: number(),
19492
+ /** Device+scope windows finished in this pass. */
19493
+ devicesDone: number(),
19494
+ complete: boolean().nullable(),
19495
+ startedAtMs: number().nullable(),
19496
+ finishedAtMs: number().nullable(),
19497
+ error: string().nullable()
19498
+ });
19295
19499
  var ReplayFrameInputSchema = object({
19296
19500
  timestamp: number(),
19297
19501
  frame: PipelineRunResultBridge
@@ -19330,10 +19534,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19330
19534
  * stationary registry). Default false: the timeline lists passages,
19331
19535
  * not parking records (operator decision, 2026-08-15). */
19332
19536
  includeStationary: boolean().optional()
19333
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(ListGroupsQueryInput, ListGroupsPageSchema), method(object({
19334
- deviceId: number(),
19335
- groupId: string().min(1)
19336
- }), AnalyticsGroupDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
19537
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
19337
19538
  kind: "mutation",
19338
19539
  auth: "admin"
19339
19540
  }), 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({
@@ -19342,7 +19543,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19342
19543
  until: number().optional(),
19343
19544
  kinds: array(string()).optional(),
19344
19545
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
19345
- }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
19546
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
19346
19547
  deviceId: number(),
19347
19548
  since: number(),
19348
19549
  until: number(),
@@ -19433,6 +19634,12 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19433
19634
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
19434
19635
  kind: "query",
19435
19636
  auth: "admin"
19637
+ }), method(MediaReclaimInputSchema, MediaReclaimStartResultSchema, {
19638
+ kind: "mutation",
19639
+ auth: "admin"
19640
+ }), method(object({}), MediaReclaimStatusSchema, {
19641
+ kind: "query",
19642
+ auth: "admin"
19436
19643
  }), method(object({ deviceIds: array(number()).optional() }), TrainingExportSummarySchema, {
19437
19644
  kind: "query",
19438
19645
  auth: "admin"
@@ -21507,7 +21714,13 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
21507
21714
  }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
21508
21715
  kind: "mutation",
21509
21716
  auth: "admin"
21510
- });
21717
+ }), method(StorageCleanupInputSchema, object({ jobId: string() }), {
21718
+ kind: "mutation",
21719
+ auth: "admin"
21720
+ }), method(StorageCleanupStatusInputSchema, StorageCleanupJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
21721
+ kind: "mutation",
21722
+ auth: "admin"
21723
+ }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
21511
21724
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
21512
21725
  providerId: string().min(1),
21513
21726
  displayName: string().min(1),
@@ -28608,6 +28821,33 @@ var RecordingRebalanceInputSchema = object({
28608
28821
  minMoveGb: number().min(0).optional()
28609
28822
  });
28610
28823
  /**
28824
+ * Operator-facing placement of one camera onto a recordings location.
28825
+ *
28826
+ * `pinLocationId` is the operator instruction: a location id, or `null` for
28827
+ * Auto (the planner may move this camera). `locationId` is where high/mid
28828
+ * currently write — the plan, which may disagree with the pin when Auto.
28829
+ */
28830
+ var RecordingDevicePlacementSchema = object({
28831
+ deviceId: number().int(),
28832
+ profile: string(),
28833
+ locationId: string()
28834
+ });
28835
+ var RecordingDevicePinSchema = object({
28836
+ deviceId: number().int(),
28837
+ /** Recordings-class location this camera is pinned to. */
28838
+ locationId: string()
28839
+ });
28840
+ var RecordingPlacementViewSchema = object({
28841
+ assignments: array(RecordingDevicePlacementSchema),
28842
+ pins: array(RecordingDevicePinSchema),
28843
+ defaultLocations: record(string(), string())
28844
+ });
28845
+ var RecordingSetDevicePlacementInputSchema = object({
28846
+ deviceId: number().int(),
28847
+ /** `null` = Auto. Otherwise a `recordings:*` location id. */
28848
+ locationId: string().nullable()
28849
+ });
28850
+ /**
28611
28851
  * Result of locating footage at a wall-clock instant for one device/profile.
28612
28852
  * `segment` carries the covering segment's window; `gap` reports the forward
28613
28853
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -28821,6 +29061,9 @@ method(object({
28821
29061
  }), method(RelocateResidueInputSchema, RelocateResidueSchema, {
28822
29062
  kind: "query",
28823
29063
  auth: "admin"
29064
+ }), method(LedgerWalkInputSchema, LedgerWalkReportSchema, {
29065
+ kind: "mutation",
29066
+ auth: "admin"
28824
29067
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
28825
29068
  kind: "mutation",
28826
29069
  auth: "admin"
@@ -28830,6 +29073,12 @@ method(object({
28830
29073
  }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
28831
29074
  kind: "mutation",
28832
29075
  auth: "admin"
29076
+ }), method(object({}), RecordingPlacementViewSchema, {
29077
+ kind: "query",
29078
+ auth: "admin"
29079
+ }), method(RecordingSetDevicePlacementInputSchema, object({ ok: literal(true) }), {
29080
+ kind: "mutation",
29081
+ auth: "admin"
28833
29082
  });
28834
29083
  /**
28835
29084
  * `recording-export` cap — render a footage time range into a single downloadable
@@ -29212,6 +29461,25 @@ var SceneMonitorStatusSchema = object({
29212
29461
  monitors: array(SceneMonitorSchema),
29213
29462
  lastFetchedAt: number()
29214
29463
  });
29464
+ /**
29465
+ * One camera's row in a `listScenesBatch` answer.
29466
+ *
29467
+ * `status` is NULLABLE and the nullability is the whole point. `scene-monitor`
29468
+ * is a `defaultActive` wrapper, so every camera is asked; a camera whose
29469
+ * provider is absent (pipeline-analytics not deployed, the post-processing node
29470
+ * down) cannot answer, and that is not the same fact as a camera with no scenes
29471
+ * configured. Fanned out per camera the difference was visible — one query
29472
+ * errored while the others resolved — and a batch that returned only the rows
29473
+ * it managed would have destroyed it, silently, by making an unreachable camera
29474
+ * indistinguishable from one that answered `monitors: []`.
29475
+ *
29476
+ * So: EVERY requested deviceId gets a row. `status: null` means "this camera
29477
+ * could not be read"; `status.monitors: []` means "read, and it has none".
29478
+ */
29479
+ var SceneMonitorStatusForDeviceSchema = object({
29480
+ deviceId: number(),
29481
+ status: SceneMonitorStatusSchema.nullable()
29482
+ });
29215
29483
  var sceneMonitorCapability = {
29216
29484
  name: "scene-monitor",
29217
29485
  scope: "device",
@@ -29221,6 +29489,22 @@ var sceneMonitorCapability = {
29221
29489
  deviceTypes: [DeviceType.Camera],
29222
29490
  methods: {
29223
29491
  listScenes: method(object({ deviceId: number() }), SceneMonitorStatusSchema),
29492
+ /**
29493
+ * The same answer, for a SET of cameras, in one round trip.
29494
+ *
29495
+ * `/scenes` renders every camera and re-reads them on a 30s safety-net
29496
+ * poll behind the push slice. Fanned out client-side that was one query
29497
+ * per camera — 29 round trips through the browser, the hub and the
29498
+ * post-analysis runner every 30 seconds to read an in-memory map the
29499
+ * owner had already merged. The work is unchanged (`statusFor` per
29500
+ * device, all in-process at the owner); what collapses is the transport.
29501
+ *
29502
+ * A camera that cannot answer still gets a row, with `status: null` —
29503
+ * see {@link SceneMonitorStatusForDeviceSchema}. Never fewer rows than
29504
+ * ids: a caller that asked for twenty-nine and got twenty-seven cannot
29505
+ * tell which two are missing, or that any are.
29506
+ */
29507
+ listScenesBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(SceneMonitorStatusForDeviceSchema).readonly()),
29224
29508
  createScene: method(object({
29225
29509
  deviceId: number(),
29226
29510
  label: string(),
@@ -31056,6 +31340,27 @@ var CameraOccupancySnapshotSchema = object({
31056
31340
  stationaryObjects: array(StationaryObjectSchema).readonly().optional()
31057
31341
  });
31058
31342
  /**
31343
+ * One camera's row in a `getCurrentSnapshotBatch` answer.
31344
+ *
31345
+ * THREE outcomes, and the single-camera method could only express two of them
31346
+ * because `snapshot: null` was already spoken for:
31347
+ *
31348
+ * - `read: 'read'`, `snapshot` present — the live occupancy reading.
31349
+ * - `read: 'read'`, `snapshot: null` — read, and this camera has no reading
31350
+ * yet: no frame since boot, and no parked-object registry to hydrate from.
31351
+ * - `read: 'unreadable'` — the owner could not answer for this
31352
+ * camera. `snapshot` is null, and it does NOT mean "nothing parked here".
31353
+ *
31354
+ * Collapsing the last two is the failure this field exists to prevent: a
31355
+ * hydration that threw would otherwise render as an empty Stationary section,
31356
+ * which is a definite claim about a camera nobody could read.
31357
+ */
31358
+ var CameraOccupancySnapshotForDeviceSchema = object({
31359
+ deviceId: number(),
31360
+ read: _enum(["read", "unreadable"]),
31361
+ snapshot: CameraOccupancySnapshotSchema.nullable()
31362
+ });
31363
+ /**
31059
31364
  * Time-series resolution. The history methods return one bucket per
31060
31365
  * step over the requested range. Smaller resolutions cost more
31061
31366
  * memory + bandwidth; bound to discrete steps so caller cannot ask
@@ -31112,6 +31417,20 @@ var zoneAnalyticsCapability = {
31112
31417
  * (no inference result emitted since boot or since binding was
31113
31418
  * activated). */
31114
31419
  getCurrentSnapshot: method(object({ deviceId: number() }), CameraOccupancySnapshotSchema.nullable()),
31420
+ /**
31421
+ * The same snapshot, for a SET of cameras, in one round trip.
31422
+ *
31423
+ * The Events page's Stationary section polls this every 15s for every
31424
+ * selected camera. Fanned out client-side that is one query per camera to
31425
+ * read a `Map.get` at the owner — the answer costs nothing, the round trip
31426
+ * costs everything. Batched, N transports become one and the per-device
31427
+ * work is unchanged.
31428
+ *
31429
+ * Every requested deviceId gets a row, tagged `read` — see
31430
+ * {@link CameraOccupancySnapshotForDeviceSchema}. A camera the owner could
31431
+ * not answer for is `'unreadable'`, never an empty reading.
31432
+ */
31433
+ getCurrentSnapshotBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(CameraOccupancySnapshotForDeviceSchema).readonly()),
31115
31434
  /** Time-series object count inside one zone. `className` optional —
31116
31435
  * omit to count every class in the zone. */
31117
31436
  getZoneHistory: method(object({
@@ -33829,6 +34148,12 @@ Object.freeze({
33829
34148
  addonId: null,
33830
34149
  access: "delete"
33831
34150
  },
34151
+ "deviceManager.renameLocation": {
34152
+ capName: "device-manager",
34153
+ capScope: "system",
34154
+ addonId: null,
34155
+ access: "create"
34156
+ },
33832
34157
  "deviceManager.runDeviceAction": {
33833
34158
  capName: "device-manager",
33834
34159
  capScope: "system",
@@ -35521,13 +35846,19 @@ Object.freeze({
35521
35846
  addonId: null,
35522
35847
  access: "view"
35523
35848
  },
35524
- "pipelineAnalytics.getGroup": {
35849
+ "pipelineAnalytics.getKeyEvents": {
35525
35850
  capName: "pipeline-analytics",
35526
35851
  capScope: "device",
35527
35852
  addonId: null,
35528
35853
  access: "view"
35529
35854
  },
35530
- "pipelineAnalytics.getKeyEvents": {
35855
+ "pipelineAnalytics.getKeyEventsBatch": {
35856
+ capName: "pipeline-analytics",
35857
+ capScope: "device",
35858
+ addonId: null,
35859
+ access: "view"
35860
+ },
35861
+ "pipelineAnalytics.getMediaReclaimStatus": {
35531
35862
  capName: "pipeline-analytics",
35532
35863
  capScope: "device",
35533
35864
  addonId: null,
@@ -35617,12 +35948,6 @@ Object.freeze({
35617
35948
  addonId: null,
35618
35949
  access: "view"
35619
35950
  },
35620
- "pipelineAnalytics.listGroups": {
35621
- capName: "pipeline-analytics",
35622
- capScope: "device",
35623
- addonId: null,
35624
- access: "view"
35625
- },
35626
35951
  "pipelineAnalytics.listOpsLog": {
35627
35952
  capName: "pipeline-analytics",
35628
35953
  capScope: "device",
@@ -35707,6 +36032,12 @@ Object.freeze({
35707
36032
  addonId: null,
35708
36033
  access: "create"
35709
36034
  },
36035
+ "pipelineAnalytics.reclaimDebugMedia": {
36036
+ capName: "pipeline-analytics",
36037
+ capScope: "device",
36038
+ addonId: null,
36039
+ access: "create"
36040
+ },
35710
36041
  "pipelineAnalytics.reconcileFromDisk": {
35711
36042
  capName: "pipeline-analytics",
35712
36043
  capScope: "device",
@@ -36631,6 +36962,12 @@ Object.freeze({
36631
36962
  addonId: null,
36632
36963
  access: "view"
36633
36964
  },
36965
+ "recording.getPlacement": {
36966
+ capName: "recording",
36967
+ capScope: "system",
36968
+ addonId: null,
36969
+ access: "view"
36970
+ },
36634
36971
  "recording.getPlaybackManifest": {
36635
36972
  capName: "recording",
36636
36973
  capScope: "system",
@@ -36709,6 +37046,12 @@ Object.freeze({
36709
37046
  addonId: null,
36710
37047
  access: "view"
36711
37048
  },
37049
+ "recording.reconcileLedgerAgainstDisk": {
37050
+ capName: "recording",
37051
+ capScope: "system",
37052
+ addonId: null,
37053
+ access: "create"
37054
+ },
36712
37055
  "recording.refreshStorageLocationsForMigration": {
36713
37056
  capName: "recording",
36714
37057
  capScope: "system",
@@ -36751,6 +37094,12 @@ Object.freeze({
36751
37094
  addonId: null,
36752
37095
  access: "create"
36753
37096
  },
37097
+ "recording.setDevicePlacement": {
37098
+ capName: "recording",
37099
+ capScope: "system",
37100
+ addonId: null,
37101
+ access: "create"
37102
+ },
36754
37103
  "recording.startStorageMigrationMove": {
36755
37104
  capName: "recording",
36756
37105
  capScope: "system",
@@ -36835,6 +37184,12 @@ Object.freeze({
36835
37184
  addonId: null,
36836
37185
  access: "view"
36837
37186
  },
37187
+ "sceneMonitor.listScenesBatch": {
37188
+ capName: "scene-monitor",
37189
+ capScope: "device",
37190
+ addonId: null,
37191
+ access: "view"
37192
+ },
36838
37193
  "sceneMonitor.recheckNow": {
36839
37194
  capName: "scene-monitor",
36840
37195
  capScope: "device",
@@ -37189,12 +37544,36 @@ Object.freeze({
37189
37544
  addonId: null,
37190
37545
  access: "create"
37191
37546
  },
37547
+ "storageMigration.cleanupCancel": {
37548
+ capName: "storage-migration",
37549
+ capScope: "system",
37550
+ addonId: null,
37551
+ access: "create"
37552
+ },
37553
+ "storageMigration.cleanupStart": {
37554
+ capName: "storage-migration",
37555
+ capScope: "system",
37556
+ addonId: null,
37557
+ access: "create"
37558
+ },
37559
+ "storageMigration.cleanupStatus": {
37560
+ capName: "storage-migration",
37561
+ capScope: "system",
37562
+ addonId: null,
37563
+ access: "view"
37564
+ },
37192
37565
  "storageMigration.drain": {
37193
37566
  capName: "storage-migration",
37194
37567
  capScope: "system",
37195
37568
  addonId: null,
37196
37569
  access: "create"
37197
37570
  },
37571
+ "storageMigration.history": {
37572
+ capName: "storage-migration",
37573
+ capScope: "system",
37574
+ addonId: null,
37575
+ access: "view"
37576
+ },
37198
37577
  "storageMigration.movers": {
37199
37578
  capName: "storage-migration",
37200
37579
  capScope: "system",
@@ -38191,6 +38570,12 @@ Object.freeze({
38191
38570
  addonId: null,
38192
38571
  access: "view"
38193
38572
  },
38573
+ "zoneAnalytics.getCurrentSnapshotBatch": {
38574
+ capName: "zone-analytics",
38575
+ capScope: "device",
38576
+ addonId: null,
38577
+ access: "view"
38578
+ },
38194
38579
  "zoneAnalytics.getUnzonedHistory": {
38195
38580
  capName: "zone-analytics",
38196
38581
  capScope: "device",
@@ -39185,14 +39570,14 @@ Object.freeze({
39185
39570
  form: "single",
39186
39571
  optional: true
39187
39572
  }],
39188
- "pipelineAnalytics.getGroup": [{
39573
+ "pipelineAnalytics.getKeyEvents": [{
39189
39574
  name: "deviceId",
39190
39575
  form: "single",
39191
39576
  optional: false
39192
39577
  }],
39193
- "pipelineAnalytics.getKeyEvents": [{
39194
- name: "deviceId",
39195
- form: "single",
39578
+ "pipelineAnalytics.getKeyEventsBatch": [{
39579
+ name: "deviceIds",
39580
+ form: "array",
39196
39581
  optional: false
39197
39582
  }],
39198
39583
  "pipelineAnalytics.getMotionEvents": [{
@@ -39250,11 +39635,6 @@ Object.freeze({
39250
39635
  form: "single",
39251
39636
  optional: false
39252
39637
  }],
39253
- "pipelineAnalytics.listGroups": [{
39254
- name: "deviceIds",
39255
- form: "array",
39256
- optional: false
39257
- }],
39258
39638
  "pipelineAnalytics.listOpsLog": [{
39259
39639
  name: "deviceId",
39260
39640
  form: "single",
@@ -39300,6 +39680,11 @@ Object.freeze({
39300
39680
  form: "single",
39301
39681
  optional: true
39302
39682
  }],
39683
+ "pipelineAnalytics.reclaimDebugMedia": [{
39684
+ name: "deviceIds",
39685
+ form: "array",
39686
+ optional: true
39687
+ }],
39303
39688
  "pipelineAnalytics.reconcileFromDisk": [{
39304
39689
  name: "deviceId",
39305
39690
  form: "single",
@@ -39635,6 +40020,11 @@ Object.freeze({
39635
40020
  form: "single",
39636
40021
  optional: false
39637
40022
  }],
40023
+ "recording.reconcileLedgerAgainstDisk": [{
40024
+ name: "deviceId",
40025
+ form: "single",
40026
+ optional: true
40027
+ }],
39638
40028
  "recording.relocateFootage": [{
39639
40029
  name: "deviceId",
39640
40030
  form: "single",
@@ -39660,6 +40050,11 @@ Object.freeze({
39660
40050
  form: "single",
39661
40051
  optional: false
39662
40052
  }],
40053
+ "recording.setDevicePlacement": [{
40054
+ name: "deviceId",
40055
+ form: "single",
40056
+ optional: false
40057
+ }],
39663
40058
  "recording.startStorageMigrationMove": [{
39664
40059
  name: "deviceId",
39665
40060
  form: "single",
@@ -39700,6 +40095,11 @@ Object.freeze({
39700
40095
  form: "single",
39701
40096
  optional: false
39702
40097
  }],
40098
+ "sceneMonitor.listScenesBatch": [{
40099
+ name: "deviceIds",
40100
+ form: "array",
40101
+ optional: false
40102
+ }],
39703
40103
  "sceneMonitor.recheckNow": [{
39704
40104
  name: "deviceId",
39705
40105
  form: "single",
@@ -39961,6 +40361,11 @@ Object.freeze({
39961
40361
  form: "single",
39962
40362
  optional: false
39963
40363
  }],
40364
+ "zoneAnalytics.getCurrentSnapshotBatch": [{
40365
+ name: "deviceIds",
40366
+ form: "array",
40367
+ optional: false
40368
+ }],
39964
40369
  "zoneAnalytics.getUnzonedHistory": [{
39965
40370
  name: "deviceId",
39966
40371
  form: "single",