@camstack/addon-auth 1.2.45 → 1.2.48

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.
@@ -8153,18 +8153,61 @@ var RelocateFootageInputSchema = object({
8153
8153
  * `RecordingConfig.enabled` or camera wrapper bindings. */
8154
8154
  var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
8155
8155
  var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
8156
+ /**
8157
+ * What a `relocateMedia` pass DOES. One engine, three passes — never a second
8158
+ * mover (the engine already walks both collections with a timestamp cursor and
8159
+ * already has a stamp-without-copy path).
8160
+ *
8161
+ * - `move` — the default and the historical behaviour: event-media and
8162
+ * retrain blobs move to `toLocationId` and their rows are
8163
+ * stamped. The enrolled gallery is skipped (D197).
8164
+ * - `seal` — ROWS ONLY, no bytes. Every row whose `locationId` is NULL is
8165
+ * stamped with `toLocationId`. `toLocationId` here is the id the
8166
+ * bytes ALREADY sit on — today's `eventMedia` default — because
8167
+ * a NULL row means "wherever `eventMedia` points *now*", and the
8168
+ * instant a repoint moves that pointer the row reads from the
8169
+ * new disk while its bytes are on the old one.
8170
+ * - `gallery` — the inverse selection of `move`: ONLY the retention-exempt
8171
+ * (enrolled-gallery) rows, which `move` deliberately skips.
8172
+ * `galleryMedia` is `cardinality: 'single'`, so this pass can
8173
+ * never run beside a live second location: it is stop-the-world
8174
+ * by construction, which is acceptable only because the gallery
8175
+ * is a few KB per enrolled sample.
8176
+ */
8177
+ var MediaRelocateModeSchema = _enum([
8178
+ "move",
8179
+ "seal",
8180
+ "gallery"
8181
+ ]);
8156
8182
  var RelocateMediaInputSchema = object({
8157
8183
  toLocationId: string(),
8158
- throttleMbps: number().min(1).max(1e3).optional()
8184
+ throttleMbps: number().min(1).max(1e3).optional(),
8185
+ /** Omitted = `move`, the pre-existing behaviour. */
8186
+ mode: MediaRelocateModeSchema.optional()
8187
+ });
8188
+ /** How many rows still carry NO `locationId` — the population a repoint would
8189
+ * silently re-aim at a disk that does not hold their bytes. Zero is the only
8190
+ * value that permits a non-blocking `eventMedia` cutover. */
8191
+ var UnstampedEventMediaCountSchema = object({
8192
+ media: number().int().nonnegative(),
8193
+ retrainFrames: number().int().nonnegative(),
8194
+ total: number().int().nonnegative()
8159
8195
  });
8160
8196
  var StorageMigrationMediaMoveInputSchema = RelocateMediaInputSchema.extend({ leaseId: string().min(1) });
8161
- /** The independently selectable logical storage classes. `recordings`
8162
- * encompasses the high and mid segment profiles; `recordingsLow` is low
8163
- * segments; `eventMedia` is post-analysis blobs. */
8197
+ /** The independently selectable logical storage classes — every class
8198
+ * `storage.listLocationDeclarations` reports, so an operator never meets a
8199
+ * Zod enum error where they should meet an explanation.
8200
+ *
8201
+ * `recordings` encompasses the high and mid segment profiles; `recordingsLow`
8202
+ * is low segments; `eventMedia` is post-analysis blobs; `galleryMedia` is the
8203
+ * enrolled gallery; `backups` is the system backup archive. The last two have
8204
+ * their own rules — see {@link StorageMigrationFindingCodeSchema}. */
8164
8205
  var StorageMigrationClassSchema = _enum([
8165
8206
  "recordings",
8166
8207
  "recordingsLow",
8167
- "eventMedia"
8208
+ "eventMedia",
8209
+ "backups",
8210
+ "galleryMedia"
8168
8211
  ]);
8169
8212
  /** A destination is always an existing, fully-qualified location id. The
8170
8213
  * migration API intentionally never changes a source location's `basePath`:
@@ -8172,20 +8215,56 @@ var StorageMigrationClassSchema = _enum([
8172
8215
  var StorageMigrationDestinationsSchema = object({
8173
8216
  recordings: string().min(1).optional(),
8174
8217
  recordingsLow: string().min(1).optional(),
8175
- eventMedia: string().min(1).optional()
8218
+ eventMedia: string().min(1).optional(),
8219
+ backups: string().min(1).optional(),
8220
+ galleryMedia: string().min(1).optional()
8176
8221
  }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
8222
+ /**
8223
+ * How a migration sequences the cutover against the byte move.
8224
+ *
8225
+ * - `blocking` — the historical order: pause, move every byte, repoint,
8226
+ * resume. Recording is stopped for the whole move. Right
8227
+ * for a small or a cold class, and the only legal mode for
8228
+ * a `cardinality: 'single'` class.
8229
+ * - `nonBlocking` — repoint FIRST, drain behind: seal, pause, repoint,
8230
+ * refresh, resume, then move the past with everything
8231
+ * running. The pause is three bounded instants (a detach +
8232
+ * attach round, a write-gate drain, a lease) instead of one
8233
+ * bounded by bytes. 1.09 TB at 7–14 MB/s is thirty hours of
8234
+ * stopped recording under `blocking`; the same move is
8235
+ * seconds of stopped recording under `nonBlocking`.
8236
+ *
8237
+ * The mode is on the JOB, not only on the input, because `status` is where an
8238
+ * operator finds out which one is running.
8239
+ */
8240
+ var StorageMigrationModeSchema = _enum(["blocking", "nonBlocking"]);
8177
8241
  /** Shared input for planning and starting an orchestrated storage migration. */
8178
8242
  var StorageMigrationInputSchema = object({
8179
8243
  destinations: StorageMigrationDestinationsSchema,
8180
- throttleMbps: number().min(1).max(1e3).optional()
8244
+ throttleMbps: number().min(1).max(1e3).optional(),
8245
+ /** Omitted = `blocking`, which stays the default. */
8246
+ mode: StorageMigrationModeSchema.optional()
8181
8247
  });
8182
- /** The durable coordinator state machine. The only phase that changes default
8183
- * locations is `repointing`, after every selected mover has completed and been
8184
- * verified. */
8248
+ /**
8249
+ * The durable coordinator state machine.
8250
+ *
8251
+ * `blocking`:
8252
+ * planning → pausing → moving → verifying → repointing → refreshing → resuming → done
8253
+ *
8254
+ * `nonBlocking`:
8255
+ * planning → sealing → pausing → repointing → refreshing → resuming → draining → verifying → done
8256
+ *
8257
+ * Same phases, different order plus two new ones — not a second mover.
8258
+ * `sealing` closes the `eventMedia` NULL-row hole BEFORE anything is paused;
8259
+ * `draining` runs the same movers UNLEASED, after every writer is back up.
8260
+ * `repointing` is still the only phase that changes a default location.
8261
+ */
8185
8262
  var StorageMigrationPhaseSchema = _enum([
8186
8263
  "planning",
8264
+ "sealing",
8187
8265
  "pausing",
8188
8266
  "moving",
8267
+ "draining",
8189
8268
  "verifying",
8190
8269
  "repointing",
8191
8270
  "refreshing",
@@ -8199,17 +8278,56 @@ var StorageMigrationParticipantSchema = _enum([
8199
8278
  "recorder",
8200
8279
  "analytics"
8201
8280
  ]);
8281
+ /**
8282
+ * The mover's own numbers, folded onto the coordinator's durable move record.
8283
+ *
8284
+ * The long half of a non-blocking migration is `draining`, and it is measured
8285
+ * in hours: 136 885 files at ~4 MB/s is about five of them. Before this shape
8286
+ * existed the only place those numbers appeared was a Loki line, so an operator
8287
+ * watching the Admin UI saw `phase: draining` and nothing else for a whole
8288
+ * afternoon.
8289
+ *
8290
+ * It is POLLED, never pushed. Events are telemetry and may be dropped
8291
+ * (D8/D11), and a dropped progress event is indistinguishable from a stalled
8292
+ * mover — which is the exact failure this is meant to end. The coordinator's
8293
+ * `waitForMoves` already fetches the whole {@link RelocateJob} on every tick to
8294
+ * read `state`; folding the counters costs no extra read and makes the durable
8295
+ * record say afterwards how far a move actually got.
8296
+ *
8297
+ * `filesTotal` is `null` for "no honest denominator" and is never zero-filled:
8298
+ * a windowed footage job (`sinceMs`) and a node with no ledger both genuinely
8299
+ * cannot say M, and a 0 there would render as "100 % done".
8300
+ */
8301
+ var StorageMigrationMoveProgressSchema = object({
8302
+ filesMoved: number().int().nonnegative(),
8303
+ /** The archive census — the **M** of "N of M" (D295). `null` = unknowable. */
8304
+ filesTotal: number().int().nonnegative().nullable(),
8305
+ bytesMoved: number().int().nonnegative(),
8306
+ /** The MOVER's start, not the migration's: a drain restarted after an addon
8307
+ * crash gets a new mover, and a rate computed from the migration's start
8308
+ * would silently average in the time nothing was running. */
8309
+ startedAt: number(),
8310
+ /** When the coordinator last read these numbers. Paired with `startedAt` it
8311
+ * is the only honest rate: both clocks are the hub's, so a UI never has to
8312
+ * subtract its own. */
8313
+ observedAt: number()
8314
+ });
8202
8315
  var StorageMigrationMoveSchema = object({
8203
8316
  storageClass: StorageMigrationClassSchema,
8204
8317
  fromLocationId: string(),
8205
8318
  toLocationId: string(),
8206
8319
  moverJobId: string().nullable(),
8207
8320
  state: RelocateJobStateSchema.nullable(),
8208
- error: string().nullable()
8321
+ error: string().nullable(),
8322
+ /** Last observed mover counters; `null` until the mover has been polled once. */
8323
+ progress: StorageMigrationMoveProgressSchema.nullable()
8209
8324
  });
8210
8325
  var StorageMigrationJobSchema = object({
8211
8326
  jobId: string(),
8212
8327
  phase: StorageMigrationPhaseSchema,
8328
+ /** Which order this job is running. `status` is the only place an operator
8329
+ * can tell a seconds-long cutover from a thirty-hour one. */
8330
+ mode: StorageMigrationModeSchema,
8213
8331
  destinations: StorageMigrationDestinationsSchema,
8214
8332
  throttleMbps: number(),
8215
8333
  moves: array(StorageMigrationMoveSchema),
@@ -8222,13 +8340,122 @@ var StorageMigrationJobSchema = object({
8222
8340
  finishedAt: number().nullable(),
8223
8341
  error: string().nullable()
8224
8342
  });
8343
+ var StorageMigrationFindingSchema = object({
8344
+ code: _enum([
8345
+ "sharesDeviceWithSource",
8346
+ "deviceIdentityUnknown",
8347
+ "unstampedEventMediaRows",
8348
+ "blockingOnly",
8349
+ "noMover"
8350
+ ]),
8351
+ storageClass: StorageMigrationClassSchema,
8352
+ /** Human-readable, already carrying the ids and counts. */
8353
+ message: string()
8354
+ });
8225
8355
  var StorageMigrationPlanSchema = object({
8226
8356
  destinations: StorageMigrationDestinationsSchema,
8357
+ /** The mode this plan was built for. A plan is only valid for its mode: the
8358
+ * `eventMedia` seal gate and the single-cardinality refusal both depend on
8359
+ * it. */
8360
+ mode: StorageMigrationModeSchema,
8227
8361
  moves: array(object({
8228
8362
  storageClass: StorageMigrationClassSchema,
8229
8363
  fromLocationId: string(),
8230
8364
  toLocationId: string()
8231
- }))
8365
+ })),
8366
+ findings: array(StorageMigrationFindingSchema)
8367
+ });
8368
+ /**
8369
+ * A mover as it exists RIGHT NOW, whether or not a migration job owns it.
8370
+ *
8371
+ * The coordinator's job record is the state of record for a migration, and its
8372
+ * moves carry {@link StorageMigrationMoveProgress}. But the movers are usable
8373
+ * standalone — `recording.relocateFootage` and `pipelineAnalytics.relocateMedia`
8374
+ * are both operator-callable, and on 2026-08-29 a five-hour drain was armed that
8375
+ * way because no supported UI path existed. A mover armed like that has no job
8376
+ * to fold progress into, so it has to be readable on its own or it is invisible.
8377
+ *
8378
+ * `migrationJobId` is what tells the two apart: `null` means nothing here
8379
+ * orchestrated it.
8380
+ */
8381
+ var StorageMigrationMoverSchema = object({
8382
+ lane: _enum(["footage", "media"]),
8383
+ job: RelocateJobSchema,
8384
+ /** The coordinator job that armed this mover, or `null` for a mover armed
8385
+ * directly against the owning addon. */
8386
+ migrationJobId: string().nullable(),
8387
+ /** When the hub read these counters. Stamped here so a rate is `bytesMoved`
8388
+ * over (`observedAt` − `job.startedAt`) with BOTH ends on the hub's clock —
8389
+ * a browser subtracting its own `Date.now()` from a server `startedAt` is a
8390
+ * rate made of two different clocks. */
8391
+ observedAt: number()
8392
+ });
8393
+ /**
8394
+ * What a SOURCE still holds for one storage class — the number that makes a
8395
+ * "drain remaining" action honest rather than hopeful.
8396
+ *
8397
+ * It comes from the archive (`SegmentHourLedger.census` for footage, the media
8398
+ * engine's own selection count for media), never from the resident index: a
8399
+ * drain sized off `RecordingIndex` is what reported `done` over 80.3 GB it had
8400
+ * never been told about (D295).
8401
+ *
8402
+ * `items`/`bytes` are `null` for "the archive could not be asked", which is
8403
+ * deliberately NOT zero: a drain is still offered for an unknown residue,
8404
+ * because refusing on an unanswerable read would hide exactly the case an
8405
+ * operator needs to act on.
8406
+ */
8407
+ var StorageMigrationResidueSchema = object({
8408
+ storageClass: StorageMigrationClassSchema,
8409
+ /** The location still holding the data. `'*'` for the media lane, whose rows
8410
+ * move from wherever they are rather than from one named source. */
8411
+ fromLocationId: string(),
8412
+ /** Where a drain would move it — the class's CURRENT default. */
8413
+ toLocationId: string(),
8414
+ /** Segments (footage lane) or rows (media lane) still on the source. */
8415
+ items: number().int().nonnegative().nullable(),
8416
+ /** Bytes on the source; `null` when the lane counts rows rather than bytes. */
8417
+ bytes: number().int().nonnegative().nullable()
8418
+ });
8419
+ /**
8420
+ * Run the DRAIN half and nothing else.
8421
+ *
8422
+ * A migration that reached `done` has already repointed, so `start` correctly
8423
+ * refuses its destination ("already the default") — there is nothing left to
8424
+ * repoint. But the drain can fail, be cancelled, be interrupted by a restart,
8425
+ * or finish against a work list that was a tenth of the archive (D295), and
8426
+ * before this there was no supported way to run only that half: the only way
8427
+ * through was calling `recording.relocateFootage` by hand over admin tRPC.
8428
+ *
8429
+ * `drain` NEVER calls `setDefaultLocations`. That is what keeps `start`'s
8430
+ * refusal meaningful: the two verbs are disjoint, so nothing here can silently
8431
+ * re-repoint a class that is already migrated.
8432
+ */
8433
+ var StorageMigrationDrainInputSchema = object({
8434
+ /** The classes to drain. Each must appear in `storageMigration.residue`, so
8435
+ * a class whose source is already empty is refused rather than started. */
8436
+ classes: array(StorageMigrationClassSchema).min(1),
8437
+ throttleMbps: number().min(1).max(1e3).optional()
8438
+ });
8439
+ /** What a footage source still holds, asked of the durable hour ledger. */
8440
+ var RelocateResidueInputSchema = object({
8441
+ fromLocationId: string().min(1),
8442
+ /** Narrow to one logical class; omit for every profile on the location. */
8443
+ footageClass: RelocateFootageClassSchema.optional()
8444
+ });
8445
+ /** `null` = the archive could not answer (no ledger on this node, or the
8446
+ * aggregate failed). Never conflated with an empty source. */
8447
+ var RelocateResidueSchema = object({
8448
+ segments: number().int().nonnegative(),
8449
+ bytes: number().int().nonnegative()
8450
+ }).nullable();
8451
+ /** How many rows a media pass would still act on against a given target — the
8452
+ * media lane's denominator AND its residue, from ONE derivation so the two can
8453
+ * never disagree. `null` = the count could not be taken. */
8454
+ var RelocatableMediaCountSchema = object({ rows: number().int().nonnegative() }).nullable();
8455
+ var RelocatableMediaCountInputSchema = object({
8456
+ toLocationId: string().min(1),
8457
+ /** Omitted = `move`. */
8458
+ mode: MediaRelocateModeSchema.optional()
8232
8459
  });
8233
8460
  /**
8234
8461
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -8334,6 +8561,32 @@ var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(
8334
8561
  * two addons declaring the same `id` must agree on `cardinality` (validated
8335
8562
  * at kernel aggregation time, not here).
8336
8563
  */
8564
+ /**
8565
+ * `StorageAccess` — how the service that DECLARED a storage-location kind
8566
+ * actually reaches the bytes. It is the constraint that decides which
8567
+ * `storage-provider`s may back a location of that kind.
8568
+ *
8569
+ * - `'local-path'` — the service asks `storage.resolve` for a path string and
8570
+ * then does its own `node:fs` I/O on it (the recorder's segment writer, the
8571
+ * post-analysis media roots). Only a provider that serves a genuine local
8572
+ * filesystem (`getProviderInfo().nodeLocal === true`) can satisfy that: a
8573
+ * remote provider's `resolve` returns a path on the REMOTE host, and
8574
+ * `fs.readdir` of it on this node either fails or — far worse — succeeds
8575
+ * against a same-named local directory that is something else entirely.
8576
+ *
8577
+ * - `'cap-mediated'` — every byte travels through the `storage` cap
8578
+ * (`read`/`write`, or `beginUpload`/`writeChunk`/`finalizeUpload`). The
8579
+ * service never sees a path, so any provider can back it. `backups` is the
8580
+ * one kind that qualifies today.
8581
+ *
8582
+ * Before this existed, `recordings` was unreachable by SFTP/S3/WebDAV only as
8583
+ * an EMERGENT property of how the recorder happened to be written. Nothing
8584
+ * refused the configuration; the first write simply went somewhere wrong, and
8585
+ * a recording write that goes wrong surfaces as a silent black window rather
8586
+ * than an error (the read path does not `stat`). This turns that accident into
8587
+ * a declared, enforced, testable refusal.
8588
+ */
8589
+ var StorageAccessSchema = _enum(["local-path", "cap-mediated"]);
8337
8590
  var StorageLocationDeclarationSchema = object({
8338
8591
  /**
8339
8592
  * Global location identifier, e.g. `recordings` or `recordingsLow`.
@@ -8353,6 +8606,19 @@ var StorageLocationDeclarationSchema = object({
8353
8606
  */
8354
8607
  cardinality: _enum(["single", "multi"]),
8355
8608
  /**
8609
+ * HOW the declaring service reaches the bytes — and therefore WHICH
8610
+ * providers may back a location of this kind. See {@link StorageAccessSchema}
8611
+ * and {@link STORAGE_ACCESS_FALLBACK}.
8612
+ *
8613
+ * Absent means `'local-path'`. That default is FAIL-CLOSED on purpose: it
8614
+ * can only over-restrict (refuse a remote provider for a kind that might
8615
+ * have coped) and never under-restrict. Declaring `'cap-mediated'` is the
8616
+ * permissive direction and is therefore never inferred — a repo guard
8617
+ * (`scripts/check-storage-access-declarations.ts`) refuses to let it be
8618
+ * reached by omission.
8619
+ */
8620
+ access: StorageAccessSchema.optional(),
8621
+ /**
8356
8622
  * When set, the default instance for this location inherits its resolved
8357
8623
  * root from the named location's default instance. Useful for derivative
8358
8624
  * slots (e.g. `recordingsLow` → `recordings`) so operators only need to
@@ -17937,8 +18203,10 @@ var TrackSchema = object({
17937
18203
  lastSeen: number(),
17938
18204
  /** Frame-rate position history (subject to maxPositionHistory cap). */
17939
18205
  positions: array(TrackPositionSchema).readonly(),
17940
- /** Periodic snapshots at snapshotIntervalMs cadence (subject to
17941
- * saveThumbnails policy). */
18206
+ /** Periodic snapshots at snapshotIntervalMs cadence DEBUG media, produced
18207
+ * only while `MediaSettings.debugMediaEnabled` is on for the camera (D299;
18208
+ * the retired `saveThumbnails` used to gate this and the rolling
18209
+ * `lastFrame` together). Empty is the healthy default, not a capture gap. */
17942
18210
  snapshots: array(TrackSnapshotSchema).readonly(),
17943
18211
  /** Deduplicated zones the track has entered at least once. Zone IDS. */
17944
18212
  zonesVisited: array(string()).readonly(),
@@ -18798,6 +19066,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
18798
19066
  }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
18799
19067
  kind: "mutation",
18800
19068
  auth: "admin"
19069
+ }), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(RelocatableMediaCountInputSchema, RelocatableMediaCountSchema, {
19070
+ kind: "query",
19071
+ auth: "admin"
18801
19072
  }), method(object({}), array(RelocateJobSchema).readonly(), {
18802
19073
  kind: "query",
18803
19074
  auth: "admin"
@@ -20705,7 +20976,10 @@ method(object({
20705
20976
  }), StorageLocationSchema, {
20706
20977
  kind: "mutation",
20707
20978
  auth: "admin"
20708
- }), method(object({ id: string() }), _void(), {
20979
+ }), method(object({
20980
+ id: string(),
20981
+ force: boolean().optional()
20982
+ }), _void(), {
20709
20983
  kind: "mutation",
20710
20984
  auth: "admin"
20711
20985
  }), method(object({ id: string() }), object({
@@ -20754,6 +21028,9 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
20754
21028
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
20755
21029
  kind: "mutation",
20756
21030
  auth: "admin"
21031
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
21032
+ kind: "mutation",
21033
+ auth: "admin"
20757
21034
  });
20758
21035
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
20759
21036
  providerId: string().min(1),
@@ -21187,12 +21464,38 @@ response: record(string(), unknown()) }), object({
21187
21464
  *
21188
21465
  * ## Why this is a capability and not a helper
21189
21466
  *
21190
- * Six stores in `addon-post-analysis` already hold vectors object CLIP, face,
21191
- * plate, vehicle, identity, and the event store's derivativesand every one of
21192
- * them keeps its vectors in a `JSON` settings-store column and ranks them by
21193
- * brute-force cosine in JS. Measured on the live hub that costs ~11.7 KB per row
21194
- * (512 floats as TEXT, `JSON.parse`d on every search) and made semantic search
21195
- * load 5,000 rows before ranking anything.
21467
+ * This capability was introduced with the claim that SIX stores in
21468
+ * `addon-post-analysis` held vectors in a `JSON` settings-store columnobject
21469
+ * CLIP, face, plate, vehicle, identity, and the event store's derivatives. That
21470
+ * claim was never true, and leaving it here made five stores look like pending
21471
+ * work when three of them have no vector at all. Counted column by column on
21472
+ * 2026-08-30, exactly THREE ever held one:
21473
+ *
21474
+ * - `object-clip` — 512-dim CLIP image embedding, migrated 2026-08-06.
21475
+ * - `faces.embedding` — 512-dim ArcFace face embedding, migrated 2026-08-30.
21476
+ * - `identity-samples.embedding` — the same ArcFace vector for an ENROLLED
21477
+ * face, migrated 2026-08-30 into its OWN index (see below).
21478
+ *
21479
+ * `plates` and `vehicle-samples` store a plate STRING and a score; `vehicles`
21480
+ * and `identities` store a name; the event store stores no derivative vector.
21481
+ * They are not migration candidates and never were.
21482
+ *
21483
+ * Measured on the live hub the JSON encoding cost ~11.7 KB per row (512 floats
21484
+ * as TEXT, `JSON.parse`d on every search) and made semantic search load 5,000
21485
+ * rows before ranking anything.
21486
+ *
21487
+ * ## One index per COMPARISON, never per encoder
21488
+ *
21489
+ * `faces` and `identity-samples` hold the same 512 ArcFace dims from the same
21490
+ * model, and they still get two indexes. An index is a set of things that are
21491
+ * ranked against each other and that live and die together, and these two are
21492
+ * neither: a `faces` row is TRACK-OWNED and cascades away with its track under
21493
+ * a per-camera capacity cap, an `identity-samples` row is retention-EXEMPT
21494
+ * forever and is the gallery every recognition ranks against. One index would
21495
+ * mean every gallery load and every reconcile carried a filter whose failure
21496
+ * mode is either ranking a candidate against itself or reclaiming an enrolled
21497
+ * person's only sample. The dimension they share is not a reason to share an
21498
+ * index; the question they answer is, and it differs.
21196
21499
  *
21197
21500
  * The fix is not a faster loop, it is a different backend — and the backend
21198
21501
  * should be replaceable without touching six callers. So: a singleton
@@ -21297,7 +21600,20 @@ var VectorQueryResultSchema = object({
21297
21600
  */
21298
21601
  scanned: number(),
21299
21602
  /** True when the backend could not consider every row that passed the filter. */
21300
- truncated: boolean()
21603
+ truncated: boolean(),
21604
+ /**
21605
+ * The `topK` the backend actually ran with.
21606
+ *
21607
+ * Every backend has a ceiling — sqlite-vec's is 4,096 — and a caller asking
21608
+ * past it used to learn nothing but a boolean, from a WARN in the provider's
21609
+ * own log rather than in its answer. That is how an audit asking for 20,000
21610
+ * consumed 4,096 and reported `examined: 4096` as if it had walked the index,
21611
+ * for weeks. `truncated` says THAT the answer was short; this says BY HOW
21612
+ * MUCH, in the return value, where the caller cannot fail to see it.
21613
+ *
21614
+ * Equals the requested `topK` whenever nothing was lowered.
21615
+ */
21616
+ effectiveTopK: number().int().positive()
21301
21617
  });
21302
21618
  var VectorDeleteInputSchema = object({
21303
21619
  index: string(),
@@ -21326,6 +21642,68 @@ var VectorGetResultSchema = object({ items: array(object({
21326
21642
  id: string(),
21327
21643
  metadata: VectorMetadataSchema
21328
21644
  })) });
21645
+ /**
21646
+ * Ids to read back WITH their vectors.
21647
+ *
21648
+ * The sibling of {@link VectorGetResultSchema}, and deliberately a separate
21649
+ * method rather than a flag on it: `getByIds` promises no vectors and its one
21650
+ * caller depends on that promise. This one promises the opposite.
21651
+ *
21652
+ * It exists because a store cannot put its vectors here otherwise. An ArcFace
21653
+ * gallery is ranked IN PROCESS, per detection, against every enrolled sample —
21654
+ * a per-face cross-process KNN would be a network round trip inside the
21655
+ * recognition loop. So the gallery is loaded once and held in RAM, and loading
21656
+ * it requires the index to hand the floats back. Without this method the only
21657
+ * way to keep a readable vector is a JSON column, which is the thing this
21658
+ * capability exists to delete.
21659
+ *
21660
+ * BOUNDED BY THE CALLER: ids are named, never "everything". Enumerating an
21661
+ * index is {@link VectorScanInputSchema}'s job, and it returns no vectors.
21662
+ */
21663
+ var VectorFetchInputSchema = object({
21664
+ index: string(),
21665
+ ids: array(string())
21666
+ });
21667
+ var VectorFetchResultSchema = object({ items: array(object({
21668
+ id: string(),
21669
+ /** base64 Float32LE — the same wire form `upsert` accepts. */
21670
+ vector: string(),
21671
+ metadata: VectorMetadataSchema
21672
+ })) });
21673
+ /**
21674
+ * ENUMERATE an index: one page of rows in a stable order, no ranking.
21675
+ *
21676
+ * A reconcile does not want the nearest rows, it wants ALL of them, and asking
21677
+ * a KNN for "all" is the wrong question twice over. It hits the backend's `k`
21678
+ * ceiling — 4,096 on sqlite-vec against a 22,128-row index — and it needs a
21679
+ * probe vector it does not have, so the audit passed a ZERO vector whose cosine
21680
+ * distance to every row is degenerate. `examined: 4096` then read as "we
21681
+ * looked" for as long as anyone cared to read it.
21682
+ *
21683
+ * This is the primitive that question actually needs: a bounded page, ordered
21684
+ * by the backend's own row order, costing no distance computation at all.
21685
+ * Vectors are NOT returned — an enumeration that shipped 2 KB per row would be
21686
+ * the full-table read this capability was built to stop.
21687
+ */
21688
+ var VectorScanInputSchema = object({
21689
+ index: string(),
21690
+ /** Opaque resume point. `0` starts at the top; pass back `nextCursor`. */
21691
+ cursor: number().int().nonnegative().default(0),
21692
+ limit: number().int().positive()
21693
+ });
21694
+ var VectorScanResultSchema = object({
21695
+ items: array(object({
21696
+ id: string(),
21697
+ metadata: VectorMetadataSchema
21698
+ })),
21699
+ /**
21700
+ * Where the next page starts, or `null` when the walk reached the end.
21701
+ *
21702
+ * `null` is the ONLY end-of-index signal. A caller must not infer the end
21703
+ * from a short page: a backend is free to return fewer rows than asked.
21704
+ */
21705
+ nextCursor: number().int().nonnegative().nullable()
21706
+ });
21329
21707
  var VectorStatsInputSchema = object({ index: string() });
21330
21708
  var VectorStatsResultSchema = object({
21331
21709
  /** Provider id, so an operator can tell brute force from an ANN index. */
@@ -21344,7 +21722,7 @@ method(VectorDeclareIndexInputSchema, _void(), {
21344
21722
  }), method(VectorUpsertInputSchema, VectorUpsertResultSchema, {
21345
21723
  kind: "mutation",
21346
21724
  auth: "admin"
21347
- }), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
21725
+ }), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorFetchInputSchema, VectorFetchResultSchema, { auth: "admin" }), method(VectorScanInputSchema, VectorScanResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
21348
21726
  kind: "mutation",
21349
21727
  auth: "admin"
21350
21728
  }), method(VectorDeleteByFilterInputSchema, VectorDeleteResultSchema, {
@@ -26248,6 +26626,9 @@ method(object({
26248
26626
  }), method(object({}), array(RelocateJobSchema).readonly(), {
26249
26627
  kind: "query",
26250
26628
  auth: "admin"
26629
+ }), method(RelocateResidueInputSchema, RelocateResidueSchema, {
26630
+ kind: "query",
26631
+ auth: "admin"
26251
26632
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
26252
26633
  kind: "mutation",
26253
26634
  auth: "admin"
@@ -31213,6 +31594,18 @@ Object.freeze({
31213
31594
  addonId: null,
31214
31595
  access: "create"
31215
31596
  },
31597
+ "pipelineAnalytics.countRelocatableMedia": {
31598
+ capName: "pipeline-analytics",
31599
+ capScope: "device",
31600
+ addonId: null,
31601
+ access: "view"
31602
+ },
31603
+ "pipelineAnalytics.countUnstampedEventMedia": {
31604
+ capName: "pipeline-analytics",
31605
+ capScope: "device",
31606
+ addonId: null,
31607
+ access: "view"
31608
+ },
31216
31609
  "pipelineAnalytics.deleteDeviceEvents": {
31217
31610
  capName: "pipeline-analytics",
31218
31611
  capScope: "device",
@@ -32371,6 +32764,12 @@ Object.freeze({
32371
32764
  addonId: null,
32372
32765
  access: "view"
32373
32766
  },
32767
+ "recording.getRelocateResidue": {
32768
+ capName: "recording",
32769
+ capScope: "system",
32770
+ addonId: null,
32771
+ access: "view"
32772
+ },
32374
32773
  "recording.getStorageMigrationMoveStatus": {
32375
32774
  capName: "recording",
32376
32775
  capScope: "system",
@@ -32917,12 +33316,30 @@ Object.freeze({
32917
33316
  addonId: null,
32918
33317
  access: "create"
32919
33318
  },
33319
+ "storageMigration.drain": {
33320
+ capName: "storage-migration",
33321
+ capScope: "system",
33322
+ addonId: null,
33323
+ access: "create"
33324
+ },
33325
+ "storageMigration.movers": {
33326
+ capName: "storage-migration",
33327
+ capScope: "system",
33328
+ addonId: null,
33329
+ access: "view"
33330
+ },
32920
33331
  "storageMigration.plan": {
32921
33332
  capName: "storage-migration",
32922
33333
  capScope: "system",
32923
33334
  addonId: null,
32924
33335
  access: "view"
32925
33336
  },
33337
+ "storageMigration.residue": {
33338
+ capName: "storage-migration",
33339
+ capScope: "system",
33340
+ addonId: null,
33341
+ access: "view"
33342
+ },
32926
33343
  "storageMigration.start": {
32927
33344
  capName: "storage-migration",
32928
33345
  capScope: "system",
@@ -33757,6 +34174,12 @@ Object.freeze({
33757
34174
  addonId: null,
33758
34175
  access: "delete"
33759
34176
  },
34177
+ "vectorStore.fetchByIds": {
34178
+ capName: "vector-store",
34179
+ capScope: "system",
34180
+ addonId: null,
34181
+ access: "view"
34182
+ },
33760
34183
  "vectorStore.getByIds": {
33761
34184
  capName: "vector-store",
33762
34185
  capScope: "system",
@@ -33769,6 +34192,12 @@ Object.freeze({
33769
34192
  addonId: null,
33770
34193
  access: "view"
33771
34194
  },
34195
+ "vectorStore.scan": {
34196
+ capName: "vector-store",
34197
+ capScope: "system",
34198
+ addonId: null,
34199
+ access: "view"
34200
+ },
33772
34201
  "vectorStore.stats": {
33773
34202
  capName: "vector-store",
33774
34203
  capScope: "system",
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../chunk-Cek0wNdY.js");
6
- const require_dist = require("../dist-CRj4EGfM.js");
6
+ const require_dist = require("../dist-DJ0XK1ze.js");
7
7
  //#region src/magic-link/auth-magic-link.addon.ts
8
8
  /**
9
9
  * Magic-link authentication addon.
@@ -1,4 +1,4 @@
1
- import { a as loginMethodCapability, c as BaseAddon, i as buildAddonRouteProvider, r as authProviderCapability, s as errMsg, t as addonRoutesCapability } from "../dist-Bksls9Ug.mjs";
1
+ import { a as loginMethodCapability, c as BaseAddon, i as buildAddonRouteProvider, r as authProviderCapability, s as errMsg, t as addonRoutesCapability } from "../dist-Cejgb_kg.mjs";
2
2
  //#region src/magic-link/auth-magic-link.addon.ts
3
3
  /**
4
4
  * Magic-link authentication addon.
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../chunk-Cek0wNdY.js");
6
- const require_dist = require("../dist-CRj4EGfM.js");
6
+ const require_dist = require("../dist-DJ0XK1ze.js");
7
7
  let node_crypto = require("node:crypto");
8
8
  node_crypto = require_chunk.__toESM(node_crypto);
9
9
  //#region node_modules/jose/dist/webapi/lib/buffer_utils.js