@camstack/addon-osd-manager 0.1.36 → 0.1.39

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 (17) hide show
  1. package/dist/{MotionZonesSettings-D83604xn.mjs → MotionZonesSettings-CIXOIaxJ.mjs} +2 -2
  2. package/dist/{PrivacyMaskSettings-DfN5NpZn.mjs → PrivacyMaskSettings-BXVb51kq.mjs} +4 -4
  3. package/dist/{SceneMonitorEditor-GBajxsPZ.mjs → SceneMonitorEditor-DYRLvvVA.mjs} +3 -3
  4. package/dist/_stub.js +10 -10
  5. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-BGccUojN.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-BfqPLLgE.mjs} +4 -4
  6. package/dist/{_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-Dtoxgyqi.mjs → _virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CnoMYUFR.mjs} +1 -1
  7. package/dist/{hostInit-De-9A9ec.mjs → hostInit-C5XnMBDh.mjs} +3 -3
  8. package/dist/index.js +492 -30
  9. package/dist/index.mjs +492 -30
  10. package/dist/{player-overlays-HbUryydX.mjs → player-overlays-BuhAo_Es.mjs} +1 -1
  11. package/dist/remoteEntry.js +1 -1
  12. package/dist/{responsive-D_qTmWde.mjs → responsive-BAE2Alvc.mjs} +1 -1
  13. package/dist/{square-C0LGbyDF.mjs → square-7AGHps0Y.mjs} +1 -1
  14. package/dist/{trash-2-sjTFBZ8w.mjs → trash-2-CeWvoLug.mjs} +1 -1
  15. package/dist/{use-device-snapshot-wIAkKsnc.mjs → use-device-snapshot-DW8FBhRd.mjs} +1 -1
  16. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-MvVd-u2_.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-hPck03Nc.mjs} +1 -1
  17. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -8102,6 +8102,21 @@ var RelocateJobSchema = object({
8102
8102
  bytesMoved: number().int(),
8103
8103
  /** Total files discovered up front; null while (or when) unknown. */
8104
8104
  filesTotal: number().int().nullable(),
8105
+ /**
8106
+ * Rows this run CORRECTED while moving them — a durable mutation the move
8107
+ * made that nobody asked for, so it is reported where the operator reads the
8108
+ * job rather than only in a log line.
8109
+ *
8110
+ * A footage segment records its byte count in its own NAME, and the durable
8111
+ * hour row derives its aggregates from those names. A file that does not
8112
+ * match its name therefore makes the ledger's sums — and with them quota and
8113
+ * pressure eviction — wrong by the difference, and only a rename can fix it.
8114
+ * On 2026-08-30 one such row also stalled a 110 749-file drain permanently.
8115
+ *
8116
+ * Absent on lanes where the question has no meaning: a media blob's size is
8117
+ * in its row, not in its name, so `MediaRelocateEngine` never reconciles one.
8118
+ */
8119
+ rowsReconciled: number().int().nonnegative().optional(),
8105
8120
  startedAt: number(),
8106
8121
  finishedAt: number().nullable(),
8107
8122
  error: string().nullable()
@@ -8170,14 +8185,42 @@ var RelocateMediaInputSchema = object({
8170
8185
  /** Omitted = `move`, the pre-existing behaviour. */
8171
8186
  mode: MediaRelocateModeSchema.optional()
8172
8187
  });
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()
8188
+ /**
8189
+ * The unstamped population of ONE collection split, because the gate and the
8190
+ * operator ask two different questions and only one of them has to be cheap.
8191
+ *
8192
+ * `present` is the GATE: "is there at least one row that would be orphaned by a
8193
+ * repoint". It is a single indexed seek to the first matching row, so it stays
8194
+ * answerable on a saturated disk and answers in O(log n) precisely in the state
8195
+ * that matters — after a seal, when the population is empty.
8196
+ *
8197
+ * `rows` is the NUMBER, for the refusal message and the operator's sense of
8198
+ * scale. It is a second, indexed `COUNT(*)`, and `null` means **not
8199
+ * measurable** — never zero. `{ present: true, rows: null }` is a legitimate
8200
+ * and useful answer: "there are some, and this read could not say how many"
8201
+ * still refuses the cutover, which is the whole job.
8202
+ */
8203
+ var UnstampedRowsSchema = object({
8204
+ present: boolean(),
8205
+ rows: number().int().nonnegative().nullable()
8180
8206
  });
8207
+ /**
8208
+ * How many rows still carry NO `locationId` — the population a repoint would
8209
+ * silently re-aim at a disk that does not hold their bytes.
8210
+ *
8211
+ * **`null` = the count could not be taken**, and it is NOT permission to cut
8212
+ * over. The gate opens on a measured absence and on nothing else; an unread
8213
+ * collection and an empty one are different facts, and this repo has already
8214
+ * paid for conflating them (`RelocateResidueSchema`, D295).
8215
+ */
8216
+ var UnstampedEventMediaCountSchema = object({
8217
+ media: UnstampedRowsSchema,
8218
+ retrainFrames: UnstampedRowsSchema,
8219
+ /** True when EITHER collection holds one. The refusal reads this. */
8220
+ anyPresent: boolean(),
8221
+ /** Sum across both, or `null` when either lane could not be counted. */
8222
+ total: number().int().nonnegative().nullable()
8223
+ }).nullable();
8181
8224
  var StorageMigrationMediaMoveInputSchema = RelocateMediaInputSchema.extend({ leaseId: string().min(1) });
8182
8225
  /** The independently selectable logical storage classes — every class
8183
8226
  * `storage.listLocationDeclarations` reports, so an operator never meets a
@@ -8263,13 +8306,53 @@ var StorageMigrationParticipantSchema = _enum([
8263
8306
  "recorder",
8264
8307
  "analytics"
8265
8308
  ]);
8309
+ /**
8310
+ * The mover's own numbers, folded onto the coordinator's durable move record.
8311
+ *
8312
+ * The long half of a non-blocking migration is `draining`, and it is measured
8313
+ * in hours: 136 885 files at ~4 MB/s is about five of them. Before this shape
8314
+ * existed the only place those numbers appeared was a Loki line, so an operator
8315
+ * watching the Admin UI saw `phase: draining` and nothing else for a whole
8316
+ * afternoon.
8317
+ *
8318
+ * It is POLLED, never pushed. Events are telemetry and may be dropped
8319
+ * (D8/D11), and a dropped progress event is indistinguishable from a stalled
8320
+ * mover — which is the exact failure this is meant to end. The coordinator's
8321
+ * `waitForMoves` already fetches the whole {@link RelocateJob} on every tick to
8322
+ * read `state`; folding the counters costs no extra read and makes the durable
8323
+ * record say afterwards how far a move actually got.
8324
+ *
8325
+ * `filesTotal` is `null` for "no honest denominator" and is never zero-filled:
8326
+ * a windowed footage job (`sinceMs`) and a node with no ledger both genuinely
8327
+ * cannot say M, and a 0 there would render as "100 % done".
8328
+ */
8329
+ var StorageMigrationMoveProgressSchema = object({
8330
+ filesMoved: number().int().nonnegative(),
8331
+ /** The archive census — the **M** of "N of M" (D295). `null` = unknowable. */
8332
+ filesTotal: number().int().nonnegative().nullable(),
8333
+ bytesMoved: number().int().nonnegative(),
8334
+ /** Rows the mover corrected while moving them — see `RelocateJob`. Absent on
8335
+ * a lane that cannot reconcile. A migration that silently rewrote durable
8336
+ * rows would be the same failure as one that silently skipped them. */
8337
+ rowsReconciled: number().int().nonnegative().optional(),
8338
+ /** The MOVER's start, not the migration's: a drain restarted after an addon
8339
+ * crash gets a new mover, and a rate computed from the migration's start
8340
+ * would silently average in the time nothing was running. */
8341
+ startedAt: number(),
8342
+ /** When the coordinator last read these numbers. Paired with `startedAt` it
8343
+ * is the only honest rate: both clocks are the hub's, so a UI never has to
8344
+ * subtract its own. */
8345
+ observedAt: number()
8346
+ });
8266
8347
  var StorageMigrationMoveSchema = object({
8267
8348
  storageClass: StorageMigrationClassSchema,
8268
8349
  fromLocationId: string(),
8269
8350
  toLocationId: string(),
8270
8351
  moverJobId: string().nullable(),
8271
8352
  state: RelocateJobStateSchema.nullable(),
8272
- error: string().nullable()
8353
+ error: string().nullable(),
8354
+ /** Last observed mover counters; `null` until the mover has been polled once. */
8355
+ progress: StorageMigrationMoveProgressSchema.nullable()
8273
8356
  });
8274
8357
  var StorageMigrationJobSchema = object({
8275
8358
  jobId: string(),
@@ -8315,6 +8398,98 @@ var StorageMigrationPlanSchema = object({
8315
8398
  findings: array(StorageMigrationFindingSchema)
8316
8399
  });
8317
8400
  /**
8401
+ * A mover as it exists RIGHT NOW, whether or not a migration job owns it.
8402
+ *
8403
+ * The coordinator's job record is the state of record for a migration, and its
8404
+ * moves carry {@link StorageMigrationMoveProgress}. But the movers are usable
8405
+ * standalone — `recording.relocateFootage` and `pipelineAnalytics.relocateMedia`
8406
+ * are both operator-callable, and on 2026-08-29 a five-hour drain was armed that
8407
+ * way because no supported UI path existed. A mover armed like that has no job
8408
+ * to fold progress into, so it has to be readable on its own or it is invisible.
8409
+ *
8410
+ * `migrationJobId` is what tells the two apart: `null` means nothing here
8411
+ * orchestrated it.
8412
+ */
8413
+ var StorageMigrationMoverSchema = object({
8414
+ lane: _enum(["footage", "media"]),
8415
+ job: RelocateJobSchema,
8416
+ /** The coordinator job that armed this mover, or `null` for a mover armed
8417
+ * directly against the owning addon. */
8418
+ migrationJobId: string().nullable(),
8419
+ /** When the hub read these counters. Stamped here so a rate is `bytesMoved`
8420
+ * over (`observedAt` − `job.startedAt`) with BOTH ends on the hub's clock —
8421
+ * a browser subtracting its own `Date.now()` from a server `startedAt` is a
8422
+ * rate made of two different clocks. */
8423
+ observedAt: number()
8424
+ });
8425
+ /**
8426
+ * What a SOURCE still holds for one storage class — the number that makes a
8427
+ * "drain remaining" action honest rather than hopeful.
8428
+ *
8429
+ * It comes from the archive (`SegmentHourLedger.census` for footage, the media
8430
+ * engine's own selection count for media), never from the resident index: a
8431
+ * drain sized off `RecordingIndex` is what reported `done` over 80.3 GB it had
8432
+ * never been told about (D295).
8433
+ *
8434
+ * `items`/`bytes` are `null` for "the archive could not be asked", which is
8435
+ * deliberately NOT zero: a drain is still offered for an unknown residue,
8436
+ * because refusing on an unanswerable read would hide exactly the case an
8437
+ * operator needs to act on.
8438
+ */
8439
+ var StorageMigrationResidueSchema = object({
8440
+ storageClass: StorageMigrationClassSchema,
8441
+ /** The location still holding the data. `'*'` for the media lane, whose rows
8442
+ * move from wherever they are rather than from one named source. */
8443
+ fromLocationId: string(),
8444
+ /** Where a drain would move it — the class's CURRENT default. */
8445
+ toLocationId: string(),
8446
+ /** Segments (footage lane) or rows (media lane) still on the source. */
8447
+ items: number().int().nonnegative().nullable(),
8448
+ /** Bytes on the source; `null` when the lane counts rows rather than bytes. */
8449
+ bytes: number().int().nonnegative().nullable()
8450
+ });
8451
+ /**
8452
+ * Run the DRAIN half and nothing else.
8453
+ *
8454
+ * A migration that reached `done` has already repointed, so `start` correctly
8455
+ * refuses its destination ("already the default") — there is nothing left to
8456
+ * repoint. But the drain can fail, be cancelled, be interrupted by a restart,
8457
+ * or finish against a work list that was a tenth of the archive (D295), and
8458
+ * before this there was no supported way to run only that half: the only way
8459
+ * through was calling `recording.relocateFootage` by hand over admin tRPC.
8460
+ *
8461
+ * `drain` NEVER calls `setDefaultLocations`. That is what keeps `start`'s
8462
+ * refusal meaningful: the two verbs are disjoint, so nothing here can silently
8463
+ * re-repoint a class that is already migrated.
8464
+ */
8465
+ var StorageMigrationDrainInputSchema = object({
8466
+ /** The classes to drain. Each must appear in `storageMigration.residue`, so
8467
+ * a class whose source is already empty is refused rather than started. */
8468
+ classes: array(StorageMigrationClassSchema).min(1),
8469
+ throttleMbps: number().min(1).max(1e3).optional()
8470
+ });
8471
+ /** What a footage source still holds, asked of the durable hour ledger. */
8472
+ var RelocateResidueInputSchema = object({
8473
+ fromLocationId: string().min(1),
8474
+ /** Narrow to one logical class; omit for every profile on the location. */
8475
+ footageClass: RelocateFootageClassSchema.optional()
8476
+ });
8477
+ /** `null` = the archive could not answer (no ledger on this node, or the
8478
+ * aggregate failed). Never conflated with an empty source. */
8479
+ var RelocateResidueSchema = object({
8480
+ segments: number().int().nonnegative(),
8481
+ bytes: number().int().nonnegative()
8482
+ }).nullable();
8483
+ /** How many rows a media pass would still act on against a given target — the
8484
+ * media lane's denominator AND its residue, from ONE derivation so the two can
8485
+ * never disagree. `null` = the count could not be taken. */
8486
+ var RelocatableMediaCountSchema = object({ rows: number().int().nonnegative() }).nullable();
8487
+ var RelocatableMediaCountInputSchema = object({
8488
+ toLocationId: string().min(1),
8489
+ /** Omitted = `move`. */
8490
+ mode: MediaRelocateModeSchema.optional()
8491
+ });
8492
+ /**
8318
8493
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8319
8494
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8320
8495
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8418,6 +8593,32 @@ var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(
8418
8593
  * two addons declaring the same `id` must agree on `cardinality` (validated
8419
8594
  * at kernel aggregation time, not here).
8420
8595
  */
8596
+ /**
8597
+ * `StorageAccess` — how the service that DECLARED a storage-location kind
8598
+ * actually reaches the bytes. It is the constraint that decides which
8599
+ * `storage-provider`s may back a location of that kind.
8600
+ *
8601
+ * - `'local-path'` — the service asks `storage.resolve` for a path string and
8602
+ * then does its own `node:fs` I/O on it (the recorder's segment writer, the
8603
+ * post-analysis media roots). Only a provider that serves a genuine local
8604
+ * filesystem (`getProviderInfo().nodeLocal === true`) can satisfy that: a
8605
+ * remote provider's `resolve` returns a path on the REMOTE host, and
8606
+ * `fs.readdir` of it on this node either fails or — far worse — succeeds
8607
+ * against a same-named local directory that is something else entirely.
8608
+ *
8609
+ * - `'cap-mediated'` — every byte travels through the `storage` cap
8610
+ * (`read`/`write`, or `beginUpload`/`writeChunk`/`finalizeUpload`). The
8611
+ * service never sees a path, so any provider can back it. `backups` is the
8612
+ * one kind that qualifies today.
8613
+ *
8614
+ * Before this existed, `recordings` was unreachable by SFTP/S3/WebDAV only as
8615
+ * an EMERGENT property of how the recorder happened to be written. Nothing
8616
+ * refused the configuration; the first write simply went somewhere wrong, and
8617
+ * a recording write that goes wrong surfaces as a silent black window rather
8618
+ * than an error (the read path does not `stat`). This turns that accident into
8619
+ * a declared, enforced, testable refusal.
8620
+ */
8621
+ var StorageAccessSchema = _enum(["local-path", "cap-mediated"]);
8421
8622
  var StorageLocationDeclarationSchema = object({
8422
8623
  /**
8423
8624
  * Global location identifier, e.g. `recordings` or `recordingsLow`.
@@ -8437,6 +8638,19 @@ var StorageLocationDeclarationSchema = object({
8437
8638
  */
8438
8639
  cardinality: _enum(["single", "multi"]),
8439
8640
  /**
8641
+ * HOW the declaring service reaches the bytes — and therefore WHICH
8642
+ * providers may back a location of this kind. See {@link StorageAccessSchema}
8643
+ * and {@link STORAGE_ACCESS_FALLBACK}.
8644
+ *
8645
+ * Absent means `'local-path'`. That default is FAIL-CLOSED on purpose: it
8646
+ * can only over-restrict (refuse a remote provider for a kind that might
8647
+ * have coped) and never under-restrict. Declaring `'cap-mediated'` is the
8648
+ * permissive direction and is therefore never inferred — a repo guard
8649
+ * (`scripts/check-storage-access-declarations.ts`) refuses to let it be
8650
+ * reached by omission.
8651
+ */
8652
+ access: StorageAccessSchema.optional(),
8653
+ /**
8440
8654
  * When set, the default instance for this location inherits its resolved
8441
8655
  * root from the named location's default instance. Useful for derivative
8442
8656
  * slots (e.g. `recordingsLow` → `recordings`) so operators only need to
@@ -14077,6 +14291,15 @@ var deviceManagerCapability = {
14077
14291
  * calls are sync. Bindings change rarely (only on wrapper toggle or
14078
14292
  * device add/remove) — clients invalidate via the
14079
14293
  * `capability.binding-changed` event.
14294
+ *
14295
+ * "A single round-trip" describes the CLIENT's side and used not to
14296
+ * describe the server's: until 2026-08-30 the resolver read the persisted
14297
+ * wrapper activations once per device, so answering this cost one
14298
+ * settings-door RPC per device — 1 020 on the live 1 019-device hub, and
14299
+ * it did not return in 240 s against `SystemMirror.init`'s 15 s budget.
14300
+ * The server side is now two reads for the whole fleet. Anything PERIODIC
14301
+ * still belongs on `getBindings` / `getBindingsBatch` (D12); this remains
14302
+ * a warm seed.
14080
14303
  */
14081
14304
  getAllBindings: method(object({}), array(DeviceBindingsForDeviceSchema)),
14082
14305
  /**
@@ -20816,8 +21039,10 @@ var TrackSchema = object({
20816
21039
  lastSeen: number(),
20817
21040
  /** Frame-rate position history (subject to maxPositionHistory cap). */
20818
21041
  positions: array(TrackPositionSchema).readonly(),
20819
- /** Periodic snapshots at snapshotIntervalMs cadence (subject to
20820
- * saveThumbnails policy). */
21042
+ /** Periodic snapshots at snapshotIntervalMs cadence DEBUG media, produced
21043
+ * only while `MediaSettings.debugMediaEnabled` is on for the camera (D299;
21044
+ * the retired `saveThumbnails` used to gate this and the rolling
21045
+ * `lastFrame` together). Empty is the healthy default, not a capture gap. */
20821
21046
  snapshots: array(TrackSnapshotSchema).readonly(),
20822
21047
  /** Deduplicated zones the track has entered at least once. Zone IDS. */
20823
21048
  zonesVisited: array(string()).readonly(),
@@ -21898,8 +22123,34 @@ var pipelineAnalyticsCapability = {
21898
22123
  * happens to stamp it. This count is what the migration planner's
21899
22124
  * non-blocking gate reads; `relocateMedia({ mode: 'seal' })` is what drives
21900
22125
  * it to zero.
22126
+ *
22127
+ * TWO indexed statements per collection, not a walk. It used to page the
22128
+ * whole collection at 200 rows per RPC ordered by an unindexed column, so
22129
+ * on the live hub — 1 254 576 rows — it hit the 60 s RPC deadline every
22130
+ * time it was called, and the migration it gates could never start. The
22131
+ * cheap question (`present`: is there at least one) is asked first and
22132
+ * separately from the expensive one (`rows`), because only the first has
22133
+ * to be answerable for the gate to do its job.
22134
+ *
22135
+ * **`null` is "not measurable", never zero** — at either level. An
22136
+ * unreadable collection must not read as a sealed one.
21901
22137
  */
21902
22138
  countUnstampedEventMedia: method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }),
22139
+ /**
22140
+ * How many rows a pass would STILL act on against `toLocationId`.
22141
+ *
22142
+ * One derivation, two consumers: it is the media lane's denominator (the
22143
+ * **M** the footage lane gets from the ledger census — D295) and it is the
22144
+ * residue behind "drain remaining". Deriving them separately is how "N of M"
22145
+ * ends up comparing two different populations.
22146
+ *
22147
+ * `null` means the count could not be taken; it is never zero-filled,
22148
+ * because a zero here reads as "nothing left to move".
22149
+ */
22150
+ countRelocatableMedia: method(RelocatableMediaCountInputSchema, RelocatableMediaCountSchema, {
22151
+ kind: "query",
22152
+ auth: "admin"
22153
+ }),
21903
22154
  /** Every relocate job this addon knows about, newest first (in RAM: the
21904
22155
  * move is resumable, so a lost list costs nothing but the display). */
21905
22156
  listRelocateMediaJobs: method(object({}), array(RelocateJobSchema).readonly(), {
@@ -24805,6 +25056,35 @@ var storageMigrationCapability = {
24805
25056
  cancel: method(object({ jobId: string() }), object({ cancelled: boolean() }), {
24806
25057
  kind: "mutation",
24807
25058
  auth: "admin"
25059
+ }),
25060
+ /**
25061
+ * Every mover running RIGHT NOW, in both lanes, with its counters.
25062
+ *
25063
+ * `status` covers a migration's own moves — the coordinator folds their
25064
+ * progress onto the durable job record it is already polling. This covers
25065
+ * the other case, and it is not hypothetical: a drain armed straight against
25066
+ * `recording.relocateFootage` (the only path that existed before
25067
+ * {@link drain}) has no job to fold into and would otherwise be invisible.
25068
+ */
25069
+ movers: method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }),
25070
+ /**
25071
+ * What each class's SOURCE still holds, from the archive — never from the
25072
+ * resident index (D295). Only classes with something left (or something
25073
+ * unknown) are listed, so an empty list means there is nothing to drain and
25074
+ * the UI has no honest button to offer.
25075
+ */
25076
+ residue: method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }),
25077
+ /**
25078
+ * Run the drain half alone, on a class whose default has ALREADY moved.
25079
+ *
25080
+ * It never repoints anything, which is what lets `start` keep refusing a
25081
+ * destination that is already the default: the two verbs cannot be confused
25082
+ * for one another, and no operator can re-repoint a migrated class through
25083
+ * this door.
25084
+ */
25085
+ drain: method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
25086
+ kind: "mutation",
25087
+ auth: "admin"
24808
25088
  })
24809
25089
  }
24810
25090
  };
@@ -25367,12 +25647,38 @@ response: record(string(), unknown()) }), object({
25367
25647
  *
25368
25648
  * ## Why this is a capability and not a helper
25369
25649
  *
25370
- * Six stores in `addon-post-analysis` already hold vectors object CLIP, face,
25371
- * plate, vehicle, identity, and the event store's derivativesand every one of
25372
- * them keeps its vectors in a `JSON` settings-store column and ranks them by
25373
- * brute-force cosine in JS. Measured on the live hub that costs ~11.7 KB per row
25374
- * (512 floats as TEXT, `JSON.parse`d on every search) and made semantic search
25375
- * load 5,000 rows before ranking anything.
25650
+ * This capability was introduced with the claim that SIX stores in
25651
+ * `addon-post-analysis` held vectors in a `JSON` settings-store columnobject
25652
+ * CLIP, face, plate, vehicle, identity, and the event store's derivatives. That
25653
+ * claim was never true, and leaving it here made five stores look like pending
25654
+ * work when three of them have no vector at all. Counted column by column on
25655
+ * 2026-08-30, exactly THREE ever held one:
25656
+ *
25657
+ * - `object-clip` — 512-dim CLIP image embedding, migrated 2026-08-06.
25658
+ * - `faces.embedding` — 512-dim ArcFace face embedding, migrated 2026-08-30.
25659
+ * - `identity-samples.embedding` — the same ArcFace vector for an ENROLLED
25660
+ * face, migrated 2026-08-30 into its OWN index (see below).
25661
+ *
25662
+ * `plates` and `vehicle-samples` store a plate STRING and a score; `vehicles`
25663
+ * and `identities` store a name; the event store stores no derivative vector.
25664
+ * They are not migration candidates and never were.
25665
+ *
25666
+ * Measured on the live hub the JSON encoding cost ~11.7 KB per row (512 floats
25667
+ * as TEXT, `JSON.parse`d on every search) and made semantic search load 5,000
25668
+ * rows before ranking anything.
25669
+ *
25670
+ * ## One index per COMPARISON, never per encoder
25671
+ *
25672
+ * `faces` and `identity-samples` hold the same 512 ArcFace dims from the same
25673
+ * model, and they still get two indexes. An index is a set of things that are
25674
+ * ranked against each other and that live and die together, and these two are
25675
+ * neither: a `faces` row is TRACK-OWNED and cascades away with its track under
25676
+ * a per-camera capacity cap, an `identity-samples` row is retention-EXEMPT
25677
+ * forever and is the gallery every recognition ranks against. One index would
25678
+ * mean every gallery load and every reconcile carried a filter whose failure
25679
+ * mode is either ranking a candidate against itself or reclaiming an enrolled
25680
+ * person's only sample. The dimension they share is not a reason to share an
25681
+ * index; the question they answer is, and it differs.
25376
25682
  *
25377
25683
  * The fix is not a faster loop, it is a different backend — and the backend
25378
25684
  * should be replaceable without touching six callers. So: a singleton
@@ -25477,7 +25783,20 @@ var VectorQueryResultSchema = object({
25477
25783
  */
25478
25784
  scanned: number(),
25479
25785
  /** True when the backend could not consider every row that passed the filter. */
25480
- truncated: boolean()
25786
+ truncated: boolean(),
25787
+ /**
25788
+ * The `topK` the backend actually ran with.
25789
+ *
25790
+ * Every backend has a ceiling — sqlite-vec's is 4,096 — and a caller asking
25791
+ * past it used to learn nothing but a boolean, from a WARN in the provider's
25792
+ * own log rather than in its answer. That is how an audit asking for 20,000
25793
+ * consumed 4,096 and reported `examined: 4096` as if it had walked the index,
25794
+ * for weeks. `truncated` says THAT the answer was short; this says BY HOW
25795
+ * MUCH, in the return value, where the caller cannot fail to see it.
25796
+ *
25797
+ * Equals the requested `topK` whenever nothing was lowered.
25798
+ */
25799
+ effectiveTopK: number().int().positive()
25481
25800
  });
25482
25801
  var VectorDeleteInputSchema = object({
25483
25802
  index: string(),
@@ -25506,6 +25825,68 @@ var VectorGetResultSchema = object({ items: array(object({
25506
25825
  id: string(),
25507
25826
  metadata: VectorMetadataSchema
25508
25827
  })) });
25828
+ /**
25829
+ * Ids to read back WITH their vectors.
25830
+ *
25831
+ * The sibling of {@link VectorGetResultSchema}, and deliberately a separate
25832
+ * method rather than a flag on it: `getByIds` promises no vectors and its one
25833
+ * caller depends on that promise. This one promises the opposite.
25834
+ *
25835
+ * It exists because a store cannot put its vectors here otherwise. An ArcFace
25836
+ * gallery is ranked IN PROCESS, per detection, against every enrolled sample —
25837
+ * a per-face cross-process KNN would be a network round trip inside the
25838
+ * recognition loop. So the gallery is loaded once and held in RAM, and loading
25839
+ * it requires the index to hand the floats back. Without this method the only
25840
+ * way to keep a readable vector is a JSON column, which is the thing this
25841
+ * capability exists to delete.
25842
+ *
25843
+ * BOUNDED BY THE CALLER: ids are named, never "everything". Enumerating an
25844
+ * index is {@link VectorScanInputSchema}'s job, and it returns no vectors.
25845
+ */
25846
+ var VectorFetchInputSchema = object({
25847
+ index: string(),
25848
+ ids: array(string())
25849
+ });
25850
+ var VectorFetchResultSchema = object({ items: array(object({
25851
+ id: string(),
25852
+ /** base64 Float32LE — the same wire form `upsert` accepts. */
25853
+ vector: string(),
25854
+ metadata: VectorMetadataSchema
25855
+ })) });
25856
+ /**
25857
+ * ENUMERATE an index: one page of rows in a stable order, no ranking.
25858
+ *
25859
+ * A reconcile does not want the nearest rows, it wants ALL of them, and asking
25860
+ * a KNN for "all" is the wrong question twice over. It hits the backend's `k`
25861
+ * ceiling — 4,096 on sqlite-vec against a 22,128-row index — and it needs a
25862
+ * probe vector it does not have, so the audit passed a ZERO vector whose cosine
25863
+ * distance to every row is degenerate. `examined: 4096` then read as "we
25864
+ * looked" for as long as anyone cared to read it.
25865
+ *
25866
+ * This is the primitive that question actually needs: a bounded page, ordered
25867
+ * by the backend's own row order, costing no distance computation at all.
25868
+ * Vectors are NOT returned — an enumeration that shipped 2 KB per row would be
25869
+ * the full-table read this capability was built to stop.
25870
+ */
25871
+ var VectorScanInputSchema = object({
25872
+ index: string(),
25873
+ /** Opaque resume point. `0` starts at the top; pass back `nextCursor`. */
25874
+ cursor: number().int().nonnegative().default(0),
25875
+ limit: number().int().positive()
25876
+ });
25877
+ var VectorScanResultSchema = object({
25878
+ items: array(object({
25879
+ id: string(),
25880
+ metadata: VectorMetadataSchema
25881
+ })),
25882
+ /**
25883
+ * Where the next page starts, or `null` when the walk reached the end.
25884
+ *
25885
+ * `null` is the ONLY end-of-index signal. A caller must not infer the end
25886
+ * from a short page: a backend is free to return fewer rows than asked.
25887
+ */
25888
+ nextCursor: number().int().nonnegative().nullable()
25889
+ });
25509
25890
  var VectorStatsInputSchema = object({ index: string() });
25510
25891
  var VectorStatsResultSchema = object({
25511
25892
  /** Provider id, so an operator can tell brute force from an ANN index. */
@@ -25544,6 +25925,10 @@ var vectorStoreCapability = {
25544
25925
  query: method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }),
25545
25926
  /** Metadata by id, no vectors — see {@link VectorGetResultSchema}. */
25546
25927
  getByIds: method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }),
25928
+ /** Metadata AND vectors, by named id — see {@link VectorFetchInputSchema}. */
25929
+ fetchByIds: method(VectorFetchInputSchema, VectorFetchResultSchema, { auth: "admin" }),
25930
+ /** One page of the whole index, unranked — see {@link VectorScanInputSchema}. */
25931
+ scan: method(VectorScanInputSchema, VectorScanResultSchema, { auth: "admin" }),
25547
25932
  deleteByIds: method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
25548
25933
  kind: "mutation",
25549
25934
  auth: "admin"
@@ -33132,6 +33517,20 @@ var recordingCapability = {
33132
33517
  kind: "query",
33133
33518
  auth: "admin"
33134
33519
  }),
33520
+ /**
33521
+ * What a location STILL holds, asked of the durable hour ledger.
33522
+ *
33523
+ * The number behind "drain remaining": segments and bytes that would still
33524
+ * have to move off `fromLocationId`. It is a ledger aggregate — the archive
33525
+ * — because the resident index is not the archive (D295), and a drain sized
33526
+ * off the index is exactly what reported `done` over 80.3 GB on 2026-08-29.
33527
+ * `null` means the archive could not be asked (no ledger on this node, or
33528
+ * the aggregate failed) and is never conflated with an empty source.
33529
+ */
33530
+ getRelocateResidue: method(RelocateResidueInputSchema, RelocateResidueSchema, {
33531
+ kind: "query",
33532
+ auth: "admin"
33533
+ }),
33135
33534
  /** Cancel a running or queued relocate job. A queued job never runs. */
33136
33535
  cancelRelocateJob: method(object({ jobId: string() }), object({ cancelled: boolean() }), {
33137
33536
  kind: "mutation",
@@ -39140,6 +39539,12 @@ Object.freeze({
39140
39539
  addonId: null,
39141
39540
  access: "create"
39142
39541
  },
39542
+ "pipelineAnalytics.countRelocatableMedia": {
39543
+ capName: "pipeline-analytics",
39544
+ capScope: "device",
39545
+ addonId: null,
39546
+ access: "view"
39547
+ },
39143
39548
  "pipelineAnalytics.countUnstampedEventMedia": {
39144
39549
  capName: "pipeline-analytics",
39145
39550
  capScope: "device",
@@ -40304,6 +40709,12 @@ Object.freeze({
40304
40709
  addonId: null,
40305
40710
  access: "view"
40306
40711
  },
40712
+ "recording.getRelocateResidue": {
40713
+ capName: "recording",
40714
+ capScope: "system",
40715
+ addonId: null,
40716
+ access: "view"
40717
+ },
40307
40718
  "recording.getStorageMigrationMoveStatus": {
40308
40719
  capName: "recording",
40309
40720
  capScope: "system",
@@ -40850,12 +41261,30 @@ Object.freeze({
40850
41261
  addonId: null,
40851
41262
  access: "create"
40852
41263
  },
41264
+ "storageMigration.drain": {
41265
+ capName: "storage-migration",
41266
+ capScope: "system",
41267
+ addonId: null,
41268
+ access: "create"
41269
+ },
41270
+ "storageMigration.movers": {
41271
+ capName: "storage-migration",
41272
+ capScope: "system",
41273
+ addonId: null,
41274
+ access: "view"
41275
+ },
40853
41276
  "storageMigration.plan": {
40854
41277
  capName: "storage-migration",
40855
41278
  capScope: "system",
40856
41279
  addonId: null,
40857
41280
  access: "view"
40858
41281
  },
41282
+ "storageMigration.residue": {
41283
+ capName: "storage-migration",
41284
+ capScope: "system",
41285
+ addonId: null,
41286
+ access: "view"
41287
+ },
40859
41288
  "storageMigration.start": {
40860
41289
  capName: "storage-migration",
40861
41290
  capScope: "system",
@@ -41690,6 +42119,12 @@ Object.freeze({
41690
42119
  addonId: null,
41691
42120
  access: "delete"
41692
42121
  },
42122
+ "vectorStore.fetchByIds": {
42123
+ capName: "vector-store",
42124
+ capScope: "system",
42125
+ addonId: null,
42126
+ access: "view"
42127
+ },
41693
42128
  "vectorStore.getByIds": {
41694
42129
  capName: "vector-store",
41695
42130
  capScope: "system",
@@ -41702,6 +42137,12 @@ Object.freeze({
41702
42137
  addonId: null,
41703
42138
  access: "view"
41704
42139
  },
42140
+ "vectorStore.scan": {
42141
+ capName: "vector-store",
42142
+ capScope: "system",
42143
+ addonId: null,
42144
+ access: "view"
42145
+ },
41705
42146
  "vectorStore.stats": {
41706
42147
  capName: "vector-store",
41707
42148
  capScope: "system",
@@ -44909,16 +45350,7 @@ var OsdManager = class {
44909
45350
  };
44910
45351
  getSourceCatalog = async ({ deviceId }) => {
44911
45352
  const devices = await this.safeListDevices();
44912
- const capsByDevice = /* @__PURE__ */ new Map();
44913
- for (const device of devices) try {
44914
- capsByDevice.set(device.id, await this.deps.listDeviceCaps(device.id));
44915
- } catch (err) {
44916
- this.logger.warn("osd-manager: cap enumeration failed — device omitted from catalog", {
44917
- tags: { deviceId: device.id },
44918
- meta: { error: String(err) }
44919
- });
44920
- }
44921
- return { sources: sourceOptionsFor(deviceId, devices, capsByDevice) };
45353
+ return { sources: sourceOptionsFor(deviceId, devices, await this.safeListDeviceCaps(deviceId, devices)) };
44922
45354
  };
44923
45355
  getConditionSupport = async () => {
44924
45356
  return {
@@ -45188,6 +45620,36 @@ var OsdManager = class {
45188
45620
  return [];
45189
45621
  }
45190
45622
  }
45623
+ /**
45624
+ * Every listed device's bound cap names, in ONE round trip.
45625
+ *
45626
+ * This used to be `listDeviceCaps(device.id)` inside the catalog loop, with a
45627
+ * per-device `catch` that omitted the device — 1 + 1 019 sequential
45628
+ * cross-process cap calls on the live hub 2026-08-30, behind an operator
45629
+ * opening a slot editor. The batch has no partial failure mode: it answers
45630
+ * for the whole set or it throws, and a throw lands where every per-device
45631
+ * read failing already landed — an empty map, hence a catalog with no
45632
+ * bindable sources. One log line instead of a thousand.
45633
+ *
45634
+ * `tags.deviceId` is the CAMERA whose editor is open, because that is the
45635
+ * question an operator asks ("why is 615's picker empty?"); the size of the
45636
+ * set that went unanswered rides in `meta`.
45637
+ */
45638
+ async safeListDeviceCaps(cameraDeviceId, devices) {
45639
+ if (devices.length === 0) return /* @__PURE__ */ new Map();
45640
+ try {
45641
+ return await this.deps.listDeviceCapsBatch(devices.map((d) => d.id));
45642
+ } catch (err) {
45643
+ this.logger.warn("osd-manager: cap enumeration failed — the source catalog has no bindable values", {
45644
+ tags: { deviceId: cameraDeviceId },
45645
+ meta: {
45646
+ devices: devices.length,
45647
+ error: String(err)
45648
+ }
45649
+ });
45650
+ return /* @__PURE__ */ new Map();
45651
+ }
45652
+ }
45191
45653
  };
45192
45654
  function cacheKey(deviceId, slotId) {
45193
45655
  return `${deviceId}:${slotId}`;
@@ -45272,9 +45734,9 @@ var OsdManagerAddon = class extends BaseAddon {
45272
45734
  name: d.name
45273
45735
  }));
45274
45736
  },
45275
- listDeviceCaps: async (deviceId) => {
45276
- const bindings = await ctx.api.deviceManager.getBindings.query({ deviceId });
45277
- return [...new Set(bindings.entries.map((e) => e.capName))];
45737
+ listDeviceCapsBatch: async (deviceIds) => {
45738
+ const rows = await ctx.api.deviceManager.getBindingsBatch.query({ deviceIds: [...deviceIds] });
45739
+ return new Map(rows.map((row) => [row.deviceId, [...new Set(row.entries.map((e) => e.capName))]]));
45278
45740
  },
45279
45741
  readLatestRecognitions: async (deviceId) => {
45280
45742
  const [faces, plates] = await Promise.all([ctx.api.faceGallery.listRecentFaces.query({