@camstack/addon-osd-manager 0.1.35 → 0.1.38

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 (18) hide show
  1. package/dist/{MotionZonesSettings-Bwxd22Nd.mjs → MotionZonesSettings-emdN0UNh.mjs} +2 -2
  2. package/dist/{PrivacyMaskSettings-C00zKECj.mjs → PrivacyMaskSettings-CrGo7BYZ.mjs} +4 -4
  3. package/dist/{SceneMonitorEditor-D-gSxqns.mjs → SceneMonitorEditor-_K9y826_.mjs} +3 -3
  4. package/dist/_stub.js +10 -10
  5. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-DKUqcAE-.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-C1HPQGS9.mjs} +4 -4
  6. package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DuDBHu79.mjs +26 -0
  7. package/dist/{hostInit-C1D1fsep.mjs → hostInit-D49Ppk5T.mjs} +3 -3
  8. package/dist/index.js +529 -22
  9. package/dist/index.mjs +529 -22
  10. package/dist/{player-overlays-hG-OsP21.mjs → player-overlays-DURd3AGI.mjs} +1 -1
  11. package/dist/remoteEntry.js +1 -1
  12. package/dist/{responsive-pP5vcFcr.mjs → responsive-DIYWmiTV.mjs} +1 -1
  13. package/dist/{square-CZEgeXdp.mjs → square-pJqxPNpb.mjs} +1 -1
  14. package/dist/{trash-2-w-Zu4e4Q.mjs → trash-2-DgzntFMe.mjs} +1 -1
  15. package/dist/{use-device-snapshot-BQ24djI3.mjs → use-device-snapshot-C-TbesfB.mjs} +1 -1
  16. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-D6jvK2Zd.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-ku4Amehr.mjs} +1 -1
  17. package/package.json +1 -1
  18. package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DR42bVST.mjs +0 -26
package/dist/index.mjs CHANGED
@@ -8134,18 +8134,61 @@ var RelocateFootageInputSchema = object({
8134
8134
  * `RecordingConfig.enabled` or camera wrapper bindings. */
8135
8135
  var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
8136
8136
  var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
8137
+ /**
8138
+ * What a `relocateMedia` pass DOES. One engine, three passes — never a second
8139
+ * mover (the engine already walks both collections with a timestamp cursor and
8140
+ * already has a stamp-without-copy path).
8141
+ *
8142
+ * - `move` — the default and the historical behaviour: event-media and
8143
+ * retrain blobs move to `toLocationId` and their rows are
8144
+ * stamped. The enrolled gallery is skipped (D197).
8145
+ * - `seal` — ROWS ONLY, no bytes. Every row whose `locationId` is NULL is
8146
+ * stamped with `toLocationId`. `toLocationId` here is the id the
8147
+ * bytes ALREADY sit on — today's `eventMedia` default — because
8148
+ * a NULL row means "wherever `eventMedia` points *now*", and the
8149
+ * instant a repoint moves that pointer the row reads from the
8150
+ * new disk while its bytes are on the old one.
8151
+ * - `gallery` — the inverse selection of `move`: ONLY the retention-exempt
8152
+ * (enrolled-gallery) rows, which `move` deliberately skips.
8153
+ * `galleryMedia` is `cardinality: 'single'`, so this pass can
8154
+ * never run beside a live second location: it is stop-the-world
8155
+ * by construction, which is acceptable only because the gallery
8156
+ * is a few KB per enrolled sample.
8157
+ */
8158
+ var MediaRelocateModeSchema = _enum([
8159
+ "move",
8160
+ "seal",
8161
+ "gallery"
8162
+ ]);
8137
8163
  var RelocateMediaInputSchema = object({
8138
8164
  toLocationId: string(),
8139
- throttleMbps: number().min(1).max(1e3).optional()
8165
+ throttleMbps: number().min(1).max(1e3).optional(),
8166
+ /** Omitted = `move`, the pre-existing behaviour. */
8167
+ mode: MediaRelocateModeSchema.optional()
8168
+ });
8169
+ /** How many rows still carry NO `locationId` — the population a repoint would
8170
+ * silently re-aim at a disk that does not hold their bytes. Zero is the only
8171
+ * value that permits a non-blocking `eventMedia` cutover. */
8172
+ var UnstampedEventMediaCountSchema = object({
8173
+ media: number().int().nonnegative(),
8174
+ retrainFrames: number().int().nonnegative(),
8175
+ total: number().int().nonnegative()
8140
8176
  });
8141
8177
  var StorageMigrationMediaMoveInputSchema = RelocateMediaInputSchema.extend({ leaseId: string().min(1) });
8142
- /** The independently selectable logical storage classes. `recordings`
8143
- * encompasses the high and mid segment profiles; `recordingsLow` is low
8144
- * segments; `eventMedia` is post-analysis blobs. */
8178
+ /** The independently selectable logical storage classes — every class
8179
+ * `storage.listLocationDeclarations` reports, so an operator never meets a
8180
+ * Zod enum error where they should meet an explanation.
8181
+ *
8182
+ * `recordings` encompasses the high and mid segment profiles; `recordingsLow`
8183
+ * is low segments; `eventMedia` is post-analysis blobs; `galleryMedia` is the
8184
+ * enrolled gallery; `backups` is the system backup archive. The last two have
8185
+ * their own rules — see {@link StorageMigrationFindingCodeSchema}. */
8145
8186
  var StorageMigrationClassSchema = _enum([
8146
8187
  "recordings",
8147
8188
  "recordingsLow",
8148
- "eventMedia"
8189
+ "eventMedia",
8190
+ "backups",
8191
+ "galleryMedia"
8149
8192
  ]);
8150
8193
  /** A destination is always an existing, fully-qualified location id. The
8151
8194
  * migration API intentionally never changes a source location's `basePath`:
@@ -8153,20 +8196,56 @@ var StorageMigrationClassSchema = _enum([
8153
8196
  var StorageMigrationDestinationsSchema = object({
8154
8197
  recordings: string().min(1).optional(),
8155
8198
  recordingsLow: string().min(1).optional(),
8156
- eventMedia: string().min(1).optional()
8199
+ eventMedia: string().min(1).optional(),
8200
+ backups: string().min(1).optional(),
8201
+ galleryMedia: string().min(1).optional()
8157
8202
  }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
8203
+ /**
8204
+ * How a migration sequences the cutover against the byte move.
8205
+ *
8206
+ * - `blocking` — the historical order: pause, move every byte, repoint,
8207
+ * resume. Recording is stopped for the whole move. Right
8208
+ * for a small or a cold class, and the only legal mode for
8209
+ * a `cardinality: 'single'` class.
8210
+ * - `nonBlocking` — repoint FIRST, drain behind: seal, pause, repoint,
8211
+ * refresh, resume, then move the past with everything
8212
+ * running. The pause is three bounded instants (a detach +
8213
+ * attach round, a write-gate drain, a lease) instead of one
8214
+ * bounded by bytes. 1.09 TB at 7–14 MB/s is thirty hours of
8215
+ * stopped recording under `blocking`; the same move is
8216
+ * seconds of stopped recording under `nonBlocking`.
8217
+ *
8218
+ * The mode is on the JOB, not only on the input, because `status` is where an
8219
+ * operator finds out which one is running.
8220
+ */
8221
+ var StorageMigrationModeSchema = _enum(["blocking", "nonBlocking"]);
8158
8222
  /** Shared input for planning and starting an orchestrated storage migration. */
8159
8223
  var StorageMigrationInputSchema = object({
8160
8224
  destinations: StorageMigrationDestinationsSchema,
8161
- throttleMbps: number().min(1).max(1e3).optional()
8225
+ throttleMbps: number().min(1).max(1e3).optional(),
8226
+ /** Omitted = `blocking`, which stays the default. */
8227
+ mode: StorageMigrationModeSchema.optional()
8162
8228
  });
8163
- /** The durable coordinator state machine. The only phase that changes default
8164
- * locations is `repointing`, after every selected mover has completed and been
8165
- * verified. */
8229
+ /**
8230
+ * The durable coordinator state machine.
8231
+ *
8232
+ * `blocking`:
8233
+ * planning → pausing → moving → verifying → repointing → refreshing → resuming → done
8234
+ *
8235
+ * `nonBlocking`:
8236
+ * planning → sealing → pausing → repointing → refreshing → resuming → draining → verifying → done
8237
+ *
8238
+ * Same phases, different order plus two new ones — not a second mover.
8239
+ * `sealing` closes the `eventMedia` NULL-row hole BEFORE anything is paused;
8240
+ * `draining` runs the same movers UNLEASED, after every writer is back up.
8241
+ * `repointing` is still the only phase that changes a default location.
8242
+ */
8166
8243
  var StorageMigrationPhaseSchema = _enum([
8167
8244
  "planning",
8245
+ "sealing",
8168
8246
  "pausing",
8169
8247
  "moving",
8248
+ "draining",
8170
8249
  "verifying",
8171
8250
  "repointing",
8172
8251
  "refreshing",
@@ -8180,17 +8259,56 @@ var StorageMigrationParticipantSchema = _enum([
8180
8259
  "recorder",
8181
8260
  "analytics"
8182
8261
  ]);
8262
+ /**
8263
+ * The mover's own numbers, folded onto the coordinator's durable move record.
8264
+ *
8265
+ * The long half of a non-blocking migration is `draining`, and it is measured
8266
+ * in hours: 136 885 files at ~4 MB/s is about five of them. Before this shape
8267
+ * existed the only place those numbers appeared was a Loki line, so an operator
8268
+ * watching the Admin UI saw `phase: draining` and nothing else for a whole
8269
+ * afternoon.
8270
+ *
8271
+ * It is POLLED, never pushed. Events are telemetry and may be dropped
8272
+ * (D8/D11), and a dropped progress event is indistinguishable from a stalled
8273
+ * mover — which is the exact failure this is meant to end. The coordinator's
8274
+ * `waitForMoves` already fetches the whole {@link RelocateJob} on every tick to
8275
+ * read `state`; folding the counters costs no extra read and makes the durable
8276
+ * record say afterwards how far a move actually got.
8277
+ *
8278
+ * `filesTotal` is `null` for "no honest denominator" and is never zero-filled:
8279
+ * a windowed footage job (`sinceMs`) and a node with no ledger both genuinely
8280
+ * cannot say M, and a 0 there would render as "100 % done".
8281
+ */
8282
+ var StorageMigrationMoveProgressSchema = object({
8283
+ filesMoved: number().int().nonnegative(),
8284
+ /** The archive census — the **M** of "N of M" (D295). `null` = unknowable. */
8285
+ filesTotal: number().int().nonnegative().nullable(),
8286
+ bytesMoved: number().int().nonnegative(),
8287
+ /** The MOVER's start, not the migration's: a drain restarted after an addon
8288
+ * crash gets a new mover, and a rate computed from the migration's start
8289
+ * would silently average in the time nothing was running. */
8290
+ startedAt: number(),
8291
+ /** When the coordinator last read these numbers. Paired with `startedAt` it
8292
+ * is the only honest rate: both clocks are the hub's, so a UI never has to
8293
+ * subtract its own. */
8294
+ observedAt: number()
8295
+ });
8183
8296
  var StorageMigrationMoveSchema = object({
8184
8297
  storageClass: StorageMigrationClassSchema,
8185
8298
  fromLocationId: string(),
8186
8299
  toLocationId: string(),
8187
8300
  moverJobId: string().nullable(),
8188
8301
  state: RelocateJobStateSchema.nullable(),
8189
- error: string().nullable()
8302
+ error: string().nullable(),
8303
+ /** Last observed mover counters; `null` until the mover has been polled once. */
8304
+ progress: StorageMigrationMoveProgressSchema.nullable()
8190
8305
  });
8191
8306
  var StorageMigrationJobSchema = object({
8192
8307
  jobId: string(),
8193
8308
  phase: StorageMigrationPhaseSchema,
8309
+ /** Which order this job is running. `status` is the only place an operator
8310
+ * can tell a seconds-long cutover from a thirty-hour one. */
8311
+ mode: StorageMigrationModeSchema,
8194
8312
  destinations: StorageMigrationDestinationsSchema,
8195
8313
  throttleMbps: number(),
8196
8314
  moves: array(StorageMigrationMoveSchema),
@@ -8203,13 +8321,122 @@ var StorageMigrationJobSchema = object({
8203
8321
  finishedAt: number().nullable(),
8204
8322
  error: string().nullable()
8205
8323
  });
8324
+ var StorageMigrationFindingSchema = object({
8325
+ code: _enum([
8326
+ "sharesDeviceWithSource",
8327
+ "deviceIdentityUnknown",
8328
+ "unstampedEventMediaRows",
8329
+ "blockingOnly",
8330
+ "noMover"
8331
+ ]),
8332
+ storageClass: StorageMigrationClassSchema,
8333
+ /** Human-readable, already carrying the ids and counts. */
8334
+ message: string()
8335
+ });
8206
8336
  var StorageMigrationPlanSchema = object({
8207
8337
  destinations: StorageMigrationDestinationsSchema,
8338
+ /** The mode this plan was built for. A plan is only valid for its mode: the
8339
+ * `eventMedia` seal gate and the single-cardinality refusal both depend on
8340
+ * it. */
8341
+ mode: StorageMigrationModeSchema,
8208
8342
  moves: array(object({
8209
8343
  storageClass: StorageMigrationClassSchema,
8210
8344
  fromLocationId: string(),
8211
8345
  toLocationId: string()
8212
- }))
8346
+ })),
8347
+ findings: array(StorageMigrationFindingSchema)
8348
+ });
8349
+ /**
8350
+ * A mover as it exists RIGHT NOW, whether or not a migration job owns it.
8351
+ *
8352
+ * The coordinator's job record is the state of record for a migration, and its
8353
+ * moves carry {@link StorageMigrationMoveProgress}. But the movers are usable
8354
+ * standalone — `recording.relocateFootage` and `pipelineAnalytics.relocateMedia`
8355
+ * are both operator-callable, and on 2026-08-29 a five-hour drain was armed that
8356
+ * way because no supported UI path existed. A mover armed like that has no job
8357
+ * to fold progress into, so it has to be readable on its own or it is invisible.
8358
+ *
8359
+ * `migrationJobId` is what tells the two apart: `null` means nothing here
8360
+ * orchestrated it.
8361
+ */
8362
+ var StorageMigrationMoverSchema = object({
8363
+ lane: _enum(["footage", "media"]),
8364
+ job: RelocateJobSchema,
8365
+ /** The coordinator job that armed this mover, or `null` for a mover armed
8366
+ * directly against the owning addon. */
8367
+ migrationJobId: string().nullable(),
8368
+ /** When the hub read these counters. Stamped here so a rate is `bytesMoved`
8369
+ * over (`observedAt` − `job.startedAt`) with BOTH ends on the hub's clock —
8370
+ * a browser subtracting its own `Date.now()` from a server `startedAt` is a
8371
+ * rate made of two different clocks. */
8372
+ observedAt: number()
8373
+ });
8374
+ /**
8375
+ * What a SOURCE still holds for one storage class — the number that makes a
8376
+ * "drain remaining" action honest rather than hopeful.
8377
+ *
8378
+ * It comes from the archive (`SegmentHourLedger.census` for footage, the media
8379
+ * engine's own selection count for media), never from the resident index: a
8380
+ * drain sized off `RecordingIndex` is what reported `done` over 80.3 GB it had
8381
+ * never been told about (D295).
8382
+ *
8383
+ * `items`/`bytes` are `null` for "the archive could not be asked", which is
8384
+ * deliberately NOT zero: a drain is still offered for an unknown residue,
8385
+ * because refusing on an unanswerable read would hide exactly the case an
8386
+ * operator needs to act on.
8387
+ */
8388
+ var StorageMigrationResidueSchema = object({
8389
+ storageClass: StorageMigrationClassSchema,
8390
+ /** The location still holding the data. `'*'` for the media lane, whose rows
8391
+ * move from wherever they are rather than from one named source. */
8392
+ fromLocationId: string(),
8393
+ /** Where a drain would move it — the class's CURRENT default. */
8394
+ toLocationId: string(),
8395
+ /** Segments (footage lane) or rows (media lane) still on the source. */
8396
+ items: number().int().nonnegative().nullable(),
8397
+ /** Bytes on the source; `null` when the lane counts rows rather than bytes. */
8398
+ bytes: number().int().nonnegative().nullable()
8399
+ });
8400
+ /**
8401
+ * Run the DRAIN half and nothing else.
8402
+ *
8403
+ * A migration that reached `done` has already repointed, so `start` correctly
8404
+ * refuses its destination ("already the default") — there is nothing left to
8405
+ * repoint. But the drain can fail, be cancelled, be interrupted by a restart,
8406
+ * or finish against a work list that was a tenth of the archive (D295), and
8407
+ * before this there was no supported way to run only that half: the only way
8408
+ * through was calling `recording.relocateFootage` by hand over admin tRPC.
8409
+ *
8410
+ * `drain` NEVER calls `setDefaultLocations`. That is what keeps `start`'s
8411
+ * refusal meaningful: the two verbs are disjoint, so nothing here can silently
8412
+ * re-repoint a class that is already migrated.
8413
+ */
8414
+ var StorageMigrationDrainInputSchema = object({
8415
+ /** The classes to drain. Each must appear in `storageMigration.residue`, so
8416
+ * a class whose source is already empty is refused rather than started. */
8417
+ classes: array(StorageMigrationClassSchema).min(1),
8418
+ throttleMbps: number().min(1).max(1e3).optional()
8419
+ });
8420
+ /** What a footage source still holds, asked of the durable hour ledger. */
8421
+ var RelocateResidueInputSchema = object({
8422
+ fromLocationId: string().min(1),
8423
+ /** Narrow to one logical class; omit for every profile on the location. */
8424
+ footageClass: RelocateFootageClassSchema.optional()
8425
+ });
8426
+ /** `null` = the archive could not answer (no ledger on this node, or the
8427
+ * aggregate failed). Never conflated with an empty source. */
8428
+ var RelocateResidueSchema = object({
8429
+ segments: number().int().nonnegative(),
8430
+ bytes: number().int().nonnegative()
8431
+ }).nullable();
8432
+ /** How many rows a media pass would still act on against a given target — the
8433
+ * media lane's denominator AND its residue, from ONE derivation so the two can
8434
+ * never disagree. `null` = the count could not be taken. */
8435
+ var RelocatableMediaCountSchema = object({ rows: number().int().nonnegative() }).nullable();
8436
+ var RelocatableMediaCountInputSchema = object({
8437
+ toLocationId: string().min(1),
8438
+ /** Omitted = `move`. */
8439
+ mode: MediaRelocateModeSchema.optional()
8213
8440
  });
8214
8441
  /**
8215
8442
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -8315,6 +8542,32 @@ var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(
8315
8542
  * two addons declaring the same `id` must agree on `cardinality` (validated
8316
8543
  * at kernel aggregation time, not here).
8317
8544
  */
8545
+ /**
8546
+ * `StorageAccess` — how the service that DECLARED a storage-location kind
8547
+ * actually reaches the bytes. It is the constraint that decides which
8548
+ * `storage-provider`s may back a location of that kind.
8549
+ *
8550
+ * - `'local-path'` — the service asks `storage.resolve` for a path string and
8551
+ * then does its own `node:fs` I/O on it (the recorder's segment writer, the
8552
+ * post-analysis media roots). Only a provider that serves a genuine local
8553
+ * filesystem (`getProviderInfo().nodeLocal === true`) can satisfy that: a
8554
+ * remote provider's `resolve` returns a path on the REMOTE host, and
8555
+ * `fs.readdir` of it on this node either fails or — far worse — succeeds
8556
+ * against a same-named local directory that is something else entirely.
8557
+ *
8558
+ * - `'cap-mediated'` — every byte travels through the `storage` cap
8559
+ * (`read`/`write`, or `beginUpload`/`writeChunk`/`finalizeUpload`). The
8560
+ * service never sees a path, so any provider can back it. `backups` is the
8561
+ * one kind that qualifies today.
8562
+ *
8563
+ * Before this existed, `recordings` was unreachable by SFTP/S3/WebDAV only as
8564
+ * an EMERGENT property of how the recorder happened to be written. Nothing
8565
+ * refused the configuration; the first write simply went somewhere wrong, and
8566
+ * a recording write that goes wrong surfaces as a silent black window rather
8567
+ * than an error (the read path does not `stat`). This turns that accident into
8568
+ * a declared, enforced, testable refusal.
8569
+ */
8570
+ var StorageAccessSchema = _enum(["local-path", "cap-mediated"]);
8318
8571
  var StorageLocationDeclarationSchema = object({
8319
8572
  /**
8320
8573
  * Global location identifier, e.g. `recordings` or `recordingsLow`.
@@ -8334,6 +8587,19 @@ var StorageLocationDeclarationSchema = object({
8334
8587
  */
8335
8588
  cardinality: _enum(["single", "multi"]),
8336
8589
  /**
8590
+ * HOW the declaring service reaches the bytes — and therefore WHICH
8591
+ * providers may back a location of this kind. See {@link StorageAccessSchema}
8592
+ * and {@link STORAGE_ACCESS_FALLBACK}.
8593
+ *
8594
+ * Absent means `'local-path'`. That default is FAIL-CLOSED on purpose: it
8595
+ * can only over-restrict (refuse a remote provider for a kind that might
8596
+ * have coped) and never under-restrict. Declaring `'cap-mediated'` is the
8597
+ * permissive direction and is therefore never inferred — a repo guard
8598
+ * (`scripts/check-storage-access-declarations.ts`) refuses to let it be
8599
+ * reached by omission.
8600
+ */
8601
+ access: StorageAccessSchema.optional(),
8602
+ /**
8337
8603
  * When set, the default instance for this location inherits its resolved
8338
8604
  * root from the named location's default instance. Useful for derivative
8339
8605
  * slots (e.g. `recordingsLow` → `recordings`) so operators only need to
@@ -20713,8 +20979,10 @@ var TrackSchema = object({
20713
20979
  lastSeen: number(),
20714
20980
  /** Frame-rate position history (subject to maxPositionHistory cap). */
20715
20981
  positions: array(TrackPositionSchema).readonly(),
20716
- /** Periodic snapshots at snapshotIntervalMs cadence (subject to
20717
- * saveThumbnails policy). */
20982
+ /** Periodic snapshots at snapshotIntervalMs cadence DEBUG media, produced
20983
+ * only while `MediaSettings.debugMediaEnabled` is on for the camera (D299;
20984
+ * the retired `saveThumbnails` used to gate this and the rolling
20985
+ * `lastFrame` together). Empty is the healthy default, not a capture gap. */
20718
20986
  snapshots: array(TrackSnapshotSchema).readonly(),
20719
20987
  /** Deduplicated zones the track has entered at least once. Zone IDS. */
20720
20988
  zonesVisited: array(string()).readonly(),
@@ -21786,6 +22054,32 @@ var pipelineAnalyticsCapability = {
21786
22054
  kind: "mutation",
21787
22055
  auth: "admin"
21788
22056
  }),
22057
+ /**
22058
+ * How many media / retrain rows still carry NO `locationId`.
22059
+ *
22060
+ * A NULL row means "wherever `eventMedia` points NOW", so the instant a
22061
+ * repoint moves that pointer every such row reads from the new disk while
22062
+ * its bytes are on the old one — the archive goes dark until a drain
22063
+ * happens to stamp it. This count is what the migration planner's
22064
+ * non-blocking gate reads; `relocateMedia({ mode: 'seal' })` is what drives
22065
+ * it to zero.
22066
+ */
22067
+ countUnstampedEventMedia: method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }),
22068
+ /**
22069
+ * How many rows a pass would STILL act on against `toLocationId`.
22070
+ *
22071
+ * One derivation, two consumers: it is the media lane's denominator (the
22072
+ * **M** the footage lane gets from the ledger census — D295) and it is the
22073
+ * residue behind "drain remaining". Deriving them separately is how "N of M"
22074
+ * ends up comparing two different populations.
22075
+ *
22076
+ * `null` means the count could not be taken; it is never zero-filled,
22077
+ * because a zero here reads as "nothing left to move".
22078
+ */
22079
+ countRelocatableMedia: method(RelocatableMediaCountInputSchema, RelocatableMediaCountSchema, {
22080
+ kind: "query",
22081
+ auth: "admin"
22082
+ }),
21789
22083
  /** Every relocate job this addon knows about, newest first (in RAM: the
21790
22084
  * move is resumable, so a lost list costs nothing but the display). */
21791
22085
  listRelocateMediaJobs: method(object({}), array(RelocateJobSchema).readonly(), {
@@ -24585,7 +24879,24 @@ var storageCapability = {
24585
24879
  kind: "mutation",
24586
24880
  auth: "admin"
24587
24881
  }),
24588
- deleteLocation: method(object({ id: string() }), _void(), {
24882
+ /**
24883
+ * Remove a location record. REFUSES a location that still holds data —
24884
+ * deleting a drained location whose durable rows still name it is how this
24885
+ * hub acquired 2 131 ghost `recordings:high` segments, and playback does
24886
+ * not stat, so the operator sees a silent black window rather than an
24887
+ * error.
24888
+ *
24889
+ * `force` exists because the occupancy check is BEST-EFFORT and refuses on
24890
+ * "unknown" as well as on "occupied" (a read that fails must not authorise
24891
+ * a destruction — D49). A location on a removed disk, on another node, or
24892
+ * behind a remote provider answers "unknown" forever, and a refusal an
24893
+ * operator cannot override is its own failure mode. `force: true` is
24894
+ * logged, loudly, with what the check saw.
24895
+ */
24896
+ deleteLocation: method(object({
24897
+ id: string(),
24898
+ force: boolean().optional()
24899
+ }), _void(), {
24589
24900
  kind: "mutation",
24590
24901
  auth: "admin"
24591
24902
  }),
@@ -24674,6 +24985,35 @@ var storageMigrationCapability = {
24674
24985
  cancel: method(object({ jobId: string() }), object({ cancelled: boolean() }), {
24675
24986
  kind: "mutation",
24676
24987
  auth: "admin"
24988
+ }),
24989
+ /**
24990
+ * Every mover running RIGHT NOW, in both lanes, with its counters.
24991
+ *
24992
+ * `status` covers a migration's own moves — the coordinator folds their
24993
+ * progress onto the durable job record it is already polling. This covers
24994
+ * the other case, and it is not hypothetical: a drain armed straight against
24995
+ * `recording.relocateFootage` (the only path that existed before
24996
+ * {@link drain}) has no job to fold into and would otherwise be invisible.
24997
+ */
24998
+ movers: method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }),
24999
+ /**
25000
+ * What each class's SOURCE still holds, from the archive — never from the
25001
+ * resident index (D295). Only classes with something left (or something
25002
+ * unknown) are listed, so an empty list means there is nothing to drain and
25003
+ * the UI has no honest button to offer.
25004
+ */
25005
+ residue: method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }),
25006
+ /**
25007
+ * Run the drain half alone, on a class whose default has ALREADY moved.
25008
+ *
25009
+ * It never repoints anything, which is what lets `start` keep refusing a
25010
+ * destination that is already the default: the two verbs cannot be confused
25011
+ * for one another, and no operator can re-repoint a migrated class through
25012
+ * this door.
25013
+ */
25014
+ drain: method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
25015
+ kind: "mutation",
25016
+ auth: "admin"
24677
25017
  })
24678
25018
  }
24679
25019
  };
@@ -25236,12 +25576,38 @@ response: record(string(), unknown()) }), object({
25236
25576
  *
25237
25577
  * ## Why this is a capability and not a helper
25238
25578
  *
25239
- * Six stores in `addon-post-analysis` already hold vectors object CLIP, face,
25240
- * plate, vehicle, identity, and the event store's derivativesand every one of
25241
- * them keeps its vectors in a `JSON` settings-store column and ranks them by
25242
- * brute-force cosine in JS. Measured on the live hub that costs ~11.7 KB per row
25243
- * (512 floats as TEXT, `JSON.parse`d on every search) and made semantic search
25244
- * load 5,000 rows before ranking anything.
25579
+ * This capability was introduced with the claim that SIX stores in
25580
+ * `addon-post-analysis` held vectors in a `JSON` settings-store columnobject
25581
+ * CLIP, face, plate, vehicle, identity, and the event store's derivatives. That
25582
+ * claim was never true, and leaving it here made five stores look like pending
25583
+ * work when three of them have no vector at all. Counted column by column on
25584
+ * 2026-08-30, exactly THREE ever held one:
25585
+ *
25586
+ * - `object-clip` — 512-dim CLIP image embedding, migrated 2026-08-06.
25587
+ * - `faces.embedding` — 512-dim ArcFace face embedding, migrated 2026-08-30.
25588
+ * - `identity-samples.embedding` — the same ArcFace vector for an ENROLLED
25589
+ * face, migrated 2026-08-30 into its OWN index (see below).
25590
+ *
25591
+ * `plates` and `vehicle-samples` store a plate STRING and a score; `vehicles`
25592
+ * and `identities` store a name; the event store stores no derivative vector.
25593
+ * They are not migration candidates and never were.
25594
+ *
25595
+ * Measured on the live hub the JSON encoding cost ~11.7 KB per row (512 floats
25596
+ * as TEXT, `JSON.parse`d on every search) and made semantic search load 5,000
25597
+ * rows before ranking anything.
25598
+ *
25599
+ * ## One index per COMPARISON, never per encoder
25600
+ *
25601
+ * `faces` and `identity-samples` hold the same 512 ArcFace dims from the same
25602
+ * model, and they still get two indexes. An index is a set of things that are
25603
+ * ranked against each other and that live and die together, and these two are
25604
+ * neither: a `faces` row is TRACK-OWNED and cascades away with its track under
25605
+ * a per-camera capacity cap, an `identity-samples` row is retention-EXEMPT
25606
+ * forever and is the gallery every recognition ranks against. One index would
25607
+ * mean every gallery load and every reconcile carried a filter whose failure
25608
+ * mode is either ranking a candidate against itself or reclaiming an enrolled
25609
+ * person's only sample. The dimension they share is not a reason to share an
25610
+ * index; the question they answer is, and it differs.
25245
25611
  *
25246
25612
  * The fix is not a faster loop, it is a different backend — and the backend
25247
25613
  * should be replaceable without touching six callers. So: a singleton
@@ -25346,7 +25712,20 @@ var VectorQueryResultSchema = object({
25346
25712
  */
25347
25713
  scanned: number(),
25348
25714
  /** True when the backend could not consider every row that passed the filter. */
25349
- truncated: boolean()
25715
+ truncated: boolean(),
25716
+ /**
25717
+ * The `topK` the backend actually ran with.
25718
+ *
25719
+ * Every backend has a ceiling — sqlite-vec's is 4,096 — and a caller asking
25720
+ * past it used to learn nothing but a boolean, from a WARN in the provider's
25721
+ * own log rather than in its answer. That is how an audit asking for 20,000
25722
+ * consumed 4,096 and reported `examined: 4096` as if it had walked the index,
25723
+ * for weeks. `truncated` says THAT the answer was short; this says BY HOW
25724
+ * MUCH, in the return value, where the caller cannot fail to see it.
25725
+ *
25726
+ * Equals the requested `topK` whenever nothing was lowered.
25727
+ */
25728
+ effectiveTopK: number().int().positive()
25350
25729
  });
25351
25730
  var VectorDeleteInputSchema = object({
25352
25731
  index: string(),
@@ -25375,6 +25754,68 @@ var VectorGetResultSchema = object({ items: array(object({
25375
25754
  id: string(),
25376
25755
  metadata: VectorMetadataSchema
25377
25756
  })) });
25757
+ /**
25758
+ * Ids to read back WITH their vectors.
25759
+ *
25760
+ * The sibling of {@link VectorGetResultSchema}, and deliberately a separate
25761
+ * method rather than a flag on it: `getByIds` promises no vectors and its one
25762
+ * caller depends on that promise. This one promises the opposite.
25763
+ *
25764
+ * It exists because a store cannot put its vectors here otherwise. An ArcFace
25765
+ * gallery is ranked IN PROCESS, per detection, against every enrolled sample —
25766
+ * a per-face cross-process KNN would be a network round trip inside the
25767
+ * recognition loop. So the gallery is loaded once and held in RAM, and loading
25768
+ * it requires the index to hand the floats back. Without this method the only
25769
+ * way to keep a readable vector is a JSON column, which is the thing this
25770
+ * capability exists to delete.
25771
+ *
25772
+ * BOUNDED BY THE CALLER: ids are named, never "everything". Enumerating an
25773
+ * index is {@link VectorScanInputSchema}'s job, and it returns no vectors.
25774
+ */
25775
+ var VectorFetchInputSchema = object({
25776
+ index: string(),
25777
+ ids: array(string())
25778
+ });
25779
+ var VectorFetchResultSchema = object({ items: array(object({
25780
+ id: string(),
25781
+ /** base64 Float32LE — the same wire form `upsert` accepts. */
25782
+ vector: string(),
25783
+ metadata: VectorMetadataSchema
25784
+ })) });
25785
+ /**
25786
+ * ENUMERATE an index: one page of rows in a stable order, no ranking.
25787
+ *
25788
+ * A reconcile does not want the nearest rows, it wants ALL of them, and asking
25789
+ * a KNN for "all" is the wrong question twice over. It hits the backend's `k`
25790
+ * ceiling — 4,096 on sqlite-vec against a 22,128-row index — and it needs a
25791
+ * probe vector it does not have, so the audit passed a ZERO vector whose cosine
25792
+ * distance to every row is degenerate. `examined: 4096` then read as "we
25793
+ * looked" for as long as anyone cared to read it.
25794
+ *
25795
+ * This is the primitive that question actually needs: a bounded page, ordered
25796
+ * by the backend's own row order, costing no distance computation at all.
25797
+ * Vectors are NOT returned — an enumeration that shipped 2 KB per row would be
25798
+ * the full-table read this capability was built to stop.
25799
+ */
25800
+ var VectorScanInputSchema = object({
25801
+ index: string(),
25802
+ /** Opaque resume point. `0` starts at the top; pass back `nextCursor`. */
25803
+ cursor: number().int().nonnegative().default(0),
25804
+ limit: number().int().positive()
25805
+ });
25806
+ var VectorScanResultSchema = object({
25807
+ items: array(object({
25808
+ id: string(),
25809
+ metadata: VectorMetadataSchema
25810
+ })),
25811
+ /**
25812
+ * Where the next page starts, or `null` when the walk reached the end.
25813
+ *
25814
+ * `null` is the ONLY end-of-index signal. A caller must not infer the end
25815
+ * from a short page: a backend is free to return fewer rows than asked.
25816
+ */
25817
+ nextCursor: number().int().nonnegative().nullable()
25818
+ });
25378
25819
  var VectorStatsInputSchema = object({ index: string() });
25379
25820
  var VectorStatsResultSchema = object({
25380
25821
  /** Provider id, so an operator can tell brute force from an ANN index. */
@@ -25413,6 +25854,10 @@ var vectorStoreCapability = {
25413
25854
  query: method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }),
25414
25855
  /** Metadata by id, no vectors — see {@link VectorGetResultSchema}. */
25415
25856
  getByIds: method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }),
25857
+ /** Metadata AND vectors, by named id — see {@link VectorFetchInputSchema}. */
25858
+ fetchByIds: method(VectorFetchInputSchema, VectorFetchResultSchema, { auth: "admin" }),
25859
+ /** One page of the whole index, unranked — see {@link VectorScanInputSchema}. */
25860
+ scan: method(VectorScanInputSchema, VectorScanResultSchema, { auth: "admin" }),
25416
25861
  deleteByIds: method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
25417
25862
  kind: "mutation",
25418
25863
  auth: "admin"
@@ -33001,6 +33446,20 @@ var recordingCapability = {
33001
33446
  kind: "query",
33002
33447
  auth: "admin"
33003
33448
  }),
33449
+ /**
33450
+ * What a location STILL holds, asked of the durable hour ledger.
33451
+ *
33452
+ * The number behind "drain remaining": segments and bytes that would still
33453
+ * have to move off `fromLocationId`. It is a ledger aggregate — the archive
33454
+ * — because the resident index is not the archive (D295), and a drain sized
33455
+ * off the index is exactly what reported `done` over 80.3 GB on 2026-08-29.
33456
+ * `null` means the archive could not be asked (no ledger on this node, or
33457
+ * the aggregate failed) and is never conflated with an empty source.
33458
+ */
33459
+ getRelocateResidue: method(RelocateResidueInputSchema, RelocateResidueSchema, {
33460
+ kind: "query",
33461
+ auth: "admin"
33462
+ }),
33004
33463
  /** Cancel a running or queued relocate job. A queued job never runs. */
33005
33464
  cancelRelocateJob: method(object({ jobId: string() }), object({ cancelled: boolean() }), {
33006
33465
  kind: "mutation",
@@ -39009,6 +39468,18 @@ Object.freeze({
39009
39468
  addonId: null,
39010
39469
  access: "create"
39011
39470
  },
39471
+ "pipelineAnalytics.countRelocatableMedia": {
39472
+ capName: "pipeline-analytics",
39473
+ capScope: "device",
39474
+ addonId: null,
39475
+ access: "view"
39476
+ },
39477
+ "pipelineAnalytics.countUnstampedEventMedia": {
39478
+ capName: "pipeline-analytics",
39479
+ capScope: "device",
39480
+ addonId: null,
39481
+ access: "view"
39482
+ },
39012
39483
  "pipelineAnalytics.deleteDeviceEvents": {
39013
39484
  capName: "pipeline-analytics",
39014
39485
  capScope: "device",
@@ -40167,6 +40638,12 @@ Object.freeze({
40167
40638
  addonId: null,
40168
40639
  access: "view"
40169
40640
  },
40641
+ "recording.getRelocateResidue": {
40642
+ capName: "recording",
40643
+ capScope: "system",
40644
+ addonId: null,
40645
+ access: "view"
40646
+ },
40170
40647
  "recording.getStorageMigrationMoveStatus": {
40171
40648
  capName: "recording",
40172
40649
  capScope: "system",
@@ -40713,12 +41190,30 @@ Object.freeze({
40713
41190
  addonId: null,
40714
41191
  access: "create"
40715
41192
  },
41193
+ "storageMigration.drain": {
41194
+ capName: "storage-migration",
41195
+ capScope: "system",
41196
+ addonId: null,
41197
+ access: "create"
41198
+ },
41199
+ "storageMigration.movers": {
41200
+ capName: "storage-migration",
41201
+ capScope: "system",
41202
+ addonId: null,
41203
+ access: "view"
41204
+ },
40716
41205
  "storageMigration.plan": {
40717
41206
  capName: "storage-migration",
40718
41207
  capScope: "system",
40719
41208
  addonId: null,
40720
41209
  access: "view"
40721
41210
  },
41211
+ "storageMigration.residue": {
41212
+ capName: "storage-migration",
41213
+ capScope: "system",
41214
+ addonId: null,
41215
+ access: "view"
41216
+ },
40722
41217
  "storageMigration.start": {
40723
41218
  capName: "storage-migration",
40724
41219
  capScope: "system",
@@ -41553,6 +42048,12 @@ Object.freeze({
41553
42048
  addonId: null,
41554
42049
  access: "delete"
41555
42050
  },
42051
+ "vectorStore.fetchByIds": {
42052
+ capName: "vector-store",
42053
+ capScope: "system",
42054
+ addonId: null,
42055
+ access: "view"
42056
+ },
41556
42057
  "vectorStore.getByIds": {
41557
42058
  capName: "vector-store",
41558
42059
  capScope: "system",
@@ -41565,6 +42066,12 @@ Object.freeze({
41565
42066
  addonId: null,
41566
42067
  access: "view"
41567
42068
  },
42069
+ "vectorStore.scan": {
42070
+ capName: "vector-store",
42071
+ capScope: "system",
42072
+ addonId: null,
42073
+ access: "view"
42074
+ },
41568
42075
  "vectorStore.stats": {
41569
42076
  capName: "vector-store",
41570
42077
  capScope: "system",