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