@camstack/addon-remote-storage 1.2.41 → 1.2.44

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.
@@ -8047,18 +8047,61 @@ var RelocateFootageInputSchema = object({
8047
8047
  * `RecordingConfig.enabled` or camera wrapper bindings. */
8048
8048
  var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
8049
8049
  var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
8050
+ /**
8051
+ * What a `relocateMedia` pass DOES. One engine, three passes — never a second
8052
+ * mover (the engine already walks both collections with a timestamp cursor and
8053
+ * already has a stamp-without-copy path).
8054
+ *
8055
+ * - `move` — the default and the historical behaviour: event-media and
8056
+ * retrain blobs move to `toLocationId` and their rows are
8057
+ * stamped. The enrolled gallery is skipped (D197).
8058
+ * - `seal` — ROWS ONLY, no bytes. Every row whose `locationId` is NULL is
8059
+ * stamped with `toLocationId`. `toLocationId` here is the id the
8060
+ * bytes ALREADY sit on — today's `eventMedia` default — because
8061
+ * a NULL row means "wherever `eventMedia` points *now*", and the
8062
+ * instant a repoint moves that pointer the row reads from the
8063
+ * new disk while its bytes are on the old one.
8064
+ * - `gallery` — the inverse selection of `move`: ONLY the retention-exempt
8065
+ * (enrolled-gallery) rows, which `move` deliberately skips.
8066
+ * `galleryMedia` is `cardinality: 'single'`, so this pass can
8067
+ * never run beside a live second location: it is stop-the-world
8068
+ * by construction, which is acceptable only because the gallery
8069
+ * is a few KB per enrolled sample.
8070
+ */
8071
+ var MediaRelocateModeSchema = _enum([
8072
+ "move",
8073
+ "seal",
8074
+ "gallery"
8075
+ ]);
8050
8076
  var RelocateMediaInputSchema = object({
8051
8077
  toLocationId: string(),
8052
- throttleMbps: number().min(1).max(1e3).optional()
8078
+ throttleMbps: number().min(1).max(1e3).optional(),
8079
+ /** Omitted = `move`, the pre-existing behaviour. */
8080
+ mode: MediaRelocateModeSchema.optional()
8081
+ });
8082
+ /** How many rows still carry NO `locationId` — the population a repoint would
8083
+ * silently re-aim at a disk that does not hold their bytes. Zero is the only
8084
+ * value that permits a non-blocking `eventMedia` cutover. */
8085
+ var UnstampedEventMediaCountSchema = object({
8086
+ media: number().int().nonnegative(),
8087
+ retrainFrames: number().int().nonnegative(),
8088
+ total: number().int().nonnegative()
8053
8089
  });
8054
8090
  var StorageMigrationMediaMoveInputSchema = RelocateMediaInputSchema.extend({ leaseId: string().min(1) });
8055
- /** The independently selectable logical storage classes. `recordings`
8056
- * encompasses the high and mid segment profiles; `recordingsLow` is low
8057
- * segments; `eventMedia` is post-analysis blobs. */
8091
+ /** The independently selectable logical storage classes — every class
8092
+ * `storage.listLocationDeclarations` reports, so an operator never meets a
8093
+ * Zod enum error where they should meet an explanation.
8094
+ *
8095
+ * `recordings` encompasses the high and mid segment profiles; `recordingsLow`
8096
+ * is low segments; `eventMedia` is post-analysis blobs; `galleryMedia` is the
8097
+ * enrolled gallery; `backups` is the system backup archive. The last two have
8098
+ * their own rules — see {@link StorageMigrationFindingCodeSchema}. */
8058
8099
  var StorageMigrationClassSchema = _enum([
8059
8100
  "recordings",
8060
8101
  "recordingsLow",
8061
- "eventMedia"
8102
+ "eventMedia",
8103
+ "backups",
8104
+ "galleryMedia"
8062
8105
  ]);
8063
8106
  /** A destination is always an existing, fully-qualified location id. The
8064
8107
  * migration API intentionally never changes a source location's `basePath`:
@@ -8066,20 +8109,56 @@ var StorageMigrationClassSchema = _enum([
8066
8109
  var StorageMigrationDestinationsSchema = object({
8067
8110
  recordings: string().min(1).optional(),
8068
8111
  recordingsLow: string().min(1).optional(),
8069
- eventMedia: string().min(1).optional()
8112
+ eventMedia: string().min(1).optional(),
8113
+ backups: string().min(1).optional(),
8114
+ galleryMedia: string().min(1).optional()
8070
8115
  }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
8116
+ /**
8117
+ * How a migration sequences the cutover against the byte move.
8118
+ *
8119
+ * - `blocking` — the historical order: pause, move every byte, repoint,
8120
+ * resume. Recording is stopped for the whole move. Right
8121
+ * for a small or a cold class, and the only legal mode for
8122
+ * a `cardinality: 'single'` class.
8123
+ * - `nonBlocking` — repoint FIRST, drain behind: seal, pause, repoint,
8124
+ * refresh, resume, then move the past with everything
8125
+ * running. The pause is three bounded instants (a detach +
8126
+ * attach round, a write-gate drain, a lease) instead of one
8127
+ * bounded by bytes. 1.09 TB at 7–14 MB/s is thirty hours of
8128
+ * stopped recording under `blocking`; the same move is
8129
+ * seconds of stopped recording under `nonBlocking`.
8130
+ *
8131
+ * The mode is on the JOB, not only on the input, because `status` is where an
8132
+ * operator finds out which one is running.
8133
+ */
8134
+ var StorageMigrationModeSchema = _enum(["blocking", "nonBlocking"]);
8071
8135
  /** Shared input for planning and starting an orchestrated storage migration. */
8072
8136
  var StorageMigrationInputSchema = object({
8073
8137
  destinations: StorageMigrationDestinationsSchema,
8074
- throttleMbps: number().min(1).max(1e3).optional()
8138
+ throttleMbps: number().min(1).max(1e3).optional(),
8139
+ /** Omitted = `blocking`, which stays the default. */
8140
+ mode: StorageMigrationModeSchema.optional()
8075
8141
  });
8076
- /** The durable coordinator state machine. The only phase that changes default
8077
- * locations is `repointing`, after every selected mover has completed and been
8078
- * verified. */
8142
+ /**
8143
+ * The durable coordinator state machine.
8144
+ *
8145
+ * `blocking`:
8146
+ * planning → pausing → moving → verifying → repointing → refreshing → resuming → done
8147
+ *
8148
+ * `nonBlocking`:
8149
+ * planning → sealing → pausing → repointing → refreshing → resuming → draining → verifying → done
8150
+ *
8151
+ * Same phases, different order plus two new ones — not a second mover.
8152
+ * `sealing` closes the `eventMedia` NULL-row hole BEFORE anything is paused;
8153
+ * `draining` runs the same movers UNLEASED, after every writer is back up.
8154
+ * `repointing` is still the only phase that changes a default location.
8155
+ */
8079
8156
  var StorageMigrationPhaseSchema = _enum([
8080
8157
  "planning",
8158
+ "sealing",
8081
8159
  "pausing",
8082
8160
  "moving",
8161
+ "draining",
8083
8162
  "verifying",
8084
8163
  "repointing",
8085
8164
  "refreshing",
@@ -8093,17 +8172,56 @@ var StorageMigrationParticipantSchema = _enum([
8093
8172
  "recorder",
8094
8173
  "analytics"
8095
8174
  ]);
8175
+ /**
8176
+ * The mover's own numbers, folded onto the coordinator's durable move record.
8177
+ *
8178
+ * The long half of a non-blocking migration is `draining`, and it is measured
8179
+ * in hours: 136 885 files at ~4 MB/s is about five of them. Before this shape
8180
+ * existed the only place those numbers appeared was a Loki line, so an operator
8181
+ * watching the Admin UI saw `phase: draining` and nothing else for a whole
8182
+ * afternoon.
8183
+ *
8184
+ * It is POLLED, never pushed. Events are telemetry and may be dropped
8185
+ * (D8/D11), and a dropped progress event is indistinguishable from a stalled
8186
+ * mover — which is the exact failure this is meant to end. The coordinator's
8187
+ * `waitForMoves` already fetches the whole {@link RelocateJob} on every tick to
8188
+ * read `state`; folding the counters costs no extra read and makes the durable
8189
+ * record say afterwards how far a move actually got.
8190
+ *
8191
+ * `filesTotal` is `null` for "no honest denominator" and is never zero-filled:
8192
+ * a windowed footage job (`sinceMs`) and a node with no ledger both genuinely
8193
+ * cannot say M, and a 0 there would render as "100 % done".
8194
+ */
8195
+ var StorageMigrationMoveProgressSchema = object({
8196
+ filesMoved: number().int().nonnegative(),
8197
+ /** The archive census — the **M** of "N of M" (D295). `null` = unknowable. */
8198
+ filesTotal: number().int().nonnegative().nullable(),
8199
+ bytesMoved: number().int().nonnegative(),
8200
+ /** The MOVER's start, not the migration's: a drain restarted after an addon
8201
+ * crash gets a new mover, and a rate computed from the migration's start
8202
+ * would silently average in the time nothing was running. */
8203
+ startedAt: number(),
8204
+ /** When the coordinator last read these numbers. Paired with `startedAt` it
8205
+ * is the only honest rate: both clocks are the hub's, so a UI never has to
8206
+ * subtract its own. */
8207
+ observedAt: number()
8208
+ });
8096
8209
  var StorageMigrationMoveSchema = object({
8097
8210
  storageClass: StorageMigrationClassSchema,
8098
8211
  fromLocationId: string(),
8099
8212
  toLocationId: string(),
8100
8213
  moverJobId: string().nullable(),
8101
8214
  state: RelocateJobStateSchema.nullable(),
8102
- error: string().nullable()
8215
+ error: string().nullable(),
8216
+ /** Last observed mover counters; `null` until the mover has been polled once. */
8217
+ progress: StorageMigrationMoveProgressSchema.nullable()
8103
8218
  });
8104
8219
  var StorageMigrationJobSchema = object({
8105
8220
  jobId: string(),
8106
8221
  phase: StorageMigrationPhaseSchema,
8222
+ /** Which order this job is running. `status` is the only place an operator
8223
+ * can tell a seconds-long cutover from a thirty-hour one. */
8224
+ mode: StorageMigrationModeSchema,
8107
8225
  destinations: StorageMigrationDestinationsSchema,
8108
8226
  throttleMbps: number(),
8109
8227
  moves: array(StorageMigrationMoveSchema),
@@ -8116,13 +8234,122 @@ var StorageMigrationJobSchema = object({
8116
8234
  finishedAt: number().nullable(),
8117
8235
  error: string().nullable()
8118
8236
  });
8237
+ var StorageMigrationFindingSchema = object({
8238
+ code: _enum([
8239
+ "sharesDeviceWithSource",
8240
+ "deviceIdentityUnknown",
8241
+ "unstampedEventMediaRows",
8242
+ "blockingOnly",
8243
+ "noMover"
8244
+ ]),
8245
+ storageClass: StorageMigrationClassSchema,
8246
+ /** Human-readable, already carrying the ids and counts. */
8247
+ message: string()
8248
+ });
8119
8249
  var StorageMigrationPlanSchema = object({
8120
8250
  destinations: StorageMigrationDestinationsSchema,
8251
+ /** The mode this plan was built for. A plan is only valid for its mode: the
8252
+ * `eventMedia` seal gate and the single-cardinality refusal both depend on
8253
+ * it. */
8254
+ mode: StorageMigrationModeSchema,
8121
8255
  moves: array(object({
8122
8256
  storageClass: StorageMigrationClassSchema,
8123
8257
  fromLocationId: string(),
8124
8258
  toLocationId: string()
8125
- }))
8259
+ })),
8260
+ findings: array(StorageMigrationFindingSchema)
8261
+ });
8262
+ /**
8263
+ * A mover as it exists RIGHT NOW, whether or not a migration job owns it.
8264
+ *
8265
+ * The coordinator's job record is the state of record for a migration, and its
8266
+ * moves carry {@link StorageMigrationMoveProgress}. But the movers are usable
8267
+ * standalone — `recording.relocateFootage` and `pipelineAnalytics.relocateMedia`
8268
+ * are both operator-callable, and on 2026-08-29 a five-hour drain was armed that
8269
+ * way because no supported UI path existed. A mover armed like that has no job
8270
+ * to fold progress into, so it has to be readable on its own or it is invisible.
8271
+ *
8272
+ * `migrationJobId` is what tells the two apart: `null` means nothing here
8273
+ * orchestrated it.
8274
+ */
8275
+ var StorageMigrationMoverSchema = object({
8276
+ lane: _enum(["footage", "media"]),
8277
+ job: RelocateJobSchema,
8278
+ /** The coordinator job that armed this mover, or `null` for a mover armed
8279
+ * directly against the owning addon. */
8280
+ migrationJobId: string().nullable(),
8281
+ /** When the hub read these counters. Stamped here so a rate is `bytesMoved`
8282
+ * over (`observedAt` − `job.startedAt`) with BOTH ends on the hub's clock —
8283
+ * a browser subtracting its own `Date.now()` from a server `startedAt` is a
8284
+ * rate made of two different clocks. */
8285
+ observedAt: number()
8286
+ });
8287
+ /**
8288
+ * What a SOURCE still holds for one storage class — the number that makes a
8289
+ * "drain remaining" action honest rather than hopeful.
8290
+ *
8291
+ * It comes from the archive (`SegmentHourLedger.census` for footage, the media
8292
+ * engine's own selection count for media), never from the resident index: a
8293
+ * drain sized off `RecordingIndex` is what reported `done` over 80.3 GB it had
8294
+ * never been told about (D295).
8295
+ *
8296
+ * `items`/`bytes` are `null` for "the archive could not be asked", which is
8297
+ * deliberately NOT zero: a drain is still offered for an unknown residue,
8298
+ * because refusing on an unanswerable read would hide exactly the case an
8299
+ * operator needs to act on.
8300
+ */
8301
+ var StorageMigrationResidueSchema = object({
8302
+ storageClass: StorageMigrationClassSchema,
8303
+ /** The location still holding the data. `'*'` for the media lane, whose rows
8304
+ * move from wherever they are rather than from one named source. */
8305
+ fromLocationId: string(),
8306
+ /** Where a drain would move it — the class's CURRENT default. */
8307
+ toLocationId: string(),
8308
+ /** Segments (footage lane) or rows (media lane) still on the source. */
8309
+ items: number().int().nonnegative().nullable(),
8310
+ /** Bytes on the source; `null` when the lane counts rows rather than bytes. */
8311
+ bytes: number().int().nonnegative().nullable()
8312
+ });
8313
+ /**
8314
+ * Run the DRAIN half and nothing else.
8315
+ *
8316
+ * A migration that reached `done` has already repointed, so `start` correctly
8317
+ * refuses its destination ("already the default") — there is nothing left to
8318
+ * repoint. But the drain can fail, be cancelled, be interrupted by a restart,
8319
+ * or finish against a work list that was a tenth of the archive (D295), and
8320
+ * before this there was no supported way to run only that half: the only way
8321
+ * through was calling `recording.relocateFootage` by hand over admin tRPC.
8322
+ *
8323
+ * `drain` NEVER calls `setDefaultLocations`. That is what keeps `start`'s
8324
+ * refusal meaningful: the two verbs are disjoint, so nothing here can silently
8325
+ * re-repoint a class that is already migrated.
8326
+ */
8327
+ var StorageMigrationDrainInputSchema = object({
8328
+ /** The classes to drain. Each must appear in `storageMigration.residue`, so
8329
+ * a class whose source is already empty is refused rather than started. */
8330
+ classes: array(StorageMigrationClassSchema).min(1),
8331
+ throttleMbps: number().min(1).max(1e3).optional()
8332
+ });
8333
+ /** What a footage source still holds, asked of the durable hour ledger. */
8334
+ var RelocateResidueInputSchema = object({
8335
+ fromLocationId: string().min(1),
8336
+ /** Narrow to one logical class; omit for every profile on the location. */
8337
+ footageClass: RelocateFootageClassSchema.optional()
8338
+ });
8339
+ /** `null` = the archive could not answer (no ledger on this node, or the
8340
+ * aggregate failed). Never conflated with an empty source. */
8341
+ var RelocateResidueSchema = object({
8342
+ segments: number().int().nonnegative(),
8343
+ bytes: number().int().nonnegative()
8344
+ }).nullable();
8345
+ /** How many rows a media pass would still act on against a given target — the
8346
+ * media lane's denominator AND its residue, from ONE derivation so the two can
8347
+ * never disagree. `null` = the count could not be taken. */
8348
+ var RelocatableMediaCountSchema = object({ rows: number().int().nonnegative() }).nullable();
8349
+ var RelocatableMediaCountInputSchema = object({
8350
+ toLocationId: string().min(1),
8351
+ /** Omitted = `move`. */
8352
+ mode: MediaRelocateModeSchema.optional()
8126
8353
  });
8127
8354
  /**
8128
8355
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -8228,6 +8455,32 @@ var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(
8228
8455
  * two addons declaring the same `id` must agree on `cardinality` (validated
8229
8456
  * at kernel aggregation time, not here).
8230
8457
  */
8458
+ /**
8459
+ * `StorageAccess` — how the service that DECLARED a storage-location kind
8460
+ * actually reaches the bytes. It is the constraint that decides which
8461
+ * `storage-provider`s may back a location of that kind.
8462
+ *
8463
+ * - `'local-path'` — the service asks `storage.resolve` for a path string and
8464
+ * then does its own `node:fs` I/O on it (the recorder's segment writer, the
8465
+ * post-analysis media roots). Only a provider that serves a genuine local
8466
+ * filesystem (`getProviderInfo().nodeLocal === true`) can satisfy that: a
8467
+ * remote provider's `resolve` returns a path on the REMOTE host, and
8468
+ * `fs.readdir` of it on this node either fails or — far worse — succeeds
8469
+ * against a same-named local directory that is something else entirely.
8470
+ *
8471
+ * - `'cap-mediated'` — every byte travels through the `storage` cap
8472
+ * (`read`/`write`, or `beginUpload`/`writeChunk`/`finalizeUpload`). The
8473
+ * service never sees a path, so any provider can back it. `backups` is the
8474
+ * one kind that qualifies today.
8475
+ *
8476
+ * Before this existed, `recordings` was unreachable by SFTP/S3/WebDAV only as
8477
+ * an EMERGENT property of how the recorder happened to be written. Nothing
8478
+ * refused the configuration; the first write simply went somewhere wrong, and
8479
+ * a recording write that goes wrong surfaces as a silent black window rather
8480
+ * than an error (the read path does not `stat`). This turns that accident into
8481
+ * a declared, enforced, testable refusal.
8482
+ */
8483
+ var StorageAccessSchema = _enum(["local-path", "cap-mediated"]);
8231
8484
  var StorageLocationDeclarationSchema = object({
8232
8485
  /**
8233
8486
  * Global location identifier, e.g. `recordings` or `recordingsLow`.
@@ -8247,6 +8500,19 @@ var StorageLocationDeclarationSchema = object({
8247
8500
  */
8248
8501
  cardinality: _enum(["single", "multi"]),
8249
8502
  /**
8503
+ * HOW the declaring service reaches the bytes — and therefore WHICH
8504
+ * providers may back a location of this kind. See {@link StorageAccessSchema}
8505
+ * and {@link STORAGE_ACCESS_FALLBACK}.
8506
+ *
8507
+ * Absent means `'local-path'`. That default is FAIL-CLOSED on purpose: it
8508
+ * can only over-restrict (refuse a remote provider for a kind that might
8509
+ * have coped) and never under-restrict. Declaring `'cap-mediated'` is the
8510
+ * permissive direction and is therefore never inferred — a repo guard
8511
+ * (`scripts/check-storage-access-declarations.ts`) refuses to let it be
8512
+ * reached by omission.
8513
+ */
8514
+ access: StorageAccessSchema.optional(),
8515
+ /**
8250
8516
  * When set, the default instance for this location inherits its resolved
8251
8517
  * root from the named location's default instance. Useful for derivative
8252
8518
  * slots (e.g. `recordingsLow` → `recordings`) so operators only need to
@@ -17772,8 +18038,10 @@ var TrackSchema = object({
17772
18038
  lastSeen: number(),
17773
18039
  /** Frame-rate position history (subject to maxPositionHistory cap). */
17774
18040
  positions: array(TrackPositionSchema).readonly(),
17775
- /** Periodic snapshots at snapshotIntervalMs cadence (subject to
17776
- * saveThumbnails policy). */
18041
+ /** Periodic snapshots at snapshotIntervalMs cadence DEBUG media, produced
18042
+ * only while `MediaSettings.debugMediaEnabled` is on for the camera (D299;
18043
+ * the retired `saveThumbnails` used to gate this and the rolling
18044
+ * `lastFrame` together). Empty is the healthy default, not a capture gap. */
17777
18045
  snapshots: array(TrackSnapshotSchema).readonly(),
17778
18046
  /** Deduplicated zones the track has entered at least once. Zone IDS. */
17779
18047
  zonesVisited: array(string()).readonly(),
@@ -18633,6 +18901,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
18633
18901
  }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
18634
18902
  kind: "mutation",
18635
18903
  auth: "admin"
18904
+ }), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(RelocatableMediaCountInputSchema, RelocatableMediaCountSchema, {
18905
+ kind: "query",
18906
+ auth: "admin"
18636
18907
  }), method(object({}), array(RelocateJobSchema).readonly(), {
18637
18908
  kind: "query",
18638
18909
  auth: "admin"
@@ -20540,7 +20811,10 @@ method(object({
20540
20811
  }), StorageLocationSchema, {
20541
20812
  kind: "mutation",
20542
20813
  auth: "admin"
20543
- }), method(object({ id: string() }), _void(), {
20814
+ }), method(object({
20815
+ id: string(),
20816
+ force: boolean().optional()
20817
+ }), _void(), {
20544
20818
  kind: "mutation",
20545
20819
  auth: "admin"
20546
20820
  }), method(object({ id: string() }), object({
@@ -20589,6 +20863,9 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
20589
20863
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
20590
20864
  kind: "mutation",
20591
20865
  auth: "admin"
20866
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
20867
+ kind: "mutation",
20868
+ auth: "admin"
20592
20869
  });
20593
20870
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
20594
20871
  providerId: string().min(1),
@@ -21047,12 +21324,38 @@ response: record(string(), unknown()) }), object({
21047
21324
  *
21048
21325
  * ## Why this is a capability and not a helper
21049
21326
  *
21050
- * Six stores in `addon-post-analysis` already hold vectors object CLIP, face,
21051
- * plate, vehicle, identity, and the event store's derivativesand every one of
21052
- * them keeps its vectors in a `JSON` settings-store column and ranks them by
21053
- * brute-force cosine in JS. Measured on the live hub that costs ~11.7 KB per row
21054
- * (512 floats as TEXT, `JSON.parse`d on every search) and made semantic search
21055
- * load 5,000 rows before ranking anything.
21327
+ * This capability was introduced with the claim that SIX stores in
21328
+ * `addon-post-analysis` held vectors in a `JSON` settings-store columnobject
21329
+ * CLIP, face, plate, vehicle, identity, and the event store's derivatives. That
21330
+ * claim was never true, and leaving it here made five stores look like pending
21331
+ * work when three of them have no vector at all. Counted column by column on
21332
+ * 2026-08-30, exactly THREE ever held one:
21333
+ *
21334
+ * - `object-clip` — 512-dim CLIP image embedding, migrated 2026-08-06.
21335
+ * - `faces.embedding` — 512-dim ArcFace face embedding, migrated 2026-08-30.
21336
+ * - `identity-samples.embedding` — the same ArcFace vector for an ENROLLED
21337
+ * face, migrated 2026-08-30 into its OWN index (see below).
21338
+ *
21339
+ * `plates` and `vehicle-samples` store a plate STRING and a score; `vehicles`
21340
+ * and `identities` store a name; the event store stores no derivative vector.
21341
+ * They are not migration candidates and never were.
21342
+ *
21343
+ * Measured on the live hub the JSON encoding cost ~11.7 KB per row (512 floats
21344
+ * as TEXT, `JSON.parse`d on every search) and made semantic search load 5,000
21345
+ * rows before ranking anything.
21346
+ *
21347
+ * ## One index per COMPARISON, never per encoder
21348
+ *
21349
+ * `faces` and `identity-samples` hold the same 512 ArcFace dims from the same
21350
+ * model, and they still get two indexes. An index is a set of things that are
21351
+ * ranked against each other and that live and die together, and these two are
21352
+ * neither: a `faces` row is TRACK-OWNED and cascades away with its track under
21353
+ * a per-camera capacity cap, an `identity-samples` row is retention-EXEMPT
21354
+ * forever and is the gallery every recognition ranks against. One index would
21355
+ * mean every gallery load and every reconcile carried a filter whose failure
21356
+ * mode is either ranking a candidate against itself or reclaiming an enrolled
21357
+ * person's only sample. The dimension they share is not a reason to share an
21358
+ * index; the question they answer is, and it differs.
21056
21359
  *
21057
21360
  * The fix is not a faster loop, it is a different backend — and the backend
21058
21361
  * should be replaceable without touching six callers. So: a singleton
@@ -21157,7 +21460,20 @@ var VectorQueryResultSchema = object({
21157
21460
  */
21158
21461
  scanned: number(),
21159
21462
  /** True when the backend could not consider every row that passed the filter. */
21160
- truncated: boolean()
21463
+ truncated: boolean(),
21464
+ /**
21465
+ * The `topK` the backend actually ran with.
21466
+ *
21467
+ * Every backend has a ceiling — sqlite-vec's is 4,096 — and a caller asking
21468
+ * past it used to learn nothing but a boolean, from a WARN in the provider's
21469
+ * own log rather than in its answer. That is how an audit asking for 20,000
21470
+ * consumed 4,096 and reported `examined: 4096` as if it had walked the index,
21471
+ * for weeks. `truncated` says THAT the answer was short; this says BY HOW
21472
+ * MUCH, in the return value, where the caller cannot fail to see it.
21473
+ *
21474
+ * Equals the requested `topK` whenever nothing was lowered.
21475
+ */
21476
+ effectiveTopK: number().int().positive()
21161
21477
  });
21162
21478
  var VectorDeleteInputSchema = object({
21163
21479
  index: string(),
@@ -21186,6 +21502,68 @@ var VectorGetResultSchema = object({ items: array(object({
21186
21502
  id: string(),
21187
21503
  metadata: VectorMetadataSchema
21188
21504
  })) });
21505
+ /**
21506
+ * Ids to read back WITH their vectors.
21507
+ *
21508
+ * The sibling of {@link VectorGetResultSchema}, and deliberately a separate
21509
+ * method rather than a flag on it: `getByIds` promises no vectors and its one
21510
+ * caller depends on that promise. This one promises the opposite.
21511
+ *
21512
+ * It exists because a store cannot put its vectors here otherwise. An ArcFace
21513
+ * gallery is ranked IN PROCESS, per detection, against every enrolled sample —
21514
+ * a per-face cross-process KNN would be a network round trip inside the
21515
+ * recognition loop. So the gallery is loaded once and held in RAM, and loading
21516
+ * it requires the index to hand the floats back. Without this method the only
21517
+ * way to keep a readable vector is a JSON column, which is the thing this
21518
+ * capability exists to delete.
21519
+ *
21520
+ * BOUNDED BY THE CALLER: ids are named, never "everything". Enumerating an
21521
+ * index is {@link VectorScanInputSchema}'s job, and it returns no vectors.
21522
+ */
21523
+ var VectorFetchInputSchema = object({
21524
+ index: string(),
21525
+ ids: array(string())
21526
+ });
21527
+ var VectorFetchResultSchema = object({ items: array(object({
21528
+ id: string(),
21529
+ /** base64 Float32LE — the same wire form `upsert` accepts. */
21530
+ vector: string(),
21531
+ metadata: VectorMetadataSchema
21532
+ })) });
21533
+ /**
21534
+ * ENUMERATE an index: one page of rows in a stable order, no ranking.
21535
+ *
21536
+ * A reconcile does not want the nearest rows, it wants ALL of them, and asking
21537
+ * a KNN for "all" is the wrong question twice over. It hits the backend's `k`
21538
+ * ceiling — 4,096 on sqlite-vec against a 22,128-row index — and it needs a
21539
+ * probe vector it does not have, so the audit passed a ZERO vector whose cosine
21540
+ * distance to every row is degenerate. `examined: 4096` then read as "we
21541
+ * looked" for as long as anyone cared to read it.
21542
+ *
21543
+ * This is the primitive that question actually needs: a bounded page, ordered
21544
+ * by the backend's own row order, costing no distance computation at all.
21545
+ * Vectors are NOT returned — an enumeration that shipped 2 KB per row would be
21546
+ * the full-table read this capability was built to stop.
21547
+ */
21548
+ var VectorScanInputSchema = object({
21549
+ index: string(),
21550
+ /** Opaque resume point. `0` starts at the top; pass back `nextCursor`. */
21551
+ cursor: number().int().nonnegative().default(0),
21552
+ limit: number().int().positive()
21553
+ });
21554
+ var VectorScanResultSchema = object({
21555
+ items: array(object({
21556
+ id: string(),
21557
+ metadata: VectorMetadataSchema
21558
+ })),
21559
+ /**
21560
+ * Where the next page starts, or `null` when the walk reached the end.
21561
+ *
21562
+ * `null` is the ONLY end-of-index signal. A caller must not infer the end
21563
+ * from a short page: a backend is free to return fewer rows than asked.
21564
+ */
21565
+ nextCursor: number().int().nonnegative().nullable()
21566
+ });
21189
21567
  var VectorStatsInputSchema = object({ index: string() });
21190
21568
  var VectorStatsResultSchema = object({
21191
21569
  /** Provider id, so an operator can tell brute force from an ANN index. */
@@ -21204,7 +21582,7 @@ method(VectorDeclareIndexInputSchema, _void(), {
21204
21582
  }), method(VectorUpsertInputSchema, VectorUpsertResultSchema, {
21205
21583
  kind: "mutation",
21206
21584
  auth: "admin"
21207
- }), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
21585
+ }), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorFetchInputSchema, VectorFetchResultSchema, { auth: "admin" }), method(VectorScanInputSchema, VectorScanResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
21208
21586
  kind: "mutation",
21209
21587
  auth: "admin"
21210
21588
  }), method(VectorDeleteByFilterInputSchema, VectorDeleteResultSchema, {
@@ -26108,6 +26486,9 @@ method(object({
26108
26486
  }), method(object({}), array(RelocateJobSchema).readonly(), {
26109
26487
  kind: "query",
26110
26488
  auth: "admin"
26489
+ }), method(RelocateResidueInputSchema, RelocateResidueSchema, {
26490
+ kind: "query",
26491
+ auth: "admin"
26111
26492
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
26112
26493
  kind: "mutation",
26113
26494
  auth: "admin"
@@ -31073,6 +31454,18 @@ Object.freeze({
31073
31454
  addonId: null,
31074
31455
  access: "create"
31075
31456
  },
31457
+ "pipelineAnalytics.countRelocatableMedia": {
31458
+ capName: "pipeline-analytics",
31459
+ capScope: "device",
31460
+ addonId: null,
31461
+ access: "view"
31462
+ },
31463
+ "pipelineAnalytics.countUnstampedEventMedia": {
31464
+ capName: "pipeline-analytics",
31465
+ capScope: "device",
31466
+ addonId: null,
31467
+ access: "view"
31468
+ },
31076
31469
  "pipelineAnalytics.deleteDeviceEvents": {
31077
31470
  capName: "pipeline-analytics",
31078
31471
  capScope: "device",
@@ -32231,6 +32624,12 @@ Object.freeze({
32231
32624
  addonId: null,
32232
32625
  access: "view"
32233
32626
  },
32627
+ "recording.getRelocateResidue": {
32628
+ capName: "recording",
32629
+ capScope: "system",
32630
+ addonId: null,
32631
+ access: "view"
32632
+ },
32234
32633
  "recording.getStorageMigrationMoveStatus": {
32235
32634
  capName: "recording",
32236
32635
  capScope: "system",
@@ -32777,12 +33176,30 @@ Object.freeze({
32777
33176
  addonId: null,
32778
33177
  access: "create"
32779
33178
  },
33179
+ "storageMigration.drain": {
33180
+ capName: "storage-migration",
33181
+ capScope: "system",
33182
+ addonId: null,
33183
+ access: "create"
33184
+ },
33185
+ "storageMigration.movers": {
33186
+ capName: "storage-migration",
33187
+ capScope: "system",
33188
+ addonId: null,
33189
+ access: "view"
33190
+ },
32780
33191
  "storageMigration.plan": {
32781
33192
  capName: "storage-migration",
32782
33193
  capScope: "system",
32783
33194
  addonId: null,
32784
33195
  access: "view"
32785
33196
  },
33197
+ "storageMigration.residue": {
33198
+ capName: "storage-migration",
33199
+ capScope: "system",
33200
+ addonId: null,
33201
+ access: "view"
33202
+ },
32786
33203
  "storageMigration.start": {
32787
33204
  capName: "storage-migration",
32788
33205
  capScope: "system",
@@ -33617,6 +34034,12 @@ Object.freeze({
33617
34034
  addonId: null,
33618
34035
  access: "delete"
33619
34036
  },
34037
+ "vectorStore.fetchByIds": {
34038
+ capName: "vector-store",
34039
+ capScope: "system",
34040
+ addonId: null,
34041
+ access: "view"
34042
+ },
33620
34043
  "vectorStore.getByIds": {
33621
34044
  capName: "vector-store",
33622
34045
  capScope: "system",
@@ -33629,6 +34052,12 @@ Object.freeze({
33629
34052
  addonId: null,
33630
34053
  access: "view"
33631
34054
  },
34055
+ "vectorStore.scan": {
34056
+ capName: "vector-store",
34057
+ capScope: "system",
34058
+ addonId: null,
34059
+ access: "view"
34060
+ },
33632
34061
  "vectorStore.stats": {
33633
34062
  capName: "vector-store",
33634
34063
  capScope: "system",