@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.mjs CHANGED
@@ -8029,6 +8029,20 @@ var RelocateJobSchema = object({
8029
8029
  * in its row, not in its name, so `MediaRelocateEngine` never reconciles one.
8030
8030
  */
8031
8031
  rowsReconciled: number().int().nonnegative().optional(),
8032
+ /**
8033
+ * Rows this run FORGOT because the file they name is not on disk.
8034
+ *
8035
+ * The mover derived the path from the row's own fields and `stat`ed it; an
8036
+ * ENOENT there is a per-path confirmation that the segment is gone (D296),
8037
+ * and the durable row is dropped through the same channel eviction uses. It
8038
+ * is reported for the same reason `rowsReconciled` is: this is a durable
8039
+ * mutation nobody asked for, and a migration that quietly erases hour rows is
8040
+ * the same failure as one that quietly skips them (D295).
8041
+ *
8042
+ * The production drain of 2026-08-30 would have reported 11 074 here — the
8043
+ * ledger claimed 5.65 GB of footage that no longer existed.
8044
+ */
8045
+ rowsForgotten: number().int().nonnegative().optional(),
8032
8046
  startedAt: number(),
8033
8047
  finishedAt: number().nullable(),
8034
8048
  error: string().nullable()
@@ -8093,6 +8107,13 @@ var MediaRelocateModeSchema = _enum([
8093
8107
  ]);
8094
8108
  var RelocateMediaInputSchema = object({
8095
8109
  toLocationId: string(),
8110
+ /**
8111
+ * Restrict the pass to rows currently on this location. Omitted / `'*'` =
8112
+ * every row that is not already on `toLocationId` (the historical
8113
+ * behaviour). A named source is what a from→to migration needs: without it
8114
+ * "move events off disk 2" also emptied disk 1.
8115
+ */
8116
+ fromLocationId: string().optional(),
8096
8117
  throttleMbps: number().min(1).max(1e3).optional(),
8097
8118
  /** Omitted = `move`, the pre-existing behaviour. */
8098
8119
  mode: MediaRelocateModeSchema.optional()
@@ -8160,6 +8181,19 @@ var StorageMigrationDestinationsSchema = object({
8160
8181
  galleryMedia: string().min(1).optional()
8161
8182
  }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
8162
8183
  /**
8184
+ * Optional named source per class. Omitted = the class's current default
8185
+ * (the historical behaviour). A named source that is NOT the default is a
8186
+ * drain of that disk: bytes move, the default stays, and the source is
8187
+ * disabled when the move finishes.
8188
+ */
8189
+ var StorageMigrationSourcesSchema = object({
8190
+ recordings: string().min(1).optional(),
8191
+ recordingsLow: string().min(1).optional(),
8192
+ eventMedia: string().min(1).optional(),
8193
+ backups: string().min(1).optional(),
8194
+ galleryMedia: string().min(1).optional()
8195
+ }).optional();
8196
+ /**
8163
8197
  * How a migration sequences the cutover against the byte move.
8164
8198
  *
8165
8199
  * - `blocking` — the historical order: pause, move every byte, repoint,
@@ -8181,6 +8215,8 @@ var StorageMigrationModeSchema = _enum(["blocking", "nonBlocking"]);
8181
8215
  /** Shared input for planning and starting an orchestrated storage migration. */
8182
8216
  var StorageMigrationInputSchema = object({
8183
8217
  destinations: StorageMigrationDestinationsSchema,
8218
+ /** Omitted = each class's current default. */
8219
+ sources: StorageMigrationSourcesSchema,
8184
8220
  throttleMbps: number().min(1).max(1e3).optional(),
8185
8221
  /** Omitted = `blocking`, which stays the default. */
8186
8222
  mode: StorageMigrationModeSchema.optional()
@@ -8260,6 +8296,13 @@ var StorageMigrationMoveSchema = object({
8260
8296
  storageClass: StorageMigrationClassSchema,
8261
8297
  fromLocationId: string(),
8262
8298
  toLocationId: string(),
8299
+ /**
8300
+ * True when `from` was NOT the class default at plan time. The move still
8301
+ * copies bytes, but the default is left alone and the source is disabled
8302
+ * once the copy verifies. Absent on jobs planned before this field existed
8303
+ * — those jobs always repointed, which is `false`.
8304
+ */
8305
+ freezeSource: boolean().optional(),
8263
8306
  moverJobId: string().nullable(),
8264
8307
  state: RelocateJobStateSchema.nullable(),
8265
8308
  error: string().nullable(),
@@ -8273,6 +8316,7 @@ var StorageMigrationJobSchema = object({
8273
8316
  * can tell a seconds-long cutover from a thirty-hour one. */
8274
8317
  mode: StorageMigrationModeSchema,
8275
8318
  destinations: StorageMigrationDestinationsSchema,
8319
+ sources: StorageMigrationSourcesSchema,
8276
8320
  throttleMbps: number(),
8277
8321
  moves: array(StorageMigrationMoveSchema),
8278
8322
  pauseLeaseId: string().nullable(),
@@ -8298,6 +8342,7 @@ var StorageMigrationFindingSchema = object({
8298
8342
  });
8299
8343
  var StorageMigrationPlanSchema = object({
8300
8344
  destinations: StorageMigrationDestinationsSchema,
8345
+ sources: StorageMigrationSourcesSchema,
8301
8346
  /** The mode this plan was built for. A plan is only valid for its mode: the
8302
8347
  * `eventMedia` seal gate and the single-cardinality refusal both depend on
8303
8348
  * it. */
@@ -8305,7 +8350,8 @@ var StorageMigrationPlanSchema = object({
8305
8350
  moves: array(object({
8306
8351
  storageClass: StorageMigrationClassSchema,
8307
8352
  fromLocationId: string(),
8308
- toLocationId: string()
8353
+ toLocationId: string(),
8354
+ freezeSource: boolean().optional()
8309
8355
  })),
8310
8356
  findings: array(StorageMigrationFindingSchema)
8311
8357
  });
@@ -8392,16 +8438,142 @@ var RelocateResidueSchema = object({
8392
8438
  segments: number().int().nonnegative(),
8393
8439
  bytes: number().int().nonnegative()
8394
8440
  }).nullable();
8441
+ /**
8442
+ * Ask one location whether its durable hour rows describe the disk — the walk
8443
+ * (D319).
8444
+ *
8445
+ * `apply` DEFAULTS TO FALSE and that default is the product: the operator's
8446
+ * missing tool is the question, and the dry run is how they sanity-check the
8447
+ * destructive run before authorising it.
8448
+ */
8449
+ var LedgerWalkInputSchema = object({
8450
+ locationId: string().min(1),
8451
+ /** Forget the confirmed-absent rows, rather than only counting them. */
8452
+ apply: boolean().optional(),
8453
+ /** Narrow to one camera. */
8454
+ deviceId: number().int().positive().optional(),
8455
+ /** Narrow to these recording profiles; empty/absent = every profile. */
8456
+ profiles: array(string().min(1)).optional()
8457
+ });
8458
+ /** Why a whole walk did nothing. Every one leaves the ledger untouched. */
8459
+ var LedgerWalkRefusalSchema = _enum([
8460
+ "location-unknown",
8461
+ "source-writable",
8462
+ "no-ledger",
8463
+ "archive-unreadable",
8464
+ "anchor-absent",
8465
+ "anchor-unreadable",
8466
+ "anchor-moved"
8467
+ ]);
8468
+ _enum([
8469
+ "live-tail",
8470
+ "listing-error",
8471
+ "path-mismatch",
8472
+ "durable-refused"
8473
+ ]);
8474
+ /** Every skip reason, always present, always a number — so a reason that never
8475
+ * fired reports as zero rather than absent and the report shape is constant
8476
+ * between passes. Spelled out rather than `z.record` for exactly that. */
8477
+ var LedgerWalkSkipCountsSchema = object({
8478
+ "live-tail": number().int().nonnegative(),
8479
+ "listing-error": number().int().nonnegative(),
8480
+ "path-mismatch": number().int().nonnegative(),
8481
+ "durable-refused": number().int().nonnegative()
8482
+ });
8483
+ /** One camera's share of a walk, so a report names cameras and not rows. */
8484
+ var LedgerWalkDeviceReportSchema = object({
8485
+ deviceId: number().int(),
8486
+ hoursWalked: number().int().nonnegative(),
8487
+ hoursMissing: number().int().nonnegative(),
8488
+ ghostSegments: number().int().nonnegative(),
8489
+ ghostBytes: number().int().nonnegative(),
8490
+ forgottenSegments: number().int().nonnegative(),
8491
+ orphanFiles: number().int().nonnegative()
8492
+ });
8493
+ /**
8494
+ * What one walk claimed, listed, found and (only when armed) forgot.
8495
+ *
8496
+ * `archiveSegments` is the **M** and `segmentsClaimed` the **N** (D295), so a
8497
+ * walk that saw a fraction of the location is visible in its own report rather
8498
+ * than in the absence of one.
8499
+ */
8500
+ var LedgerWalkReportSchema = object({
8501
+ locationId: string(),
8502
+ applied: boolean(),
8503
+ refused: LedgerWalkRefusalSchema.nullable(),
8504
+ archiveSegments: number().int().nonnegative().nullable(),
8505
+ archiveBytes: number().int().nonnegative().nullable(),
8506
+ hoursClaimed: number().int().nonnegative(),
8507
+ hoursWalked: number().int().nonnegative(),
8508
+ hoursMissing: number().int().nonnegative(),
8509
+ /** `readdir` calls issued — the cost, stated in the unit that is paid. */
8510
+ listings: number().int().nonnegative(),
8511
+ segmentsClaimed: number().int().nonnegative(),
8512
+ ghostSegments: number().int().nonnegative(),
8513
+ ghostBytes: number().int().nonnegative(),
8514
+ ghostHoursWhole: number().int().nonnegative(),
8515
+ forgottenSegments: number().int().nonnegative(),
8516
+ forgottenBytes: number().int().nonnegative(),
8517
+ /** Files under a claimed hour that no durable row names. Never deleted. */
8518
+ orphanFiles: number().int().nonnegative(),
8519
+ orphanSample: array(string()).readonly(),
8520
+ hoursSkipped: number().int().nonnegative(),
8521
+ skippedByReason: LedgerWalkSkipCountsSchema,
8522
+ /** The walk stopped at its per-pass hour bound with claims unwalked. */
8523
+ bounded: boolean(),
8524
+ byDevice: array(LedgerWalkDeviceReportSchema).readonly()
8525
+ });
8395
8526
  /** How many rows a media pass would still act on against a given target — the
8396
8527
  * media lane's denominator AND its residue, from ONE derivation so the two can
8397
8528
  * never disagree. `null` = the count could not be taken. */
8398
8529
  var RelocatableMediaCountSchema = object({ rows: number().int().nonnegative() }).nullable();
8399
8530
  var RelocatableMediaCountInputSchema = object({
8400
8531
  toLocationId: string().min(1),
8532
+ /** Restrict the count to one source; omitted / `'*'` = every non-target row. */
8533
+ fromLocationId: string().optional(),
8401
8534
  /** Omitted = `move`. */
8402
8535
  mode: MediaRelocateModeSchema.optional()
8403
8536
  });
8404
8537
  /**
8538
+ * Operator cleanup of leftover analytics rows, optional debug media, and
8539
+ * ghost ledger entries on frozen footage locations.
8540
+ *
8541
+ * A pass is tens of minutes on a standing backlog. The hub method RETURNS
8542
+ * `{ jobId }` immediately; progress is `cleanupStatus`. Awaiting the work
8543
+ * is how `addons.custom` hit the 60 s UDS deadline while reclaim continued
8544
+ * with no operator-visible status.
8545
+ */
8546
+ var StorageCleanupPhaseSchema = _enum([
8547
+ "orphans",
8548
+ "debug-media",
8549
+ "ghost-ledger",
8550
+ "done",
8551
+ "failed",
8552
+ "cancelled"
8553
+ ]);
8554
+ var StorageCleanupInputSchema = object({
8555
+ /** Also walk motion stills / track filmstrips. Off by default. */
8556
+ includeDebugMedia: boolean().optional() });
8557
+ var StorageCleanupJobSchema = object({
8558
+ jobId: string(),
8559
+ phase: StorageCleanupPhaseSchema,
8560
+ includeDebugMedia: boolean(),
8561
+ orphansReclaimed: number().int().nonnegative(),
8562
+ orphanBytesReclaimed: number().int().nonnegative(),
8563
+ debugMediaReclaimed: number().int().nonnegative(),
8564
+ debugMediaBytesReclaimed: number().int().nonnegative(),
8565
+ ghostsForgotten: number().int().nonnegative(),
8566
+ ghostBytesForgotten: number().int().nonnegative(),
8567
+ /** Short operator-facing line: current collection, pass, or location. */
8568
+ detail: string().nullable(),
8569
+ cancelRequested: boolean(),
8570
+ startedAt: number(),
8571
+ updatedAt: number(),
8572
+ finishedAt: number().nullable(),
8573
+ error: string().nullable()
8574
+ });
8575
+ var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8576
+ /**
8405
8577
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8406
8578
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8407
8579
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8429,11 +8601,10 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
8429
8601
  * The default location for a type uses `id === <type>:default` by
8430
8602
  * convention (the bare type ref like `'backups'` resolves to it).
8431
8603
  *
8432
- * `isSystem: true` marks a location as orchestrator-seeded and
8433
- * undeletable. The bootstrap-installed defaults (one per type) carry
8434
- * this flag; operator-added locations don't. Editing the config of
8435
- * a system location is allowed (path migration, provider swap) but
8436
- * deleting it is rejected at the cap level.
8604
+ * `isSystem` is a legacy persisted flag. Seed still creates the initial
8605
+ * `<type>:default` locations; the flag is no longer a lock, a badge, or a
8606
+ * prune selector. New writes leave it false. Deletion is gated on uniqueness
8607
+ * / last-enabled, not on this bit.
8437
8608
  */
8438
8609
  var StorageLocationSchema = object({
8439
8610
  id: string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),
@@ -12976,6 +13147,12 @@ method(object({
12976
13147
  }), _void(), {
12977
13148
  kind: "mutation",
12978
13149
  auth: "admin"
13150
+ }), method(object({
13151
+ from: string(),
13152
+ to: string()
13153
+ }), object({ moved: number() }), {
13154
+ kind: "mutation",
13155
+ auth: "admin"
12979
13156
  }), method(object({
12980
13157
  deviceId: number(),
12981
13158
  disabled: boolean()
@@ -18984,53 +19161,15 @@ var RecentTracksPageSchema = object({
18984
19161
  /** Cursor for the next page, or null when this page is the last. */
18985
19162
  nextCursor: string().nullable()
18986
19163
  });
18987
- var LIST_GROUPS_DEFAULT_LIMIT = 40;
18988
- var LIST_GROUPS_MAX_LIMIT = 100;
18989
- var AnalyticsGroupRecordSchema = object({
18990
- id: string(),
18991
- deviceId: number().int(),
18992
- openedAt: number().int(),
18993
- closedAt: number().int(),
18994
- timestamp: number().int(),
18995
- memberCount: number().int(),
18996
- memberTrackIds: array(string()).readonly(),
18997
- className: string(),
18998
- classes: array(string()).readonly(),
18999
- /** Relative event-media path, or null when the group has no picture yet. */
19000
- mediaUrl: string().nullable(),
19001
- singleton: boolean()
19002
- });
19003
- var AnalyticsGroupMemberSchema = object({
19004
- trackId: string(),
19005
- deviceId: number().int(),
19006
- className: string(),
19007
- firstSeen: number().int(),
19008
- lastSeen: number().int(),
19009
- mediaUrl: string().nullable()
19010
- });
19011
- var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
19012
- var ListGroupsQueryInput = object({
19013
- /** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
19014
- deviceIds: array(number()),
19015
- /** Window lower bound on `closedAt` (inclusive). */
19016
- since: number().optional(),
19017
- /** Window upper bound on `openedAt` (inclusive). */
19018
- until: number().optional(),
19019
- limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
19020
- /** Opaque continuation cursor from a previous page's `nextCursor`. */
19021
- cursor: string().optional()
19022
- });
19023
- var ListGroupsPageSchema = object({
19024
- groups: array(AnalyticsGroupRecordSchema).readonly(),
19025
- nextCursor: string().nullable()
19026
- });
19164
+ var KEY_EVENTS_DEFAULT_LIMIT = 50;
19165
+ var KEY_EVENTS_MAX_LIMIT = 200;
19027
19166
  var KeyEventQueryInput = object({
19028
19167
  deviceId: number(),
19029
19168
  /** Window lower bound (track firstSeen ≥ since). */
19030
19169
  since: number(),
19031
19170
  /** Window upper bound (track firstSeen ≤ until). */
19032
19171
  until: number(),
19033
- limit: number().int().min(1).max(200).default(50),
19172
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
19034
19173
  /** Drop tracks scoring below this importance. */
19035
19174
  minImportance: number().min(0).max(1).optional(),
19036
19175
  /** Restrict to a single class (e.g. 'person'). */
@@ -19052,6 +19191,32 @@ var KeyEventSchema = object({
19052
19191
  ...TrackFlagFields,
19053
19192
  ...TrackRetrainFields
19054
19193
  });
19194
+ /** `getKeyEvents`' window and filters, asked of a SET of cameras at once. */
19195
+ var KeyEventBatchQueryInput = object({
19196
+ deviceIds: array(number()).min(1).max(200),
19197
+ since: number(),
19198
+ until: number(),
19199
+ /** Applied PER CAMERA, exactly as `getKeyEvents.limit` is — never a total
19200
+ * across the set, which would let a busy camera starve a quiet one of its
19201
+ * rows and change what the merged feed contains. */
19202
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
19203
+ minImportance: number().min(0).max(1).optional(),
19204
+ classFilter: string().optional()
19205
+ });
19206
+ /**
19207
+ * One camera's key events in a batch answer.
19208
+ *
19209
+ * The row exists for every requested id. `getKeyEvents` degrades to `[]` on
19210
+ * error rather than throwing, so a camera whose store read failed and one with
19211
+ * no events in the window were ALREADY indistinguishable per camera — the
19212
+ * batch does not make that worse, and the row keeps the deviceId the single
19213
+ * method's output never carried (the caller used to stamp it from the fan-out
19214
+ * key, which only worked because there was one query per camera).
19215
+ */
19216
+ var KeyEventsForDeviceSchema = object({
19217
+ deviceId: number(),
19218
+ events: array(KeyEventSchema).readonly()
19219
+ });
19055
19220
  object({
19056
19221
  trackId: string(),
19057
19222
  className: string(),
@@ -19099,9 +19264,7 @@ var TrackCascadeCountsSchema = object({
19099
19264
  /** Unassigned plate reads removed (best-effort; plate leg deferred to plate-intelligence). */
19100
19265
  plates: number().int(),
19101
19266
  /** Per-track CLIP search vectors removed (best-effort). */
19102
- embeddings: number().int(),
19103
- /** Group membership + group rows removed with their last member (best-effort). */
19104
- groups: number().int()
19267
+ embeddings: number().int()
19105
19268
  });
19106
19269
  /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
19107
19270
  var DiskReconcileCountsSchema = object({
@@ -19271,6 +19434,47 @@ var RebuildStatusSchema = object({
19271
19434
  /** Present when the pass ended by throwing. */
19272
19435
  error: string().nullable()
19273
19436
  });
19437
+ /**
19438
+ * Acknowledgement that a debug-media reclaim STARTED.
19439
+ *
19440
+ * The pass is paced at ~2 MB/s over a standing 100 GB — tens of minutes — so
19441
+ * it runs detached and this returns immediately. Awaiting it is how the
19442
+ * `addons.custom` door hit the 60 s UDS deadline while the walk carried on
19443
+ * with no status. Poll {@link pipelineAnalyticsCapability.methods.getMediaReclaimStatus}.
19444
+ */
19445
+ var MediaReclaimStartResultSchema = object({
19446
+ started: boolean(),
19447
+ /** True when a pass was already running; the new request is ignored. */
19448
+ alreadyRunning: boolean()
19449
+ });
19450
+ var MediaReclaimInputSchema = object({
19451
+ mode: _enum(["report", "reclaim"]).default("report"),
19452
+ scopes: array(_enum(["motion-still", "track-filmstrip"])).min(1).optional(),
19453
+ deviceIds: array(number().int()).min(1).optional(),
19454
+ restart: boolean().optional(),
19455
+ pageSize: number().int().min(50).max(5e3).optional(),
19456
+ maxRowsPerDevice: number().int().min(1).max(5e5).optional(),
19457
+ maxReclaimPerDevice: number().int().min(1).max(5e5).optional(),
19458
+ maxBytesPerRun: number().int().min(1).optional(),
19459
+ budgetMinutes: number().int().min(1).max(720).optional(),
19460
+ throttleBytesPerSec: number().int().min(64 * 1024).optional(),
19461
+ graceMinutes: number().int().min(1).max(10080).optional()
19462
+ });
19463
+ var MediaReclaimStatusSchema = object({
19464
+ running: boolean(),
19465
+ mode: _enum(["report", "reclaim"]).nullable(),
19466
+ totalExamined: number(),
19467
+ totalEligible: number(),
19468
+ totalReclaimed: number(),
19469
+ totalBytesReclaimed: number(),
19470
+ totalRefused: number(),
19471
+ /** Device+scope windows finished in this pass. */
19472
+ devicesDone: number(),
19473
+ complete: boolean().nullable(),
19474
+ startedAtMs: number().nullable(),
19475
+ finishedAtMs: number().nullable(),
19476
+ error: string().nullable()
19477
+ });
19274
19478
  var ReplayFrameInputSchema = object({
19275
19479
  timestamp: number(),
19276
19480
  frame: PipelineRunResultBridge
@@ -19309,10 +19513,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19309
19513
  * stationary registry). Default false: the timeline lists passages,
19310
19514
  * not parking records (operator decision, 2026-08-15). */
19311
19515
  includeStationary: boolean().optional()
19312
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(ListGroupsQueryInput, ListGroupsPageSchema), method(object({
19313
- deviceId: number(),
19314
- groupId: string().min(1)
19315
- }), AnalyticsGroupDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
19516
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
19316
19517
  kind: "mutation",
19317
19518
  auth: "admin"
19318
19519
  }), 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({
@@ -19321,7 +19522,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19321
19522
  until: number().optional(),
19322
19523
  kinds: array(string()).optional(),
19323
19524
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
19324
- }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
19525
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
19325
19526
  deviceId: number(),
19326
19527
  since: number(),
19327
19528
  until: number(),
@@ -19412,6 +19613,12 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19412
19613
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
19413
19614
  kind: "query",
19414
19615
  auth: "admin"
19616
+ }), method(MediaReclaimInputSchema, MediaReclaimStartResultSchema, {
19617
+ kind: "mutation",
19618
+ auth: "admin"
19619
+ }), method(object({}), MediaReclaimStatusSchema, {
19620
+ kind: "query",
19621
+ auth: "admin"
19415
19622
  }), method(object({ deviceIds: array(number()).optional() }), TrainingExportSummarySchema, {
19416
19623
  kind: "query",
19417
19624
  auth: "admin"
@@ -21486,7 +21693,13 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
21486
21693
  }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
21487
21694
  kind: "mutation",
21488
21695
  auth: "admin"
21489
- });
21696
+ }), method(StorageCleanupInputSchema, object({ jobId: string() }), {
21697
+ kind: "mutation",
21698
+ auth: "admin"
21699
+ }), method(StorageCleanupStatusInputSchema, StorageCleanupJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
21700
+ kind: "mutation",
21701
+ auth: "admin"
21702
+ }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
21490
21703
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
21491
21704
  providerId: string().min(1),
21492
21705
  displayName: string().min(1),
@@ -28587,6 +28800,33 @@ var RecordingRebalanceInputSchema = object({
28587
28800
  minMoveGb: number().min(0).optional()
28588
28801
  });
28589
28802
  /**
28803
+ * Operator-facing placement of one camera onto a recordings location.
28804
+ *
28805
+ * `pinLocationId` is the operator instruction: a location id, or `null` for
28806
+ * Auto (the planner may move this camera). `locationId` is where high/mid
28807
+ * currently write — the plan, which may disagree with the pin when Auto.
28808
+ */
28809
+ var RecordingDevicePlacementSchema = object({
28810
+ deviceId: number().int(),
28811
+ profile: string(),
28812
+ locationId: string()
28813
+ });
28814
+ var RecordingDevicePinSchema = object({
28815
+ deviceId: number().int(),
28816
+ /** Recordings-class location this camera is pinned to. */
28817
+ locationId: string()
28818
+ });
28819
+ var RecordingPlacementViewSchema = object({
28820
+ assignments: array(RecordingDevicePlacementSchema),
28821
+ pins: array(RecordingDevicePinSchema),
28822
+ defaultLocations: record(string(), string())
28823
+ });
28824
+ var RecordingSetDevicePlacementInputSchema = object({
28825
+ deviceId: number().int(),
28826
+ /** `null` = Auto. Otherwise a `recordings:*` location id. */
28827
+ locationId: string().nullable()
28828
+ });
28829
+ /**
28590
28830
  * Result of locating footage at a wall-clock instant for one device/profile.
28591
28831
  * `segment` carries the covering segment's window; `gap` reports the forward
28592
28832
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -28800,6 +29040,9 @@ method(object({
28800
29040
  }), method(RelocateResidueInputSchema, RelocateResidueSchema, {
28801
29041
  kind: "query",
28802
29042
  auth: "admin"
29043
+ }), method(LedgerWalkInputSchema, LedgerWalkReportSchema, {
29044
+ kind: "mutation",
29045
+ auth: "admin"
28803
29046
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
28804
29047
  kind: "mutation",
28805
29048
  auth: "admin"
@@ -28809,6 +29052,12 @@ method(object({
28809
29052
  }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
28810
29053
  kind: "mutation",
28811
29054
  auth: "admin"
29055
+ }), method(object({}), RecordingPlacementViewSchema, {
29056
+ kind: "query",
29057
+ auth: "admin"
29058
+ }), method(RecordingSetDevicePlacementInputSchema, object({ ok: literal(true) }), {
29059
+ kind: "mutation",
29060
+ auth: "admin"
28812
29061
  });
28813
29062
  /**
28814
29063
  * `recording-export` cap — render a footage time range into a single downloadable
@@ -29191,6 +29440,25 @@ var SceneMonitorStatusSchema = object({
29191
29440
  monitors: array(SceneMonitorSchema),
29192
29441
  lastFetchedAt: number()
29193
29442
  });
29443
+ /**
29444
+ * One camera's row in a `listScenesBatch` answer.
29445
+ *
29446
+ * `status` is NULLABLE and the nullability is the whole point. `scene-monitor`
29447
+ * is a `defaultActive` wrapper, so every camera is asked; a camera whose
29448
+ * provider is absent (pipeline-analytics not deployed, the post-processing node
29449
+ * down) cannot answer, and that is not the same fact as a camera with no scenes
29450
+ * configured. Fanned out per camera the difference was visible — one query
29451
+ * errored while the others resolved — and a batch that returned only the rows
29452
+ * it managed would have destroyed it, silently, by making an unreachable camera
29453
+ * indistinguishable from one that answered `monitors: []`.
29454
+ *
29455
+ * So: EVERY requested deviceId gets a row. `status: null` means "this camera
29456
+ * could not be read"; `status.monitors: []` means "read, and it has none".
29457
+ */
29458
+ var SceneMonitorStatusForDeviceSchema = object({
29459
+ deviceId: number(),
29460
+ status: SceneMonitorStatusSchema.nullable()
29461
+ });
29194
29462
  var sceneMonitorCapability = {
29195
29463
  name: "scene-monitor",
29196
29464
  scope: "device",
@@ -29200,6 +29468,22 @@ var sceneMonitorCapability = {
29200
29468
  deviceTypes: [DeviceType.Camera],
29201
29469
  methods: {
29202
29470
  listScenes: method(object({ deviceId: number() }), SceneMonitorStatusSchema),
29471
+ /**
29472
+ * The same answer, for a SET of cameras, in one round trip.
29473
+ *
29474
+ * `/scenes` renders every camera and re-reads them on a 30s safety-net
29475
+ * poll behind the push slice. Fanned out client-side that was one query
29476
+ * per camera — 29 round trips through the browser, the hub and the
29477
+ * post-analysis runner every 30 seconds to read an in-memory map the
29478
+ * owner had already merged. The work is unchanged (`statusFor` per
29479
+ * device, all in-process at the owner); what collapses is the transport.
29480
+ *
29481
+ * A camera that cannot answer still gets a row, with `status: null` —
29482
+ * see {@link SceneMonitorStatusForDeviceSchema}. Never fewer rows than
29483
+ * ids: a caller that asked for twenty-nine and got twenty-seven cannot
29484
+ * tell which two are missing, or that any are.
29485
+ */
29486
+ listScenesBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(SceneMonitorStatusForDeviceSchema).readonly()),
29203
29487
  createScene: method(object({
29204
29488
  deviceId: number(),
29205
29489
  label: string(),
@@ -31035,6 +31319,27 @@ var CameraOccupancySnapshotSchema = object({
31035
31319
  stationaryObjects: array(StationaryObjectSchema).readonly().optional()
31036
31320
  });
31037
31321
  /**
31322
+ * One camera's row in a `getCurrentSnapshotBatch` answer.
31323
+ *
31324
+ * THREE outcomes, and the single-camera method could only express two of them
31325
+ * because `snapshot: null` was already spoken for:
31326
+ *
31327
+ * - `read: 'read'`, `snapshot` present — the live occupancy reading.
31328
+ * - `read: 'read'`, `snapshot: null` — read, and this camera has no reading
31329
+ * yet: no frame since boot, and no parked-object registry to hydrate from.
31330
+ * - `read: 'unreadable'` — the owner could not answer for this
31331
+ * camera. `snapshot` is null, and it does NOT mean "nothing parked here".
31332
+ *
31333
+ * Collapsing the last two is the failure this field exists to prevent: a
31334
+ * hydration that threw would otherwise render as an empty Stationary section,
31335
+ * which is a definite claim about a camera nobody could read.
31336
+ */
31337
+ var CameraOccupancySnapshotForDeviceSchema = object({
31338
+ deviceId: number(),
31339
+ read: _enum(["read", "unreadable"]),
31340
+ snapshot: CameraOccupancySnapshotSchema.nullable()
31341
+ });
31342
+ /**
31038
31343
  * Time-series resolution. The history methods return one bucket per
31039
31344
  * step over the requested range. Smaller resolutions cost more
31040
31345
  * memory + bandwidth; bound to discrete steps so caller cannot ask
@@ -31091,6 +31396,20 @@ var zoneAnalyticsCapability = {
31091
31396
  * (no inference result emitted since boot or since binding was
31092
31397
  * activated). */
31093
31398
  getCurrentSnapshot: method(object({ deviceId: number() }), CameraOccupancySnapshotSchema.nullable()),
31399
+ /**
31400
+ * The same snapshot, for a SET of cameras, in one round trip.
31401
+ *
31402
+ * The Events page's Stationary section polls this every 15s for every
31403
+ * selected camera. Fanned out client-side that is one query per camera to
31404
+ * read a `Map.get` at the owner — the answer costs nothing, the round trip
31405
+ * costs everything. Batched, N transports become one and the per-device
31406
+ * work is unchanged.
31407
+ *
31408
+ * Every requested deviceId gets a row, tagged `read` — see
31409
+ * {@link CameraOccupancySnapshotForDeviceSchema}. A camera the owner could
31410
+ * not answer for is `'unreadable'`, never an empty reading.
31411
+ */
31412
+ getCurrentSnapshotBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(CameraOccupancySnapshotForDeviceSchema).readonly()),
31094
31413
  /** Time-series object count inside one zone. `className` optional —
31095
31414
  * omit to count every class in the zone. */
31096
31415
  getZoneHistory: method(object({
@@ -33808,6 +34127,12 @@ Object.freeze({
33808
34127
  addonId: null,
33809
34128
  access: "delete"
33810
34129
  },
34130
+ "deviceManager.renameLocation": {
34131
+ capName: "device-manager",
34132
+ capScope: "system",
34133
+ addonId: null,
34134
+ access: "create"
34135
+ },
33811
34136
  "deviceManager.runDeviceAction": {
33812
34137
  capName: "device-manager",
33813
34138
  capScope: "system",
@@ -35500,13 +35825,19 @@ Object.freeze({
35500
35825
  addonId: null,
35501
35826
  access: "view"
35502
35827
  },
35503
- "pipelineAnalytics.getGroup": {
35828
+ "pipelineAnalytics.getKeyEvents": {
35504
35829
  capName: "pipeline-analytics",
35505
35830
  capScope: "device",
35506
35831
  addonId: null,
35507
35832
  access: "view"
35508
35833
  },
35509
- "pipelineAnalytics.getKeyEvents": {
35834
+ "pipelineAnalytics.getKeyEventsBatch": {
35835
+ capName: "pipeline-analytics",
35836
+ capScope: "device",
35837
+ addonId: null,
35838
+ access: "view"
35839
+ },
35840
+ "pipelineAnalytics.getMediaReclaimStatus": {
35510
35841
  capName: "pipeline-analytics",
35511
35842
  capScope: "device",
35512
35843
  addonId: null,
@@ -35596,12 +35927,6 @@ Object.freeze({
35596
35927
  addonId: null,
35597
35928
  access: "view"
35598
35929
  },
35599
- "pipelineAnalytics.listGroups": {
35600
- capName: "pipeline-analytics",
35601
- capScope: "device",
35602
- addonId: null,
35603
- access: "view"
35604
- },
35605
35930
  "pipelineAnalytics.listOpsLog": {
35606
35931
  capName: "pipeline-analytics",
35607
35932
  capScope: "device",
@@ -35686,6 +36011,12 @@ Object.freeze({
35686
36011
  addonId: null,
35687
36012
  access: "create"
35688
36013
  },
36014
+ "pipelineAnalytics.reclaimDebugMedia": {
36015
+ capName: "pipeline-analytics",
36016
+ capScope: "device",
36017
+ addonId: null,
36018
+ access: "create"
36019
+ },
35689
36020
  "pipelineAnalytics.reconcileFromDisk": {
35690
36021
  capName: "pipeline-analytics",
35691
36022
  capScope: "device",
@@ -36610,6 +36941,12 @@ Object.freeze({
36610
36941
  addonId: null,
36611
36942
  access: "view"
36612
36943
  },
36944
+ "recording.getPlacement": {
36945
+ capName: "recording",
36946
+ capScope: "system",
36947
+ addonId: null,
36948
+ access: "view"
36949
+ },
36613
36950
  "recording.getPlaybackManifest": {
36614
36951
  capName: "recording",
36615
36952
  capScope: "system",
@@ -36688,6 +37025,12 @@ Object.freeze({
36688
37025
  addonId: null,
36689
37026
  access: "view"
36690
37027
  },
37028
+ "recording.reconcileLedgerAgainstDisk": {
37029
+ capName: "recording",
37030
+ capScope: "system",
37031
+ addonId: null,
37032
+ access: "create"
37033
+ },
36691
37034
  "recording.refreshStorageLocationsForMigration": {
36692
37035
  capName: "recording",
36693
37036
  capScope: "system",
@@ -36730,6 +37073,12 @@ Object.freeze({
36730
37073
  addonId: null,
36731
37074
  access: "create"
36732
37075
  },
37076
+ "recording.setDevicePlacement": {
37077
+ capName: "recording",
37078
+ capScope: "system",
37079
+ addonId: null,
37080
+ access: "create"
37081
+ },
36733
37082
  "recording.startStorageMigrationMove": {
36734
37083
  capName: "recording",
36735
37084
  capScope: "system",
@@ -36814,6 +37163,12 @@ Object.freeze({
36814
37163
  addonId: null,
36815
37164
  access: "view"
36816
37165
  },
37166
+ "sceneMonitor.listScenesBatch": {
37167
+ capName: "scene-monitor",
37168
+ capScope: "device",
37169
+ addonId: null,
37170
+ access: "view"
37171
+ },
36817
37172
  "sceneMonitor.recheckNow": {
36818
37173
  capName: "scene-monitor",
36819
37174
  capScope: "device",
@@ -37168,12 +37523,36 @@ Object.freeze({
37168
37523
  addonId: null,
37169
37524
  access: "create"
37170
37525
  },
37526
+ "storageMigration.cleanupCancel": {
37527
+ capName: "storage-migration",
37528
+ capScope: "system",
37529
+ addonId: null,
37530
+ access: "create"
37531
+ },
37532
+ "storageMigration.cleanupStart": {
37533
+ capName: "storage-migration",
37534
+ capScope: "system",
37535
+ addonId: null,
37536
+ access: "create"
37537
+ },
37538
+ "storageMigration.cleanupStatus": {
37539
+ capName: "storage-migration",
37540
+ capScope: "system",
37541
+ addonId: null,
37542
+ access: "view"
37543
+ },
37171
37544
  "storageMigration.drain": {
37172
37545
  capName: "storage-migration",
37173
37546
  capScope: "system",
37174
37547
  addonId: null,
37175
37548
  access: "create"
37176
37549
  },
37550
+ "storageMigration.history": {
37551
+ capName: "storage-migration",
37552
+ capScope: "system",
37553
+ addonId: null,
37554
+ access: "view"
37555
+ },
37177
37556
  "storageMigration.movers": {
37178
37557
  capName: "storage-migration",
37179
37558
  capScope: "system",
@@ -38170,6 +38549,12 @@ Object.freeze({
38170
38549
  addonId: null,
38171
38550
  access: "view"
38172
38551
  },
38552
+ "zoneAnalytics.getCurrentSnapshotBatch": {
38553
+ capName: "zone-analytics",
38554
+ capScope: "device",
38555
+ addonId: null,
38556
+ access: "view"
38557
+ },
38173
38558
  "zoneAnalytics.getUnzonedHistory": {
38174
38559
  capName: "zone-analytics",
38175
38560
  capScope: "device",
@@ -39164,14 +39549,14 @@ Object.freeze({
39164
39549
  form: "single",
39165
39550
  optional: true
39166
39551
  }],
39167
- "pipelineAnalytics.getGroup": [{
39552
+ "pipelineAnalytics.getKeyEvents": [{
39168
39553
  name: "deviceId",
39169
39554
  form: "single",
39170
39555
  optional: false
39171
39556
  }],
39172
- "pipelineAnalytics.getKeyEvents": [{
39173
- name: "deviceId",
39174
- form: "single",
39557
+ "pipelineAnalytics.getKeyEventsBatch": [{
39558
+ name: "deviceIds",
39559
+ form: "array",
39175
39560
  optional: false
39176
39561
  }],
39177
39562
  "pipelineAnalytics.getMotionEvents": [{
@@ -39229,11 +39614,6 @@ Object.freeze({
39229
39614
  form: "single",
39230
39615
  optional: false
39231
39616
  }],
39232
- "pipelineAnalytics.listGroups": [{
39233
- name: "deviceIds",
39234
- form: "array",
39235
- optional: false
39236
- }],
39237
39617
  "pipelineAnalytics.listOpsLog": [{
39238
39618
  name: "deviceId",
39239
39619
  form: "single",
@@ -39279,6 +39659,11 @@ Object.freeze({
39279
39659
  form: "single",
39280
39660
  optional: true
39281
39661
  }],
39662
+ "pipelineAnalytics.reclaimDebugMedia": [{
39663
+ name: "deviceIds",
39664
+ form: "array",
39665
+ optional: true
39666
+ }],
39282
39667
  "pipelineAnalytics.reconcileFromDisk": [{
39283
39668
  name: "deviceId",
39284
39669
  form: "single",
@@ -39614,6 +39999,11 @@ Object.freeze({
39614
39999
  form: "single",
39615
40000
  optional: false
39616
40001
  }],
40002
+ "recording.reconcileLedgerAgainstDisk": [{
40003
+ name: "deviceId",
40004
+ form: "single",
40005
+ optional: true
40006
+ }],
39617
40007
  "recording.relocateFootage": [{
39618
40008
  name: "deviceId",
39619
40009
  form: "single",
@@ -39639,6 +40029,11 @@ Object.freeze({
39639
40029
  form: "single",
39640
40030
  optional: false
39641
40031
  }],
40032
+ "recording.setDevicePlacement": [{
40033
+ name: "deviceId",
40034
+ form: "single",
40035
+ optional: false
40036
+ }],
39642
40037
  "recording.startStorageMigrationMove": [{
39643
40038
  name: "deviceId",
39644
40039
  form: "single",
@@ -39679,6 +40074,11 @@ Object.freeze({
39679
40074
  form: "single",
39680
40075
  optional: false
39681
40076
  }],
40077
+ "sceneMonitor.listScenesBatch": [{
40078
+ name: "deviceIds",
40079
+ form: "array",
40080
+ optional: false
40081
+ }],
39682
40082
  "sceneMonitor.recheckNow": [{
39683
40083
  name: "deviceId",
39684
40084
  form: "single",
@@ -39940,6 +40340,11 @@ Object.freeze({
39940
40340
  form: "single",
39941
40341
  optional: false
39942
40342
  }],
40343
+ "zoneAnalytics.getCurrentSnapshotBatch": [{
40344
+ name: "deviceIds",
40345
+ form: "array",
40346
+ optional: false
40347
+ }],
39943
40348
  "zoneAnalytics.getUnzonedHistory": [{
39944
40349
  name: "deviceId",
39945
40350
  form: "single",