@camstack/addon-provider-rtsp 1.2.48 → 1.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
@@ -8074,6 +8074,20 @@ var RelocateJobSchema = object({
8074
8074
  * in its row, not in its name, so `MediaRelocateEngine` never reconciles one.
8075
8075
  */
8076
8076
  rowsReconciled: number().int().nonnegative().optional(),
8077
+ /**
8078
+ * Rows this run FORGOT because the file they name is not on disk.
8079
+ *
8080
+ * The mover derived the path from the row's own fields and `stat`ed it; an
8081
+ * ENOENT there is a per-path confirmation that the segment is gone (D296),
8082
+ * and the durable row is dropped through the same channel eviction uses. It
8083
+ * is reported for the same reason `rowsReconciled` is: this is a durable
8084
+ * mutation nobody asked for, and a migration that quietly erases hour rows is
8085
+ * the same failure as one that quietly skips them (D295).
8086
+ *
8087
+ * The production drain of 2026-08-30 would have reported 11 074 here — the
8088
+ * ledger claimed 5.65 GB of footage that no longer existed.
8089
+ */
8090
+ rowsForgotten: number().int().nonnegative().optional(),
8077
8091
  startedAt: number(),
8078
8092
  finishedAt: number().nullable(),
8079
8093
  error: string().nullable()
@@ -8138,6 +8152,13 @@ var MediaRelocateModeSchema = _enum([
8138
8152
  ]);
8139
8153
  var RelocateMediaInputSchema = object({
8140
8154
  toLocationId: string(),
8155
+ /**
8156
+ * Restrict the pass to rows currently on this location. Omitted / `'*'` =
8157
+ * every row that is not already on `toLocationId` (the historical
8158
+ * behaviour). A named source is what a from→to migration needs: without it
8159
+ * "move events off disk 2" also emptied disk 1.
8160
+ */
8161
+ fromLocationId: string().optional(),
8141
8162
  throttleMbps: number().min(1).max(1e3).optional(),
8142
8163
  /** Omitted = `move`, the pre-existing behaviour. */
8143
8164
  mode: MediaRelocateModeSchema.optional()
@@ -8205,6 +8226,19 @@ var StorageMigrationDestinationsSchema = object({
8205
8226
  galleryMedia: string().min(1).optional()
8206
8227
  }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
8207
8228
  /**
8229
+ * Optional named source per class. Omitted = the class's current default
8230
+ * (the historical behaviour). A named source that is NOT the default is a
8231
+ * drain of that disk: bytes move, the default stays, and the source is
8232
+ * disabled when the move finishes.
8233
+ */
8234
+ var StorageMigrationSourcesSchema = object({
8235
+ recordings: string().min(1).optional(),
8236
+ recordingsLow: string().min(1).optional(),
8237
+ eventMedia: string().min(1).optional(),
8238
+ backups: string().min(1).optional(),
8239
+ galleryMedia: string().min(1).optional()
8240
+ }).optional();
8241
+ /**
8208
8242
  * How a migration sequences the cutover against the byte move.
8209
8243
  *
8210
8244
  * - `blocking` — the historical order: pause, move every byte, repoint,
@@ -8226,6 +8260,8 @@ var StorageMigrationModeSchema = _enum(["blocking", "nonBlocking"]);
8226
8260
  /** Shared input for planning and starting an orchestrated storage migration. */
8227
8261
  var StorageMigrationInputSchema = object({
8228
8262
  destinations: StorageMigrationDestinationsSchema,
8263
+ /** Omitted = each class's current default. */
8264
+ sources: StorageMigrationSourcesSchema,
8229
8265
  throttleMbps: number().min(1).max(1e3).optional(),
8230
8266
  /** Omitted = `blocking`, which stays the default. */
8231
8267
  mode: StorageMigrationModeSchema.optional()
@@ -8305,6 +8341,13 @@ var StorageMigrationMoveSchema = object({
8305
8341
  storageClass: StorageMigrationClassSchema,
8306
8342
  fromLocationId: string(),
8307
8343
  toLocationId: string(),
8344
+ /**
8345
+ * True when `from` was NOT the class default at plan time. The move still
8346
+ * copies bytes, but the default is left alone and the source is disabled
8347
+ * once the copy verifies. Absent on jobs planned before this field existed
8348
+ * — those jobs always repointed, which is `false`.
8349
+ */
8350
+ freezeSource: boolean().optional(),
8308
8351
  moverJobId: string().nullable(),
8309
8352
  state: RelocateJobStateSchema.nullable(),
8310
8353
  error: string().nullable(),
@@ -8318,6 +8361,7 @@ var StorageMigrationJobSchema = object({
8318
8361
  * can tell a seconds-long cutover from a thirty-hour one. */
8319
8362
  mode: StorageMigrationModeSchema,
8320
8363
  destinations: StorageMigrationDestinationsSchema,
8364
+ sources: StorageMigrationSourcesSchema,
8321
8365
  throttleMbps: number(),
8322
8366
  moves: array(StorageMigrationMoveSchema),
8323
8367
  pauseLeaseId: string().nullable(),
@@ -8343,6 +8387,7 @@ var StorageMigrationFindingSchema = object({
8343
8387
  });
8344
8388
  var StorageMigrationPlanSchema = object({
8345
8389
  destinations: StorageMigrationDestinationsSchema,
8390
+ sources: StorageMigrationSourcesSchema,
8346
8391
  /** The mode this plan was built for. A plan is only valid for its mode: the
8347
8392
  * `eventMedia` seal gate and the single-cardinality refusal both depend on
8348
8393
  * it. */
@@ -8350,7 +8395,8 @@ var StorageMigrationPlanSchema = object({
8350
8395
  moves: array(object({
8351
8396
  storageClass: StorageMigrationClassSchema,
8352
8397
  fromLocationId: string(),
8353
- toLocationId: string()
8398
+ toLocationId: string(),
8399
+ freezeSource: boolean().optional()
8354
8400
  })),
8355
8401
  findings: array(StorageMigrationFindingSchema)
8356
8402
  });
@@ -8437,16 +8483,142 @@ var RelocateResidueSchema = object({
8437
8483
  segments: number().int().nonnegative(),
8438
8484
  bytes: number().int().nonnegative()
8439
8485
  }).nullable();
8486
+ /**
8487
+ * Ask one location whether its durable hour rows describe the disk — the walk
8488
+ * (D319).
8489
+ *
8490
+ * `apply` DEFAULTS TO FALSE and that default is the product: the operator's
8491
+ * missing tool is the question, and the dry run is how they sanity-check the
8492
+ * destructive run before authorising it.
8493
+ */
8494
+ var LedgerWalkInputSchema = object({
8495
+ locationId: string().min(1),
8496
+ /** Forget the confirmed-absent rows, rather than only counting them. */
8497
+ apply: boolean().optional(),
8498
+ /** Narrow to one camera. */
8499
+ deviceId: number().int().positive().optional(),
8500
+ /** Narrow to these recording profiles; empty/absent = every profile. */
8501
+ profiles: array(string().min(1)).optional()
8502
+ });
8503
+ /** Why a whole walk did nothing. Every one leaves the ledger untouched. */
8504
+ var LedgerWalkRefusalSchema = _enum([
8505
+ "location-unknown",
8506
+ "source-writable",
8507
+ "no-ledger",
8508
+ "archive-unreadable",
8509
+ "anchor-absent",
8510
+ "anchor-unreadable",
8511
+ "anchor-moved"
8512
+ ]);
8513
+ _enum([
8514
+ "live-tail",
8515
+ "listing-error",
8516
+ "path-mismatch",
8517
+ "durable-refused"
8518
+ ]);
8519
+ /** Every skip reason, always present, always a number — so a reason that never
8520
+ * fired reports as zero rather than absent and the report shape is constant
8521
+ * between passes. Spelled out rather than `z.record` for exactly that. */
8522
+ var LedgerWalkSkipCountsSchema = object({
8523
+ "live-tail": number().int().nonnegative(),
8524
+ "listing-error": number().int().nonnegative(),
8525
+ "path-mismatch": number().int().nonnegative(),
8526
+ "durable-refused": number().int().nonnegative()
8527
+ });
8528
+ /** One camera's share of a walk, so a report names cameras and not rows. */
8529
+ var LedgerWalkDeviceReportSchema = object({
8530
+ deviceId: number().int(),
8531
+ hoursWalked: number().int().nonnegative(),
8532
+ hoursMissing: number().int().nonnegative(),
8533
+ ghostSegments: number().int().nonnegative(),
8534
+ ghostBytes: number().int().nonnegative(),
8535
+ forgottenSegments: number().int().nonnegative(),
8536
+ orphanFiles: number().int().nonnegative()
8537
+ });
8538
+ /**
8539
+ * What one walk claimed, listed, found and (only when armed) forgot.
8540
+ *
8541
+ * `archiveSegments` is the **M** and `segmentsClaimed` the **N** (D295), so a
8542
+ * walk that saw a fraction of the location is visible in its own report rather
8543
+ * than in the absence of one.
8544
+ */
8545
+ var LedgerWalkReportSchema = object({
8546
+ locationId: string(),
8547
+ applied: boolean(),
8548
+ refused: LedgerWalkRefusalSchema.nullable(),
8549
+ archiveSegments: number().int().nonnegative().nullable(),
8550
+ archiveBytes: number().int().nonnegative().nullable(),
8551
+ hoursClaimed: number().int().nonnegative(),
8552
+ hoursWalked: number().int().nonnegative(),
8553
+ hoursMissing: number().int().nonnegative(),
8554
+ /** `readdir` calls issued — the cost, stated in the unit that is paid. */
8555
+ listings: number().int().nonnegative(),
8556
+ segmentsClaimed: number().int().nonnegative(),
8557
+ ghostSegments: number().int().nonnegative(),
8558
+ ghostBytes: number().int().nonnegative(),
8559
+ ghostHoursWhole: number().int().nonnegative(),
8560
+ forgottenSegments: number().int().nonnegative(),
8561
+ forgottenBytes: number().int().nonnegative(),
8562
+ /** Files under a claimed hour that no durable row names. Never deleted. */
8563
+ orphanFiles: number().int().nonnegative(),
8564
+ orphanSample: array(string()).readonly(),
8565
+ hoursSkipped: number().int().nonnegative(),
8566
+ skippedByReason: LedgerWalkSkipCountsSchema,
8567
+ /** The walk stopped at its per-pass hour bound with claims unwalked. */
8568
+ bounded: boolean(),
8569
+ byDevice: array(LedgerWalkDeviceReportSchema).readonly()
8570
+ });
8440
8571
  /** How many rows a media pass would still act on against a given target — the
8441
8572
  * media lane's denominator AND its residue, from ONE derivation so the two can
8442
8573
  * never disagree. `null` = the count could not be taken. */
8443
8574
  var RelocatableMediaCountSchema = object({ rows: number().int().nonnegative() }).nullable();
8444
8575
  var RelocatableMediaCountInputSchema = object({
8445
8576
  toLocationId: string().min(1),
8577
+ /** Restrict the count to one source; omitted / `'*'` = every non-target row. */
8578
+ fromLocationId: string().optional(),
8446
8579
  /** Omitted = `move`. */
8447
8580
  mode: MediaRelocateModeSchema.optional()
8448
8581
  });
8449
8582
  /**
8583
+ * Operator cleanup of leftover analytics rows, optional debug media, and
8584
+ * ghost ledger entries on frozen footage locations.
8585
+ *
8586
+ * A pass is tens of minutes on a standing backlog. The hub method RETURNS
8587
+ * `{ jobId }` immediately; progress is `cleanupStatus`. Awaiting the work
8588
+ * is how `addons.custom` hit the 60 s UDS deadline while reclaim continued
8589
+ * with no operator-visible status.
8590
+ */
8591
+ var StorageCleanupPhaseSchema = _enum([
8592
+ "orphans",
8593
+ "debug-media",
8594
+ "ghost-ledger",
8595
+ "done",
8596
+ "failed",
8597
+ "cancelled"
8598
+ ]);
8599
+ var StorageCleanupInputSchema = object({
8600
+ /** Also walk motion stills / track filmstrips. Off by default. */
8601
+ includeDebugMedia: boolean().optional() });
8602
+ var StorageCleanupJobSchema = object({
8603
+ jobId: string(),
8604
+ phase: StorageCleanupPhaseSchema,
8605
+ includeDebugMedia: boolean(),
8606
+ orphansReclaimed: number().int().nonnegative(),
8607
+ orphanBytesReclaimed: number().int().nonnegative(),
8608
+ debugMediaReclaimed: number().int().nonnegative(),
8609
+ debugMediaBytesReclaimed: number().int().nonnegative(),
8610
+ ghostsForgotten: number().int().nonnegative(),
8611
+ ghostBytesForgotten: number().int().nonnegative(),
8612
+ /** Short operator-facing line: current collection, pass, or location. */
8613
+ detail: string().nullable(),
8614
+ cancelRequested: boolean(),
8615
+ startedAt: number(),
8616
+ updatedAt: number(),
8617
+ finishedAt: number().nullable(),
8618
+ error: string().nullable()
8619
+ });
8620
+ var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8621
+ /**
8450
8622
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8451
8623
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8452
8624
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8474,11 +8646,10 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
8474
8646
  * The default location for a type uses `id === <type>:default` by
8475
8647
  * convention (the bare type ref like `'backups'` resolves to it).
8476
8648
  *
8477
- * `isSystem: true` marks a location as orchestrator-seeded and
8478
- * undeletable. The bootstrap-installed defaults (one per type) carry
8479
- * this flag; operator-added locations don't. Editing the config of
8480
- * a system location is allowed (path migration, provider swap) but
8481
- * deleting it is rejected at the cap level.
8649
+ * `isSystem` is a legacy persisted flag. Seed still creates the initial
8650
+ * `<type>:default` locations; the flag is no longer a lock, a badge, or a
8651
+ * prune selector. New writes leave it false. Deletion is gated on uniqueness
8652
+ * / last-enabled, not on this bit.
8482
8653
  */
8483
8654
  var StorageLocationSchema = object({
8484
8655
  id: string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),
@@ -13004,6 +13175,12 @@ method(object({
13004
13175
  }), _void(), {
13005
13176
  kind: "mutation",
13006
13177
  auth: "admin"
13178
+ }), method(object({
13179
+ from: string(),
13180
+ to: string()
13181
+ }), object({ moved: number() }), {
13182
+ kind: "mutation",
13183
+ auth: "admin"
13007
13184
  }), method(object({
13008
13185
  deviceId: number(),
13009
13186
  disabled: boolean()
@@ -19012,53 +19189,15 @@ var RecentTracksPageSchema = object({
19012
19189
  /** Cursor for the next page, or null when this page is the last. */
19013
19190
  nextCursor: string().nullable()
19014
19191
  });
19015
- var LIST_GROUPS_DEFAULT_LIMIT = 40;
19016
- var LIST_GROUPS_MAX_LIMIT = 100;
19017
- var AnalyticsGroupRecordSchema = object({
19018
- id: string(),
19019
- deviceId: number().int(),
19020
- openedAt: number().int(),
19021
- closedAt: number().int(),
19022
- timestamp: number().int(),
19023
- memberCount: number().int(),
19024
- memberTrackIds: array(string()).readonly(),
19025
- className: string(),
19026
- classes: array(string()).readonly(),
19027
- /** Relative event-media path, or null when the group has no picture yet. */
19028
- mediaUrl: string().nullable(),
19029
- singleton: boolean()
19030
- });
19031
- var AnalyticsGroupMemberSchema = object({
19032
- trackId: string(),
19033
- deviceId: number().int(),
19034
- className: string(),
19035
- firstSeen: number().int(),
19036
- lastSeen: number().int(),
19037
- mediaUrl: string().nullable()
19038
- });
19039
- var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
19040
- var ListGroupsQueryInput = object({
19041
- /** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
19042
- deviceIds: array(number()),
19043
- /** Window lower bound on `closedAt` (inclusive). */
19044
- since: number().optional(),
19045
- /** Window upper bound on `openedAt` (inclusive). */
19046
- until: number().optional(),
19047
- limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
19048
- /** Opaque continuation cursor from a previous page's `nextCursor`. */
19049
- cursor: string().optional()
19050
- });
19051
- var ListGroupsPageSchema = object({
19052
- groups: array(AnalyticsGroupRecordSchema).readonly(),
19053
- nextCursor: string().nullable()
19054
- });
19192
+ var KEY_EVENTS_DEFAULT_LIMIT = 50;
19193
+ var KEY_EVENTS_MAX_LIMIT = 200;
19055
19194
  var KeyEventQueryInput = object({
19056
19195
  deviceId: number(),
19057
19196
  /** Window lower bound (track firstSeen ≥ since). */
19058
19197
  since: number(),
19059
19198
  /** Window upper bound (track firstSeen ≤ until). */
19060
19199
  until: number(),
19061
- limit: number().int().min(1).max(200).default(50),
19200
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
19062
19201
  /** Drop tracks scoring below this importance. */
19063
19202
  minImportance: number().min(0).max(1).optional(),
19064
19203
  /** Restrict to a single class (e.g. 'person'). */
@@ -19080,6 +19219,32 @@ var KeyEventSchema = object({
19080
19219
  ...TrackFlagFields,
19081
19220
  ...TrackRetrainFields
19082
19221
  });
19222
+ /** `getKeyEvents`' window and filters, asked of a SET of cameras at once. */
19223
+ var KeyEventBatchQueryInput = object({
19224
+ deviceIds: array(number()).min(1).max(200),
19225
+ since: number(),
19226
+ until: number(),
19227
+ /** Applied PER CAMERA, exactly as `getKeyEvents.limit` is — never a total
19228
+ * across the set, which would let a busy camera starve a quiet one of its
19229
+ * rows and change what the merged feed contains. */
19230
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
19231
+ minImportance: number().min(0).max(1).optional(),
19232
+ classFilter: string().optional()
19233
+ });
19234
+ /**
19235
+ * One camera's key events in a batch answer.
19236
+ *
19237
+ * The row exists for every requested id. `getKeyEvents` degrades to `[]` on
19238
+ * error rather than throwing, so a camera whose store read failed and one with
19239
+ * no events in the window were ALREADY indistinguishable per camera — the
19240
+ * batch does not make that worse, and the row keeps the deviceId the single
19241
+ * method's output never carried (the caller used to stamp it from the fan-out
19242
+ * key, which only worked because there was one query per camera).
19243
+ */
19244
+ var KeyEventsForDeviceSchema = object({
19245
+ deviceId: number(),
19246
+ events: array(KeyEventSchema).readonly()
19247
+ });
19083
19248
  object({
19084
19249
  trackId: string(),
19085
19250
  className: string(),
@@ -19127,9 +19292,7 @@ var TrackCascadeCountsSchema = object({
19127
19292
  /** Unassigned plate reads removed (best-effort; plate leg deferred to plate-intelligence). */
19128
19293
  plates: number().int(),
19129
19294
  /** Per-track CLIP search vectors removed (best-effort). */
19130
- embeddings: number().int(),
19131
- /** Group membership + group rows removed with their last member (best-effort). */
19132
- groups: number().int()
19295
+ embeddings: number().int()
19133
19296
  });
19134
19297
  /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
19135
19298
  var DiskReconcileCountsSchema = object({
@@ -19299,6 +19462,47 @@ var RebuildStatusSchema = object({
19299
19462
  /** Present when the pass ended by throwing. */
19300
19463
  error: string().nullable()
19301
19464
  });
19465
+ /**
19466
+ * Acknowledgement that a debug-media reclaim STARTED.
19467
+ *
19468
+ * The pass is paced at ~2 MB/s over a standing 100 GB — tens of minutes — so
19469
+ * it runs detached and this returns immediately. Awaiting it is how the
19470
+ * `addons.custom` door hit the 60 s UDS deadline while the walk carried on
19471
+ * with no status. Poll {@link pipelineAnalyticsCapability.methods.getMediaReclaimStatus}.
19472
+ */
19473
+ var MediaReclaimStartResultSchema = object({
19474
+ started: boolean(),
19475
+ /** True when a pass was already running; the new request is ignored. */
19476
+ alreadyRunning: boolean()
19477
+ });
19478
+ var MediaReclaimInputSchema = object({
19479
+ mode: _enum(["report", "reclaim"]).default("report"),
19480
+ scopes: array(_enum(["motion-still", "track-filmstrip"])).min(1).optional(),
19481
+ deviceIds: array(number().int()).min(1).optional(),
19482
+ restart: boolean().optional(),
19483
+ pageSize: number().int().min(50).max(5e3).optional(),
19484
+ maxRowsPerDevice: number().int().min(1).max(5e5).optional(),
19485
+ maxReclaimPerDevice: number().int().min(1).max(5e5).optional(),
19486
+ maxBytesPerRun: number().int().min(1).optional(),
19487
+ budgetMinutes: number().int().min(1).max(720).optional(),
19488
+ throttleBytesPerSec: number().int().min(64 * 1024).optional(),
19489
+ graceMinutes: number().int().min(1).max(10080).optional()
19490
+ });
19491
+ var MediaReclaimStatusSchema = object({
19492
+ running: boolean(),
19493
+ mode: _enum(["report", "reclaim"]).nullable(),
19494
+ totalExamined: number(),
19495
+ totalEligible: number(),
19496
+ totalReclaimed: number(),
19497
+ totalBytesReclaimed: number(),
19498
+ totalRefused: number(),
19499
+ /** Device+scope windows finished in this pass. */
19500
+ devicesDone: number(),
19501
+ complete: boolean().nullable(),
19502
+ startedAtMs: number().nullable(),
19503
+ finishedAtMs: number().nullable(),
19504
+ error: string().nullable()
19505
+ });
19302
19506
  var ReplayFrameInputSchema = object({
19303
19507
  timestamp: number(),
19304
19508
  frame: PipelineRunResultBridge
@@ -19337,10 +19541,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19337
19541
  * stationary registry). Default false: the timeline lists passages,
19338
19542
  * not parking records (operator decision, 2026-08-15). */
19339
19543
  includeStationary: boolean().optional()
19340
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(ListGroupsQueryInput, ListGroupsPageSchema), method(object({
19341
- deviceId: number(),
19342
- groupId: string().min(1)
19343
- }), AnalyticsGroupDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
19544
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
19344
19545
  kind: "mutation",
19345
19546
  auth: "admin"
19346
19547
  }), 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({
@@ -19349,7 +19550,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19349
19550
  until: number().optional(),
19350
19551
  kinds: array(string()).optional(),
19351
19552
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
19352
- }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
19553
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
19353
19554
  deviceId: number(),
19354
19555
  since: number(),
19355
19556
  until: number(),
@@ -19440,6 +19641,12 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19440
19641
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
19441
19642
  kind: "query",
19442
19643
  auth: "admin"
19644
+ }), method(MediaReclaimInputSchema, MediaReclaimStartResultSchema, {
19645
+ kind: "mutation",
19646
+ auth: "admin"
19647
+ }), method(object({}), MediaReclaimStatusSchema, {
19648
+ kind: "query",
19649
+ auth: "admin"
19443
19650
  }), method(object({ deviceIds: array(number()).optional() }), TrainingExportSummarySchema, {
19444
19651
  kind: "query",
19445
19652
  auth: "admin"
@@ -21514,7 +21721,13 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
21514
21721
  }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
21515
21722
  kind: "mutation",
21516
21723
  auth: "admin"
21517
- });
21724
+ }), method(StorageCleanupInputSchema, object({ jobId: string() }), {
21725
+ kind: "mutation",
21726
+ auth: "admin"
21727
+ }), method(StorageCleanupStatusInputSchema, StorageCleanupJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
21728
+ kind: "mutation",
21729
+ auth: "admin"
21730
+ }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
21518
21731
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
21519
21732
  providerId: string().min(1),
21520
21733
  displayName: string().min(1),
@@ -28615,6 +28828,33 @@ var RecordingRebalanceInputSchema = object({
28615
28828
  minMoveGb: number().min(0).optional()
28616
28829
  });
28617
28830
  /**
28831
+ * Operator-facing placement of one camera onto a recordings location.
28832
+ *
28833
+ * `pinLocationId` is the operator instruction: a location id, or `null` for
28834
+ * Auto (the planner may move this camera). `locationId` is where high/mid
28835
+ * currently write — the plan, which may disagree with the pin when Auto.
28836
+ */
28837
+ var RecordingDevicePlacementSchema = object({
28838
+ deviceId: number().int(),
28839
+ profile: string(),
28840
+ locationId: string()
28841
+ });
28842
+ var RecordingDevicePinSchema = object({
28843
+ deviceId: number().int(),
28844
+ /** Recordings-class location this camera is pinned to. */
28845
+ locationId: string()
28846
+ });
28847
+ var RecordingPlacementViewSchema = object({
28848
+ assignments: array(RecordingDevicePlacementSchema),
28849
+ pins: array(RecordingDevicePinSchema),
28850
+ defaultLocations: record(string(), string())
28851
+ });
28852
+ var RecordingSetDevicePlacementInputSchema = object({
28853
+ deviceId: number().int(),
28854
+ /** `null` = Auto. Otherwise a `recordings:*` location id. */
28855
+ locationId: string().nullable()
28856
+ });
28857
+ /**
28618
28858
  * Result of locating footage at a wall-clock instant for one device/profile.
28619
28859
  * `segment` carries the covering segment's window; `gap` reports the forward
28620
28860
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -28828,6 +29068,9 @@ method(object({
28828
29068
  }), method(RelocateResidueInputSchema, RelocateResidueSchema, {
28829
29069
  kind: "query",
28830
29070
  auth: "admin"
29071
+ }), method(LedgerWalkInputSchema, LedgerWalkReportSchema, {
29072
+ kind: "mutation",
29073
+ auth: "admin"
28831
29074
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
28832
29075
  kind: "mutation",
28833
29076
  auth: "admin"
@@ -28837,6 +29080,12 @@ method(object({
28837
29080
  }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
28838
29081
  kind: "mutation",
28839
29082
  auth: "admin"
29083
+ }), method(object({}), RecordingPlacementViewSchema, {
29084
+ kind: "query",
29085
+ auth: "admin"
29086
+ }), method(RecordingSetDevicePlacementInputSchema, object({ ok: literal(true) }), {
29087
+ kind: "mutation",
29088
+ auth: "admin"
28840
29089
  });
28841
29090
  /**
28842
29091
  * `recording-export` cap — render a footage time range into a single downloadable
@@ -29219,6 +29468,25 @@ var SceneMonitorStatusSchema = object({
29219
29468
  monitors: array(SceneMonitorSchema),
29220
29469
  lastFetchedAt: number()
29221
29470
  });
29471
+ /**
29472
+ * One camera's row in a `listScenesBatch` answer.
29473
+ *
29474
+ * `status` is NULLABLE and the nullability is the whole point. `scene-monitor`
29475
+ * is a `defaultActive` wrapper, so every camera is asked; a camera whose
29476
+ * provider is absent (pipeline-analytics not deployed, the post-processing node
29477
+ * down) cannot answer, and that is not the same fact as a camera with no scenes
29478
+ * configured. Fanned out per camera the difference was visible — one query
29479
+ * errored while the others resolved — and a batch that returned only the rows
29480
+ * it managed would have destroyed it, silently, by making an unreachable camera
29481
+ * indistinguishable from one that answered `monitors: []`.
29482
+ *
29483
+ * So: EVERY requested deviceId gets a row. `status: null` means "this camera
29484
+ * could not be read"; `status.monitors: []` means "read, and it has none".
29485
+ */
29486
+ var SceneMonitorStatusForDeviceSchema = object({
29487
+ deviceId: number(),
29488
+ status: SceneMonitorStatusSchema.nullable()
29489
+ });
29222
29490
  var sceneMonitorCapability = {
29223
29491
  name: "scene-monitor",
29224
29492
  scope: "device",
@@ -29228,6 +29496,22 @@ var sceneMonitorCapability = {
29228
29496
  deviceTypes: [DeviceType.Camera],
29229
29497
  methods: {
29230
29498
  listScenes: method(object({ deviceId: number() }), SceneMonitorStatusSchema),
29499
+ /**
29500
+ * The same answer, for a SET of cameras, in one round trip.
29501
+ *
29502
+ * `/scenes` renders every camera and re-reads them on a 30s safety-net
29503
+ * poll behind the push slice. Fanned out client-side that was one query
29504
+ * per camera — 29 round trips through the browser, the hub and the
29505
+ * post-analysis runner every 30 seconds to read an in-memory map the
29506
+ * owner had already merged. The work is unchanged (`statusFor` per
29507
+ * device, all in-process at the owner); what collapses is the transport.
29508
+ *
29509
+ * A camera that cannot answer still gets a row, with `status: null` —
29510
+ * see {@link SceneMonitorStatusForDeviceSchema}. Never fewer rows than
29511
+ * ids: a caller that asked for twenty-nine and got twenty-seven cannot
29512
+ * tell which two are missing, or that any are.
29513
+ */
29514
+ listScenesBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(SceneMonitorStatusForDeviceSchema).readonly()),
29231
29515
  createScene: method(object({
29232
29516
  deviceId: number(),
29233
29517
  label: string(),
@@ -31063,6 +31347,27 @@ var CameraOccupancySnapshotSchema = object({
31063
31347
  stationaryObjects: array(StationaryObjectSchema).readonly().optional()
31064
31348
  });
31065
31349
  /**
31350
+ * One camera's row in a `getCurrentSnapshotBatch` answer.
31351
+ *
31352
+ * THREE outcomes, and the single-camera method could only express two of them
31353
+ * because `snapshot: null` was already spoken for:
31354
+ *
31355
+ * - `read: 'read'`, `snapshot` present — the live occupancy reading.
31356
+ * - `read: 'read'`, `snapshot: null` — read, and this camera has no reading
31357
+ * yet: no frame since boot, and no parked-object registry to hydrate from.
31358
+ * - `read: 'unreadable'` — the owner could not answer for this
31359
+ * camera. `snapshot` is null, and it does NOT mean "nothing parked here".
31360
+ *
31361
+ * Collapsing the last two is the failure this field exists to prevent: a
31362
+ * hydration that threw would otherwise render as an empty Stationary section,
31363
+ * which is a definite claim about a camera nobody could read.
31364
+ */
31365
+ var CameraOccupancySnapshotForDeviceSchema = object({
31366
+ deviceId: number(),
31367
+ read: _enum(["read", "unreadable"]),
31368
+ snapshot: CameraOccupancySnapshotSchema.nullable()
31369
+ });
31370
+ /**
31066
31371
  * Time-series resolution. The history methods return one bucket per
31067
31372
  * step over the requested range. Smaller resolutions cost more
31068
31373
  * memory + bandwidth; bound to discrete steps so caller cannot ask
@@ -31119,6 +31424,20 @@ var zoneAnalyticsCapability = {
31119
31424
  * (no inference result emitted since boot or since binding was
31120
31425
  * activated). */
31121
31426
  getCurrentSnapshot: method(object({ deviceId: number() }), CameraOccupancySnapshotSchema.nullable()),
31427
+ /**
31428
+ * The same snapshot, for a SET of cameras, in one round trip.
31429
+ *
31430
+ * The Events page's Stationary section polls this every 15s for every
31431
+ * selected camera. Fanned out client-side that is one query per camera to
31432
+ * read a `Map.get` at the owner — the answer costs nothing, the round trip
31433
+ * costs everything. Batched, N transports become one and the per-device
31434
+ * work is unchanged.
31435
+ *
31436
+ * Every requested deviceId gets a row, tagged `read` — see
31437
+ * {@link CameraOccupancySnapshotForDeviceSchema}. A camera the owner could
31438
+ * not answer for is `'unreadable'`, never an empty reading.
31439
+ */
31440
+ getCurrentSnapshotBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(CameraOccupancySnapshotForDeviceSchema).readonly()),
31122
31441
  /** Time-series object count inside one zone. `className` optional —
31123
31442
  * omit to count every class in the zone. */
31124
31443
  getZoneHistory: method(object({
@@ -33902,6 +34221,12 @@ Object.freeze({
33902
34221
  addonId: null,
33903
34222
  access: "delete"
33904
34223
  },
34224
+ "deviceManager.renameLocation": {
34225
+ capName: "device-manager",
34226
+ capScope: "system",
34227
+ addonId: null,
34228
+ access: "create"
34229
+ },
33905
34230
  "deviceManager.runDeviceAction": {
33906
34231
  capName: "device-manager",
33907
34232
  capScope: "system",
@@ -35594,13 +35919,19 @@ Object.freeze({
35594
35919
  addonId: null,
35595
35920
  access: "view"
35596
35921
  },
35597
- "pipelineAnalytics.getGroup": {
35922
+ "pipelineAnalytics.getKeyEvents": {
35598
35923
  capName: "pipeline-analytics",
35599
35924
  capScope: "device",
35600
35925
  addonId: null,
35601
35926
  access: "view"
35602
35927
  },
35603
- "pipelineAnalytics.getKeyEvents": {
35928
+ "pipelineAnalytics.getKeyEventsBatch": {
35929
+ capName: "pipeline-analytics",
35930
+ capScope: "device",
35931
+ addonId: null,
35932
+ access: "view"
35933
+ },
35934
+ "pipelineAnalytics.getMediaReclaimStatus": {
35604
35935
  capName: "pipeline-analytics",
35605
35936
  capScope: "device",
35606
35937
  addonId: null,
@@ -35690,12 +36021,6 @@ Object.freeze({
35690
36021
  addonId: null,
35691
36022
  access: "view"
35692
36023
  },
35693
- "pipelineAnalytics.listGroups": {
35694
- capName: "pipeline-analytics",
35695
- capScope: "device",
35696
- addonId: null,
35697
- access: "view"
35698
- },
35699
36024
  "pipelineAnalytics.listOpsLog": {
35700
36025
  capName: "pipeline-analytics",
35701
36026
  capScope: "device",
@@ -35780,6 +36105,12 @@ Object.freeze({
35780
36105
  addonId: null,
35781
36106
  access: "create"
35782
36107
  },
36108
+ "pipelineAnalytics.reclaimDebugMedia": {
36109
+ capName: "pipeline-analytics",
36110
+ capScope: "device",
36111
+ addonId: null,
36112
+ access: "create"
36113
+ },
35783
36114
  "pipelineAnalytics.reconcileFromDisk": {
35784
36115
  capName: "pipeline-analytics",
35785
36116
  capScope: "device",
@@ -36704,6 +37035,12 @@ Object.freeze({
36704
37035
  addonId: null,
36705
37036
  access: "view"
36706
37037
  },
37038
+ "recording.getPlacement": {
37039
+ capName: "recording",
37040
+ capScope: "system",
37041
+ addonId: null,
37042
+ access: "view"
37043
+ },
36707
37044
  "recording.getPlaybackManifest": {
36708
37045
  capName: "recording",
36709
37046
  capScope: "system",
@@ -36782,6 +37119,12 @@ Object.freeze({
36782
37119
  addonId: null,
36783
37120
  access: "view"
36784
37121
  },
37122
+ "recording.reconcileLedgerAgainstDisk": {
37123
+ capName: "recording",
37124
+ capScope: "system",
37125
+ addonId: null,
37126
+ access: "create"
37127
+ },
36785
37128
  "recording.refreshStorageLocationsForMigration": {
36786
37129
  capName: "recording",
36787
37130
  capScope: "system",
@@ -36824,6 +37167,12 @@ Object.freeze({
36824
37167
  addonId: null,
36825
37168
  access: "create"
36826
37169
  },
37170
+ "recording.setDevicePlacement": {
37171
+ capName: "recording",
37172
+ capScope: "system",
37173
+ addonId: null,
37174
+ access: "create"
37175
+ },
36827
37176
  "recording.startStorageMigrationMove": {
36828
37177
  capName: "recording",
36829
37178
  capScope: "system",
@@ -36908,6 +37257,12 @@ Object.freeze({
36908
37257
  addonId: null,
36909
37258
  access: "view"
36910
37259
  },
37260
+ "sceneMonitor.listScenesBatch": {
37261
+ capName: "scene-monitor",
37262
+ capScope: "device",
37263
+ addonId: null,
37264
+ access: "view"
37265
+ },
36911
37266
  "sceneMonitor.recheckNow": {
36912
37267
  capName: "scene-monitor",
36913
37268
  capScope: "device",
@@ -37262,12 +37617,36 @@ Object.freeze({
37262
37617
  addonId: null,
37263
37618
  access: "create"
37264
37619
  },
37620
+ "storageMigration.cleanupCancel": {
37621
+ capName: "storage-migration",
37622
+ capScope: "system",
37623
+ addonId: null,
37624
+ access: "create"
37625
+ },
37626
+ "storageMigration.cleanupStart": {
37627
+ capName: "storage-migration",
37628
+ capScope: "system",
37629
+ addonId: null,
37630
+ access: "create"
37631
+ },
37632
+ "storageMigration.cleanupStatus": {
37633
+ capName: "storage-migration",
37634
+ capScope: "system",
37635
+ addonId: null,
37636
+ access: "view"
37637
+ },
37265
37638
  "storageMigration.drain": {
37266
37639
  capName: "storage-migration",
37267
37640
  capScope: "system",
37268
37641
  addonId: null,
37269
37642
  access: "create"
37270
37643
  },
37644
+ "storageMigration.history": {
37645
+ capName: "storage-migration",
37646
+ capScope: "system",
37647
+ addonId: null,
37648
+ access: "view"
37649
+ },
37271
37650
  "storageMigration.movers": {
37272
37651
  capName: "storage-migration",
37273
37652
  capScope: "system",
@@ -38264,6 +38643,12 @@ Object.freeze({
38264
38643
  addonId: null,
38265
38644
  access: "view"
38266
38645
  },
38646
+ "zoneAnalytics.getCurrentSnapshotBatch": {
38647
+ capName: "zone-analytics",
38648
+ capScope: "device",
38649
+ addonId: null,
38650
+ access: "view"
38651
+ },
38267
38652
  "zoneAnalytics.getUnzonedHistory": {
38268
38653
  capName: "zone-analytics",
38269
38654
  capScope: "device",
@@ -39258,14 +39643,14 @@ Object.freeze({
39258
39643
  form: "single",
39259
39644
  optional: true
39260
39645
  }],
39261
- "pipelineAnalytics.getGroup": [{
39646
+ "pipelineAnalytics.getKeyEvents": [{
39262
39647
  name: "deviceId",
39263
39648
  form: "single",
39264
39649
  optional: false
39265
39650
  }],
39266
- "pipelineAnalytics.getKeyEvents": [{
39267
- name: "deviceId",
39268
- form: "single",
39651
+ "pipelineAnalytics.getKeyEventsBatch": [{
39652
+ name: "deviceIds",
39653
+ form: "array",
39269
39654
  optional: false
39270
39655
  }],
39271
39656
  "pipelineAnalytics.getMotionEvents": [{
@@ -39323,11 +39708,6 @@ Object.freeze({
39323
39708
  form: "single",
39324
39709
  optional: false
39325
39710
  }],
39326
- "pipelineAnalytics.listGroups": [{
39327
- name: "deviceIds",
39328
- form: "array",
39329
- optional: false
39330
- }],
39331
39711
  "pipelineAnalytics.listOpsLog": [{
39332
39712
  name: "deviceId",
39333
39713
  form: "single",
@@ -39373,6 +39753,11 @@ Object.freeze({
39373
39753
  form: "single",
39374
39754
  optional: true
39375
39755
  }],
39756
+ "pipelineAnalytics.reclaimDebugMedia": [{
39757
+ name: "deviceIds",
39758
+ form: "array",
39759
+ optional: true
39760
+ }],
39376
39761
  "pipelineAnalytics.reconcileFromDisk": [{
39377
39762
  name: "deviceId",
39378
39763
  form: "single",
@@ -39708,6 +40093,11 @@ Object.freeze({
39708
40093
  form: "single",
39709
40094
  optional: false
39710
40095
  }],
40096
+ "recording.reconcileLedgerAgainstDisk": [{
40097
+ name: "deviceId",
40098
+ form: "single",
40099
+ optional: true
40100
+ }],
39711
40101
  "recording.relocateFootage": [{
39712
40102
  name: "deviceId",
39713
40103
  form: "single",
@@ -39733,6 +40123,11 @@ Object.freeze({
39733
40123
  form: "single",
39734
40124
  optional: false
39735
40125
  }],
40126
+ "recording.setDevicePlacement": [{
40127
+ name: "deviceId",
40128
+ form: "single",
40129
+ optional: false
40130
+ }],
39736
40131
  "recording.startStorageMigrationMove": [{
39737
40132
  name: "deviceId",
39738
40133
  form: "single",
@@ -39773,6 +40168,11 @@ Object.freeze({
39773
40168
  form: "single",
39774
40169
  optional: false
39775
40170
  }],
40171
+ "sceneMonitor.listScenesBatch": [{
40172
+ name: "deviceIds",
40173
+ form: "array",
40174
+ optional: false
40175
+ }],
39776
40176
  "sceneMonitor.recheckNow": [{
39777
40177
  name: "deviceId",
39778
40178
  form: "single",
@@ -40034,6 +40434,11 @@ Object.freeze({
40034
40434
  form: "single",
40035
40435
  optional: false
40036
40436
  }],
40437
+ "zoneAnalytics.getCurrentSnapshotBatch": [{
40438
+ name: "deviceIds",
40439
+ form: "array",
40440
+ optional: false
40441
+ }],
40037
40442
  "zoneAnalytics.getUnzonedHistory": [{
40038
40443
  name: "deviceId",
40039
40444
  form: "single",