@camstack/addon-remote-storage 1.2.42 → 1.2.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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-CzYVi403.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-DsnRUNmJ.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-CzYVi403.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-DsnRUNmJ.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"
@@ -8172,13 +8172,49 @@ var StorageMigrationParticipantSchema = _enum([
8172
8172
  "recorder",
8173
8173
  "analytics"
8174
8174
  ]);
8175
+ /**
8176
+ * The mover's own numbers, folded onto the coordinator's durable move record.
8177
+ *
8178
+ * The long half of a non-blocking migration is `draining`, and it is measured
8179
+ * in hours: 136 885 files at ~4 MB/s is about five of them. Before this shape
8180
+ * existed the only place those numbers appeared was a Loki line, so an operator
8181
+ * watching the Admin UI saw `phase: draining` and nothing else for a whole
8182
+ * afternoon.
8183
+ *
8184
+ * It is POLLED, never pushed. Events are telemetry and may be dropped
8185
+ * (D8/D11), and a dropped progress event is indistinguishable from a stalled
8186
+ * mover — which is the exact failure this is meant to end. The coordinator's
8187
+ * `waitForMoves` already fetches the whole {@link RelocateJob} on every tick to
8188
+ * read `state`; folding the counters costs no extra read and makes the durable
8189
+ * record say afterwards how far a move actually got.
8190
+ *
8191
+ * `filesTotal` is `null` for "no honest denominator" and is never zero-filled:
8192
+ * a windowed footage job (`sinceMs`) and a node with no ledger both genuinely
8193
+ * cannot say M, and a 0 there would render as "100 % done".
8194
+ */
8195
+ var StorageMigrationMoveProgressSchema = object({
8196
+ filesMoved: number().int().nonnegative(),
8197
+ /** The archive census — the **M** of "N of M" (D295). `null` = unknowable. */
8198
+ filesTotal: number().int().nonnegative().nullable(),
8199
+ bytesMoved: number().int().nonnegative(),
8200
+ /** The MOVER's start, not the migration's: a drain restarted after an addon
8201
+ * crash gets a new mover, and a rate computed from the migration's start
8202
+ * would silently average in the time nothing was running. */
8203
+ startedAt: number(),
8204
+ /** When the coordinator last read these numbers. Paired with `startedAt` it
8205
+ * is the only honest rate: both clocks are the hub's, so a UI never has to
8206
+ * subtract its own. */
8207
+ observedAt: number()
8208
+ });
8175
8209
  var StorageMigrationMoveSchema = object({
8176
8210
  storageClass: StorageMigrationClassSchema,
8177
8211
  fromLocationId: string(),
8178
8212
  toLocationId: string(),
8179
8213
  moverJobId: string().nullable(),
8180
8214
  state: RelocateJobStateSchema.nullable(),
8181
- error: string().nullable()
8215
+ error: string().nullable(),
8216
+ /** Last observed mover counters; `null` until the mover has been polled once. */
8217
+ progress: StorageMigrationMoveProgressSchema.nullable()
8182
8218
  });
8183
8219
  var StorageMigrationJobSchema = object({
8184
8220
  jobId: string(),
@@ -8224,6 +8260,98 @@ var StorageMigrationPlanSchema = object({
8224
8260
  findings: array(StorageMigrationFindingSchema)
8225
8261
  });
8226
8262
  /**
8263
+ * A mover as it exists RIGHT NOW, whether or not a migration job owns it.
8264
+ *
8265
+ * The coordinator's job record is the state of record for a migration, and its
8266
+ * moves carry {@link StorageMigrationMoveProgress}. But the movers are usable
8267
+ * standalone — `recording.relocateFootage` and `pipelineAnalytics.relocateMedia`
8268
+ * are both operator-callable, and on 2026-08-29 a five-hour drain was armed that
8269
+ * way because no supported UI path existed. A mover armed like that has no job
8270
+ * to fold progress into, so it has to be readable on its own or it is invisible.
8271
+ *
8272
+ * `migrationJobId` is what tells the two apart: `null` means nothing here
8273
+ * orchestrated it.
8274
+ */
8275
+ var StorageMigrationMoverSchema = object({
8276
+ lane: _enum(["footage", "media"]),
8277
+ job: RelocateJobSchema,
8278
+ /** The coordinator job that armed this mover, or `null` for a mover armed
8279
+ * directly against the owning addon. */
8280
+ migrationJobId: string().nullable(),
8281
+ /** When the hub read these counters. Stamped here so a rate is `bytesMoved`
8282
+ * over (`observedAt` − `job.startedAt`) with BOTH ends on the hub's clock —
8283
+ * a browser subtracting its own `Date.now()` from a server `startedAt` is a
8284
+ * rate made of two different clocks. */
8285
+ observedAt: number()
8286
+ });
8287
+ /**
8288
+ * What a SOURCE still holds for one storage class — the number that makes a
8289
+ * "drain remaining" action honest rather than hopeful.
8290
+ *
8291
+ * It comes from the archive (`SegmentHourLedger.census` for footage, the media
8292
+ * engine's own selection count for media), never from the resident index: a
8293
+ * drain sized off `RecordingIndex` is what reported `done` over 80.3 GB it had
8294
+ * never been told about (D295).
8295
+ *
8296
+ * `items`/`bytes` are `null` for "the archive could not be asked", which is
8297
+ * deliberately NOT zero: a drain is still offered for an unknown residue,
8298
+ * because refusing on an unanswerable read would hide exactly the case an
8299
+ * operator needs to act on.
8300
+ */
8301
+ var StorageMigrationResidueSchema = object({
8302
+ storageClass: StorageMigrationClassSchema,
8303
+ /** The location still holding the data. `'*'` for the media lane, whose rows
8304
+ * move from wherever they are rather than from one named source. */
8305
+ fromLocationId: string(),
8306
+ /** Where a drain would move it — the class's CURRENT default. */
8307
+ toLocationId: string(),
8308
+ /** Segments (footage lane) or rows (media lane) still on the source. */
8309
+ items: number().int().nonnegative().nullable(),
8310
+ /** Bytes on the source; `null` when the lane counts rows rather than bytes. */
8311
+ bytes: number().int().nonnegative().nullable()
8312
+ });
8313
+ /**
8314
+ * Run the DRAIN half and nothing else.
8315
+ *
8316
+ * A migration that reached `done` has already repointed, so `start` correctly
8317
+ * refuses its destination ("already the default") — there is nothing left to
8318
+ * repoint. But the drain can fail, be cancelled, be interrupted by a restart,
8319
+ * or finish against a work list that was a tenth of the archive (D295), and
8320
+ * before this there was no supported way to run only that half: the only way
8321
+ * through was calling `recording.relocateFootage` by hand over admin tRPC.
8322
+ *
8323
+ * `drain` NEVER calls `setDefaultLocations`. That is what keeps `start`'s
8324
+ * refusal meaningful: the two verbs are disjoint, so nothing here can silently
8325
+ * re-repoint a class that is already migrated.
8326
+ */
8327
+ var StorageMigrationDrainInputSchema = object({
8328
+ /** The classes to drain. Each must appear in `storageMigration.residue`, so
8329
+ * a class whose source is already empty is refused rather than started. */
8330
+ classes: array(StorageMigrationClassSchema).min(1),
8331
+ throttleMbps: number().min(1).max(1e3).optional()
8332
+ });
8333
+ /** What a footage source still holds, asked of the durable hour ledger. */
8334
+ var RelocateResidueInputSchema = object({
8335
+ fromLocationId: string().min(1),
8336
+ /** Narrow to one logical class; omit for every profile on the location. */
8337
+ footageClass: RelocateFootageClassSchema.optional()
8338
+ });
8339
+ /** `null` = the archive could not answer (no ledger on this node, or the
8340
+ * aggregate failed). Never conflated with an empty source. */
8341
+ var RelocateResidueSchema = object({
8342
+ segments: number().int().nonnegative(),
8343
+ bytes: number().int().nonnegative()
8344
+ }).nullable();
8345
+ /** How many rows a media pass would still act on against a given target — the
8346
+ * media lane's denominator AND its residue, from ONE derivation so the two can
8347
+ * never disagree. `null` = the count could not be taken. */
8348
+ var RelocatableMediaCountSchema = object({ rows: number().int().nonnegative() }).nullable();
8349
+ var RelocatableMediaCountInputSchema = object({
8350
+ toLocationId: string().min(1),
8351
+ /** Omitted = `move`. */
8352
+ mode: MediaRelocateModeSchema.optional()
8353
+ });
8354
+ /**
8227
8355
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8228
8356
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8229
8357
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8327,6 +8455,32 @@ var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(
8327
8455
  * two addons declaring the same `id` must agree on `cardinality` (validated
8328
8456
  * at kernel aggregation time, not here).
8329
8457
  */
8458
+ /**
8459
+ * `StorageAccess` — how the service that DECLARED a storage-location kind
8460
+ * actually reaches the bytes. It is the constraint that decides which
8461
+ * `storage-provider`s may back a location of that kind.
8462
+ *
8463
+ * - `'local-path'` — the service asks `storage.resolve` for a path string and
8464
+ * then does its own `node:fs` I/O on it (the recorder's segment writer, the
8465
+ * post-analysis media roots). Only a provider that serves a genuine local
8466
+ * filesystem (`getProviderInfo().nodeLocal === true`) can satisfy that: a
8467
+ * remote provider's `resolve` returns a path on the REMOTE host, and
8468
+ * `fs.readdir` of it on this node either fails or — far worse — succeeds
8469
+ * against a same-named local directory that is something else entirely.
8470
+ *
8471
+ * - `'cap-mediated'` — every byte travels through the `storage` cap
8472
+ * (`read`/`write`, or `beginUpload`/`writeChunk`/`finalizeUpload`). The
8473
+ * service never sees a path, so any provider can back it. `backups` is the
8474
+ * one kind that qualifies today.
8475
+ *
8476
+ * Before this existed, `recordings` was unreachable by SFTP/S3/WebDAV only as
8477
+ * an EMERGENT property of how the recorder happened to be written. Nothing
8478
+ * refused the configuration; the first write simply went somewhere wrong, and
8479
+ * a recording write that goes wrong surfaces as a silent black window rather
8480
+ * than an error (the read path does not `stat`). This turns that accident into
8481
+ * a declared, enforced, testable refusal.
8482
+ */
8483
+ var StorageAccessSchema = _enum(["local-path", "cap-mediated"]);
8330
8484
  var StorageLocationDeclarationSchema = object({
8331
8485
  /**
8332
8486
  * Global location identifier, e.g. `recordings` or `recordingsLow`.
@@ -8346,6 +8500,19 @@ var StorageLocationDeclarationSchema = object({
8346
8500
  */
8347
8501
  cardinality: _enum(["single", "multi"]),
8348
8502
  /**
8503
+ * HOW the declaring service reaches the bytes — and therefore WHICH
8504
+ * providers may back a location of this kind. See {@link StorageAccessSchema}
8505
+ * and {@link STORAGE_ACCESS_FALLBACK}.
8506
+ *
8507
+ * Absent means `'local-path'`. That default is FAIL-CLOSED on purpose: it
8508
+ * can only over-restrict (refuse a remote provider for a kind that might
8509
+ * have coped) and never under-restrict. Declaring `'cap-mediated'` is the
8510
+ * permissive direction and is therefore never inferred — a repo guard
8511
+ * (`scripts/check-storage-access-declarations.ts`) refuses to let it be
8512
+ * reached by omission.
8513
+ */
8514
+ access: StorageAccessSchema.optional(),
8515
+ /**
8349
8516
  * When set, the default instance for this location inherits its resolved
8350
8517
  * root from the named location's default instance. Useful for derivative
8351
8518
  * slots (e.g. `recordingsLow` → `recordings`) so operators only need to
@@ -17871,8 +18038,10 @@ var TrackSchema = object({
17871
18038
  lastSeen: number(),
17872
18039
  /** Frame-rate position history (subject to maxPositionHistory cap). */
17873
18040
  positions: array(TrackPositionSchema).readonly(),
17874
- /** Periodic snapshots at snapshotIntervalMs cadence (subject to
17875
- * saveThumbnails policy). */
18041
+ /** Periodic snapshots at snapshotIntervalMs cadence DEBUG media, produced
18042
+ * only while `MediaSettings.debugMediaEnabled` is on for the camera (D299;
18043
+ * the retired `saveThumbnails` used to gate this and the rolling
18044
+ * `lastFrame` together). Empty is the healthy default, not a capture gap. */
17876
18045
  snapshots: array(TrackSnapshotSchema).readonly(),
17877
18046
  /** Deduplicated zones the track has entered at least once. Zone IDS. */
17878
18047
  zonesVisited: array(string()).readonly(),
@@ -18732,7 +18901,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
18732
18901
  }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
18733
18902
  kind: "mutation",
18734
18903
  auth: "admin"
18735
- }), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(object({}), array(RelocateJobSchema).readonly(), {
18904
+ }), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(RelocatableMediaCountInputSchema, RelocatableMediaCountSchema, {
18905
+ kind: "query",
18906
+ auth: "admin"
18907
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
18736
18908
  kind: "query",
18737
18909
  auth: "admin"
18738
18910
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
@@ -20691,6 +20863,9 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
20691
20863
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
20692
20864
  kind: "mutation",
20693
20865
  auth: "admin"
20866
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
20867
+ kind: "mutation",
20868
+ auth: "admin"
20694
20869
  });
20695
20870
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
20696
20871
  providerId: string().min(1),
@@ -21149,12 +21324,38 @@ response: record(string(), unknown()) }), object({
21149
21324
  *
21150
21325
  * ## Why this is a capability and not a helper
21151
21326
  *
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.
21327
+ * This capability was introduced with the claim that SIX stores in
21328
+ * `addon-post-analysis` held vectors in a `JSON` settings-store columnobject
21329
+ * CLIP, face, plate, vehicle, identity, and the event store's derivatives. That
21330
+ * claim was never true, and leaving it here made five stores look like pending
21331
+ * work when three of them have no vector at all. Counted column by column on
21332
+ * 2026-08-30, exactly THREE ever held one:
21333
+ *
21334
+ * - `object-clip` — 512-dim CLIP image embedding, migrated 2026-08-06.
21335
+ * - `faces.embedding` — 512-dim ArcFace face embedding, migrated 2026-08-30.
21336
+ * - `identity-samples.embedding` — the same ArcFace vector for an ENROLLED
21337
+ * face, migrated 2026-08-30 into its OWN index (see below).
21338
+ *
21339
+ * `plates` and `vehicle-samples` store a plate STRING and a score; `vehicles`
21340
+ * and `identities` store a name; the event store stores no derivative vector.
21341
+ * They are not migration candidates and never were.
21342
+ *
21343
+ * Measured on the live hub the JSON encoding cost ~11.7 KB per row (512 floats
21344
+ * as TEXT, `JSON.parse`d on every search) and made semantic search load 5,000
21345
+ * rows before ranking anything.
21346
+ *
21347
+ * ## One index per COMPARISON, never per encoder
21348
+ *
21349
+ * `faces` and `identity-samples` hold the same 512 ArcFace dims from the same
21350
+ * model, and they still get two indexes. An index is a set of things that are
21351
+ * ranked against each other and that live and die together, and these two are
21352
+ * neither: a `faces` row is TRACK-OWNED and cascades away with its track under
21353
+ * a per-camera capacity cap, an `identity-samples` row is retention-EXEMPT
21354
+ * forever and is the gallery every recognition ranks against. One index would
21355
+ * mean every gallery load and every reconcile carried a filter whose failure
21356
+ * mode is either ranking a candidate against itself or reclaiming an enrolled
21357
+ * person's only sample. The dimension they share is not a reason to share an
21358
+ * index; the question they answer is, and it differs.
21158
21359
  *
21159
21360
  * The fix is not a faster loop, it is a different backend — and the backend
21160
21361
  * should be replaceable without touching six callers. So: a singleton
@@ -21259,7 +21460,20 @@ var VectorQueryResultSchema = object({
21259
21460
  */
21260
21461
  scanned: number(),
21261
21462
  /** True when the backend could not consider every row that passed the filter. */
21262
- truncated: boolean()
21463
+ truncated: boolean(),
21464
+ /**
21465
+ * The `topK` the backend actually ran with.
21466
+ *
21467
+ * Every backend has a ceiling — sqlite-vec's is 4,096 — and a caller asking
21468
+ * past it used to learn nothing but a boolean, from a WARN in the provider's
21469
+ * own log rather than in its answer. That is how an audit asking for 20,000
21470
+ * consumed 4,096 and reported `examined: 4096` as if it had walked the index,
21471
+ * for weeks. `truncated` says THAT the answer was short; this says BY HOW
21472
+ * MUCH, in the return value, where the caller cannot fail to see it.
21473
+ *
21474
+ * Equals the requested `topK` whenever nothing was lowered.
21475
+ */
21476
+ effectiveTopK: number().int().positive()
21263
21477
  });
21264
21478
  var VectorDeleteInputSchema = object({
21265
21479
  index: string(),
@@ -21288,6 +21502,68 @@ var VectorGetResultSchema = object({ items: array(object({
21288
21502
  id: string(),
21289
21503
  metadata: VectorMetadataSchema
21290
21504
  })) });
21505
+ /**
21506
+ * Ids to read back WITH their vectors.
21507
+ *
21508
+ * The sibling of {@link VectorGetResultSchema}, and deliberately a separate
21509
+ * method rather than a flag on it: `getByIds` promises no vectors and its one
21510
+ * caller depends on that promise. This one promises the opposite.
21511
+ *
21512
+ * It exists because a store cannot put its vectors here otherwise. An ArcFace
21513
+ * gallery is ranked IN PROCESS, per detection, against every enrolled sample —
21514
+ * a per-face cross-process KNN would be a network round trip inside the
21515
+ * recognition loop. So the gallery is loaded once and held in RAM, and loading
21516
+ * it requires the index to hand the floats back. Without this method the only
21517
+ * way to keep a readable vector is a JSON column, which is the thing this
21518
+ * capability exists to delete.
21519
+ *
21520
+ * BOUNDED BY THE CALLER: ids are named, never "everything". Enumerating an
21521
+ * index is {@link VectorScanInputSchema}'s job, and it returns no vectors.
21522
+ */
21523
+ var VectorFetchInputSchema = object({
21524
+ index: string(),
21525
+ ids: array(string())
21526
+ });
21527
+ var VectorFetchResultSchema = object({ items: array(object({
21528
+ id: string(),
21529
+ /** base64 Float32LE — the same wire form `upsert` accepts. */
21530
+ vector: string(),
21531
+ metadata: VectorMetadataSchema
21532
+ })) });
21533
+ /**
21534
+ * ENUMERATE an index: one page of rows in a stable order, no ranking.
21535
+ *
21536
+ * A reconcile does not want the nearest rows, it wants ALL of them, and asking
21537
+ * a KNN for "all" is the wrong question twice over. It hits the backend's `k`
21538
+ * ceiling — 4,096 on sqlite-vec against a 22,128-row index — and it needs a
21539
+ * probe vector it does not have, so the audit passed a ZERO vector whose cosine
21540
+ * distance to every row is degenerate. `examined: 4096` then read as "we
21541
+ * looked" for as long as anyone cared to read it.
21542
+ *
21543
+ * This is the primitive that question actually needs: a bounded page, ordered
21544
+ * by the backend's own row order, costing no distance computation at all.
21545
+ * Vectors are NOT returned — an enumeration that shipped 2 KB per row would be
21546
+ * the full-table read this capability was built to stop.
21547
+ */
21548
+ var VectorScanInputSchema = object({
21549
+ index: string(),
21550
+ /** Opaque resume point. `0` starts at the top; pass back `nextCursor`. */
21551
+ cursor: number().int().nonnegative().default(0),
21552
+ limit: number().int().positive()
21553
+ });
21554
+ var VectorScanResultSchema = object({
21555
+ items: array(object({
21556
+ id: string(),
21557
+ metadata: VectorMetadataSchema
21558
+ })),
21559
+ /**
21560
+ * Where the next page starts, or `null` when the walk reached the end.
21561
+ *
21562
+ * `null` is the ONLY end-of-index signal. A caller must not infer the end
21563
+ * from a short page: a backend is free to return fewer rows than asked.
21564
+ */
21565
+ nextCursor: number().int().nonnegative().nullable()
21566
+ });
21291
21567
  var VectorStatsInputSchema = object({ index: string() });
21292
21568
  var VectorStatsResultSchema = object({
21293
21569
  /** Provider id, so an operator can tell brute force from an ANN index. */
@@ -21306,7 +21582,7 @@ method(VectorDeclareIndexInputSchema, _void(), {
21306
21582
  }), method(VectorUpsertInputSchema, VectorUpsertResultSchema, {
21307
21583
  kind: "mutation",
21308
21584
  auth: "admin"
21309
- }), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
21585
+ }), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorFetchInputSchema, VectorFetchResultSchema, { auth: "admin" }), method(VectorScanInputSchema, VectorScanResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
21310
21586
  kind: "mutation",
21311
21587
  auth: "admin"
21312
21588
  }), method(VectorDeleteByFilterInputSchema, VectorDeleteResultSchema, {
@@ -26210,6 +26486,9 @@ method(object({
26210
26486
  }), method(object({}), array(RelocateJobSchema).readonly(), {
26211
26487
  kind: "query",
26212
26488
  auth: "admin"
26489
+ }), method(RelocateResidueInputSchema, RelocateResidueSchema, {
26490
+ kind: "query",
26491
+ auth: "admin"
26213
26492
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
26214
26493
  kind: "mutation",
26215
26494
  auth: "admin"
@@ -31175,6 +31454,12 @@ Object.freeze({
31175
31454
  addonId: null,
31176
31455
  access: "create"
31177
31456
  },
31457
+ "pipelineAnalytics.countRelocatableMedia": {
31458
+ capName: "pipeline-analytics",
31459
+ capScope: "device",
31460
+ addonId: null,
31461
+ access: "view"
31462
+ },
31178
31463
  "pipelineAnalytics.countUnstampedEventMedia": {
31179
31464
  capName: "pipeline-analytics",
31180
31465
  capScope: "device",
@@ -32339,6 +32624,12 @@ Object.freeze({
32339
32624
  addonId: null,
32340
32625
  access: "view"
32341
32626
  },
32627
+ "recording.getRelocateResidue": {
32628
+ capName: "recording",
32629
+ capScope: "system",
32630
+ addonId: null,
32631
+ access: "view"
32632
+ },
32342
32633
  "recording.getStorageMigrationMoveStatus": {
32343
32634
  capName: "recording",
32344
32635
  capScope: "system",
@@ -32885,12 +33176,30 @@ Object.freeze({
32885
33176
  addonId: null,
32886
33177
  access: "create"
32887
33178
  },
33179
+ "storageMigration.drain": {
33180
+ capName: "storage-migration",
33181
+ capScope: "system",
33182
+ addonId: null,
33183
+ access: "create"
33184
+ },
33185
+ "storageMigration.movers": {
33186
+ capName: "storage-migration",
33187
+ capScope: "system",
33188
+ addonId: null,
33189
+ access: "view"
33190
+ },
32888
33191
  "storageMigration.plan": {
32889
33192
  capName: "storage-migration",
32890
33193
  capScope: "system",
32891
33194
  addonId: null,
32892
33195
  access: "view"
32893
33196
  },
33197
+ "storageMigration.residue": {
33198
+ capName: "storage-migration",
33199
+ capScope: "system",
33200
+ addonId: null,
33201
+ access: "view"
33202
+ },
32894
33203
  "storageMigration.start": {
32895
33204
  capName: "storage-migration",
32896
33205
  capScope: "system",
@@ -33725,6 +34034,12 @@ Object.freeze({
33725
34034
  addonId: null,
33726
34035
  access: "delete"
33727
34036
  },
34037
+ "vectorStore.fetchByIds": {
34038
+ capName: "vector-store",
34039
+ capScope: "system",
34040
+ addonId: null,
34041
+ access: "view"
34042
+ },
33728
34043
  "vectorStore.getByIds": {
33729
34044
  capName: "vector-store",
33730
34045
  capScope: "system",
@@ -33737,6 +34052,12 @@ Object.freeze({
33737
34052
  addonId: null,
33738
34053
  access: "view"
33739
34054
  },
34055
+ "vectorStore.scan": {
34056
+ capName: "vector-store",
34057
+ capScope: "system",
34058
+ addonId: null,
34059
+ access: "view"
34060
+ },
33740
34061
  "vectorStore.stats": {
33741
34062
  capName: "vector-store",
33742
34063
  capScope: "system",