@camstack/addon-provider-gree 0.2.47 → 0.2.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +478 -73
  2. package/dist/addon.mjs +478 -73
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -8021,6 +8021,20 @@ var RelocateJobSchema = object({
8021
8021
  * in its row, not in its name, so `MediaRelocateEngine` never reconciles one.
8022
8022
  */
8023
8023
  rowsReconciled: number().int().nonnegative().optional(),
8024
+ /**
8025
+ * Rows this run FORGOT because the file they name is not on disk.
8026
+ *
8027
+ * The mover derived the path from the row's own fields and `stat`ed it; an
8028
+ * ENOENT there is a per-path confirmation that the segment is gone (D296),
8029
+ * and the durable row is dropped through the same channel eviction uses. It
8030
+ * is reported for the same reason `rowsReconciled` is: this is a durable
8031
+ * mutation nobody asked for, and a migration that quietly erases hour rows is
8032
+ * the same failure as one that quietly skips them (D295).
8033
+ *
8034
+ * The production drain of 2026-08-30 would have reported 11 074 here — the
8035
+ * ledger claimed 5.65 GB of footage that no longer existed.
8036
+ */
8037
+ rowsForgotten: number().int().nonnegative().optional(),
8024
8038
  startedAt: number(),
8025
8039
  finishedAt: number().nullable(),
8026
8040
  error: string().nullable()
@@ -8085,6 +8099,13 @@ var MediaRelocateModeSchema = _enum([
8085
8099
  ]);
8086
8100
  var RelocateMediaInputSchema = object({
8087
8101
  toLocationId: string(),
8102
+ /**
8103
+ * Restrict the pass to rows currently on this location. Omitted / `'*'` =
8104
+ * every row that is not already on `toLocationId` (the historical
8105
+ * behaviour). A named source is what a from→to migration needs: without it
8106
+ * "move events off disk 2" also emptied disk 1.
8107
+ */
8108
+ fromLocationId: string().optional(),
8088
8109
  throttleMbps: number().min(1).max(1e3).optional(),
8089
8110
  /** Omitted = `move`, the pre-existing behaviour. */
8090
8111
  mode: MediaRelocateModeSchema.optional()
@@ -8152,6 +8173,19 @@ var StorageMigrationDestinationsSchema = object({
8152
8173
  galleryMedia: string().min(1).optional()
8153
8174
  }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
8154
8175
  /**
8176
+ * Optional named source per class. Omitted = the class's current default
8177
+ * (the historical behaviour). A named source that is NOT the default is a
8178
+ * drain of that disk: bytes move, the default stays, and the source is
8179
+ * disabled when the move finishes.
8180
+ */
8181
+ var StorageMigrationSourcesSchema = object({
8182
+ recordings: string().min(1).optional(),
8183
+ recordingsLow: string().min(1).optional(),
8184
+ eventMedia: string().min(1).optional(),
8185
+ backups: string().min(1).optional(),
8186
+ galleryMedia: string().min(1).optional()
8187
+ }).optional();
8188
+ /**
8155
8189
  * How a migration sequences the cutover against the byte move.
8156
8190
  *
8157
8191
  * - `blocking` — the historical order: pause, move every byte, repoint,
@@ -8173,6 +8207,8 @@ var StorageMigrationModeSchema = _enum(["blocking", "nonBlocking"]);
8173
8207
  /** Shared input for planning and starting an orchestrated storage migration. */
8174
8208
  var StorageMigrationInputSchema = object({
8175
8209
  destinations: StorageMigrationDestinationsSchema,
8210
+ /** Omitted = each class's current default. */
8211
+ sources: StorageMigrationSourcesSchema,
8176
8212
  throttleMbps: number().min(1).max(1e3).optional(),
8177
8213
  /** Omitted = `blocking`, which stays the default. */
8178
8214
  mode: StorageMigrationModeSchema.optional()
@@ -8252,6 +8288,13 @@ var StorageMigrationMoveSchema = object({
8252
8288
  storageClass: StorageMigrationClassSchema,
8253
8289
  fromLocationId: string(),
8254
8290
  toLocationId: string(),
8291
+ /**
8292
+ * True when `from` was NOT the class default at plan time. The move still
8293
+ * copies bytes, but the default is left alone and the source is disabled
8294
+ * once the copy verifies. Absent on jobs planned before this field existed
8295
+ * — those jobs always repointed, which is `false`.
8296
+ */
8297
+ freezeSource: boolean().optional(),
8255
8298
  moverJobId: string().nullable(),
8256
8299
  state: RelocateJobStateSchema.nullable(),
8257
8300
  error: string().nullable(),
@@ -8265,6 +8308,7 @@ var StorageMigrationJobSchema = object({
8265
8308
  * can tell a seconds-long cutover from a thirty-hour one. */
8266
8309
  mode: StorageMigrationModeSchema,
8267
8310
  destinations: StorageMigrationDestinationsSchema,
8311
+ sources: StorageMigrationSourcesSchema,
8268
8312
  throttleMbps: number(),
8269
8313
  moves: array(StorageMigrationMoveSchema),
8270
8314
  pauseLeaseId: string().nullable(),
@@ -8290,6 +8334,7 @@ var StorageMigrationFindingSchema = object({
8290
8334
  });
8291
8335
  var StorageMigrationPlanSchema = object({
8292
8336
  destinations: StorageMigrationDestinationsSchema,
8337
+ sources: StorageMigrationSourcesSchema,
8293
8338
  /** The mode this plan was built for. A plan is only valid for its mode: the
8294
8339
  * `eventMedia` seal gate and the single-cardinality refusal both depend on
8295
8340
  * it. */
@@ -8297,7 +8342,8 @@ var StorageMigrationPlanSchema = object({
8297
8342
  moves: array(object({
8298
8343
  storageClass: StorageMigrationClassSchema,
8299
8344
  fromLocationId: string(),
8300
- toLocationId: string()
8345
+ toLocationId: string(),
8346
+ freezeSource: boolean().optional()
8301
8347
  })),
8302
8348
  findings: array(StorageMigrationFindingSchema)
8303
8349
  });
@@ -8384,16 +8430,142 @@ var RelocateResidueSchema = object({
8384
8430
  segments: number().int().nonnegative(),
8385
8431
  bytes: number().int().nonnegative()
8386
8432
  }).nullable();
8433
+ /**
8434
+ * Ask one location whether its durable hour rows describe the disk — the walk
8435
+ * (D319).
8436
+ *
8437
+ * `apply` DEFAULTS TO FALSE and that default is the product: the operator's
8438
+ * missing tool is the question, and the dry run is how they sanity-check the
8439
+ * destructive run before authorising it.
8440
+ */
8441
+ var LedgerWalkInputSchema = object({
8442
+ locationId: string().min(1),
8443
+ /** Forget the confirmed-absent rows, rather than only counting them. */
8444
+ apply: boolean().optional(),
8445
+ /** Narrow to one camera. */
8446
+ deviceId: number().int().positive().optional(),
8447
+ /** Narrow to these recording profiles; empty/absent = every profile. */
8448
+ profiles: array(string().min(1)).optional()
8449
+ });
8450
+ /** Why a whole walk did nothing. Every one leaves the ledger untouched. */
8451
+ var LedgerWalkRefusalSchema = _enum([
8452
+ "location-unknown",
8453
+ "source-writable",
8454
+ "no-ledger",
8455
+ "archive-unreadable",
8456
+ "anchor-absent",
8457
+ "anchor-unreadable",
8458
+ "anchor-moved"
8459
+ ]);
8460
+ _enum([
8461
+ "live-tail",
8462
+ "listing-error",
8463
+ "path-mismatch",
8464
+ "durable-refused"
8465
+ ]);
8466
+ /** Every skip reason, always present, always a number — so a reason that never
8467
+ * fired reports as zero rather than absent and the report shape is constant
8468
+ * between passes. Spelled out rather than `z.record` for exactly that. */
8469
+ var LedgerWalkSkipCountsSchema = object({
8470
+ "live-tail": number().int().nonnegative(),
8471
+ "listing-error": number().int().nonnegative(),
8472
+ "path-mismatch": number().int().nonnegative(),
8473
+ "durable-refused": number().int().nonnegative()
8474
+ });
8475
+ /** One camera's share of a walk, so a report names cameras and not rows. */
8476
+ var LedgerWalkDeviceReportSchema = object({
8477
+ deviceId: number().int(),
8478
+ hoursWalked: number().int().nonnegative(),
8479
+ hoursMissing: number().int().nonnegative(),
8480
+ ghostSegments: number().int().nonnegative(),
8481
+ ghostBytes: number().int().nonnegative(),
8482
+ forgottenSegments: number().int().nonnegative(),
8483
+ orphanFiles: number().int().nonnegative()
8484
+ });
8485
+ /**
8486
+ * What one walk claimed, listed, found and (only when armed) forgot.
8487
+ *
8488
+ * `archiveSegments` is the **M** and `segmentsClaimed` the **N** (D295), so a
8489
+ * walk that saw a fraction of the location is visible in its own report rather
8490
+ * than in the absence of one.
8491
+ */
8492
+ var LedgerWalkReportSchema = object({
8493
+ locationId: string(),
8494
+ applied: boolean(),
8495
+ refused: LedgerWalkRefusalSchema.nullable(),
8496
+ archiveSegments: number().int().nonnegative().nullable(),
8497
+ archiveBytes: number().int().nonnegative().nullable(),
8498
+ hoursClaimed: number().int().nonnegative(),
8499
+ hoursWalked: number().int().nonnegative(),
8500
+ hoursMissing: number().int().nonnegative(),
8501
+ /** `readdir` calls issued — the cost, stated in the unit that is paid. */
8502
+ listings: number().int().nonnegative(),
8503
+ segmentsClaimed: number().int().nonnegative(),
8504
+ ghostSegments: number().int().nonnegative(),
8505
+ ghostBytes: number().int().nonnegative(),
8506
+ ghostHoursWhole: number().int().nonnegative(),
8507
+ forgottenSegments: number().int().nonnegative(),
8508
+ forgottenBytes: number().int().nonnegative(),
8509
+ /** Files under a claimed hour that no durable row names. Never deleted. */
8510
+ orphanFiles: number().int().nonnegative(),
8511
+ orphanSample: array(string()).readonly(),
8512
+ hoursSkipped: number().int().nonnegative(),
8513
+ skippedByReason: LedgerWalkSkipCountsSchema,
8514
+ /** The walk stopped at its per-pass hour bound with claims unwalked. */
8515
+ bounded: boolean(),
8516
+ byDevice: array(LedgerWalkDeviceReportSchema).readonly()
8517
+ });
8387
8518
  /** How many rows a media pass would still act on against a given target — the
8388
8519
  * media lane's denominator AND its residue, from ONE derivation so the two can
8389
8520
  * never disagree. `null` = the count could not be taken. */
8390
8521
  var RelocatableMediaCountSchema = object({ rows: number().int().nonnegative() }).nullable();
8391
8522
  var RelocatableMediaCountInputSchema = object({
8392
8523
  toLocationId: string().min(1),
8524
+ /** Restrict the count to one source; omitted / `'*'` = every non-target row. */
8525
+ fromLocationId: string().optional(),
8393
8526
  /** Omitted = `move`. */
8394
8527
  mode: MediaRelocateModeSchema.optional()
8395
8528
  });
8396
8529
  /**
8530
+ * Operator cleanup of leftover analytics rows, optional debug media, and
8531
+ * ghost ledger entries on frozen footage locations.
8532
+ *
8533
+ * A pass is tens of minutes on a standing backlog. The hub method RETURNS
8534
+ * `{ jobId }` immediately; progress is `cleanupStatus`. Awaiting the work
8535
+ * is how `addons.custom` hit the 60 s UDS deadline while reclaim continued
8536
+ * with no operator-visible status.
8537
+ */
8538
+ var StorageCleanupPhaseSchema = _enum([
8539
+ "orphans",
8540
+ "debug-media",
8541
+ "ghost-ledger",
8542
+ "done",
8543
+ "failed",
8544
+ "cancelled"
8545
+ ]);
8546
+ var StorageCleanupInputSchema = object({
8547
+ /** Also walk motion stills / track filmstrips. Off by default. */
8548
+ includeDebugMedia: boolean().optional() });
8549
+ var StorageCleanupJobSchema = object({
8550
+ jobId: string(),
8551
+ phase: StorageCleanupPhaseSchema,
8552
+ includeDebugMedia: boolean(),
8553
+ orphansReclaimed: number().int().nonnegative(),
8554
+ orphanBytesReclaimed: number().int().nonnegative(),
8555
+ debugMediaReclaimed: number().int().nonnegative(),
8556
+ debugMediaBytesReclaimed: number().int().nonnegative(),
8557
+ ghostsForgotten: number().int().nonnegative(),
8558
+ ghostBytesForgotten: number().int().nonnegative(),
8559
+ /** Short operator-facing line: current collection, pass, or location. */
8560
+ detail: string().nullable(),
8561
+ cancelRequested: boolean(),
8562
+ startedAt: number(),
8563
+ updatedAt: number(),
8564
+ finishedAt: number().nullable(),
8565
+ error: string().nullable()
8566
+ });
8567
+ var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8568
+ /**
8397
8569
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8398
8570
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8399
8571
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8421,11 +8593,10 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
8421
8593
  * The default location for a type uses `id === <type>:default` by
8422
8594
  * convention (the bare type ref like `'backups'` resolves to it).
8423
8595
  *
8424
- * `isSystem: true` marks a location as orchestrator-seeded and
8425
- * undeletable. The bootstrap-installed defaults (one per type) carry
8426
- * this flag; operator-added locations don't. Editing the config of
8427
- * a system location is allowed (path migration, provider swap) but
8428
- * deleting it is rejected at the cap level.
8596
+ * `isSystem` is a legacy persisted flag. Seed still creates the initial
8597
+ * `<type>:default` locations; the flag is no longer a lock, a badge, or a
8598
+ * prune selector. New writes leave it false. Deletion is gated on uniqueness
8599
+ * / last-enabled, not on this bit.
8429
8600
  */
8430
8601
  var StorageLocationSchema = object({
8431
8602
  id: string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),
@@ -12951,6 +13122,12 @@ method(object({
12951
13122
  }), _void(), {
12952
13123
  kind: "mutation",
12953
13124
  auth: "admin"
13125
+ }), method(object({
13126
+ from: string(),
13127
+ to: string()
13128
+ }), object({ moved: number() }), {
13129
+ kind: "mutation",
13130
+ auth: "admin"
12954
13131
  }), method(object({
12955
13132
  deviceId: number(),
12956
13133
  disabled: boolean()
@@ -18959,53 +19136,15 @@ var RecentTracksPageSchema = object({
18959
19136
  /** Cursor for the next page, or null when this page is the last. */
18960
19137
  nextCursor: string().nullable()
18961
19138
  });
18962
- var LIST_GROUPS_DEFAULT_LIMIT = 40;
18963
- var LIST_GROUPS_MAX_LIMIT = 100;
18964
- var AnalyticsGroupRecordSchema = object({
18965
- id: string(),
18966
- deviceId: number().int(),
18967
- openedAt: number().int(),
18968
- closedAt: number().int(),
18969
- timestamp: number().int(),
18970
- memberCount: number().int(),
18971
- memberTrackIds: array(string()).readonly(),
18972
- className: string(),
18973
- classes: array(string()).readonly(),
18974
- /** Relative event-media path, or null when the group has no picture yet. */
18975
- mediaUrl: string().nullable(),
18976
- singleton: boolean()
18977
- });
18978
- var AnalyticsGroupMemberSchema = object({
18979
- trackId: string(),
18980
- deviceId: number().int(),
18981
- className: string(),
18982
- firstSeen: number().int(),
18983
- lastSeen: number().int(),
18984
- mediaUrl: string().nullable()
18985
- });
18986
- var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
18987
- var ListGroupsQueryInput = object({
18988
- /** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
18989
- deviceIds: array(number()),
18990
- /** Window lower bound on `closedAt` (inclusive). */
18991
- since: number().optional(),
18992
- /** Window upper bound on `openedAt` (inclusive). */
18993
- until: number().optional(),
18994
- limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
18995
- /** Opaque continuation cursor from a previous page's `nextCursor`. */
18996
- cursor: string().optional()
18997
- });
18998
- var ListGroupsPageSchema = object({
18999
- groups: array(AnalyticsGroupRecordSchema).readonly(),
19000
- nextCursor: string().nullable()
19001
- });
19139
+ var KEY_EVENTS_DEFAULT_LIMIT = 50;
19140
+ var KEY_EVENTS_MAX_LIMIT = 200;
19002
19141
  var KeyEventQueryInput = object({
19003
19142
  deviceId: number(),
19004
19143
  /** Window lower bound (track firstSeen ≥ since). */
19005
19144
  since: number(),
19006
19145
  /** Window upper bound (track firstSeen ≤ until). */
19007
19146
  until: number(),
19008
- limit: number().int().min(1).max(200).default(50),
19147
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
19009
19148
  /** Drop tracks scoring below this importance. */
19010
19149
  minImportance: number().min(0).max(1).optional(),
19011
19150
  /** Restrict to a single class (e.g. 'person'). */
@@ -19027,6 +19166,32 @@ var KeyEventSchema = object({
19027
19166
  ...TrackFlagFields,
19028
19167
  ...TrackRetrainFields
19029
19168
  });
19169
+ /** `getKeyEvents`' window and filters, asked of a SET of cameras at once. */
19170
+ var KeyEventBatchQueryInput = object({
19171
+ deviceIds: array(number()).min(1).max(200),
19172
+ since: number(),
19173
+ until: number(),
19174
+ /** Applied PER CAMERA, exactly as `getKeyEvents.limit` is — never a total
19175
+ * across the set, which would let a busy camera starve a quiet one of its
19176
+ * rows and change what the merged feed contains. */
19177
+ limit: number().int().min(1).max(KEY_EVENTS_MAX_LIMIT).default(KEY_EVENTS_DEFAULT_LIMIT),
19178
+ minImportance: number().min(0).max(1).optional(),
19179
+ classFilter: string().optional()
19180
+ });
19181
+ /**
19182
+ * One camera's key events in a batch answer.
19183
+ *
19184
+ * The row exists for every requested id. `getKeyEvents` degrades to `[]` on
19185
+ * error rather than throwing, so a camera whose store read failed and one with
19186
+ * no events in the window were ALREADY indistinguishable per camera — the
19187
+ * batch does not make that worse, and the row keeps the deviceId the single
19188
+ * method's output never carried (the caller used to stamp it from the fan-out
19189
+ * key, which only worked because there was one query per camera).
19190
+ */
19191
+ var KeyEventsForDeviceSchema = object({
19192
+ deviceId: number(),
19193
+ events: array(KeyEventSchema).readonly()
19194
+ });
19030
19195
  object({
19031
19196
  trackId: string(),
19032
19197
  className: string(),
@@ -19074,9 +19239,7 @@ var TrackCascadeCountsSchema = object({
19074
19239
  /** Unassigned plate reads removed (best-effort; plate leg deferred to plate-intelligence). */
19075
19240
  plates: number().int(),
19076
19241
  /** Per-track CLIP search vectors removed (best-effort). */
19077
- embeddings: number().int(),
19078
- /** Group membership + group rows removed with their last member (best-effort). */
19079
- groups: number().int()
19242
+ embeddings: number().int()
19080
19243
  });
19081
19244
  /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
19082
19245
  var DiskReconcileCountsSchema = object({
@@ -19246,6 +19409,47 @@ var RebuildStatusSchema = object({
19246
19409
  /** Present when the pass ended by throwing. */
19247
19410
  error: string().nullable()
19248
19411
  });
19412
+ /**
19413
+ * Acknowledgement that a debug-media reclaim STARTED.
19414
+ *
19415
+ * The pass is paced at ~2 MB/s over a standing 100 GB — tens of minutes — so
19416
+ * it runs detached and this returns immediately. Awaiting it is how the
19417
+ * `addons.custom` door hit the 60 s UDS deadline while the walk carried on
19418
+ * with no status. Poll {@link pipelineAnalyticsCapability.methods.getMediaReclaimStatus}.
19419
+ */
19420
+ var MediaReclaimStartResultSchema = object({
19421
+ started: boolean(),
19422
+ /** True when a pass was already running; the new request is ignored. */
19423
+ alreadyRunning: boolean()
19424
+ });
19425
+ var MediaReclaimInputSchema = object({
19426
+ mode: _enum(["report", "reclaim"]).default("report"),
19427
+ scopes: array(_enum(["motion-still", "track-filmstrip"])).min(1).optional(),
19428
+ deviceIds: array(number().int()).min(1).optional(),
19429
+ restart: boolean().optional(),
19430
+ pageSize: number().int().min(50).max(5e3).optional(),
19431
+ maxRowsPerDevice: number().int().min(1).max(5e5).optional(),
19432
+ maxReclaimPerDevice: number().int().min(1).max(5e5).optional(),
19433
+ maxBytesPerRun: number().int().min(1).optional(),
19434
+ budgetMinutes: number().int().min(1).max(720).optional(),
19435
+ throttleBytesPerSec: number().int().min(64 * 1024).optional(),
19436
+ graceMinutes: number().int().min(1).max(10080).optional()
19437
+ });
19438
+ var MediaReclaimStatusSchema = object({
19439
+ running: boolean(),
19440
+ mode: _enum(["report", "reclaim"]).nullable(),
19441
+ totalExamined: number(),
19442
+ totalEligible: number(),
19443
+ totalReclaimed: number(),
19444
+ totalBytesReclaimed: number(),
19445
+ totalRefused: number(),
19446
+ /** Device+scope windows finished in this pass. */
19447
+ devicesDone: number(),
19448
+ complete: boolean().nullable(),
19449
+ startedAtMs: number().nullable(),
19450
+ finishedAtMs: number().nullable(),
19451
+ error: string().nullable()
19452
+ });
19249
19453
  var ReplayFrameInputSchema = object({
19250
19454
  timestamp: number(),
19251
19455
  frame: PipelineRunResultBridge
@@ -19284,10 +19488,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19284
19488
  * stationary registry). Default false: the timeline lists passages,
19285
19489
  * not parking records (operator decision, 2026-08-15). */
19286
19490
  includeStationary: boolean().optional()
19287
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(ListGroupsQueryInput, ListGroupsPageSchema), method(object({
19288
- deviceId: number(),
19289
- groupId: string().min(1)
19290
- }), AnalyticsGroupDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
19491
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
19291
19492
  kind: "mutation",
19292
19493
  auth: "admin"
19293
19494
  }), 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({
@@ -19296,7 +19497,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19296
19497
  until: number().optional(),
19297
19498
  kinds: array(string()).optional(),
19298
19499
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
19299
- }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
19500
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
19300
19501
  deviceId: number(),
19301
19502
  since: number(),
19302
19503
  until: number(),
@@ -19387,6 +19588,12 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19387
19588
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
19388
19589
  kind: "query",
19389
19590
  auth: "admin"
19591
+ }), method(MediaReclaimInputSchema, MediaReclaimStartResultSchema, {
19592
+ kind: "mutation",
19593
+ auth: "admin"
19594
+ }), method(object({}), MediaReclaimStatusSchema, {
19595
+ kind: "query",
19596
+ auth: "admin"
19390
19597
  }), method(object({ deviceIds: array(number()).optional() }), TrainingExportSummarySchema, {
19391
19598
  kind: "query",
19392
19599
  auth: "admin"
@@ -21357,7 +21564,13 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
21357
21564
  }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
21358
21565
  kind: "mutation",
21359
21566
  auth: "admin"
21360
- });
21567
+ }), method(StorageCleanupInputSchema, object({ jobId: string() }), {
21568
+ kind: "mutation",
21569
+ auth: "admin"
21570
+ }), method(StorageCleanupStatusInputSchema, StorageCleanupJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
21571
+ kind: "mutation",
21572
+ auth: "admin"
21573
+ }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
21361
21574
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
21362
21575
  providerId: string().min(1),
21363
21576
  displayName: string().min(1),
@@ -28450,6 +28663,33 @@ var RecordingRebalanceInputSchema = object({
28450
28663
  minMoveGb: number().min(0).optional()
28451
28664
  });
28452
28665
  /**
28666
+ * Operator-facing placement of one camera onto a recordings location.
28667
+ *
28668
+ * `pinLocationId` is the operator instruction: a location id, or `null` for
28669
+ * Auto (the planner may move this camera). `locationId` is where high/mid
28670
+ * currently write — the plan, which may disagree with the pin when Auto.
28671
+ */
28672
+ var RecordingDevicePlacementSchema = object({
28673
+ deviceId: number().int(),
28674
+ profile: string(),
28675
+ locationId: string()
28676
+ });
28677
+ var RecordingDevicePinSchema = object({
28678
+ deviceId: number().int(),
28679
+ /** Recordings-class location this camera is pinned to. */
28680
+ locationId: string()
28681
+ });
28682
+ var RecordingPlacementViewSchema = object({
28683
+ assignments: array(RecordingDevicePlacementSchema),
28684
+ pins: array(RecordingDevicePinSchema),
28685
+ defaultLocations: record(string(), string())
28686
+ });
28687
+ var RecordingSetDevicePlacementInputSchema = object({
28688
+ deviceId: number().int(),
28689
+ /** `null` = Auto. Otherwise a `recordings:*` location id. */
28690
+ locationId: string().nullable()
28691
+ });
28692
+ /**
28453
28693
  * Result of locating footage at a wall-clock instant for one device/profile.
28454
28694
  * `segment` carries the covering segment's window; `gap` reports the forward
28455
28695
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -28663,6 +28903,9 @@ method(object({
28663
28903
  }), method(RelocateResidueInputSchema, RelocateResidueSchema, {
28664
28904
  kind: "query",
28665
28905
  auth: "admin"
28906
+ }), method(LedgerWalkInputSchema, LedgerWalkReportSchema, {
28907
+ kind: "mutation",
28908
+ auth: "admin"
28666
28909
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
28667
28910
  kind: "mutation",
28668
28911
  auth: "admin"
@@ -28672,6 +28915,12 @@ method(object({
28672
28915
  }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
28673
28916
  kind: "mutation",
28674
28917
  auth: "admin"
28918
+ }), method(object({}), RecordingPlacementViewSchema, {
28919
+ kind: "query",
28920
+ auth: "admin"
28921
+ }), method(RecordingSetDevicePlacementInputSchema, object({ ok: literal(true) }), {
28922
+ kind: "mutation",
28923
+ auth: "admin"
28675
28924
  });
28676
28925
  /**
28677
28926
  * `recording-export` cap — render a footage time range into a single downloadable
@@ -29054,6 +29303,25 @@ var SceneMonitorStatusSchema = object({
29054
29303
  monitors: array(SceneMonitorSchema),
29055
29304
  lastFetchedAt: number()
29056
29305
  });
29306
+ /**
29307
+ * One camera's row in a `listScenesBatch` answer.
29308
+ *
29309
+ * `status` is NULLABLE and the nullability is the whole point. `scene-monitor`
29310
+ * is a `defaultActive` wrapper, so every camera is asked; a camera whose
29311
+ * provider is absent (pipeline-analytics not deployed, the post-processing node
29312
+ * down) cannot answer, and that is not the same fact as a camera with no scenes
29313
+ * configured. Fanned out per camera the difference was visible — one query
29314
+ * errored while the others resolved — and a batch that returned only the rows
29315
+ * it managed would have destroyed it, silently, by making an unreachable camera
29316
+ * indistinguishable from one that answered `monitors: []`.
29317
+ *
29318
+ * So: EVERY requested deviceId gets a row. `status: null` means "this camera
29319
+ * could not be read"; `status.monitors: []` means "read, and it has none".
29320
+ */
29321
+ var SceneMonitorStatusForDeviceSchema = object({
29322
+ deviceId: number(),
29323
+ status: SceneMonitorStatusSchema.nullable()
29324
+ });
29057
29325
  var sceneMonitorCapability = {
29058
29326
  name: "scene-monitor",
29059
29327
  scope: "device",
@@ -29063,6 +29331,22 @@ var sceneMonitorCapability = {
29063
29331
  deviceTypes: [DeviceType.Camera],
29064
29332
  methods: {
29065
29333
  listScenes: method(object({ deviceId: number() }), SceneMonitorStatusSchema),
29334
+ /**
29335
+ * The same answer, for a SET of cameras, in one round trip.
29336
+ *
29337
+ * `/scenes` renders every camera and re-reads them on a 30s safety-net
29338
+ * poll behind the push slice. Fanned out client-side that was one query
29339
+ * per camera — 29 round trips through the browser, the hub and the
29340
+ * post-analysis runner every 30 seconds to read an in-memory map the
29341
+ * owner had already merged. The work is unchanged (`statusFor` per
29342
+ * device, all in-process at the owner); what collapses is the transport.
29343
+ *
29344
+ * A camera that cannot answer still gets a row, with `status: null` —
29345
+ * see {@link SceneMonitorStatusForDeviceSchema}. Never fewer rows than
29346
+ * ids: a caller that asked for twenty-nine and got twenty-seven cannot
29347
+ * tell which two are missing, or that any are.
29348
+ */
29349
+ listScenesBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(SceneMonitorStatusForDeviceSchema).readonly()),
29066
29350
  createScene: method(object({
29067
29351
  deviceId: number(),
29068
29352
  label: string(),
@@ -30898,6 +31182,27 @@ var CameraOccupancySnapshotSchema = object({
30898
31182
  stationaryObjects: array(StationaryObjectSchema).readonly().optional()
30899
31183
  });
30900
31184
  /**
31185
+ * One camera's row in a `getCurrentSnapshotBatch` answer.
31186
+ *
31187
+ * THREE outcomes, and the single-camera method could only express two of them
31188
+ * because `snapshot: null` was already spoken for:
31189
+ *
31190
+ * - `read: 'read'`, `snapshot` present — the live occupancy reading.
31191
+ * - `read: 'read'`, `snapshot: null` — read, and this camera has no reading
31192
+ * yet: no frame since boot, and no parked-object registry to hydrate from.
31193
+ * - `read: 'unreadable'` — the owner could not answer for this
31194
+ * camera. `snapshot` is null, and it does NOT mean "nothing parked here".
31195
+ *
31196
+ * Collapsing the last two is the failure this field exists to prevent: a
31197
+ * hydration that threw would otherwise render as an empty Stationary section,
31198
+ * which is a definite claim about a camera nobody could read.
31199
+ */
31200
+ var CameraOccupancySnapshotForDeviceSchema = object({
31201
+ deviceId: number(),
31202
+ read: _enum(["read", "unreadable"]),
31203
+ snapshot: CameraOccupancySnapshotSchema.nullable()
31204
+ });
31205
+ /**
30901
31206
  * Time-series resolution. The history methods return one bucket per
30902
31207
  * step over the requested range. Smaller resolutions cost more
30903
31208
  * memory + bandwidth; bound to discrete steps so caller cannot ask
@@ -30954,6 +31259,20 @@ var zoneAnalyticsCapability = {
30954
31259
  * (no inference result emitted since boot or since binding was
30955
31260
  * activated). */
30956
31261
  getCurrentSnapshot: method(object({ deviceId: number() }), CameraOccupancySnapshotSchema.nullable()),
31262
+ /**
31263
+ * The same snapshot, for a SET of cameras, in one round trip.
31264
+ *
31265
+ * The Events page's Stationary section polls this every 15s for every
31266
+ * selected camera. Fanned out client-side that is one query per camera to
31267
+ * read a `Map.get` at the owner — the answer costs nothing, the round trip
31268
+ * costs everything. Batched, N transports become one and the per-device
31269
+ * work is unchanged.
31270
+ *
31271
+ * Every requested deviceId gets a row, tagged `read` — see
31272
+ * {@link CameraOccupancySnapshotForDeviceSchema}. A camera the owner could
31273
+ * not answer for is `'unreadable'`, never an empty reading.
31274
+ */
31275
+ getCurrentSnapshotBatch: method(object({ deviceIds: array(number()).min(1).max(200) }), array(CameraOccupancySnapshotForDeviceSchema).readonly()),
30957
31276
  /** Time-series object count inside one zone. `className` optional —
30958
31277
  * omit to count every class in the zone. */
30959
31278
  getZoneHistory: method(object({
@@ -33671,6 +33990,12 @@ Object.freeze({
33671
33990
  addonId: null,
33672
33991
  access: "delete"
33673
33992
  },
33993
+ "deviceManager.renameLocation": {
33994
+ capName: "device-manager",
33995
+ capScope: "system",
33996
+ addonId: null,
33997
+ access: "create"
33998
+ },
33674
33999
  "deviceManager.runDeviceAction": {
33675
34000
  capName: "device-manager",
33676
34001
  capScope: "system",
@@ -35363,13 +35688,19 @@ Object.freeze({
35363
35688
  addonId: null,
35364
35689
  access: "view"
35365
35690
  },
35366
- "pipelineAnalytics.getGroup": {
35691
+ "pipelineAnalytics.getKeyEvents": {
35367
35692
  capName: "pipeline-analytics",
35368
35693
  capScope: "device",
35369
35694
  addonId: null,
35370
35695
  access: "view"
35371
35696
  },
35372
- "pipelineAnalytics.getKeyEvents": {
35697
+ "pipelineAnalytics.getKeyEventsBatch": {
35698
+ capName: "pipeline-analytics",
35699
+ capScope: "device",
35700
+ addonId: null,
35701
+ access: "view"
35702
+ },
35703
+ "pipelineAnalytics.getMediaReclaimStatus": {
35373
35704
  capName: "pipeline-analytics",
35374
35705
  capScope: "device",
35375
35706
  addonId: null,
@@ -35459,12 +35790,6 @@ Object.freeze({
35459
35790
  addonId: null,
35460
35791
  access: "view"
35461
35792
  },
35462
- "pipelineAnalytics.listGroups": {
35463
- capName: "pipeline-analytics",
35464
- capScope: "device",
35465
- addonId: null,
35466
- access: "view"
35467
- },
35468
35793
  "pipelineAnalytics.listOpsLog": {
35469
35794
  capName: "pipeline-analytics",
35470
35795
  capScope: "device",
@@ -35549,6 +35874,12 @@ Object.freeze({
35549
35874
  addonId: null,
35550
35875
  access: "create"
35551
35876
  },
35877
+ "pipelineAnalytics.reclaimDebugMedia": {
35878
+ capName: "pipeline-analytics",
35879
+ capScope: "device",
35880
+ addonId: null,
35881
+ access: "create"
35882
+ },
35552
35883
  "pipelineAnalytics.reconcileFromDisk": {
35553
35884
  capName: "pipeline-analytics",
35554
35885
  capScope: "device",
@@ -36473,6 +36804,12 @@ Object.freeze({
36473
36804
  addonId: null,
36474
36805
  access: "view"
36475
36806
  },
36807
+ "recording.getPlacement": {
36808
+ capName: "recording",
36809
+ capScope: "system",
36810
+ addonId: null,
36811
+ access: "view"
36812
+ },
36476
36813
  "recording.getPlaybackManifest": {
36477
36814
  capName: "recording",
36478
36815
  capScope: "system",
@@ -36551,6 +36888,12 @@ Object.freeze({
36551
36888
  addonId: null,
36552
36889
  access: "view"
36553
36890
  },
36891
+ "recording.reconcileLedgerAgainstDisk": {
36892
+ capName: "recording",
36893
+ capScope: "system",
36894
+ addonId: null,
36895
+ access: "create"
36896
+ },
36554
36897
  "recording.refreshStorageLocationsForMigration": {
36555
36898
  capName: "recording",
36556
36899
  capScope: "system",
@@ -36593,6 +36936,12 @@ Object.freeze({
36593
36936
  addonId: null,
36594
36937
  access: "create"
36595
36938
  },
36939
+ "recording.setDevicePlacement": {
36940
+ capName: "recording",
36941
+ capScope: "system",
36942
+ addonId: null,
36943
+ access: "create"
36944
+ },
36596
36945
  "recording.startStorageMigrationMove": {
36597
36946
  capName: "recording",
36598
36947
  capScope: "system",
@@ -36677,6 +37026,12 @@ Object.freeze({
36677
37026
  addonId: null,
36678
37027
  access: "view"
36679
37028
  },
37029
+ "sceneMonitor.listScenesBatch": {
37030
+ capName: "scene-monitor",
37031
+ capScope: "device",
37032
+ addonId: null,
37033
+ access: "view"
37034
+ },
36680
37035
  "sceneMonitor.recheckNow": {
36681
37036
  capName: "scene-monitor",
36682
37037
  capScope: "device",
@@ -37031,12 +37386,36 @@ Object.freeze({
37031
37386
  addonId: null,
37032
37387
  access: "create"
37033
37388
  },
37389
+ "storageMigration.cleanupCancel": {
37390
+ capName: "storage-migration",
37391
+ capScope: "system",
37392
+ addonId: null,
37393
+ access: "create"
37394
+ },
37395
+ "storageMigration.cleanupStart": {
37396
+ capName: "storage-migration",
37397
+ capScope: "system",
37398
+ addonId: null,
37399
+ access: "create"
37400
+ },
37401
+ "storageMigration.cleanupStatus": {
37402
+ capName: "storage-migration",
37403
+ capScope: "system",
37404
+ addonId: null,
37405
+ access: "view"
37406
+ },
37034
37407
  "storageMigration.drain": {
37035
37408
  capName: "storage-migration",
37036
37409
  capScope: "system",
37037
37410
  addonId: null,
37038
37411
  access: "create"
37039
37412
  },
37413
+ "storageMigration.history": {
37414
+ capName: "storage-migration",
37415
+ capScope: "system",
37416
+ addonId: null,
37417
+ access: "view"
37418
+ },
37040
37419
  "storageMigration.movers": {
37041
37420
  capName: "storage-migration",
37042
37421
  capScope: "system",
@@ -38033,6 +38412,12 @@ Object.freeze({
38033
38412
  addonId: null,
38034
38413
  access: "view"
38035
38414
  },
38415
+ "zoneAnalytics.getCurrentSnapshotBatch": {
38416
+ capName: "zone-analytics",
38417
+ capScope: "device",
38418
+ addonId: null,
38419
+ access: "view"
38420
+ },
38036
38421
  "zoneAnalytics.getUnzonedHistory": {
38037
38422
  capName: "zone-analytics",
38038
38423
  capScope: "device",
@@ -39027,14 +39412,14 @@ Object.freeze({
39027
39412
  form: "single",
39028
39413
  optional: true
39029
39414
  }],
39030
- "pipelineAnalytics.getGroup": [{
39415
+ "pipelineAnalytics.getKeyEvents": [{
39031
39416
  name: "deviceId",
39032
39417
  form: "single",
39033
39418
  optional: false
39034
39419
  }],
39035
- "pipelineAnalytics.getKeyEvents": [{
39036
- name: "deviceId",
39037
- form: "single",
39420
+ "pipelineAnalytics.getKeyEventsBatch": [{
39421
+ name: "deviceIds",
39422
+ form: "array",
39038
39423
  optional: false
39039
39424
  }],
39040
39425
  "pipelineAnalytics.getMotionEvents": [{
@@ -39092,11 +39477,6 @@ Object.freeze({
39092
39477
  form: "single",
39093
39478
  optional: false
39094
39479
  }],
39095
- "pipelineAnalytics.listGroups": [{
39096
- name: "deviceIds",
39097
- form: "array",
39098
- optional: false
39099
- }],
39100
39480
  "pipelineAnalytics.listOpsLog": [{
39101
39481
  name: "deviceId",
39102
39482
  form: "single",
@@ -39142,6 +39522,11 @@ Object.freeze({
39142
39522
  form: "single",
39143
39523
  optional: true
39144
39524
  }],
39525
+ "pipelineAnalytics.reclaimDebugMedia": [{
39526
+ name: "deviceIds",
39527
+ form: "array",
39528
+ optional: true
39529
+ }],
39145
39530
  "pipelineAnalytics.reconcileFromDisk": [{
39146
39531
  name: "deviceId",
39147
39532
  form: "single",
@@ -39477,6 +39862,11 @@ Object.freeze({
39477
39862
  form: "single",
39478
39863
  optional: false
39479
39864
  }],
39865
+ "recording.reconcileLedgerAgainstDisk": [{
39866
+ name: "deviceId",
39867
+ form: "single",
39868
+ optional: true
39869
+ }],
39480
39870
  "recording.relocateFootage": [{
39481
39871
  name: "deviceId",
39482
39872
  form: "single",
@@ -39502,6 +39892,11 @@ Object.freeze({
39502
39892
  form: "single",
39503
39893
  optional: false
39504
39894
  }],
39895
+ "recording.setDevicePlacement": [{
39896
+ name: "deviceId",
39897
+ form: "single",
39898
+ optional: false
39899
+ }],
39505
39900
  "recording.startStorageMigrationMove": [{
39506
39901
  name: "deviceId",
39507
39902
  form: "single",
@@ -39542,6 +39937,11 @@ Object.freeze({
39542
39937
  form: "single",
39543
39938
  optional: false
39544
39939
  }],
39940
+ "sceneMonitor.listScenesBatch": [{
39941
+ name: "deviceIds",
39942
+ form: "array",
39943
+ optional: false
39944
+ }],
39545
39945
  "sceneMonitor.recheckNow": [{
39546
39946
  name: "deviceId",
39547
39947
  form: "single",
@@ -39803,6 +40203,11 @@ Object.freeze({
39803
40203
  form: "single",
39804
40204
  optional: false
39805
40205
  }],
40206
+ "zoneAnalytics.getCurrentSnapshotBatch": [{
40207
+ name: "deviceIds",
40208
+ form: "array",
40209
+ optional: false
40210
+ }],
39806
40211
  "zoneAnalytics.getUnzonedHistory": [{
39807
40212
  name: "deviceId",
39808
40213
  form: "single",