@camstack/addon-provider-homeassistant 1.2.56 → 1.2.58

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.
package/dist/addon.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_dist = require("./dist-DuEiH0D0.js");
2
+ const require_dist = require("./dist-DjxuSmvp.js");
3
3
  let node_crypto = require("node:crypto");
4
4
  let node_zlib = require("node:zlib");
5
5
  //#region src/ha-device-source.ts
package/dist/addon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as presenceCapability, A as controlCapability, At as EventCategory, B as humiditySensorCapability, C as buildAddonRouteProvider, Ct as number, D as colorCapability, Dt as union, E as climateControlCapability, Et as string, F as eventEmitterCapability, G as motionCapability, H as lawnMowerControlCapability, I as fanControlCapability, J as notifierCapability, K as normalizeUnit, L as floodCapability, M as deviceAdoptionCapability, O as connectivityCapability, Ot as unknown, P as enumSensorCapability, Q as prepareNotification, R as gasCapability, S as brokerCapability, St as literal, T as carbonMonoxideCapability, Tt as record, U as lockControlCapability, V as imageCapability, W as mediaPlayerCapability, Y as numericSensorCapability, Z as powerMeterCapability, _ as automationControlCapability, _t as createEvent, at as temperatureSensorCapability, b as binaryCapability, bt as array, ct as valveCapability, d as TargetSchema, dt as weatherCapability, et as pressureSensorCapability, f as accessoriesCapability, ft as errMsg, g as ambientLightSensorCapability, gt as DeviceType, h as alarmPanelCapability, ht as DeviceRole, it as tamperCapability, j as coverCapability, k as contactCapability, kt as url, lt as vibrationCapability, m as airQualitySensorCapability, mt as DeviceFeature, n as BaseDevice, nt as smokeCapability, ot as updateCapability, p as addonRoutesCapability, q as notificationOutputCapability, r as BaseDeviceProvider, rt as switchCapability, s as EnumSensorDateTimeFormatSchema, st as vacuumControlCapability, tt as scriptRunnerCapability, ut as waterHeaterCapability, v as batteryCapability, w as buttonCapability, wt as object, x as brightnessCapability, xt as discriminatedUnion, y as bestLocationMatch, yt as _enum, z as humidifierCapability } from "./dist-DQlMgQbg.mjs";
1
+ import { $ as presenceCapability, A as controlCapability, At as EventCategory, B as humiditySensorCapability, C as buildAddonRouteProvider, Ct as number, D as colorCapability, Dt as union, E as climateControlCapability, Et as string, F as eventEmitterCapability, G as motionCapability, H as lawnMowerControlCapability, I as fanControlCapability, J as notifierCapability, K as normalizeUnit, L as floodCapability, M as deviceAdoptionCapability, O as connectivityCapability, Ot as unknown, P as enumSensorCapability, Q as prepareNotification, R as gasCapability, S as brokerCapability, St as literal, T as carbonMonoxideCapability, Tt as record, U as lockControlCapability, V as imageCapability, W as mediaPlayerCapability, Y as numericSensorCapability, Z as powerMeterCapability, _ as automationControlCapability, _t as createEvent, at as temperatureSensorCapability, b as binaryCapability, bt as array, ct as valveCapability, d as TargetSchema, dt as weatherCapability, et as pressureSensorCapability, f as accessoriesCapability, ft as errMsg, g as ambientLightSensorCapability, gt as DeviceType, h as alarmPanelCapability, ht as DeviceRole, it as tamperCapability, j as coverCapability, k as contactCapability, kt as url, lt as vibrationCapability, m as airQualitySensorCapability, mt as DeviceFeature, n as BaseDevice, nt as smokeCapability, ot as updateCapability, p as addonRoutesCapability, q as notificationOutputCapability, r as BaseDeviceProvider, rt as switchCapability, s as EnumSensorDateTimeFormatSchema, st as vacuumControlCapability, tt as scriptRunnerCapability, ut as waterHeaterCapability, v as batteryCapability, w as buttonCapability, wt as object, x as brightnessCapability, xt as discriminatedUnion, y as bestLocationMatch, yt as _enum, z as humidifierCapability } from "./dist-CCHqsqE6.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { brotliCompressSync, deflateSync, gzipSync } from "node:zlib";
4
4
  //#region src/ha-device-source.ts
@@ -8367,13 +8367,49 @@ var StorageMigrationParticipantSchema = _enum([
8367
8367
  "recorder",
8368
8368
  "analytics"
8369
8369
  ]);
8370
+ /**
8371
+ * The mover's own numbers, folded onto the coordinator's durable move record.
8372
+ *
8373
+ * The long half of a non-blocking migration is `draining`, and it is measured
8374
+ * in hours: 136 885 files at ~4 MB/s is about five of them. Before this shape
8375
+ * existed the only place those numbers appeared was a Loki line, so an operator
8376
+ * watching the Admin UI saw `phase: draining` and nothing else for a whole
8377
+ * afternoon.
8378
+ *
8379
+ * It is POLLED, never pushed. Events are telemetry and may be dropped
8380
+ * (D8/D11), and a dropped progress event is indistinguishable from a stalled
8381
+ * mover — which is the exact failure this is meant to end. The coordinator's
8382
+ * `waitForMoves` already fetches the whole {@link RelocateJob} on every tick to
8383
+ * read `state`; folding the counters costs no extra read and makes the durable
8384
+ * record say afterwards how far a move actually got.
8385
+ *
8386
+ * `filesTotal` is `null` for "no honest denominator" and is never zero-filled:
8387
+ * a windowed footage job (`sinceMs`) and a node with no ledger both genuinely
8388
+ * cannot say M, and a 0 there would render as "100 % done".
8389
+ */
8390
+ var StorageMigrationMoveProgressSchema = object({
8391
+ filesMoved: number().int().nonnegative(),
8392
+ /** The archive census — the **M** of "N of M" (D295). `null` = unknowable. */
8393
+ filesTotal: number().int().nonnegative().nullable(),
8394
+ bytesMoved: number().int().nonnegative(),
8395
+ /** The MOVER's start, not the migration's: a drain restarted after an addon
8396
+ * crash gets a new mover, and a rate computed from the migration's start
8397
+ * would silently average in the time nothing was running. */
8398
+ startedAt: number(),
8399
+ /** When the coordinator last read these numbers. Paired with `startedAt` it
8400
+ * is the only honest rate: both clocks are the hub's, so a UI never has to
8401
+ * subtract its own. */
8402
+ observedAt: number()
8403
+ });
8370
8404
  var StorageMigrationMoveSchema = object({
8371
8405
  storageClass: StorageMigrationClassSchema,
8372
8406
  fromLocationId: string(),
8373
8407
  toLocationId: string(),
8374
8408
  moverJobId: string().nullable(),
8375
8409
  state: RelocateJobStateSchema.nullable(),
8376
- error: string().nullable()
8410
+ error: string().nullable(),
8411
+ /** Last observed mover counters; `null` until the mover has been polled once. */
8412
+ progress: StorageMigrationMoveProgressSchema.nullable()
8377
8413
  });
8378
8414
  var StorageMigrationJobSchema = object({
8379
8415
  jobId: string(),
@@ -8419,6 +8455,98 @@ var StorageMigrationPlanSchema = object({
8419
8455
  findings: array(StorageMigrationFindingSchema)
8420
8456
  });
8421
8457
  /**
8458
+ * A mover as it exists RIGHT NOW, whether or not a migration job owns it.
8459
+ *
8460
+ * The coordinator's job record is the state of record for a migration, and its
8461
+ * moves carry {@link StorageMigrationMoveProgress}. But the movers are usable
8462
+ * standalone — `recording.relocateFootage` and `pipelineAnalytics.relocateMedia`
8463
+ * are both operator-callable, and on 2026-08-29 a five-hour drain was armed that
8464
+ * way because no supported UI path existed. A mover armed like that has no job
8465
+ * to fold progress into, so it has to be readable on its own or it is invisible.
8466
+ *
8467
+ * `migrationJobId` is what tells the two apart: `null` means nothing here
8468
+ * orchestrated it.
8469
+ */
8470
+ var StorageMigrationMoverSchema = object({
8471
+ lane: _enum(["footage", "media"]),
8472
+ job: RelocateJobSchema,
8473
+ /** The coordinator job that armed this mover, or `null` for a mover armed
8474
+ * directly against the owning addon. */
8475
+ migrationJobId: string().nullable(),
8476
+ /** When the hub read these counters. Stamped here so a rate is `bytesMoved`
8477
+ * over (`observedAt` − `job.startedAt`) with BOTH ends on the hub's clock —
8478
+ * a browser subtracting its own `Date.now()` from a server `startedAt` is a
8479
+ * rate made of two different clocks. */
8480
+ observedAt: number()
8481
+ });
8482
+ /**
8483
+ * What a SOURCE still holds for one storage class — the number that makes a
8484
+ * "drain remaining" action honest rather than hopeful.
8485
+ *
8486
+ * It comes from the archive (`SegmentHourLedger.census` for footage, the media
8487
+ * engine's own selection count for media), never from the resident index: a
8488
+ * drain sized off `RecordingIndex` is what reported `done` over 80.3 GB it had
8489
+ * never been told about (D295).
8490
+ *
8491
+ * `items`/`bytes` are `null` for "the archive could not be asked", which is
8492
+ * deliberately NOT zero: a drain is still offered for an unknown residue,
8493
+ * because refusing on an unanswerable read would hide exactly the case an
8494
+ * operator needs to act on.
8495
+ */
8496
+ var StorageMigrationResidueSchema = object({
8497
+ storageClass: StorageMigrationClassSchema,
8498
+ /** The location still holding the data. `'*'` for the media lane, whose rows
8499
+ * move from wherever they are rather than from one named source. */
8500
+ fromLocationId: string(),
8501
+ /** Where a drain would move it — the class's CURRENT default. */
8502
+ toLocationId: string(),
8503
+ /** Segments (footage lane) or rows (media lane) still on the source. */
8504
+ items: number().int().nonnegative().nullable(),
8505
+ /** Bytes on the source; `null` when the lane counts rows rather than bytes. */
8506
+ bytes: number().int().nonnegative().nullable()
8507
+ });
8508
+ /**
8509
+ * Run the DRAIN half and nothing else.
8510
+ *
8511
+ * A migration that reached `done` has already repointed, so `start` correctly
8512
+ * refuses its destination ("already the default") — there is nothing left to
8513
+ * repoint. But the drain can fail, be cancelled, be interrupted by a restart,
8514
+ * or finish against a work list that was a tenth of the archive (D295), and
8515
+ * before this there was no supported way to run only that half: the only way
8516
+ * through was calling `recording.relocateFootage` by hand over admin tRPC.
8517
+ *
8518
+ * `drain` NEVER calls `setDefaultLocations`. That is what keeps `start`'s
8519
+ * refusal meaningful: the two verbs are disjoint, so nothing here can silently
8520
+ * re-repoint a class that is already migrated.
8521
+ */
8522
+ var StorageMigrationDrainInputSchema = object({
8523
+ /** The classes to drain. Each must appear in `storageMigration.residue`, so
8524
+ * a class whose source is already empty is refused rather than started. */
8525
+ classes: array(StorageMigrationClassSchema).min(1),
8526
+ throttleMbps: number().min(1).max(1e3).optional()
8527
+ });
8528
+ /** What a footage source still holds, asked of the durable hour ledger. */
8529
+ var RelocateResidueInputSchema = object({
8530
+ fromLocationId: string().min(1),
8531
+ /** Narrow to one logical class; omit for every profile on the location. */
8532
+ footageClass: RelocateFootageClassSchema.optional()
8533
+ });
8534
+ /** `null` = the archive could not answer (no ledger on this node, or the
8535
+ * aggregate failed). Never conflated with an empty source. */
8536
+ var RelocateResidueSchema = object({
8537
+ segments: number().int().nonnegative(),
8538
+ bytes: number().int().nonnegative()
8539
+ }).nullable();
8540
+ /** How many rows a media pass would still act on against a given target — the
8541
+ * media lane's denominator AND its residue, from ONE derivation so the two can
8542
+ * never disagree. `null` = the count could not be taken. */
8543
+ var RelocatableMediaCountSchema = object({ rows: number().int().nonnegative() }).nullable();
8544
+ var RelocatableMediaCountInputSchema = object({
8545
+ toLocationId: string().min(1),
8546
+ /** Omitted = `move`. */
8547
+ mode: MediaRelocateModeSchema.optional()
8548
+ });
8549
+ /**
8422
8550
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8423
8551
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8424
8552
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8522,6 +8650,32 @@ var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(
8522
8650
  * two addons declaring the same `id` must agree on `cardinality` (validated
8523
8651
  * at kernel aggregation time, not here).
8524
8652
  */
8653
+ /**
8654
+ * `StorageAccess` — how the service that DECLARED a storage-location kind
8655
+ * actually reaches the bytes. It is the constraint that decides which
8656
+ * `storage-provider`s may back a location of that kind.
8657
+ *
8658
+ * - `'local-path'` — the service asks `storage.resolve` for a path string and
8659
+ * then does its own `node:fs` I/O on it (the recorder's segment writer, the
8660
+ * post-analysis media roots). Only a provider that serves a genuine local
8661
+ * filesystem (`getProviderInfo().nodeLocal === true`) can satisfy that: a
8662
+ * remote provider's `resolve` returns a path on the REMOTE host, and
8663
+ * `fs.readdir` of it on this node either fails or — far worse — succeeds
8664
+ * against a same-named local directory that is something else entirely.
8665
+ *
8666
+ * - `'cap-mediated'` — every byte travels through the `storage` cap
8667
+ * (`read`/`write`, or `beginUpload`/`writeChunk`/`finalizeUpload`). The
8668
+ * service never sees a path, so any provider can back it. `backups` is the
8669
+ * one kind that qualifies today.
8670
+ *
8671
+ * Before this existed, `recordings` was unreachable by SFTP/S3/WebDAV only as
8672
+ * an EMERGENT property of how the recorder happened to be written. Nothing
8673
+ * refused the configuration; the first write simply went somewhere wrong, and
8674
+ * a recording write that goes wrong surfaces as a silent black window rather
8675
+ * than an error (the read path does not `stat`). This turns that accident into
8676
+ * a declared, enforced, testable refusal.
8677
+ */
8678
+ var StorageAccessSchema = _enum(["local-path", "cap-mediated"]);
8525
8679
  var StorageLocationDeclarationSchema = object({
8526
8680
  /**
8527
8681
  * Global location identifier, e.g. `recordings` or `recordingsLow`.
@@ -8541,6 +8695,19 @@ var StorageLocationDeclarationSchema = object({
8541
8695
  */
8542
8696
  cardinality: _enum(["single", "multi"]),
8543
8697
  /**
8698
+ * HOW the declaring service reaches the bytes — and therefore WHICH
8699
+ * providers may back a location of this kind. See {@link StorageAccessSchema}
8700
+ * and {@link STORAGE_ACCESS_FALLBACK}.
8701
+ *
8702
+ * Absent means `'local-path'`. That default is FAIL-CLOSED on purpose: it
8703
+ * can only over-restrict (refuse a remote provider for a kind that might
8704
+ * have coped) and never under-restrict. Declaring `'cap-mediated'` is the
8705
+ * permissive direction and is therefore never inferred — a repo guard
8706
+ * (`scripts/check-storage-access-declarations.ts`) refuses to let it be
8707
+ * reached by omission.
8708
+ */
8709
+ access: StorageAccessSchema.optional(),
8710
+ /**
8544
8711
  * When set, the default instance for this location inherits its resolved
8545
8712
  * root from the named location's default instance. Useful for derivative
8546
8713
  * slots (e.g. `recordingsLow` → `recordings`) so operators only need to
@@ -18593,8 +18760,10 @@ var TrackSchema = object({
18593
18760
  lastSeen: number(),
18594
18761
  /** Frame-rate position history (subject to maxPositionHistory cap). */
18595
18762
  positions: array(TrackPositionSchema).readonly(),
18596
- /** Periodic snapshots at snapshotIntervalMs cadence (subject to
18597
- * saveThumbnails policy). */
18763
+ /** Periodic snapshots at snapshotIntervalMs cadence DEBUG media, produced
18764
+ * only while `MediaSettings.debugMediaEnabled` is on for the camera (D299;
18765
+ * the retired `saveThumbnails` used to gate this and the rolling
18766
+ * `lastFrame` together). Empty is the healthy default, not a capture gap. */
18598
18767
  snapshots: array(TrackSnapshotSchema).readonly(),
18599
18768
  /** Deduplicated zones the track has entered at least once. Zone IDS. */
18600
18769
  zonesVisited: array(string()).readonly(),
@@ -19454,7 +19623,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19454
19623
  }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
19455
19624
  kind: "mutation",
19456
19625
  auth: "admin"
19457
- }), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(object({}), array(RelocateJobSchema).readonly(), {
19626
+ }), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(RelocatableMediaCountInputSchema, RelocatableMediaCountSchema, {
19627
+ kind: "query",
19628
+ auth: "admin"
19629
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
19458
19630
  kind: "query",
19459
19631
  auth: "admin"
19460
19632
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
@@ -21413,6 +21585,9 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
21413
21585
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
21414
21586
  kind: "mutation",
21415
21587
  auth: "admin"
21588
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
21589
+ kind: "mutation",
21590
+ auth: "admin"
21416
21591
  });
21417
21592
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
21418
21593
  providerId: string().min(1),
@@ -21811,12 +21986,38 @@ response: record(string(), unknown()) }), object({
21811
21986
  *
21812
21987
  * ## Why this is a capability and not a helper
21813
21988
  *
21814
- * Six stores in `addon-post-analysis` already hold vectors object CLIP, face,
21815
- * plate, vehicle, identity, and the event store's derivativesand every one of
21816
- * them keeps its vectors in a `JSON` settings-store column and ranks them by
21817
- * brute-force cosine in JS. Measured on the live hub that costs ~11.7 KB per row
21818
- * (512 floats as TEXT, `JSON.parse`d on every search) and made semantic search
21819
- * load 5,000 rows before ranking anything.
21989
+ * This capability was introduced with the claim that SIX stores in
21990
+ * `addon-post-analysis` held vectors in a `JSON` settings-store columnobject
21991
+ * CLIP, face, plate, vehicle, identity, and the event store's derivatives. That
21992
+ * claim was never true, and leaving it here made five stores look like pending
21993
+ * work when three of them have no vector at all. Counted column by column on
21994
+ * 2026-08-30, exactly THREE ever held one:
21995
+ *
21996
+ * - `object-clip` — 512-dim CLIP image embedding, migrated 2026-08-06.
21997
+ * - `faces.embedding` — 512-dim ArcFace face embedding, migrated 2026-08-30.
21998
+ * - `identity-samples.embedding` — the same ArcFace vector for an ENROLLED
21999
+ * face, migrated 2026-08-30 into its OWN index (see below).
22000
+ *
22001
+ * `plates` and `vehicle-samples` store a plate STRING and a score; `vehicles`
22002
+ * and `identities` store a name; the event store stores no derivative vector.
22003
+ * They are not migration candidates and never were.
22004
+ *
22005
+ * Measured on the live hub the JSON encoding cost ~11.7 KB per row (512 floats
22006
+ * as TEXT, `JSON.parse`d on every search) and made semantic search load 5,000
22007
+ * rows before ranking anything.
22008
+ *
22009
+ * ## One index per COMPARISON, never per encoder
22010
+ *
22011
+ * `faces` and `identity-samples` hold the same 512 ArcFace dims from the same
22012
+ * model, and they still get two indexes. An index is a set of things that are
22013
+ * ranked against each other and that live and die together, and these two are
22014
+ * neither: a `faces` row is TRACK-OWNED and cascades away with its track under
22015
+ * a per-camera capacity cap, an `identity-samples` row is retention-EXEMPT
22016
+ * forever and is the gallery every recognition ranks against. One index would
22017
+ * mean every gallery load and every reconcile carried a filter whose failure
22018
+ * mode is either ranking a candidate against itself or reclaiming an enrolled
22019
+ * person's only sample. The dimension they share is not a reason to share an
22020
+ * index; the question they answer is, and it differs.
21820
22021
  *
21821
22022
  * The fix is not a faster loop, it is a different backend — and the backend
21822
22023
  * should be replaceable without touching six callers. So: a singleton
@@ -21921,7 +22122,20 @@ var VectorQueryResultSchema = object({
21921
22122
  */
21922
22123
  scanned: number(),
21923
22124
  /** True when the backend could not consider every row that passed the filter. */
21924
- truncated: boolean()
22125
+ truncated: boolean(),
22126
+ /**
22127
+ * The `topK` the backend actually ran with.
22128
+ *
22129
+ * Every backend has a ceiling — sqlite-vec's is 4,096 — and a caller asking
22130
+ * past it used to learn nothing but a boolean, from a WARN in the provider's
22131
+ * own log rather than in its answer. That is how an audit asking for 20,000
22132
+ * consumed 4,096 and reported `examined: 4096` as if it had walked the index,
22133
+ * for weeks. `truncated` says THAT the answer was short; this says BY HOW
22134
+ * MUCH, in the return value, where the caller cannot fail to see it.
22135
+ *
22136
+ * Equals the requested `topK` whenever nothing was lowered.
22137
+ */
22138
+ effectiveTopK: number().int().positive()
21925
22139
  });
21926
22140
  var VectorDeleteInputSchema = object({
21927
22141
  index: string(),
@@ -21950,6 +22164,68 @@ var VectorGetResultSchema = object({ items: array(object({
21950
22164
  id: string(),
21951
22165
  metadata: VectorMetadataSchema
21952
22166
  })) });
22167
+ /**
22168
+ * Ids to read back WITH their vectors.
22169
+ *
22170
+ * The sibling of {@link VectorGetResultSchema}, and deliberately a separate
22171
+ * method rather than a flag on it: `getByIds` promises no vectors and its one
22172
+ * caller depends on that promise. This one promises the opposite.
22173
+ *
22174
+ * It exists because a store cannot put its vectors here otherwise. An ArcFace
22175
+ * gallery is ranked IN PROCESS, per detection, against every enrolled sample —
22176
+ * a per-face cross-process KNN would be a network round trip inside the
22177
+ * recognition loop. So the gallery is loaded once and held in RAM, and loading
22178
+ * it requires the index to hand the floats back. Without this method the only
22179
+ * way to keep a readable vector is a JSON column, which is the thing this
22180
+ * capability exists to delete.
22181
+ *
22182
+ * BOUNDED BY THE CALLER: ids are named, never "everything". Enumerating an
22183
+ * index is {@link VectorScanInputSchema}'s job, and it returns no vectors.
22184
+ */
22185
+ var VectorFetchInputSchema = object({
22186
+ index: string(),
22187
+ ids: array(string())
22188
+ });
22189
+ var VectorFetchResultSchema = object({ items: array(object({
22190
+ id: string(),
22191
+ /** base64 Float32LE — the same wire form `upsert` accepts. */
22192
+ vector: string(),
22193
+ metadata: VectorMetadataSchema
22194
+ })) });
22195
+ /**
22196
+ * ENUMERATE an index: one page of rows in a stable order, no ranking.
22197
+ *
22198
+ * A reconcile does not want the nearest rows, it wants ALL of them, and asking
22199
+ * a KNN for "all" is the wrong question twice over. It hits the backend's `k`
22200
+ * ceiling — 4,096 on sqlite-vec against a 22,128-row index — and it needs a
22201
+ * probe vector it does not have, so the audit passed a ZERO vector whose cosine
22202
+ * distance to every row is degenerate. `examined: 4096` then read as "we
22203
+ * looked" for as long as anyone cared to read it.
22204
+ *
22205
+ * This is the primitive that question actually needs: a bounded page, ordered
22206
+ * by the backend's own row order, costing no distance computation at all.
22207
+ * Vectors are NOT returned — an enumeration that shipped 2 KB per row would be
22208
+ * the full-table read this capability was built to stop.
22209
+ */
22210
+ var VectorScanInputSchema = object({
22211
+ index: string(),
22212
+ /** Opaque resume point. `0` starts at the top; pass back `nextCursor`. */
22213
+ cursor: number().int().nonnegative().default(0),
22214
+ limit: number().int().positive()
22215
+ });
22216
+ var VectorScanResultSchema = object({
22217
+ items: array(object({
22218
+ id: string(),
22219
+ metadata: VectorMetadataSchema
22220
+ })),
22221
+ /**
22222
+ * Where the next page starts, or `null` when the walk reached the end.
22223
+ *
22224
+ * `null` is the ONLY end-of-index signal. A caller must not infer the end
22225
+ * from a short page: a backend is free to return fewer rows than asked.
22226
+ */
22227
+ nextCursor: number().int().nonnegative().nullable()
22228
+ });
21953
22229
  var VectorStatsInputSchema = object({ index: string() });
21954
22230
  var VectorStatsResultSchema = object({
21955
22231
  /** Provider id, so an operator can tell brute force from an ANN index. */
@@ -21968,7 +22244,7 @@ method(VectorDeclareIndexInputSchema, _void(), {
21968
22244
  }), method(VectorUpsertInputSchema, VectorUpsertResultSchema, {
21969
22245
  kind: "mutation",
21970
22246
  auth: "admin"
21971
- }), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
22247
+ }), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorFetchInputSchema, VectorFetchResultSchema, { auth: "admin" }), method(VectorScanInputSchema, VectorScanResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
21972
22248
  kind: "mutation",
21973
22249
  auth: "admin"
21974
22250
  }), method(VectorDeleteByFilterInputSchema, VectorDeleteResultSchema, {
@@ -28676,6 +28952,9 @@ method(object({
28676
28952
  }), method(object({}), array(RelocateJobSchema).readonly(), {
28677
28953
  kind: "query",
28678
28954
  auth: "admin"
28955
+ }), method(RelocateResidueInputSchema, RelocateResidueSchema, {
28956
+ kind: "query",
28957
+ auth: "admin"
28679
28958
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
28680
28959
  kind: "mutation",
28681
28960
  auth: "admin"
@@ -35310,6 +35589,12 @@ Object.freeze({
35310
35589
  addonId: null,
35311
35590
  access: "create"
35312
35591
  },
35592
+ "pipelineAnalytics.countRelocatableMedia": {
35593
+ capName: "pipeline-analytics",
35594
+ capScope: "device",
35595
+ addonId: null,
35596
+ access: "view"
35597
+ },
35313
35598
  "pipelineAnalytics.countUnstampedEventMedia": {
35314
35599
  capName: "pipeline-analytics",
35315
35600
  capScope: "device",
@@ -36474,6 +36759,12 @@ Object.freeze({
36474
36759
  addonId: null,
36475
36760
  access: "view"
36476
36761
  },
36762
+ "recording.getRelocateResidue": {
36763
+ capName: "recording",
36764
+ capScope: "system",
36765
+ addonId: null,
36766
+ access: "view"
36767
+ },
36477
36768
  "recording.getStorageMigrationMoveStatus": {
36478
36769
  capName: "recording",
36479
36770
  capScope: "system",
@@ -37020,12 +37311,30 @@ Object.freeze({
37020
37311
  addonId: null,
37021
37312
  access: "create"
37022
37313
  },
37314
+ "storageMigration.drain": {
37315
+ capName: "storage-migration",
37316
+ capScope: "system",
37317
+ addonId: null,
37318
+ access: "create"
37319
+ },
37320
+ "storageMigration.movers": {
37321
+ capName: "storage-migration",
37322
+ capScope: "system",
37323
+ addonId: null,
37324
+ access: "view"
37325
+ },
37023
37326
  "storageMigration.plan": {
37024
37327
  capName: "storage-migration",
37025
37328
  capScope: "system",
37026
37329
  addonId: null,
37027
37330
  access: "view"
37028
37331
  },
37332
+ "storageMigration.residue": {
37333
+ capName: "storage-migration",
37334
+ capScope: "system",
37335
+ addonId: null,
37336
+ access: "view"
37337
+ },
37029
37338
  "storageMigration.start": {
37030
37339
  capName: "storage-migration",
37031
37340
  capScope: "system",
@@ -37860,6 +38169,12 @@ Object.freeze({
37860
38169
  addonId: null,
37861
38170
  access: "delete"
37862
38171
  },
38172
+ "vectorStore.fetchByIds": {
38173
+ capName: "vector-store",
38174
+ capScope: "system",
38175
+ addonId: null,
38176
+ access: "view"
38177
+ },
37863
38178
  "vectorStore.getByIds": {
37864
38179
  capName: "vector-store",
37865
38180
  capScope: "system",
@@ -37872,6 +38187,12 @@ Object.freeze({
37872
38187
  addonId: null,
37873
38188
  access: "view"
37874
38189
  },
38190
+ "vectorStore.scan": {
38191
+ capName: "vector-store",
38192
+ capScope: "system",
38193
+ addonId: null,
38194
+ access: "view"
38195
+ },
37875
38196
  "vectorStore.stats": {
37876
38197
  capName: "vector-store",
37877
38198
  capScope: "system",
@@ -8367,13 +8367,49 @@ var StorageMigrationParticipantSchema = _enum([
8367
8367
  "recorder",
8368
8368
  "analytics"
8369
8369
  ]);
8370
+ /**
8371
+ * The mover's own numbers, folded onto the coordinator's durable move record.
8372
+ *
8373
+ * The long half of a non-blocking migration is `draining`, and it is measured
8374
+ * in hours: 136 885 files at ~4 MB/s is about five of them. Before this shape
8375
+ * existed the only place those numbers appeared was a Loki line, so an operator
8376
+ * watching the Admin UI saw `phase: draining` and nothing else for a whole
8377
+ * afternoon.
8378
+ *
8379
+ * It is POLLED, never pushed. Events are telemetry and may be dropped
8380
+ * (D8/D11), and a dropped progress event is indistinguishable from a stalled
8381
+ * mover — which is the exact failure this is meant to end. The coordinator's
8382
+ * `waitForMoves` already fetches the whole {@link RelocateJob} on every tick to
8383
+ * read `state`; folding the counters costs no extra read and makes the durable
8384
+ * record say afterwards how far a move actually got.
8385
+ *
8386
+ * `filesTotal` is `null` for "no honest denominator" and is never zero-filled:
8387
+ * a windowed footage job (`sinceMs`) and a node with no ledger both genuinely
8388
+ * cannot say M, and a 0 there would render as "100 % done".
8389
+ */
8390
+ var StorageMigrationMoveProgressSchema = object({
8391
+ filesMoved: number().int().nonnegative(),
8392
+ /** The archive census — the **M** of "N of M" (D295). `null` = unknowable. */
8393
+ filesTotal: number().int().nonnegative().nullable(),
8394
+ bytesMoved: number().int().nonnegative(),
8395
+ /** The MOVER's start, not the migration's: a drain restarted after an addon
8396
+ * crash gets a new mover, and a rate computed from the migration's start
8397
+ * would silently average in the time nothing was running. */
8398
+ startedAt: number(),
8399
+ /** When the coordinator last read these numbers. Paired with `startedAt` it
8400
+ * is the only honest rate: both clocks are the hub's, so a UI never has to
8401
+ * subtract its own. */
8402
+ observedAt: number()
8403
+ });
8370
8404
  var StorageMigrationMoveSchema = object({
8371
8405
  storageClass: StorageMigrationClassSchema,
8372
8406
  fromLocationId: string(),
8373
8407
  toLocationId: string(),
8374
8408
  moverJobId: string().nullable(),
8375
8409
  state: RelocateJobStateSchema.nullable(),
8376
- error: string().nullable()
8410
+ error: string().nullable(),
8411
+ /** Last observed mover counters; `null` until the mover has been polled once. */
8412
+ progress: StorageMigrationMoveProgressSchema.nullable()
8377
8413
  });
8378
8414
  var StorageMigrationJobSchema = object({
8379
8415
  jobId: string(),
@@ -8419,6 +8455,98 @@ var StorageMigrationPlanSchema = object({
8419
8455
  findings: array(StorageMigrationFindingSchema)
8420
8456
  });
8421
8457
  /**
8458
+ * A mover as it exists RIGHT NOW, whether or not a migration job owns it.
8459
+ *
8460
+ * The coordinator's job record is the state of record for a migration, and its
8461
+ * moves carry {@link StorageMigrationMoveProgress}. But the movers are usable
8462
+ * standalone — `recording.relocateFootage` and `pipelineAnalytics.relocateMedia`
8463
+ * are both operator-callable, and on 2026-08-29 a five-hour drain was armed that
8464
+ * way because no supported UI path existed. A mover armed like that has no job
8465
+ * to fold progress into, so it has to be readable on its own or it is invisible.
8466
+ *
8467
+ * `migrationJobId` is what tells the two apart: `null` means nothing here
8468
+ * orchestrated it.
8469
+ */
8470
+ var StorageMigrationMoverSchema = object({
8471
+ lane: _enum(["footage", "media"]),
8472
+ job: RelocateJobSchema,
8473
+ /** The coordinator job that armed this mover, or `null` for a mover armed
8474
+ * directly against the owning addon. */
8475
+ migrationJobId: string().nullable(),
8476
+ /** When the hub read these counters. Stamped here so a rate is `bytesMoved`
8477
+ * over (`observedAt` − `job.startedAt`) with BOTH ends on the hub's clock —
8478
+ * a browser subtracting its own `Date.now()` from a server `startedAt` is a
8479
+ * rate made of two different clocks. */
8480
+ observedAt: number()
8481
+ });
8482
+ /**
8483
+ * What a SOURCE still holds for one storage class — the number that makes a
8484
+ * "drain remaining" action honest rather than hopeful.
8485
+ *
8486
+ * It comes from the archive (`SegmentHourLedger.census` for footage, the media
8487
+ * engine's own selection count for media), never from the resident index: a
8488
+ * drain sized off `RecordingIndex` is what reported `done` over 80.3 GB it had
8489
+ * never been told about (D295).
8490
+ *
8491
+ * `items`/`bytes` are `null` for "the archive could not be asked", which is
8492
+ * deliberately NOT zero: a drain is still offered for an unknown residue,
8493
+ * because refusing on an unanswerable read would hide exactly the case an
8494
+ * operator needs to act on.
8495
+ */
8496
+ var StorageMigrationResidueSchema = object({
8497
+ storageClass: StorageMigrationClassSchema,
8498
+ /** The location still holding the data. `'*'` for the media lane, whose rows
8499
+ * move from wherever they are rather than from one named source. */
8500
+ fromLocationId: string(),
8501
+ /** Where a drain would move it — the class's CURRENT default. */
8502
+ toLocationId: string(),
8503
+ /** Segments (footage lane) or rows (media lane) still on the source. */
8504
+ items: number().int().nonnegative().nullable(),
8505
+ /** Bytes on the source; `null` when the lane counts rows rather than bytes. */
8506
+ bytes: number().int().nonnegative().nullable()
8507
+ });
8508
+ /**
8509
+ * Run the DRAIN half and nothing else.
8510
+ *
8511
+ * A migration that reached `done` has already repointed, so `start` correctly
8512
+ * refuses its destination ("already the default") — there is nothing left to
8513
+ * repoint. But the drain can fail, be cancelled, be interrupted by a restart,
8514
+ * or finish against a work list that was a tenth of the archive (D295), and
8515
+ * before this there was no supported way to run only that half: the only way
8516
+ * through was calling `recording.relocateFootage` by hand over admin tRPC.
8517
+ *
8518
+ * `drain` NEVER calls `setDefaultLocations`. That is what keeps `start`'s
8519
+ * refusal meaningful: the two verbs are disjoint, so nothing here can silently
8520
+ * re-repoint a class that is already migrated.
8521
+ */
8522
+ var StorageMigrationDrainInputSchema = object({
8523
+ /** The classes to drain. Each must appear in `storageMigration.residue`, so
8524
+ * a class whose source is already empty is refused rather than started. */
8525
+ classes: array(StorageMigrationClassSchema).min(1),
8526
+ throttleMbps: number().min(1).max(1e3).optional()
8527
+ });
8528
+ /** What a footage source still holds, asked of the durable hour ledger. */
8529
+ var RelocateResidueInputSchema = object({
8530
+ fromLocationId: string().min(1),
8531
+ /** Narrow to one logical class; omit for every profile on the location. */
8532
+ footageClass: RelocateFootageClassSchema.optional()
8533
+ });
8534
+ /** `null` = the archive could not answer (no ledger on this node, or the
8535
+ * aggregate failed). Never conflated with an empty source. */
8536
+ var RelocateResidueSchema = object({
8537
+ segments: number().int().nonnegative(),
8538
+ bytes: number().int().nonnegative()
8539
+ }).nullable();
8540
+ /** How many rows a media pass would still act on against a given target — the
8541
+ * media lane's denominator AND its residue, from ONE derivation so the two can
8542
+ * never disagree. `null` = the count could not be taken. */
8543
+ var RelocatableMediaCountSchema = object({ rows: number().int().nonnegative() }).nullable();
8544
+ var RelocatableMediaCountInputSchema = object({
8545
+ toLocationId: string().min(1),
8546
+ /** Omitted = `move`. */
8547
+ mode: MediaRelocateModeSchema.optional()
8548
+ });
8549
+ /**
8422
8550
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8423
8551
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8424
8552
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8522,6 +8650,32 @@ var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(
8522
8650
  * two addons declaring the same `id` must agree on `cardinality` (validated
8523
8651
  * at kernel aggregation time, not here).
8524
8652
  */
8653
+ /**
8654
+ * `StorageAccess` — how the service that DECLARED a storage-location kind
8655
+ * actually reaches the bytes. It is the constraint that decides which
8656
+ * `storage-provider`s may back a location of that kind.
8657
+ *
8658
+ * - `'local-path'` — the service asks `storage.resolve` for a path string and
8659
+ * then does its own `node:fs` I/O on it (the recorder's segment writer, the
8660
+ * post-analysis media roots). Only a provider that serves a genuine local
8661
+ * filesystem (`getProviderInfo().nodeLocal === true`) can satisfy that: a
8662
+ * remote provider's `resolve` returns a path on the REMOTE host, and
8663
+ * `fs.readdir` of it on this node either fails or — far worse — succeeds
8664
+ * against a same-named local directory that is something else entirely.
8665
+ *
8666
+ * - `'cap-mediated'` — every byte travels through the `storage` cap
8667
+ * (`read`/`write`, or `beginUpload`/`writeChunk`/`finalizeUpload`). The
8668
+ * service never sees a path, so any provider can back it. `backups` is the
8669
+ * one kind that qualifies today.
8670
+ *
8671
+ * Before this existed, `recordings` was unreachable by SFTP/S3/WebDAV only as
8672
+ * an EMERGENT property of how the recorder happened to be written. Nothing
8673
+ * refused the configuration; the first write simply went somewhere wrong, and
8674
+ * a recording write that goes wrong surfaces as a silent black window rather
8675
+ * than an error (the read path does not `stat`). This turns that accident into
8676
+ * a declared, enforced, testable refusal.
8677
+ */
8678
+ var StorageAccessSchema = _enum(["local-path", "cap-mediated"]);
8525
8679
  var StorageLocationDeclarationSchema = object({
8526
8680
  /**
8527
8681
  * Global location identifier, e.g. `recordings` or `recordingsLow`.
@@ -8541,6 +8695,19 @@ var StorageLocationDeclarationSchema = object({
8541
8695
  */
8542
8696
  cardinality: _enum(["single", "multi"]),
8543
8697
  /**
8698
+ * HOW the declaring service reaches the bytes — and therefore WHICH
8699
+ * providers may back a location of this kind. See {@link StorageAccessSchema}
8700
+ * and {@link STORAGE_ACCESS_FALLBACK}.
8701
+ *
8702
+ * Absent means `'local-path'`. That default is FAIL-CLOSED on purpose: it
8703
+ * can only over-restrict (refuse a remote provider for a kind that might
8704
+ * have coped) and never under-restrict. Declaring `'cap-mediated'` is the
8705
+ * permissive direction and is therefore never inferred — a repo guard
8706
+ * (`scripts/check-storage-access-declarations.ts`) refuses to let it be
8707
+ * reached by omission.
8708
+ */
8709
+ access: StorageAccessSchema.optional(),
8710
+ /**
8544
8711
  * When set, the default instance for this location inherits its resolved
8545
8712
  * root from the named location's default instance. Useful for derivative
8546
8713
  * slots (e.g. `recordingsLow` → `recordings`) so operators only need to
@@ -18593,8 +18760,10 @@ var TrackSchema = object({
18593
18760
  lastSeen: number(),
18594
18761
  /** Frame-rate position history (subject to maxPositionHistory cap). */
18595
18762
  positions: array(TrackPositionSchema).readonly(),
18596
- /** Periodic snapshots at snapshotIntervalMs cadence (subject to
18597
- * saveThumbnails policy). */
18763
+ /** Periodic snapshots at snapshotIntervalMs cadence DEBUG media, produced
18764
+ * only while `MediaSettings.debugMediaEnabled` is on for the camera (D299;
18765
+ * the retired `saveThumbnails` used to gate this and the rolling
18766
+ * `lastFrame` together). Empty is the healthy default, not a capture gap. */
18598
18767
  snapshots: array(TrackSnapshotSchema).readonly(),
18599
18768
  /** Deduplicated zones the track has entered at least once. Zone IDS. */
18600
18769
  zonesVisited: array(string()).readonly(),
@@ -19454,7 +19623,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19454
19623
  }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
19455
19624
  kind: "mutation",
19456
19625
  auth: "admin"
19457
- }), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(object({}), array(RelocateJobSchema).readonly(), {
19626
+ }), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(RelocatableMediaCountInputSchema, RelocatableMediaCountSchema, {
19627
+ kind: "query",
19628
+ auth: "admin"
19629
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
19458
19630
  kind: "query",
19459
19631
  auth: "admin"
19460
19632
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
@@ -21413,6 +21585,9 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
21413
21585
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
21414
21586
  kind: "mutation",
21415
21587
  auth: "admin"
21588
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
21589
+ kind: "mutation",
21590
+ auth: "admin"
21416
21591
  });
21417
21592
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
21418
21593
  providerId: string().min(1),
@@ -21811,12 +21986,38 @@ response: record(string(), unknown()) }), object({
21811
21986
  *
21812
21987
  * ## Why this is a capability and not a helper
21813
21988
  *
21814
- * Six stores in `addon-post-analysis` already hold vectors object CLIP, face,
21815
- * plate, vehicle, identity, and the event store's derivativesand every one of
21816
- * them keeps its vectors in a `JSON` settings-store column and ranks them by
21817
- * brute-force cosine in JS. Measured on the live hub that costs ~11.7 KB per row
21818
- * (512 floats as TEXT, `JSON.parse`d on every search) and made semantic search
21819
- * load 5,000 rows before ranking anything.
21989
+ * This capability was introduced with the claim that SIX stores in
21990
+ * `addon-post-analysis` held vectors in a `JSON` settings-store columnobject
21991
+ * CLIP, face, plate, vehicle, identity, and the event store's derivatives. That
21992
+ * claim was never true, and leaving it here made five stores look like pending
21993
+ * work when three of them have no vector at all. Counted column by column on
21994
+ * 2026-08-30, exactly THREE ever held one:
21995
+ *
21996
+ * - `object-clip` — 512-dim CLIP image embedding, migrated 2026-08-06.
21997
+ * - `faces.embedding` — 512-dim ArcFace face embedding, migrated 2026-08-30.
21998
+ * - `identity-samples.embedding` — the same ArcFace vector for an ENROLLED
21999
+ * face, migrated 2026-08-30 into its OWN index (see below).
22000
+ *
22001
+ * `plates` and `vehicle-samples` store a plate STRING and a score; `vehicles`
22002
+ * and `identities` store a name; the event store stores no derivative vector.
22003
+ * They are not migration candidates and never were.
22004
+ *
22005
+ * Measured on the live hub the JSON encoding cost ~11.7 KB per row (512 floats
22006
+ * as TEXT, `JSON.parse`d on every search) and made semantic search load 5,000
22007
+ * rows before ranking anything.
22008
+ *
22009
+ * ## One index per COMPARISON, never per encoder
22010
+ *
22011
+ * `faces` and `identity-samples` hold the same 512 ArcFace dims from the same
22012
+ * model, and they still get two indexes. An index is a set of things that are
22013
+ * ranked against each other and that live and die together, and these two are
22014
+ * neither: a `faces` row is TRACK-OWNED and cascades away with its track under
22015
+ * a per-camera capacity cap, an `identity-samples` row is retention-EXEMPT
22016
+ * forever and is the gallery every recognition ranks against. One index would
22017
+ * mean every gallery load and every reconcile carried a filter whose failure
22018
+ * mode is either ranking a candidate against itself or reclaiming an enrolled
22019
+ * person's only sample. The dimension they share is not a reason to share an
22020
+ * index; the question they answer is, and it differs.
21820
22021
  *
21821
22022
  * The fix is not a faster loop, it is a different backend — and the backend
21822
22023
  * should be replaceable without touching six callers. So: a singleton
@@ -21921,7 +22122,20 @@ var VectorQueryResultSchema = object({
21921
22122
  */
21922
22123
  scanned: number(),
21923
22124
  /** True when the backend could not consider every row that passed the filter. */
21924
- truncated: boolean()
22125
+ truncated: boolean(),
22126
+ /**
22127
+ * The `topK` the backend actually ran with.
22128
+ *
22129
+ * Every backend has a ceiling — sqlite-vec's is 4,096 — and a caller asking
22130
+ * past it used to learn nothing but a boolean, from a WARN in the provider's
22131
+ * own log rather than in its answer. That is how an audit asking for 20,000
22132
+ * consumed 4,096 and reported `examined: 4096` as if it had walked the index,
22133
+ * for weeks. `truncated` says THAT the answer was short; this says BY HOW
22134
+ * MUCH, in the return value, where the caller cannot fail to see it.
22135
+ *
22136
+ * Equals the requested `topK` whenever nothing was lowered.
22137
+ */
22138
+ effectiveTopK: number().int().positive()
21925
22139
  });
21926
22140
  var VectorDeleteInputSchema = object({
21927
22141
  index: string(),
@@ -21950,6 +22164,68 @@ var VectorGetResultSchema = object({ items: array(object({
21950
22164
  id: string(),
21951
22165
  metadata: VectorMetadataSchema
21952
22166
  })) });
22167
+ /**
22168
+ * Ids to read back WITH their vectors.
22169
+ *
22170
+ * The sibling of {@link VectorGetResultSchema}, and deliberately a separate
22171
+ * method rather than a flag on it: `getByIds` promises no vectors and its one
22172
+ * caller depends on that promise. This one promises the opposite.
22173
+ *
22174
+ * It exists because a store cannot put its vectors here otherwise. An ArcFace
22175
+ * gallery is ranked IN PROCESS, per detection, against every enrolled sample —
22176
+ * a per-face cross-process KNN would be a network round trip inside the
22177
+ * recognition loop. So the gallery is loaded once and held in RAM, and loading
22178
+ * it requires the index to hand the floats back. Without this method the only
22179
+ * way to keep a readable vector is a JSON column, which is the thing this
22180
+ * capability exists to delete.
22181
+ *
22182
+ * BOUNDED BY THE CALLER: ids are named, never "everything". Enumerating an
22183
+ * index is {@link VectorScanInputSchema}'s job, and it returns no vectors.
22184
+ */
22185
+ var VectorFetchInputSchema = object({
22186
+ index: string(),
22187
+ ids: array(string())
22188
+ });
22189
+ var VectorFetchResultSchema = object({ items: array(object({
22190
+ id: string(),
22191
+ /** base64 Float32LE — the same wire form `upsert` accepts. */
22192
+ vector: string(),
22193
+ metadata: VectorMetadataSchema
22194
+ })) });
22195
+ /**
22196
+ * ENUMERATE an index: one page of rows in a stable order, no ranking.
22197
+ *
22198
+ * A reconcile does not want the nearest rows, it wants ALL of them, and asking
22199
+ * a KNN for "all" is the wrong question twice over. It hits the backend's `k`
22200
+ * ceiling — 4,096 on sqlite-vec against a 22,128-row index — and it needs a
22201
+ * probe vector it does not have, so the audit passed a ZERO vector whose cosine
22202
+ * distance to every row is degenerate. `examined: 4096` then read as "we
22203
+ * looked" for as long as anyone cared to read it.
22204
+ *
22205
+ * This is the primitive that question actually needs: a bounded page, ordered
22206
+ * by the backend's own row order, costing no distance computation at all.
22207
+ * Vectors are NOT returned — an enumeration that shipped 2 KB per row would be
22208
+ * the full-table read this capability was built to stop.
22209
+ */
22210
+ var VectorScanInputSchema = object({
22211
+ index: string(),
22212
+ /** Opaque resume point. `0` starts at the top; pass back `nextCursor`. */
22213
+ cursor: number().int().nonnegative().default(0),
22214
+ limit: number().int().positive()
22215
+ });
22216
+ var VectorScanResultSchema = object({
22217
+ items: array(object({
22218
+ id: string(),
22219
+ metadata: VectorMetadataSchema
22220
+ })),
22221
+ /**
22222
+ * Where the next page starts, or `null` when the walk reached the end.
22223
+ *
22224
+ * `null` is the ONLY end-of-index signal. A caller must not infer the end
22225
+ * from a short page: a backend is free to return fewer rows than asked.
22226
+ */
22227
+ nextCursor: number().int().nonnegative().nullable()
22228
+ });
21953
22229
  var VectorStatsInputSchema = object({ index: string() });
21954
22230
  var VectorStatsResultSchema = object({
21955
22231
  /** Provider id, so an operator can tell brute force from an ANN index. */
@@ -21968,7 +22244,7 @@ method(VectorDeclareIndexInputSchema, _void(), {
21968
22244
  }), method(VectorUpsertInputSchema, VectorUpsertResultSchema, {
21969
22245
  kind: "mutation",
21970
22246
  auth: "admin"
21971
- }), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
22247
+ }), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorFetchInputSchema, VectorFetchResultSchema, { auth: "admin" }), method(VectorScanInputSchema, VectorScanResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
21972
22248
  kind: "mutation",
21973
22249
  auth: "admin"
21974
22250
  }), method(VectorDeleteByFilterInputSchema, VectorDeleteResultSchema, {
@@ -28676,6 +28952,9 @@ method(object({
28676
28952
  }), method(object({}), array(RelocateJobSchema).readonly(), {
28677
28953
  kind: "query",
28678
28954
  auth: "admin"
28955
+ }), method(RelocateResidueInputSchema, RelocateResidueSchema, {
28956
+ kind: "query",
28957
+ auth: "admin"
28679
28958
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
28680
28959
  kind: "mutation",
28681
28960
  auth: "admin"
@@ -35310,6 +35589,12 @@ Object.freeze({
35310
35589
  addonId: null,
35311
35590
  access: "create"
35312
35591
  },
35592
+ "pipelineAnalytics.countRelocatableMedia": {
35593
+ capName: "pipeline-analytics",
35594
+ capScope: "device",
35595
+ addonId: null,
35596
+ access: "view"
35597
+ },
35313
35598
  "pipelineAnalytics.countUnstampedEventMedia": {
35314
35599
  capName: "pipeline-analytics",
35315
35600
  capScope: "device",
@@ -36474,6 +36759,12 @@ Object.freeze({
36474
36759
  addonId: null,
36475
36760
  access: "view"
36476
36761
  },
36762
+ "recording.getRelocateResidue": {
36763
+ capName: "recording",
36764
+ capScope: "system",
36765
+ addonId: null,
36766
+ access: "view"
36767
+ },
36477
36768
  "recording.getStorageMigrationMoveStatus": {
36478
36769
  capName: "recording",
36479
36770
  capScope: "system",
@@ -37020,12 +37311,30 @@ Object.freeze({
37020
37311
  addonId: null,
37021
37312
  access: "create"
37022
37313
  },
37314
+ "storageMigration.drain": {
37315
+ capName: "storage-migration",
37316
+ capScope: "system",
37317
+ addonId: null,
37318
+ access: "create"
37319
+ },
37320
+ "storageMigration.movers": {
37321
+ capName: "storage-migration",
37322
+ capScope: "system",
37323
+ addonId: null,
37324
+ access: "view"
37325
+ },
37023
37326
  "storageMigration.plan": {
37024
37327
  capName: "storage-migration",
37025
37328
  capScope: "system",
37026
37329
  addonId: null,
37027
37330
  access: "view"
37028
37331
  },
37332
+ "storageMigration.residue": {
37333
+ capName: "storage-migration",
37334
+ capScope: "system",
37335
+ addonId: null,
37336
+ access: "view"
37337
+ },
37029
37338
  "storageMigration.start": {
37030
37339
  capName: "storage-migration",
37031
37340
  capScope: "system",
@@ -37860,6 +38169,12 @@ Object.freeze({
37860
38169
  addonId: null,
37861
38170
  access: "delete"
37862
38171
  },
38172
+ "vectorStore.fetchByIds": {
38173
+ capName: "vector-store",
38174
+ capScope: "system",
38175
+ addonId: null,
38176
+ access: "view"
38177
+ },
37863
38178
  "vectorStore.getByIds": {
37864
38179
  capName: "vector-store",
37865
38180
  capScope: "system",
@@ -37872,6 +38187,12 @@ Object.freeze({
37872
38187
  addonId: null,
37873
38188
  access: "view"
37874
38189
  },
38190
+ "vectorStore.scan": {
38191
+ capName: "vector-store",
38192
+ capScope: "system",
38193
+ addonId: null,
38194
+ access: "view"
38195
+ },
37875
38196
  "vectorStore.stats": {
37876
38197
  capName: "vector-store",
37877
38198
  capScope: "system",
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  //#endregion
6
- const require_dist = require("../dist-DuEiH0D0.js");
6
+ const require_dist = require("../dist-DjxuSmvp.js");
7
7
  let node_crypto = require("node:crypto");
8
8
  //#region src/ha-export/topics.ts
9
9
  /**
@@ -1,4 +1,4 @@
1
- import { At as EventCategory, C as buildAddonRouteProvider, Et as string, N as deviceExportCapability, X as oauthIntegrationCapability, a as COCO_TO_MACRO, c as FanDirectionSchema, i as CAMERA_SWITCH_ORDER, l as HvacModeSchema, o as CameraSwitchIdSchema, p as addonRoutesCapability, pt as BaseAddon, t as AlarmArmModeSchema, u as MediaPlayerRepeatSchema, vt as nodePin } from "../dist-DQlMgQbg.mjs";
1
+ import { At as EventCategory, C as buildAddonRouteProvider, Et as string, N as deviceExportCapability, X as oauthIntegrationCapability, a as COCO_TO_MACRO, c as FanDirectionSchema, i as CAMERA_SWITCH_ORDER, l as HvacModeSchema, o as CameraSwitchIdSchema, p as addonRoutesCapability, pt as BaseAddon, t as AlarmArmModeSchema, u as MediaPlayerRepeatSchema, vt as nodePin } from "../dist-CCHqsqE6.mjs";
2
2
  import { createHmac, timingSafeEqual } from "node:crypto";
3
3
  //#region src/ha-export/topics.ts
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-homeassistant",
3
- "version": "1.2.56",
3
+ "version": "1.2.58",
4
4
  "description": "Home Assistant device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",