@camstack/addon-remote-storage 1.2.42 → 1.2.45

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/index.js CHANGED
@@ -2,9 +2,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_sftp_addon = require("./sftp.addon.js");
3
3
  const require_s3_addon = require("./s3.addon.js");
4
4
  const require_webdav_addon = require("./webdav.addon.js");
5
+ const require_smb_addon = require("./smb.addon.js");
5
6
  exports.S3StorageAddon = require_s3_addon.S3StorageAddon;
6
7
  exports.S3StorageProvider = require_s3_addon.S3StorageProvider;
7
8
  exports.SftpStorageAddon = require_sftp_addon.SftpStorageAddon;
8
9
  exports.SftpStorageProvider = require_sftp_addon.SftpStorageProvider;
10
+ exports.SmbBinaryUnavailableError = require_smb_addon.SmbBinaryUnavailableError;
11
+ exports.SmbStorageAddon = require_smb_addon.SmbStorageAddon;
12
+ exports.SmbStorageProvider = require_smb_addon.SmbStorageProvider;
9
13
  exports.WebDavStorageAddon = require_webdav_addon.WebDavStorageAddon;
10
14
  exports.WebDavStorageProvider = require_webdav_addon.WebDavStorageProvider;
package/dist/index.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import { SftpStorageAddon, t as SftpStorageProvider } from "./sftp.addon.mjs";
2
2
  import { S3StorageAddon, t as S3StorageProvider } from "./s3.addon.mjs";
3
3
  import { WebDavStorageAddon, t as WebDavStorageProvider } from "./webdav.addon.mjs";
4
- export { S3StorageAddon, S3StorageProvider, SftpStorageAddon, SftpStorageProvider, WebDavStorageAddon, WebDavStorageProvider };
4
+ import { SmbStorageAddon, n as SmbBinaryUnavailableError, t as SmbStorageProvider } from "./smb.addon.mjs";
5
+ export { S3StorageAddon, S3StorageProvider, SftpStorageAddon, SftpStorageProvider, SmbBinaryUnavailableError, SmbStorageAddon, SmbStorageProvider, WebDavStorageAddon, WebDavStorageProvider };
package/dist/s3.addon.js CHANGED
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_shared = require("./shared-DSJ7V_r6.js");
5
+ const require_shared = require("./shared-BHqbklNT.js");
6
6
  let node_stream = require("node:stream");
7
7
  let _aws_sdk_client_s3 = require("@aws-sdk/client-s3");
8
8
  let _aws_sdk_lib_storage = require("@aws-sdk/lib-storage");
package/dist/s3.addon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { c as BaseAddon, i as rearmIdleAbort, n as getOptionalBasePath, o as scheduleIdleAbort, s as storageProviderCapability, t as createSessionId } from "./shared-8LifrPLV.mjs";
1
+ import { c as BaseAddon, i as rearmIdleAbort, n as getOptionalBasePath, o as scheduleIdleAbort, s as storageProviderCapability, t as createSessionId } from "./shared-CSwUP1hZ.mjs";
2
2
  import { PassThrough } from "node:stream";
3
3
  import { DeleteObjectCommand, GetObjectCommand, HeadBucketCommand, HeadObjectCommand, ListObjectsV2Command, PutObjectCommand, S3Client } from "@aws-sdk/client-s3";
4
4
  import { Upload } from "@aws-sdk/lib-storage";
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_shared = require("./shared-DSJ7V_r6.js");
5
+ const require_shared = require("./shared-BHqbklNT.js");
6
6
  let ssh2 = require("ssh2");
7
7
  let node_path = require("node:path");
8
8
  node_path = require_shared.__toESM(node_path);
@@ -12,7 +12,9 @@ node_path = require_shared.__toESM(node_path);
12
12
  * form in the admin UI.
13
13
  *
14
14
  * Field shape mirrors the rest of the addon ecosystem:
15
- * - secrets use `type: 'password'` so the UI redacts them
15
+ * - secrets use `type: 'password'` so the UI masks them, and any secret that
16
+ * is NOT a password input carries `secret: true` — `type` alone drives the
17
+ * widget, `isSecretConfigField` drives what leaves the process
16
18
  * - conditional visibility uses `showWhen` (NOT `hideUnless` — that's
17
19
  * not part of the ConfigField contract)
18
20
  * - `basePath` is required so we can enforce path-traversal guards
@@ -71,6 +73,7 @@ var SFTP_CONFIG_SCHEMA = { sections: [{
71
73
  key: "privateKey",
72
74
  label: "Private Key (PEM)",
73
75
  rows: 6,
76
+ secret: true,
74
77
  showWhen: {
75
78
  field: "authMethod",
76
79
  equals: "privateKey"
@@ -1,4 +1,4 @@
1
- import { a as safeJoinRemotePath, c as BaseAddon, i as rearmIdleAbort, o as scheduleIdleAbort, r as getRequiredBasePath, s as storageProviderCapability, t as createSessionId } from "./shared-8LifrPLV.mjs";
1
+ import { a as safeJoinRemotePath, c as BaseAddon, i as rearmIdleAbort, o as scheduleIdleAbort, r as getRequiredBasePath, s as storageProviderCapability, t as createSessionId } from "./shared-CSwUP1hZ.mjs";
2
2
  import { Client } from "ssh2";
3
3
  import * as path from "node:path";
4
4
  //#region src/providers/sftp/sftp-config-schema.ts
@@ -7,7 +7,9 @@ import * as path from "node:path";
7
7
  * form in the admin UI.
8
8
  *
9
9
  * Field shape mirrors the rest of the addon ecosystem:
10
- * - secrets use `type: 'password'` so the UI redacts them
10
+ * - secrets use `type: 'password'` so the UI masks them, and any secret that
11
+ * is NOT a password input carries `secret: true` — `type` alone drives the
12
+ * widget, `isSecretConfigField` drives what leaves the process
11
13
  * - conditional visibility uses `showWhen` (NOT `hideUnless` — that's
12
14
  * not part of the ConfigField contract)
13
15
  * - `basePath` is required so we can enforce path-traversal guards
@@ -66,6 +68,7 @@ var SFTP_CONFIG_SCHEMA = { sections: [{
66
68
  key: "privateKey",
67
69
  label: "Private Key (PEM)",
68
70
  rows: 6,
71
+ secret: true,
69
72
  showWhen: {
70
73
  field: "authMethod",
71
74
  equals: "privateKey"
@@ -8011,6 +8011,21 @@ var RelocateJobSchema = object({
8011
8011
  bytesMoved: number().int(),
8012
8012
  /** Total files discovered up front; null while (or when) unknown. */
8013
8013
  filesTotal: number().int().nullable(),
8014
+ /**
8015
+ * Rows this run CORRECTED while moving them — a durable mutation the move
8016
+ * made that nobody asked for, so it is reported where the operator reads the
8017
+ * job rather than only in a log line.
8018
+ *
8019
+ * A footage segment records its byte count in its own NAME, and the durable
8020
+ * hour row derives its aggregates from those names. A file that does not
8021
+ * match its name therefore makes the ledger's sums — and with them quota and
8022
+ * pressure eviction — wrong by the difference, and only a rename can fix it.
8023
+ * On 2026-08-30 one such row also stalled a 110 749-file drain permanently.
8024
+ *
8025
+ * Absent on lanes where the question has no meaning: a media blob's size is
8026
+ * in its row, not in its name, so `MediaRelocateEngine` never reconciles one.
8027
+ */
8028
+ rowsReconciled: number().int().nonnegative().optional(),
8014
8029
  startedAt: number(),
8015
8030
  finishedAt: number().nullable(),
8016
8031
  error: string().nullable()
@@ -8079,14 +8094,42 @@ var RelocateMediaInputSchema = object({
8079
8094
  /** Omitted = `move`, the pre-existing behaviour. */
8080
8095
  mode: MediaRelocateModeSchema.optional()
8081
8096
  });
8082
- /** How many rows still carry NO `locationId` — the population a repoint would
8083
- * silently re-aim at a disk that does not hold their bytes. Zero is the only
8084
- * value that permits a non-blocking `eventMedia` cutover. */
8085
- var UnstampedEventMediaCountSchema = object({
8086
- media: number().int().nonnegative(),
8087
- retrainFrames: number().int().nonnegative(),
8088
- total: number().int().nonnegative()
8097
+ /**
8098
+ * The unstamped population of ONE collection split, because the gate and the
8099
+ * operator ask two different questions and only one of them has to be cheap.
8100
+ *
8101
+ * `present` is the GATE: "is there at least one row that would be orphaned by a
8102
+ * repoint". It is a single indexed seek to the first matching row, so it stays
8103
+ * answerable on a saturated disk and answers in O(log n) precisely in the state
8104
+ * that matters — after a seal, when the population is empty.
8105
+ *
8106
+ * `rows` is the NUMBER, for the refusal message and the operator's sense of
8107
+ * scale. It is a second, indexed `COUNT(*)`, and `null` means **not
8108
+ * measurable** — never zero. `{ present: true, rows: null }` is a legitimate
8109
+ * and useful answer: "there are some, and this read could not say how many"
8110
+ * still refuses the cutover, which is the whole job.
8111
+ */
8112
+ var UnstampedRowsSchema = object({
8113
+ present: boolean(),
8114
+ rows: number().int().nonnegative().nullable()
8089
8115
  });
8116
+ /**
8117
+ * How many rows still carry NO `locationId` — the population a repoint would
8118
+ * silently re-aim at a disk that does not hold their bytes.
8119
+ *
8120
+ * **`null` = the count could not be taken**, and it is NOT permission to cut
8121
+ * over. The gate opens on a measured absence and on nothing else; an unread
8122
+ * collection and an empty one are different facts, and this repo has already
8123
+ * paid for conflating them (`RelocateResidueSchema`, D295).
8124
+ */
8125
+ var UnstampedEventMediaCountSchema = object({
8126
+ media: UnstampedRowsSchema,
8127
+ retrainFrames: UnstampedRowsSchema,
8128
+ /** True when EITHER collection holds one. The refusal reads this. */
8129
+ anyPresent: boolean(),
8130
+ /** Sum across both, or `null` when either lane could not be counted. */
8131
+ total: number().int().nonnegative().nullable()
8132
+ }).nullable();
8090
8133
  var StorageMigrationMediaMoveInputSchema = RelocateMediaInputSchema.extend({ leaseId: string().min(1) });
8091
8134
  /** The independently selectable logical storage classes — every class
8092
8135
  * `storage.listLocationDeclarations` reports, so an operator never meets a
@@ -8172,13 +8215,53 @@ var StorageMigrationParticipantSchema = _enum([
8172
8215
  "recorder",
8173
8216
  "analytics"
8174
8217
  ]);
8218
+ /**
8219
+ * The mover's own numbers, folded onto the coordinator's durable move record.
8220
+ *
8221
+ * The long half of a non-blocking migration is `draining`, and it is measured
8222
+ * in hours: 136 885 files at ~4 MB/s is about five of them. Before this shape
8223
+ * existed the only place those numbers appeared was a Loki line, so an operator
8224
+ * watching the Admin UI saw `phase: draining` and nothing else for a whole
8225
+ * afternoon.
8226
+ *
8227
+ * It is POLLED, never pushed. Events are telemetry and may be dropped
8228
+ * (D8/D11), and a dropped progress event is indistinguishable from a stalled
8229
+ * mover — which is the exact failure this is meant to end. The coordinator's
8230
+ * `waitForMoves` already fetches the whole {@link RelocateJob} on every tick to
8231
+ * read `state`; folding the counters costs no extra read and makes the durable
8232
+ * record say afterwards how far a move actually got.
8233
+ *
8234
+ * `filesTotal` is `null` for "no honest denominator" and is never zero-filled:
8235
+ * a windowed footage job (`sinceMs`) and a node with no ledger both genuinely
8236
+ * cannot say M, and a 0 there would render as "100 % done".
8237
+ */
8238
+ var StorageMigrationMoveProgressSchema = object({
8239
+ filesMoved: number().int().nonnegative(),
8240
+ /** The archive census — the **M** of "N of M" (D295). `null` = unknowable. */
8241
+ filesTotal: number().int().nonnegative().nullable(),
8242
+ bytesMoved: number().int().nonnegative(),
8243
+ /** Rows the mover corrected while moving them — see `RelocateJob`. Absent on
8244
+ * a lane that cannot reconcile. A migration that silently rewrote durable
8245
+ * rows would be the same failure as one that silently skipped them. */
8246
+ rowsReconciled: number().int().nonnegative().optional(),
8247
+ /** The MOVER's start, not the migration's: a drain restarted after an addon
8248
+ * crash gets a new mover, and a rate computed from the migration's start
8249
+ * would silently average in the time nothing was running. */
8250
+ startedAt: number(),
8251
+ /** When the coordinator last read these numbers. Paired with `startedAt` it
8252
+ * is the only honest rate: both clocks are the hub's, so a UI never has to
8253
+ * subtract its own. */
8254
+ observedAt: number()
8255
+ });
8175
8256
  var StorageMigrationMoveSchema = object({
8176
8257
  storageClass: StorageMigrationClassSchema,
8177
8258
  fromLocationId: string(),
8178
8259
  toLocationId: string(),
8179
8260
  moverJobId: string().nullable(),
8180
8261
  state: RelocateJobStateSchema.nullable(),
8181
- error: string().nullable()
8262
+ error: string().nullable(),
8263
+ /** Last observed mover counters; `null` until the mover has been polled once. */
8264
+ progress: StorageMigrationMoveProgressSchema.nullable()
8182
8265
  });
8183
8266
  var StorageMigrationJobSchema = object({
8184
8267
  jobId: string(),
@@ -8224,6 +8307,98 @@ var StorageMigrationPlanSchema = object({
8224
8307
  findings: array(StorageMigrationFindingSchema)
8225
8308
  });
8226
8309
  /**
8310
+ * A mover as it exists RIGHT NOW, whether or not a migration job owns it.
8311
+ *
8312
+ * The coordinator's job record is the state of record for a migration, and its
8313
+ * moves carry {@link StorageMigrationMoveProgress}. But the movers are usable
8314
+ * standalone — `recording.relocateFootage` and `pipelineAnalytics.relocateMedia`
8315
+ * are both operator-callable, and on 2026-08-29 a five-hour drain was armed that
8316
+ * way because no supported UI path existed. A mover armed like that has no job
8317
+ * to fold progress into, so it has to be readable on its own or it is invisible.
8318
+ *
8319
+ * `migrationJobId` is what tells the two apart: `null` means nothing here
8320
+ * orchestrated it.
8321
+ */
8322
+ var StorageMigrationMoverSchema = object({
8323
+ lane: _enum(["footage", "media"]),
8324
+ job: RelocateJobSchema,
8325
+ /** The coordinator job that armed this mover, or `null` for a mover armed
8326
+ * directly against the owning addon. */
8327
+ migrationJobId: string().nullable(),
8328
+ /** When the hub read these counters. Stamped here so a rate is `bytesMoved`
8329
+ * over (`observedAt` − `job.startedAt`) with BOTH ends on the hub's clock —
8330
+ * a browser subtracting its own `Date.now()` from a server `startedAt` is a
8331
+ * rate made of two different clocks. */
8332
+ observedAt: number()
8333
+ });
8334
+ /**
8335
+ * What a SOURCE still holds for one storage class — the number that makes a
8336
+ * "drain remaining" action honest rather than hopeful.
8337
+ *
8338
+ * It comes from the archive (`SegmentHourLedger.census` for footage, the media
8339
+ * engine's own selection count for media), never from the resident index: a
8340
+ * drain sized off `RecordingIndex` is what reported `done` over 80.3 GB it had
8341
+ * never been told about (D295).
8342
+ *
8343
+ * `items`/`bytes` are `null` for "the archive could not be asked", which is
8344
+ * deliberately NOT zero: a drain is still offered for an unknown residue,
8345
+ * because refusing on an unanswerable read would hide exactly the case an
8346
+ * operator needs to act on.
8347
+ */
8348
+ var StorageMigrationResidueSchema = object({
8349
+ storageClass: StorageMigrationClassSchema,
8350
+ /** The location still holding the data. `'*'` for the media lane, whose rows
8351
+ * move from wherever they are rather than from one named source. */
8352
+ fromLocationId: string(),
8353
+ /** Where a drain would move it — the class's CURRENT default. */
8354
+ toLocationId: string(),
8355
+ /** Segments (footage lane) or rows (media lane) still on the source. */
8356
+ items: number().int().nonnegative().nullable(),
8357
+ /** Bytes on the source; `null` when the lane counts rows rather than bytes. */
8358
+ bytes: number().int().nonnegative().nullable()
8359
+ });
8360
+ /**
8361
+ * Run the DRAIN half and nothing else.
8362
+ *
8363
+ * A migration that reached `done` has already repointed, so `start` correctly
8364
+ * refuses its destination ("already the default") — there is nothing left to
8365
+ * repoint. But the drain can fail, be cancelled, be interrupted by a restart,
8366
+ * or finish against a work list that was a tenth of the archive (D295), and
8367
+ * before this there was no supported way to run only that half: the only way
8368
+ * through was calling `recording.relocateFootage` by hand over admin tRPC.
8369
+ *
8370
+ * `drain` NEVER calls `setDefaultLocations`. That is what keeps `start`'s
8371
+ * refusal meaningful: the two verbs are disjoint, so nothing here can silently
8372
+ * re-repoint a class that is already migrated.
8373
+ */
8374
+ var StorageMigrationDrainInputSchema = object({
8375
+ /** The classes to drain. Each must appear in `storageMigration.residue`, so
8376
+ * a class whose source is already empty is refused rather than started. */
8377
+ classes: array(StorageMigrationClassSchema).min(1),
8378
+ throttleMbps: number().min(1).max(1e3).optional()
8379
+ });
8380
+ /** What a footage source still holds, asked of the durable hour ledger. */
8381
+ var RelocateResidueInputSchema = object({
8382
+ fromLocationId: string().min(1),
8383
+ /** Narrow to one logical class; omit for every profile on the location. */
8384
+ footageClass: RelocateFootageClassSchema.optional()
8385
+ });
8386
+ /** `null` = the archive could not answer (no ledger on this node, or the
8387
+ * aggregate failed). Never conflated with an empty source. */
8388
+ var RelocateResidueSchema = object({
8389
+ segments: number().int().nonnegative(),
8390
+ bytes: number().int().nonnegative()
8391
+ }).nullable();
8392
+ /** How many rows a media pass would still act on against a given target — the
8393
+ * media lane's denominator AND its residue, from ONE derivation so the two can
8394
+ * never disagree. `null` = the count could not be taken. */
8395
+ var RelocatableMediaCountSchema = object({ rows: number().int().nonnegative() }).nullable();
8396
+ var RelocatableMediaCountInputSchema = object({
8397
+ toLocationId: string().min(1),
8398
+ /** Omitted = `move`. */
8399
+ mode: MediaRelocateModeSchema.optional()
8400
+ });
8401
+ /**
8227
8402
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8228
8403
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8229
8404
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8327,6 +8502,32 @@ var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(
8327
8502
  * two addons declaring the same `id` must agree on `cardinality` (validated
8328
8503
  * at kernel aggregation time, not here).
8329
8504
  */
8505
+ /**
8506
+ * `StorageAccess` — how the service that DECLARED a storage-location kind
8507
+ * actually reaches the bytes. It is the constraint that decides which
8508
+ * `storage-provider`s may back a location of that kind.
8509
+ *
8510
+ * - `'local-path'` — the service asks `storage.resolve` for a path string and
8511
+ * then does its own `node:fs` I/O on it (the recorder's segment writer, the
8512
+ * post-analysis media roots). Only a provider that serves a genuine local
8513
+ * filesystem (`getProviderInfo().nodeLocal === true`) can satisfy that: a
8514
+ * remote provider's `resolve` returns a path on the REMOTE host, and
8515
+ * `fs.readdir` of it on this node either fails or — far worse — succeeds
8516
+ * against a same-named local directory that is something else entirely.
8517
+ *
8518
+ * - `'cap-mediated'` — every byte travels through the `storage` cap
8519
+ * (`read`/`write`, or `beginUpload`/`writeChunk`/`finalizeUpload`). The
8520
+ * service never sees a path, so any provider can back it. `backups` is the
8521
+ * one kind that qualifies today.
8522
+ *
8523
+ * Before this existed, `recordings` was unreachable by SFTP/S3/WebDAV only as
8524
+ * an EMERGENT property of how the recorder happened to be written. Nothing
8525
+ * refused the configuration; the first write simply went somewhere wrong, and
8526
+ * a recording write that goes wrong surfaces as a silent black window rather
8527
+ * than an error (the read path does not `stat`). This turns that accident into
8528
+ * a declared, enforced, testable refusal.
8529
+ */
8530
+ var StorageAccessSchema = _enum(["local-path", "cap-mediated"]);
8330
8531
  var StorageLocationDeclarationSchema = object({
8331
8532
  /**
8332
8533
  * Global location identifier, e.g. `recordings` or `recordingsLow`.
@@ -8346,6 +8547,19 @@ var StorageLocationDeclarationSchema = object({
8346
8547
  */
8347
8548
  cardinality: _enum(["single", "multi"]),
8348
8549
  /**
8550
+ * HOW the declaring service reaches the bytes — and therefore WHICH
8551
+ * providers may back a location of this kind. See {@link StorageAccessSchema}
8552
+ * and {@link STORAGE_ACCESS_FALLBACK}.
8553
+ *
8554
+ * Absent means `'local-path'`. That default is FAIL-CLOSED on purpose: it
8555
+ * can only over-restrict (refuse a remote provider for a kind that might
8556
+ * have coped) and never under-restrict. Declaring `'cap-mediated'` is the
8557
+ * permissive direction and is therefore never inferred — a repo guard
8558
+ * (`scripts/check-storage-access-declarations.ts`) refuses to let it be
8559
+ * reached by omission.
8560
+ */
8561
+ access: StorageAccessSchema.optional(),
8562
+ /**
8349
8563
  * When set, the default instance for this location inherits its resolved
8350
8564
  * root from the named location's default instance. Useful for derivative
8351
8565
  * slots (e.g. `recordingsLow` → `recordings`) so operators only need to
@@ -17871,8 +18085,10 @@ var TrackSchema = object({
17871
18085
  lastSeen: number(),
17872
18086
  /** Frame-rate position history (subject to maxPositionHistory cap). */
17873
18087
  positions: array(TrackPositionSchema).readonly(),
17874
- /** Periodic snapshots at snapshotIntervalMs cadence (subject to
17875
- * saveThumbnails policy). */
18088
+ /** Periodic snapshots at snapshotIntervalMs cadence DEBUG media, produced
18089
+ * only while `MediaSettings.debugMediaEnabled` is on for the camera (D299;
18090
+ * the retired `saveThumbnails` used to gate this and the rolling
18091
+ * `lastFrame` together). Empty is the healthy default, not a capture gap. */
17876
18092
  snapshots: array(TrackSnapshotSchema).readonly(),
17877
18093
  /** Deduplicated zones the track has entered at least once. Zone IDS. */
17878
18094
  zonesVisited: array(string()).readonly(),
@@ -18732,7 +18948,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
18732
18948
  }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
18733
18949
  kind: "mutation",
18734
18950
  auth: "admin"
18735
- }), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(object({}), array(RelocateJobSchema).readonly(), {
18951
+ }), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(RelocatableMediaCountInputSchema, RelocatableMediaCountSchema, {
18952
+ kind: "query",
18953
+ auth: "admin"
18954
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
18736
18955
  kind: "query",
18737
18956
  auth: "admin"
18738
18957
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
@@ -20691,6 +20910,9 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
20691
20910
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
20692
20911
  kind: "mutation",
20693
20912
  auth: "admin"
20913
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
20914
+ kind: "mutation",
20915
+ auth: "admin"
20694
20916
  });
20695
20917
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
20696
20918
  providerId: string().min(1),
@@ -21149,12 +21371,38 @@ response: record(string(), unknown()) }), object({
21149
21371
  *
21150
21372
  * ## Why this is a capability and not a helper
21151
21373
  *
21152
- * Six stores in `addon-post-analysis` already hold vectors object CLIP, face,
21153
- * plate, vehicle, identity, and the event store's derivativesand every one of
21154
- * them keeps its vectors in a `JSON` settings-store column and ranks them by
21155
- * brute-force cosine in JS. Measured on the live hub that costs ~11.7 KB per row
21156
- * (512 floats as TEXT, `JSON.parse`d on every search) and made semantic search
21157
- * load 5,000 rows before ranking anything.
21374
+ * This capability was introduced with the claim that SIX stores in
21375
+ * `addon-post-analysis` held vectors in a `JSON` settings-store columnobject
21376
+ * CLIP, face, plate, vehicle, identity, and the event store's derivatives. That
21377
+ * claim was never true, and leaving it here made five stores look like pending
21378
+ * work when three of them have no vector at all. Counted column by column on
21379
+ * 2026-08-30, exactly THREE ever held one:
21380
+ *
21381
+ * - `object-clip` — 512-dim CLIP image embedding, migrated 2026-08-06.
21382
+ * - `faces.embedding` — 512-dim ArcFace face embedding, migrated 2026-08-30.
21383
+ * - `identity-samples.embedding` — the same ArcFace vector for an ENROLLED
21384
+ * face, migrated 2026-08-30 into its OWN index (see below).
21385
+ *
21386
+ * `plates` and `vehicle-samples` store a plate STRING and a score; `vehicles`
21387
+ * and `identities` store a name; the event store stores no derivative vector.
21388
+ * They are not migration candidates and never were.
21389
+ *
21390
+ * Measured on the live hub the JSON encoding cost ~11.7 KB per row (512 floats
21391
+ * as TEXT, `JSON.parse`d on every search) and made semantic search load 5,000
21392
+ * rows before ranking anything.
21393
+ *
21394
+ * ## One index per COMPARISON, never per encoder
21395
+ *
21396
+ * `faces` and `identity-samples` hold the same 512 ArcFace dims from the same
21397
+ * model, and they still get two indexes. An index is a set of things that are
21398
+ * ranked against each other and that live and die together, and these two are
21399
+ * neither: a `faces` row is TRACK-OWNED and cascades away with its track under
21400
+ * a per-camera capacity cap, an `identity-samples` row is retention-EXEMPT
21401
+ * forever and is the gallery every recognition ranks against. One index would
21402
+ * mean every gallery load and every reconcile carried a filter whose failure
21403
+ * mode is either ranking a candidate against itself or reclaiming an enrolled
21404
+ * person's only sample. The dimension they share is not a reason to share an
21405
+ * index; the question they answer is, and it differs.
21158
21406
  *
21159
21407
  * The fix is not a faster loop, it is a different backend — and the backend
21160
21408
  * should be replaceable without touching six callers. So: a singleton
@@ -21259,7 +21507,20 @@ var VectorQueryResultSchema = object({
21259
21507
  */
21260
21508
  scanned: number(),
21261
21509
  /** True when the backend could not consider every row that passed the filter. */
21262
- truncated: boolean()
21510
+ truncated: boolean(),
21511
+ /**
21512
+ * The `topK` the backend actually ran with.
21513
+ *
21514
+ * Every backend has a ceiling — sqlite-vec's is 4,096 — and a caller asking
21515
+ * past it used to learn nothing but a boolean, from a WARN in the provider's
21516
+ * own log rather than in its answer. That is how an audit asking for 20,000
21517
+ * consumed 4,096 and reported `examined: 4096` as if it had walked the index,
21518
+ * for weeks. `truncated` says THAT the answer was short; this says BY HOW
21519
+ * MUCH, in the return value, where the caller cannot fail to see it.
21520
+ *
21521
+ * Equals the requested `topK` whenever nothing was lowered.
21522
+ */
21523
+ effectiveTopK: number().int().positive()
21263
21524
  });
21264
21525
  var VectorDeleteInputSchema = object({
21265
21526
  index: string(),
@@ -21288,6 +21549,68 @@ var VectorGetResultSchema = object({ items: array(object({
21288
21549
  id: string(),
21289
21550
  metadata: VectorMetadataSchema
21290
21551
  })) });
21552
+ /**
21553
+ * Ids to read back WITH their vectors.
21554
+ *
21555
+ * The sibling of {@link VectorGetResultSchema}, and deliberately a separate
21556
+ * method rather than a flag on it: `getByIds` promises no vectors and its one
21557
+ * caller depends on that promise. This one promises the opposite.
21558
+ *
21559
+ * It exists because a store cannot put its vectors here otherwise. An ArcFace
21560
+ * gallery is ranked IN PROCESS, per detection, against every enrolled sample —
21561
+ * a per-face cross-process KNN would be a network round trip inside the
21562
+ * recognition loop. So the gallery is loaded once and held in RAM, and loading
21563
+ * it requires the index to hand the floats back. Without this method the only
21564
+ * way to keep a readable vector is a JSON column, which is the thing this
21565
+ * capability exists to delete.
21566
+ *
21567
+ * BOUNDED BY THE CALLER: ids are named, never "everything". Enumerating an
21568
+ * index is {@link VectorScanInputSchema}'s job, and it returns no vectors.
21569
+ */
21570
+ var VectorFetchInputSchema = object({
21571
+ index: string(),
21572
+ ids: array(string())
21573
+ });
21574
+ var VectorFetchResultSchema = object({ items: array(object({
21575
+ id: string(),
21576
+ /** base64 Float32LE — the same wire form `upsert` accepts. */
21577
+ vector: string(),
21578
+ metadata: VectorMetadataSchema
21579
+ })) });
21580
+ /**
21581
+ * ENUMERATE an index: one page of rows in a stable order, no ranking.
21582
+ *
21583
+ * A reconcile does not want the nearest rows, it wants ALL of them, and asking
21584
+ * a KNN for "all" is the wrong question twice over. It hits the backend's `k`
21585
+ * ceiling — 4,096 on sqlite-vec against a 22,128-row index — and it needs a
21586
+ * probe vector it does not have, so the audit passed a ZERO vector whose cosine
21587
+ * distance to every row is degenerate. `examined: 4096` then read as "we
21588
+ * looked" for as long as anyone cared to read it.
21589
+ *
21590
+ * This is the primitive that question actually needs: a bounded page, ordered
21591
+ * by the backend's own row order, costing no distance computation at all.
21592
+ * Vectors are NOT returned — an enumeration that shipped 2 KB per row would be
21593
+ * the full-table read this capability was built to stop.
21594
+ */
21595
+ var VectorScanInputSchema = object({
21596
+ index: string(),
21597
+ /** Opaque resume point. `0` starts at the top; pass back `nextCursor`. */
21598
+ cursor: number().int().nonnegative().default(0),
21599
+ limit: number().int().positive()
21600
+ });
21601
+ var VectorScanResultSchema = object({
21602
+ items: array(object({
21603
+ id: string(),
21604
+ metadata: VectorMetadataSchema
21605
+ })),
21606
+ /**
21607
+ * Where the next page starts, or `null` when the walk reached the end.
21608
+ *
21609
+ * `null` is the ONLY end-of-index signal. A caller must not infer the end
21610
+ * from a short page: a backend is free to return fewer rows than asked.
21611
+ */
21612
+ nextCursor: number().int().nonnegative().nullable()
21613
+ });
21291
21614
  var VectorStatsInputSchema = object({ index: string() });
21292
21615
  var VectorStatsResultSchema = object({
21293
21616
  /** Provider id, so an operator can tell brute force from an ANN index. */
@@ -21306,7 +21629,7 @@ method(VectorDeclareIndexInputSchema, _void(), {
21306
21629
  }), method(VectorUpsertInputSchema, VectorUpsertResultSchema, {
21307
21630
  kind: "mutation",
21308
21631
  auth: "admin"
21309
- }), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
21632
+ }), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorFetchInputSchema, VectorFetchResultSchema, { auth: "admin" }), method(VectorScanInputSchema, VectorScanResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
21310
21633
  kind: "mutation",
21311
21634
  auth: "admin"
21312
21635
  }), method(VectorDeleteByFilterInputSchema, VectorDeleteResultSchema, {
@@ -26210,6 +26533,9 @@ method(object({
26210
26533
  }), method(object({}), array(RelocateJobSchema).readonly(), {
26211
26534
  kind: "query",
26212
26535
  auth: "admin"
26536
+ }), method(RelocateResidueInputSchema, RelocateResidueSchema, {
26537
+ kind: "query",
26538
+ auth: "admin"
26213
26539
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
26214
26540
  kind: "mutation",
26215
26541
  auth: "admin"
@@ -31175,6 +31501,12 @@ Object.freeze({
31175
31501
  addonId: null,
31176
31502
  access: "create"
31177
31503
  },
31504
+ "pipelineAnalytics.countRelocatableMedia": {
31505
+ capName: "pipeline-analytics",
31506
+ capScope: "device",
31507
+ addonId: null,
31508
+ access: "view"
31509
+ },
31178
31510
  "pipelineAnalytics.countUnstampedEventMedia": {
31179
31511
  capName: "pipeline-analytics",
31180
31512
  capScope: "device",
@@ -32339,6 +32671,12 @@ Object.freeze({
32339
32671
  addonId: null,
32340
32672
  access: "view"
32341
32673
  },
32674
+ "recording.getRelocateResidue": {
32675
+ capName: "recording",
32676
+ capScope: "system",
32677
+ addonId: null,
32678
+ access: "view"
32679
+ },
32342
32680
  "recording.getStorageMigrationMoveStatus": {
32343
32681
  capName: "recording",
32344
32682
  capScope: "system",
@@ -32885,12 +33223,30 @@ Object.freeze({
32885
33223
  addonId: null,
32886
33224
  access: "create"
32887
33225
  },
33226
+ "storageMigration.drain": {
33227
+ capName: "storage-migration",
33228
+ capScope: "system",
33229
+ addonId: null,
33230
+ access: "create"
33231
+ },
33232
+ "storageMigration.movers": {
33233
+ capName: "storage-migration",
33234
+ capScope: "system",
33235
+ addonId: null,
33236
+ access: "view"
33237
+ },
32888
33238
  "storageMigration.plan": {
32889
33239
  capName: "storage-migration",
32890
33240
  capScope: "system",
32891
33241
  addonId: null,
32892
33242
  access: "view"
32893
33243
  },
33244
+ "storageMigration.residue": {
33245
+ capName: "storage-migration",
33246
+ capScope: "system",
33247
+ addonId: null,
33248
+ access: "view"
33249
+ },
32894
33250
  "storageMigration.start": {
32895
33251
  capName: "storage-migration",
32896
33252
  capScope: "system",
@@ -33725,6 +34081,12 @@ Object.freeze({
33725
34081
  addonId: null,
33726
34082
  access: "delete"
33727
34083
  },
34084
+ "vectorStore.fetchByIds": {
34085
+ capName: "vector-store",
34086
+ capScope: "system",
34087
+ addonId: null,
34088
+ access: "view"
34089
+ },
33728
34090
  "vectorStore.getByIds": {
33729
34091
  capName: "vector-store",
33730
34092
  capScope: "system",
@@ -33737,6 +34099,12 @@ Object.freeze({
33737
34099
  addonId: null,
33738
34100
  access: "view"
33739
34101
  },
34102
+ "vectorStore.scan": {
34103
+ capName: "vector-store",
34104
+ capScope: "system",
34105
+ addonId: null,
34106
+ access: "view"
34107
+ },
33740
34108
  "vectorStore.stats": {
33741
34109
  capName: "vector-store",
33742
34110
  capScope: "system",