@camstack/addon-decoder-ffmpeg 1.2.43 → 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 +333 -12
- package/dist/index.mjs +333 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8165,13 +8165,49 @@ var StorageMigrationParticipantSchema = _enum([
|
|
|
8165
8165
|
"recorder",
|
|
8166
8166
|
"analytics"
|
|
8167
8167
|
]);
|
|
8168
|
+
/**
|
|
8169
|
+
* The mover's own numbers, folded onto the coordinator's durable move record.
|
|
8170
|
+
*
|
|
8171
|
+
* The long half of a non-blocking migration is `draining`, and it is measured
|
|
8172
|
+
* in hours: 136 885 files at ~4 MB/s is about five of them. Before this shape
|
|
8173
|
+
* existed the only place those numbers appeared was a Loki line, so an operator
|
|
8174
|
+
* watching the Admin UI saw `phase: draining` and nothing else for a whole
|
|
8175
|
+
* afternoon.
|
|
8176
|
+
*
|
|
8177
|
+
* It is POLLED, never pushed. Events are telemetry and may be dropped
|
|
8178
|
+
* (D8/D11), and a dropped progress event is indistinguishable from a stalled
|
|
8179
|
+
* mover — which is the exact failure this is meant to end. The coordinator's
|
|
8180
|
+
* `waitForMoves` already fetches the whole {@link RelocateJob} on every tick to
|
|
8181
|
+
* read `state`; folding the counters costs no extra read and makes the durable
|
|
8182
|
+
* record say afterwards how far a move actually got.
|
|
8183
|
+
*
|
|
8184
|
+
* `filesTotal` is `null` for "no honest denominator" and is never zero-filled:
|
|
8185
|
+
* a windowed footage job (`sinceMs`) and a node with no ledger both genuinely
|
|
8186
|
+
* cannot say M, and a 0 there would render as "100 % done".
|
|
8187
|
+
*/
|
|
8188
|
+
var StorageMigrationMoveProgressSchema = object({
|
|
8189
|
+
filesMoved: number().int().nonnegative(),
|
|
8190
|
+
/** The archive census — the **M** of "N of M" (D295). `null` = unknowable. */
|
|
8191
|
+
filesTotal: number().int().nonnegative().nullable(),
|
|
8192
|
+
bytesMoved: number().int().nonnegative(),
|
|
8193
|
+
/** The MOVER's start, not the migration's: a drain restarted after an addon
|
|
8194
|
+
* crash gets a new mover, and a rate computed from the migration's start
|
|
8195
|
+
* would silently average in the time nothing was running. */
|
|
8196
|
+
startedAt: number(),
|
|
8197
|
+
/** When the coordinator last read these numbers. Paired with `startedAt` it
|
|
8198
|
+
* is the only honest rate: both clocks are the hub's, so a UI never has to
|
|
8199
|
+
* subtract its own. */
|
|
8200
|
+
observedAt: number()
|
|
8201
|
+
});
|
|
8168
8202
|
var StorageMigrationMoveSchema = object({
|
|
8169
8203
|
storageClass: StorageMigrationClassSchema,
|
|
8170
8204
|
fromLocationId: string(),
|
|
8171
8205
|
toLocationId: string(),
|
|
8172
8206
|
moverJobId: string().nullable(),
|
|
8173
8207
|
state: RelocateJobStateSchema.nullable(),
|
|
8174
|
-
error: string().nullable()
|
|
8208
|
+
error: string().nullable(),
|
|
8209
|
+
/** Last observed mover counters; `null` until the mover has been polled once. */
|
|
8210
|
+
progress: StorageMigrationMoveProgressSchema.nullable()
|
|
8175
8211
|
});
|
|
8176
8212
|
var StorageMigrationJobSchema = object({
|
|
8177
8213
|
jobId: string(),
|
|
@@ -8217,6 +8253,98 @@ var StorageMigrationPlanSchema = object({
|
|
|
8217
8253
|
findings: array(StorageMigrationFindingSchema)
|
|
8218
8254
|
});
|
|
8219
8255
|
/**
|
|
8256
|
+
* A mover as it exists RIGHT NOW, whether or not a migration job owns it.
|
|
8257
|
+
*
|
|
8258
|
+
* The coordinator's job record is the state of record for a migration, and its
|
|
8259
|
+
* moves carry {@link StorageMigrationMoveProgress}. But the movers are usable
|
|
8260
|
+
* standalone — `recording.relocateFootage` and `pipelineAnalytics.relocateMedia`
|
|
8261
|
+
* are both operator-callable, and on 2026-08-29 a five-hour drain was armed that
|
|
8262
|
+
* way because no supported UI path existed. A mover armed like that has no job
|
|
8263
|
+
* to fold progress into, so it has to be readable on its own or it is invisible.
|
|
8264
|
+
*
|
|
8265
|
+
* `migrationJobId` is what tells the two apart: `null` means nothing here
|
|
8266
|
+
* orchestrated it.
|
|
8267
|
+
*/
|
|
8268
|
+
var StorageMigrationMoverSchema = object({
|
|
8269
|
+
lane: _enum(["footage", "media"]),
|
|
8270
|
+
job: RelocateJobSchema,
|
|
8271
|
+
/** The coordinator job that armed this mover, or `null` for a mover armed
|
|
8272
|
+
* directly against the owning addon. */
|
|
8273
|
+
migrationJobId: string().nullable(),
|
|
8274
|
+
/** When the hub read these counters. Stamped here so a rate is `bytesMoved`
|
|
8275
|
+
* over (`observedAt` − `job.startedAt`) with BOTH ends on the hub's clock —
|
|
8276
|
+
* a browser subtracting its own `Date.now()` from a server `startedAt` is a
|
|
8277
|
+
* rate made of two different clocks. */
|
|
8278
|
+
observedAt: number()
|
|
8279
|
+
});
|
|
8280
|
+
/**
|
|
8281
|
+
* What a SOURCE still holds for one storage class — the number that makes a
|
|
8282
|
+
* "drain remaining" action honest rather than hopeful.
|
|
8283
|
+
*
|
|
8284
|
+
* It comes from the archive (`SegmentHourLedger.census` for footage, the media
|
|
8285
|
+
* engine's own selection count for media), never from the resident index: a
|
|
8286
|
+
* drain sized off `RecordingIndex` is what reported `done` over 80.3 GB it had
|
|
8287
|
+
* never been told about (D295).
|
|
8288
|
+
*
|
|
8289
|
+
* `items`/`bytes` are `null` for "the archive could not be asked", which is
|
|
8290
|
+
* deliberately NOT zero: a drain is still offered for an unknown residue,
|
|
8291
|
+
* because refusing on an unanswerable read would hide exactly the case an
|
|
8292
|
+
* operator needs to act on.
|
|
8293
|
+
*/
|
|
8294
|
+
var StorageMigrationResidueSchema = object({
|
|
8295
|
+
storageClass: StorageMigrationClassSchema,
|
|
8296
|
+
/** The location still holding the data. `'*'` for the media lane, whose rows
|
|
8297
|
+
* move from wherever they are rather than from one named source. */
|
|
8298
|
+
fromLocationId: string(),
|
|
8299
|
+
/** Where a drain would move it — the class's CURRENT default. */
|
|
8300
|
+
toLocationId: string(),
|
|
8301
|
+
/** Segments (footage lane) or rows (media lane) still on the source. */
|
|
8302
|
+
items: number().int().nonnegative().nullable(),
|
|
8303
|
+
/** Bytes on the source; `null` when the lane counts rows rather than bytes. */
|
|
8304
|
+
bytes: number().int().nonnegative().nullable()
|
|
8305
|
+
});
|
|
8306
|
+
/**
|
|
8307
|
+
* Run the DRAIN half and nothing else.
|
|
8308
|
+
*
|
|
8309
|
+
* A migration that reached `done` has already repointed, so `start` correctly
|
|
8310
|
+
* refuses its destination ("already the default") — there is nothing left to
|
|
8311
|
+
* repoint. But the drain can fail, be cancelled, be interrupted by a restart,
|
|
8312
|
+
* or finish against a work list that was a tenth of the archive (D295), and
|
|
8313
|
+
* before this there was no supported way to run only that half: the only way
|
|
8314
|
+
* through was calling `recording.relocateFootage` by hand over admin tRPC.
|
|
8315
|
+
*
|
|
8316
|
+
* `drain` NEVER calls `setDefaultLocations`. That is what keeps `start`'s
|
|
8317
|
+
* refusal meaningful: the two verbs are disjoint, so nothing here can silently
|
|
8318
|
+
* re-repoint a class that is already migrated.
|
|
8319
|
+
*/
|
|
8320
|
+
var StorageMigrationDrainInputSchema = object({
|
|
8321
|
+
/** The classes to drain. Each must appear in `storageMigration.residue`, so
|
|
8322
|
+
* a class whose source is already empty is refused rather than started. */
|
|
8323
|
+
classes: array(StorageMigrationClassSchema).min(1),
|
|
8324
|
+
throttleMbps: number().min(1).max(1e3).optional()
|
|
8325
|
+
});
|
|
8326
|
+
/** What a footage source still holds, asked of the durable hour ledger. */
|
|
8327
|
+
var RelocateResidueInputSchema = object({
|
|
8328
|
+
fromLocationId: string().min(1),
|
|
8329
|
+
/** Narrow to one logical class; omit for every profile on the location. */
|
|
8330
|
+
footageClass: RelocateFootageClassSchema.optional()
|
|
8331
|
+
});
|
|
8332
|
+
/** `null` = the archive could not answer (no ledger on this node, or the
|
|
8333
|
+
* aggregate failed). Never conflated with an empty source. */
|
|
8334
|
+
var RelocateResidueSchema = object({
|
|
8335
|
+
segments: number().int().nonnegative(),
|
|
8336
|
+
bytes: number().int().nonnegative()
|
|
8337
|
+
}).nullable();
|
|
8338
|
+
/** How many rows a media pass would still act on against a given target — the
|
|
8339
|
+
* media lane's denominator AND its residue, from ONE derivation so the two can
|
|
8340
|
+
* never disagree. `null` = the count could not be taken. */
|
|
8341
|
+
var RelocatableMediaCountSchema = object({ rows: number().int().nonnegative() }).nullable();
|
|
8342
|
+
var RelocatableMediaCountInputSchema = object({
|
|
8343
|
+
toLocationId: string().min(1),
|
|
8344
|
+
/** Omitted = `move`. */
|
|
8345
|
+
mode: MediaRelocateModeSchema.optional()
|
|
8346
|
+
});
|
|
8347
|
+
/**
|
|
8220
8348
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
8221
8349
|
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
8222
8350
|
* so the persisted record schema and the consumer-facing cap can both consume it
|
|
@@ -8320,6 +8448,32 @@ var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(
|
|
|
8320
8448
|
* two addons declaring the same `id` must agree on `cardinality` (validated
|
|
8321
8449
|
* at kernel aggregation time, not here).
|
|
8322
8450
|
*/
|
|
8451
|
+
/**
|
|
8452
|
+
* `StorageAccess` — how the service that DECLARED a storage-location kind
|
|
8453
|
+
* actually reaches the bytes. It is the constraint that decides which
|
|
8454
|
+
* `storage-provider`s may back a location of that kind.
|
|
8455
|
+
*
|
|
8456
|
+
* - `'local-path'` — the service asks `storage.resolve` for a path string and
|
|
8457
|
+
* then does its own `node:fs` I/O on it (the recorder's segment writer, the
|
|
8458
|
+
* post-analysis media roots). Only a provider that serves a genuine local
|
|
8459
|
+
* filesystem (`getProviderInfo().nodeLocal === true`) can satisfy that: a
|
|
8460
|
+
* remote provider's `resolve` returns a path on the REMOTE host, and
|
|
8461
|
+
* `fs.readdir` of it on this node either fails or — far worse — succeeds
|
|
8462
|
+
* against a same-named local directory that is something else entirely.
|
|
8463
|
+
*
|
|
8464
|
+
* - `'cap-mediated'` — every byte travels through the `storage` cap
|
|
8465
|
+
* (`read`/`write`, or `beginUpload`/`writeChunk`/`finalizeUpload`). The
|
|
8466
|
+
* service never sees a path, so any provider can back it. `backups` is the
|
|
8467
|
+
* one kind that qualifies today.
|
|
8468
|
+
*
|
|
8469
|
+
* Before this existed, `recordings` was unreachable by SFTP/S3/WebDAV only as
|
|
8470
|
+
* an EMERGENT property of how the recorder happened to be written. Nothing
|
|
8471
|
+
* refused the configuration; the first write simply went somewhere wrong, and
|
|
8472
|
+
* a recording write that goes wrong surfaces as a silent black window rather
|
|
8473
|
+
* than an error (the read path does not `stat`). This turns that accident into
|
|
8474
|
+
* a declared, enforced, testable refusal.
|
|
8475
|
+
*/
|
|
8476
|
+
var StorageAccessSchema = _enum(["local-path", "cap-mediated"]);
|
|
8323
8477
|
var StorageLocationDeclarationSchema = object({
|
|
8324
8478
|
/**
|
|
8325
8479
|
* Global location identifier, e.g. `recordings` or `recordingsLow`.
|
|
@@ -8339,6 +8493,19 @@ var StorageLocationDeclarationSchema = object({
|
|
|
8339
8493
|
*/
|
|
8340
8494
|
cardinality: _enum(["single", "multi"]),
|
|
8341
8495
|
/**
|
|
8496
|
+
* HOW the declaring service reaches the bytes — and therefore WHICH
|
|
8497
|
+
* providers may back a location of this kind. See {@link StorageAccessSchema}
|
|
8498
|
+
* and {@link STORAGE_ACCESS_FALLBACK}.
|
|
8499
|
+
*
|
|
8500
|
+
* Absent means `'local-path'`. That default is FAIL-CLOSED on purpose: it
|
|
8501
|
+
* can only over-restrict (refuse a remote provider for a kind that might
|
|
8502
|
+
* have coped) and never under-restrict. Declaring `'cap-mediated'` is the
|
|
8503
|
+
* permissive direction and is therefore never inferred — a repo guard
|
|
8504
|
+
* (`scripts/check-storage-access-declarations.ts`) refuses to let it be
|
|
8505
|
+
* reached by omission.
|
|
8506
|
+
*/
|
|
8507
|
+
access: StorageAccessSchema.optional(),
|
|
8508
|
+
/**
|
|
8342
8509
|
* When set, the default instance for this location inherits its resolved
|
|
8343
8510
|
* root from the named location's default instance. Useful for derivative
|
|
8344
8511
|
* slots (e.g. `recordingsLow` → `recordings`) so operators only need to
|
|
@@ -17994,8 +18161,10 @@ var TrackSchema = object({
|
|
|
17994
18161
|
lastSeen: number(),
|
|
17995
18162
|
/** Frame-rate position history (subject to maxPositionHistory cap). */
|
|
17996
18163
|
positions: array(TrackPositionSchema).readonly(),
|
|
17997
|
-
/** Periodic snapshots at snapshotIntervalMs cadence
|
|
17998
|
-
*
|
|
18164
|
+
/** Periodic snapshots at snapshotIntervalMs cadence — DEBUG media, produced
|
|
18165
|
+
* only while `MediaSettings.debugMediaEnabled` is on for the camera (D299;
|
|
18166
|
+
* the retired `saveThumbnails` used to gate this and the rolling
|
|
18167
|
+
* `lastFrame` together). Empty is the healthy default, not a capture gap. */
|
|
17999
18168
|
snapshots: array(TrackSnapshotSchema).readonly(),
|
|
18000
18169
|
/** Deduplicated zones the track has entered at least once. Zone IDS. */
|
|
18001
18170
|
zonesVisited: array(string()).readonly(),
|
|
@@ -18855,7 +19024,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
18855
19024
|
}), method(RelocateMediaInputSchema, object({ jobId: string() }), {
|
|
18856
19025
|
kind: "mutation",
|
|
18857
19026
|
auth: "admin"
|
|
18858
|
-
}), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(
|
|
19027
|
+
}), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(RelocatableMediaCountInputSchema, RelocatableMediaCountSchema, {
|
|
19028
|
+
kind: "query",
|
|
19029
|
+
auth: "admin"
|
|
19030
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
18859
19031
|
kind: "query",
|
|
18860
19032
|
auth: "admin"
|
|
18861
19033
|
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
@@ -20814,6 +20986,9 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
|
|
|
20814
20986
|
}), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
20815
20987
|
kind: "mutation",
|
|
20816
20988
|
auth: "admin"
|
|
20989
|
+
}), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
|
|
20990
|
+
kind: "mutation",
|
|
20991
|
+
auth: "admin"
|
|
20817
20992
|
});
|
|
20818
20993
|
var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
|
|
20819
20994
|
providerId: string().min(1),
|
|
@@ -21212,12 +21387,38 @@ response: record(string(), unknown()) }), object({
|
|
|
21212
21387
|
*
|
|
21213
21388
|
* ## Why this is a capability and not a helper
|
|
21214
21389
|
*
|
|
21215
|
-
*
|
|
21216
|
-
*
|
|
21217
|
-
*
|
|
21218
|
-
*
|
|
21219
|
-
*
|
|
21220
|
-
*
|
|
21390
|
+
* This capability was introduced with the claim that SIX stores in
|
|
21391
|
+
* `addon-post-analysis` held vectors in a `JSON` settings-store column — object
|
|
21392
|
+
* CLIP, face, plate, vehicle, identity, and the event store's derivatives. That
|
|
21393
|
+
* claim was never true, and leaving it here made five stores look like pending
|
|
21394
|
+
* work when three of them have no vector at all. Counted column by column on
|
|
21395
|
+
* 2026-08-30, exactly THREE ever held one:
|
|
21396
|
+
*
|
|
21397
|
+
* - `object-clip` — 512-dim CLIP image embedding, migrated 2026-08-06.
|
|
21398
|
+
* - `faces.embedding` — 512-dim ArcFace face embedding, migrated 2026-08-30.
|
|
21399
|
+
* - `identity-samples.embedding` — the same ArcFace vector for an ENROLLED
|
|
21400
|
+
* face, migrated 2026-08-30 into its OWN index (see below).
|
|
21401
|
+
*
|
|
21402
|
+
* `plates` and `vehicle-samples` store a plate STRING and a score; `vehicles`
|
|
21403
|
+
* and `identities` store a name; the event store stores no derivative vector.
|
|
21404
|
+
* They are not migration candidates and never were.
|
|
21405
|
+
*
|
|
21406
|
+
* Measured on the live hub the JSON encoding cost ~11.7 KB per row (512 floats
|
|
21407
|
+
* as TEXT, `JSON.parse`d on every search) and made semantic search load 5,000
|
|
21408
|
+
* rows before ranking anything.
|
|
21409
|
+
*
|
|
21410
|
+
* ## One index per COMPARISON, never per encoder
|
|
21411
|
+
*
|
|
21412
|
+
* `faces` and `identity-samples` hold the same 512 ArcFace dims from the same
|
|
21413
|
+
* model, and they still get two indexes. An index is a set of things that are
|
|
21414
|
+
* ranked against each other and that live and die together, and these two are
|
|
21415
|
+
* neither: a `faces` row is TRACK-OWNED and cascades away with its track under
|
|
21416
|
+
* a per-camera capacity cap, an `identity-samples` row is retention-EXEMPT
|
|
21417
|
+
* forever and is the gallery every recognition ranks against. One index would
|
|
21418
|
+
* mean every gallery load and every reconcile carried a filter whose failure
|
|
21419
|
+
* mode is either ranking a candidate against itself or reclaiming an enrolled
|
|
21420
|
+
* person's only sample. The dimension they share is not a reason to share an
|
|
21421
|
+
* index; the question they answer is, and it differs.
|
|
21221
21422
|
*
|
|
21222
21423
|
* The fix is not a faster loop, it is a different backend — and the backend
|
|
21223
21424
|
* should be replaceable without touching six callers. So: a singleton
|
|
@@ -21322,7 +21523,20 @@ var VectorQueryResultSchema = object({
|
|
|
21322
21523
|
*/
|
|
21323
21524
|
scanned: number(),
|
|
21324
21525
|
/** True when the backend could not consider every row that passed the filter. */
|
|
21325
|
-
truncated: boolean()
|
|
21526
|
+
truncated: boolean(),
|
|
21527
|
+
/**
|
|
21528
|
+
* The `topK` the backend actually ran with.
|
|
21529
|
+
*
|
|
21530
|
+
* Every backend has a ceiling — sqlite-vec's is 4,096 — and a caller asking
|
|
21531
|
+
* past it used to learn nothing but a boolean, from a WARN in the provider's
|
|
21532
|
+
* own log rather than in its answer. That is how an audit asking for 20,000
|
|
21533
|
+
* consumed 4,096 and reported `examined: 4096` as if it had walked the index,
|
|
21534
|
+
* for weeks. `truncated` says THAT the answer was short; this says BY HOW
|
|
21535
|
+
* MUCH, in the return value, where the caller cannot fail to see it.
|
|
21536
|
+
*
|
|
21537
|
+
* Equals the requested `topK` whenever nothing was lowered.
|
|
21538
|
+
*/
|
|
21539
|
+
effectiveTopK: number().int().positive()
|
|
21326
21540
|
});
|
|
21327
21541
|
var VectorDeleteInputSchema = object({
|
|
21328
21542
|
index: string(),
|
|
@@ -21351,6 +21565,68 @@ var VectorGetResultSchema = object({ items: array(object({
|
|
|
21351
21565
|
id: string(),
|
|
21352
21566
|
metadata: VectorMetadataSchema
|
|
21353
21567
|
})) });
|
|
21568
|
+
/**
|
|
21569
|
+
* Ids to read back WITH their vectors.
|
|
21570
|
+
*
|
|
21571
|
+
* The sibling of {@link VectorGetResultSchema}, and deliberately a separate
|
|
21572
|
+
* method rather than a flag on it: `getByIds` promises no vectors and its one
|
|
21573
|
+
* caller depends on that promise. This one promises the opposite.
|
|
21574
|
+
*
|
|
21575
|
+
* It exists because a store cannot put its vectors here otherwise. An ArcFace
|
|
21576
|
+
* gallery is ranked IN PROCESS, per detection, against every enrolled sample —
|
|
21577
|
+
* a per-face cross-process KNN would be a network round trip inside the
|
|
21578
|
+
* recognition loop. So the gallery is loaded once and held in RAM, and loading
|
|
21579
|
+
* it requires the index to hand the floats back. Without this method the only
|
|
21580
|
+
* way to keep a readable vector is a JSON column, which is the thing this
|
|
21581
|
+
* capability exists to delete.
|
|
21582
|
+
*
|
|
21583
|
+
* BOUNDED BY THE CALLER: ids are named, never "everything". Enumerating an
|
|
21584
|
+
* index is {@link VectorScanInputSchema}'s job, and it returns no vectors.
|
|
21585
|
+
*/
|
|
21586
|
+
var VectorFetchInputSchema = object({
|
|
21587
|
+
index: string(),
|
|
21588
|
+
ids: array(string())
|
|
21589
|
+
});
|
|
21590
|
+
var VectorFetchResultSchema = object({ items: array(object({
|
|
21591
|
+
id: string(),
|
|
21592
|
+
/** base64 Float32LE — the same wire form `upsert` accepts. */
|
|
21593
|
+
vector: string(),
|
|
21594
|
+
metadata: VectorMetadataSchema
|
|
21595
|
+
})) });
|
|
21596
|
+
/**
|
|
21597
|
+
* ENUMERATE an index: one page of rows in a stable order, no ranking.
|
|
21598
|
+
*
|
|
21599
|
+
* A reconcile does not want the nearest rows, it wants ALL of them, and asking
|
|
21600
|
+
* a KNN for "all" is the wrong question twice over. It hits the backend's `k`
|
|
21601
|
+
* ceiling — 4,096 on sqlite-vec against a 22,128-row index — and it needs a
|
|
21602
|
+
* probe vector it does not have, so the audit passed a ZERO vector whose cosine
|
|
21603
|
+
* distance to every row is degenerate. `examined: 4096` then read as "we
|
|
21604
|
+
* looked" for as long as anyone cared to read it.
|
|
21605
|
+
*
|
|
21606
|
+
* This is the primitive that question actually needs: a bounded page, ordered
|
|
21607
|
+
* by the backend's own row order, costing no distance computation at all.
|
|
21608
|
+
* Vectors are NOT returned — an enumeration that shipped 2 KB per row would be
|
|
21609
|
+
* the full-table read this capability was built to stop.
|
|
21610
|
+
*/
|
|
21611
|
+
var VectorScanInputSchema = object({
|
|
21612
|
+
index: string(),
|
|
21613
|
+
/** Opaque resume point. `0` starts at the top; pass back `nextCursor`. */
|
|
21614
|
+
cursor: number().int().nonnegative().default(0),
|
|
21615
|
+
limit: number().int().positive()
|
|
21616
|
+
});
|
|
21617
|
+
var VectorScanResultSchema = object({
|
|
21618
|
+
items: array(object({
|
|
21619
|
+
id: string(),
|
|
21620
|
+
metadata: VectorMetadataSchema
|
|
21621
|
+
})),
|
|
21622
|
+
/**
|
|
21623
|
+
* Where the next page starts, or `null` when the walk reached the end.
|
|
21624
|
+
*
|
|
21625
|
+
* `null` is the ONLY end-of-index signal. A caller must not infer the end
|
|
21626
|
+
* from a short page: a backend is free to return fewer rows than asked.
|
|
21627
|
+
*/
|
|
21628
|
+
nextCursor: number().int().nonnegative().nullable()
|
|
21629
|
+
});
|
|
21354
21630
|
var VectorStatsInputSchema = object({ index: string() });
|
|
21355
21631
|
var VectorStatsResultSchema = object({
|
|
21356
21632
|
/** Provider id, so an operator can tell brute force from an ANN index. */
|
|
@@ -21369,7 +21645,7 @@ method(VectorDeclareIndexInputSchema, _void(), {
|
|
|
21369
21645
|
}), method(VectorUpsertInputSchema, VectorUpsertResultSchema, {
|
|
21370
21646
|
kind: "mutation",
|
|
21371
21647
|
auth: "admin"
|
|
21372
|
-
}), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
|
|
21648
|
+
}), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorFetchInputSchema, VectorFetchResultSchema, { auth: "admin" }), method(VectorScanInputSchema, VectorScanResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
|
|
21373
21649
|
kind: "mutation",
|
|
21374
21650
|
auth: "admin"
|
|
21375
21651
|
}), method(VectorDeleteByFilterInputSchema, VectorDeleteResultSchema, {
|
|
@@ -26273,6 +26549,9 @@ method(object({
|
|
|
26273
26549
|
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
26274
26550
|
kind: "query",
|
|
26275
26551
|
auth: "admin"
|
|
26552
|
+
}), method(RelocateResidueInputSchema, RelocateResidueSchema, {
|
|
26553
|
+
kind: "query",
|
|
26554
|
+
auth: "admin"
|
|
26276
26555
|
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
26277
26556
|
kind: "mutation",
|
|
26278
26557
|
auth: "admin"
|
|
@@ -31238,6 +31517,12 @@ Object.freeze({
|
|
|
31238
31517
|
addonId: null,
|
|
31239
31518
|
access: "create"
|
|
31240
31519
|
},
|
|
31520
|
+
"pipelineAnalytics.countRelocatableMedia": {
|
|
31521
|
+
capName: "pipeline-analytics",
|
|
31522
|
+
capScope: "device",
|
|
31523
|
+
addonId: null,
|
|
31524
|
+
access: "view"
|
|
31525
|
+
},
|
|
31241
31526
|
"pipelineAnalytics.countUnstampedEventMedia": {
|
|
31242
31527
|
capName: "pipeline-analytics",
|
|
31243
31528
|
capScope: "device",
|
|
@@ -32402,6 +32687,12 @@ Object.freeze({
|
|
|
32402
32687
|
addonId: null,
|
|
32403
32688
|
access: "view"
|
|
32404
32689
|
},
|
|
32690
|
+
"recording.getRelocateResidue": {
|
|
32691
|
+
capName: "recording",
|
|
32692
|
+
capScope: "system",
|
|
32693
|
+
addonId: null,
|
|
32694
|
+
access: "view"
|
|
32695
|
+
},
|
|
32405
32696
|
"recording.getStorageMigrationMoveStatus": {
|
|
32406
32697
|
capName: "recording",
|
|
32407
32698
|
capScope: "system",
|
|
@@ -32948,12 +33239,30 @@ Object.freeze({
|
|
|
32948
33239
|
addonId: null,
|
|
32949
33240
|
access: "create"
|
|
32950
33241
|
},
|
|
33242
|
+
"storageMigration.drain": {
|
|
33243
|
+
capName: "storage-migration",
|
|
33244
|
+
capScope: "system",
|
|
33245
|
+
addonId: null,
|
|
33246
|
+
access: "create"
|
|
33247
|
+
},
|
|
33248
|
+
"storageMigration.movers": {
|
|
33249
|
+
capName: "storage-migration",
|
|
33250
|
+
capScope: "system",
|
|
33251
|
+
addonId: null,
|
|
33252
|
+
access: "view"
|
|
33253
|
+
},
|
|
32951
33254
|
"storageMigration.plan": {
|
|
32952
33255
|
capName: "storage-migration",
|
|
32953
33256
|
capScope: "system",
|
|
32954
33257
|
addonId: null,
|
|
32955
33258
|
access: "view"
|
|
32956
33259
|
},
|
|
33260
|
+
"storageMigration.residue": {
|
|
33261
|
+
capName: "storage-migration",
|
|
33262
|
+
capScope: "system",
|
|
33263
|
+
addonId: null,
|
|
33264
|
+
access: "view"
|
|
33265
|
+
},
|
|
32957
33266
|
"storageMigration.start": {
|
|
32958
33267
|
capName: "storage-migration",
|
|
32959
33268
|
capScope: "system",
|
|
@@ -33788,6 +34097,12 @@ Object.freeze({
|
|
|
33788
34097
|
addonId: null,
|
|
33789
34098
|
access: "delete"
|
|
33790
34099
|
},
|
|
34100
|
+
"vectorStore.fetchByIds": {
|
|
34101
|
+
capName: "vector-store",
|
|
34102
|
+
capScope: "system",
|
|
34103
|
+
addonId: null,
|
|
34104
|
+
access: "view"
|
|
34105
|
+
},
|
|
33791
34106
|
"vectorStore.getByIds": {
|
|
33792
34107
|
capName: "vector-store",
|
|
33793
34108
|
capScope: "system",
|
|
@@ -33800,6 +34115,12 @@ Object.freeze({
|
|
|
33800
34115
|
addonId: null,
|
|
33801
34116
|
access: "view"
|
|
33802
34117
|
},
|
|
34118
|
+
"vectorStore.scan": {
|
|
34119
|
+
capName: "vector-store",
|
|
34120
|
+
capScope: "system",
|
|
34121
|
+
addonId: null,
|
|
34122
|
+
access: "view"
|
|
34123
|
+
},
|
|
33803
34124
|
"vectorStore.stats": {
|
|
33804
34125
|
capName: "vector-store",
|
|
33805
34126
|
capScope: "system",
|
package/dist/index.mjs
CHANGED
|
@@ -8161,13 +8161,49 @@ var StorageMigrationParticipantSchema = _enum([
|
|
|
8161
8161
|
"recorder",
|
|
8162
8162
|
"analytics"
|
|
8163
8163
|
]);
|
|
8164
|
+
/**
|
|
8165
|
+
* The mover's own numbers, folded onto the coordinator's durable move record.
|
|
8166
|
+
*
|
|
8167
|
+
* The long half of a non-blocking migration is `draining`, and it is measured
|
|
8168
|
+
* in hours: 136 885 files at ~4 MB/s is about five of them. Before this shape
|
|
8169
|
+
* existed the only place those numbers appeared was a Loki line, so an operator
|
|
8170
|
+
* watching the Admin UI saw `phase: draining` and nothing else for a whole
|
|
8171
|
+
* afternoon.
|
|
8172
|
+
*
|
|
8173
|
+
* It is POLLED, never pushed. Events are telemetry and may be dropped
|
|
8174
|
+
* (D8/D11), and a dropped progress event is indistinguishable from a stalled
|
|
8175
|
+
* mover — which is the exact failure this is meant to end. The coordinator's
|
|
8176
|
+
* `waitForMoves` already fetches the whole {@link RelocateJob} on every tick to
|
|
8177
|
+
* read `state`; folding the counters costs no extra read and makes the durable
|
|
8178
|
+
* record say afterwards how far a move actually got.
|
|
8179
|
+
*
|
|
8180
|
+
* `filesTotal` is `null` for "no honest denominator" and is never zero-filled:
|
|
8181
|
+
* a windowed footage job (`sinceMs`) and a node with no ledger both genuinely
|
|
8182
|
+
* cannot say M, and a 0 there would render as "100 % done".
|
|
8183
|
+
*/
|
|
8184
|
+
var StorageMigrationMoveProgressSchema = object({
|
|
8185
|
+
filesMoved: number().int().nonnegative(),
|
|
8186
|
+
/** The archive census — the **M** of "N of M" (D295). `null` = unknowable. */
|
|
8187
|
+
filesTotal: number().int().nonnegative().nullable(),
|
|
8188
|
+
bytesMoved: number().int().nonnegative(),
|
|
8189
|
+
/** The MOVER's start, not the migration's: a drain restarted after an addon
|
|
8190
|
+
* crash gets a new mover, and a rate computed from the migration's start
|
|
8191
|
+
* would silently average in the time nothing was running. */
|
|
8192
|
+
startedAt: number(),
|
|
8193
|
+
/** When the coordinator last read these numbers. Paired with `startedAt` it
|
|
8194
|
+
* is the only honest rate: both clocks are the hub's, so a UI never has to
|
|
8195
|
+
* subtract its own. */
|
|
8196
|
+
observedAt: number()
|
|
8197
|
+
});
|
|
8164
8198
|
var StorageMigrationMoveSchema = object({
|
|
8165
8199
|
storageClass: StorageMigrationClassSchema,
|
|
8166
8200
|
fromLocationId: string(),
|
|
8167
8201
|
toLocationId: string(),
|
|
8168
8202
|
moverJobId: string().nullable(),
|
|
8169
8203
|
state: RelocateJobStateSchema.nullable(),
|
|
8170
|
-
error: string().nullable()
|
|
8204
|
+
error: string().nullable(),
|
|
8205
|
+
/** Last observed mover counters; `null` until the mover has been polled once. */
|
|
8206
|
+
progress: StorageMigrationMoveProgressSchema.nullable()
|
|
8171
8207
|
});
|
|
8172
8208
|
var StorageMigrationJobSchema = object({
|
|
8173
8209
|
jobId: string(),
|
|
@@ -8213,6 +8249,98 @@ var StorageMigrationPlanSchema = object({
|
|
|
8213
8249
|
findings: array(StorageMigrationFindingSchema)
|
|
8214
8250
|
});
|
|
8215
8251
|
/**
|
|
8252
|
+
* A mover as it exists RIGHT NOW, whether or not a migration job owns it.
|
|
8253
|
+
*
|
|
8254
|
+
* The coordinator's job record is the state of record for a migration, and its
|
|
8255
|
+
* moves carry {@link StorageMigrationMoveProgress}. But the movers are usable
|
|
8256
|
+
* standalone — `recording.relocateFootage` and `pipelineAnalytics.relocateMedia`
|
|
8257
|
+
* are both operator-callable, and on 2026-08-29 a five-hour drain was armed that
|
|
8258
|
+
* way because no supported UI path existed. A mover armed like that has no job
|
|
8259
|
+
* to fold progress into, so it has to be readable on its own or it is invisible.
|
|
8260
|
+
*
|
|
8261
|
+
* `migrationJobId` is what tells the two apart: `null` means nothing here
|
|
8262
|
+
* orchestrated it.
|
|
8263
|
+
*/
|
|
8264
|
+
var StorageMigrationMoverSchema = object({
|
|
8265
|
+
lane: _enum(["footage", "media"]),
|
|
8266
|
+
job: RelocateJobSchema,
|
|
8267
|
+
/** The coordinator job that armed this mover, or `null` for a mover armed
|
|
8268
|
+
* directly against the owning addon. */
|
|
8269
|
+
migrationJobId: string().nullable(),
|
|
8270
|
+
/** When the hub read these counters. Stamped here so a rate is `bytesMoved`
|
|
8271
|
+
* over (`observedAt` − `job.startedAt`) with BOTH ends on the hub's clock —
|
|
8272
|
+
* a browser subtracting its own `Date.now()` from a server `startedAt` is a
|
|
8273
|
+
* rate made of two different clocks. */
|
|
8274
|
+
observedAt: number()
|
|
8275
|
+
});
|
|
8276
|
+
/**
|
|
8277
|
+
* What a SOURCE still holds for one storage class — the number that makes a
|
|
8278
|
+
* "drain remaining" action honest rather than hopeful.
|
|
8279
|
+
*
|
|
8280
|
+
* It comes from the archive (`SegmentHourLedger.census` for footage, the media
|
|
8281
|
+
* engine's own selection count for media), never from the resident index: a
|
|
8282
|
+
* drain sized off `RecordingIndex` is what reported `done` over 80.3 GB it had
|
|
8283
|
+
* never been told about (D295).
|
|
8284
|
+
*
|
|
8285
|
+
* `items`/`bytes` are `null` for "the archive could not be asked", which is
|
|
8286
|
+
* deliberately NOT zero: a drain is still offered for an unknown residue,
|
|
8287
|
+
* because refusing on an unanswerable read would hide exactly the case an
|
|
8288
|
+
* operator needs to act on.
|
|
8289
|
+
*/
|
|
8290
|
+
var StorageMigrationResidueSchema = object({
|
|
8291
|
+
storageClass: StorageMigrationClassSchema,
|
|
8292
|
+
/** The location still holding the data. `'*'` for the media lane, whose rows
|
|
8293
|
+
* move from wherever they are rather than from one named source. */
|
|
8294
|
+
fromLocationId: string(),
|
|
8295
|
+
/** Where a drain would move it — the class's CURRENT default. */
|
|
8296
|
+
toLocationId: string(),
|
|
8297
|
+
/** Segments (footage lane) or rows (media lane) still on the source. */
|
|
8298
|
+
items: number().int().nonnegative().nullable(),
|
|
8299
|
+
/** Bytes on the source; `null` when the lane counts rows rather than bytes. */
|
|
8300
|
+
bytes: number().int().nonnegative().nullable()
|
|
8301
|
+
});
|
|
8302
|
+
/**
|
|
8303
|
+
* Run the DRAIN half and nothing else.
|
|
8304
|
+
*
|
|
8305
|
+
* A migration that reached `done` has already repointed, so `start` correctly
|
|
8306
|
+
* refuses its destination ("already the default") — there is nothing left to
|
|
8307
|
+
* repoint. But the drain can fail, be cancelled, be interrupted by a restart,
|
|
8308
|
+
* or finish against a work list that was a tenth of the archive (D295), and
|
|
8309
|
+
* before this there was no supported way to run only that half: the only way
|
|
8310
|
+
* through was calling `recording.relocateFootage` by hand over admin tRPC.
|
|
8311
|
+
*
|
|
8312
|
+
* `drain` NEVER calls `setDefaultLocations`. That is what keeps `start`'s
|
|
8313
|
+
* refusal meaningful: the two verbs are disjoint, so nothing here can silently
|
|
8314
|
+
* re-repoint a class that is already migrated.
|
|
8315
|
+
*/
|
|
8316
|
+
var StorageMigrationDrainInputSchema = object({
|
|
8317
|
+
/** The classes to drain. Each must appear in `storageMigration.residue`, so
|
|
8318
|
+
* a class whose source is already empty is refused rather than started. */
|
|
8319
|
+
classes: array(StorageMigrationClassSchema).min(1),
|
|
8320
|
+
throttleMbps: number().min(1).max(1e3).optional()
|
|
8321
|
+
});
|
|
8322
|
+
/** What a footage source still holds, asked of the durable hour ledger. */
|
|
8323
|
+
var RelocateResidueInputSchema = object({
|
|
8324
|
+
fromLocationId: string().min(1),
|
|
8325
|
+
/** Narrow to one logical class; omit for every profile on the location. */
|
|
8326
|
+
footageClass: RelocateFootageClassSchema.optional()
|
|
8327
|
+
});
|
|
8328
|
+
/** `null` = the archive could not answer (no ledger on this node, or the
|
|
8329
|
+
* aggregate failed). Never conflated with an empty source. */
|
|
8330
|
+
var RelocateResidueSchema = object({
|
|
8331
|
+
segments: number().int().nonnegative(),
|
|
8332
|
+
bytes: number().int().nonnegative()
|
|
8333
|
+
}).nullable();
|
|
8334
|
+
/** How many rows a media pass would still act on against a given target — the
|
|
8335
|
+
* media lane's denominator AND its residue, from ONE derivation so the two can
|
|
8336
|
+
* never disagree. `null` = the count could not be taken. */
|
|
8337
|
+
var RelocatableMediaCountSchema = object({ rows: number().int().nonnegative() }).nullable();
|
|
8338
|
+
var RelocatableMediaCountInputSchema = object({
|
|
8339
|
+
toLocationId: string().min(1),
|
|
8340
|
+
/** Omitted = `move`. */
|
|
8341
|
+
mode: MediaRelocateModeSchema.optional()
|
|
8342
|
+
});
|
|
8343
|
+
/**
|
|
8216
8344
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
8217
8345
|
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
8218
8346
|
* so the persisted record schema and the consumer-facing cap can both consume it
|
|
@@ -8316,6 +8444,32 @@ var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(
|
|
|
8316
8444
|
* two addons declaring the same `id` must agree on `cardinality` (validated
|
|
8317
8445
|
* at kernel aggregation time, not here).
|
|
8318
8446
|
*/
|
|
8447
|
+
/**
|
|
8448
|
+
* `StorageAccess` — how the service that DECLARED a storage-location kind
|
|
8449
|
+
* actually reaches the bytes. It is the constraint that decides which
|
|
8450
|
+
* `storage-provider`s may back a location of that kind.
|
|
8451
|
+
*
|
|
8452
|
+
* - `'local-path'` — the service asks `storage.resolve` for a path string and
|
|
8453
|
+
* then does its own `node:fs` I/O on it (the recorder's segment writer, the
|
|
8454
|
+
* post-analysis media roots). Only a provider that serves a genuine local
|
|
8455
|
+
* filesystem (`getProviderInfo().nodeLocal === true`) can satisfy that: a
|
|
8456
|
+
* remote provider's `resolve` returns a path on the REMOTE host, and
|
|
8457
|
+
* `fs.readdir` of it on this node either fails or — far worse — succeeds
|
|
8458
|
+
* against a same-named local directory that is something else entirely.
|
|
8459
|
+
*
|
|
8460
|
+
* - `'cap-mediated'` — every byte travels through the `storage` cap
|
|
8461
|
+
* (`read`/`write`, or `beginUpload`/`writeChunk`/`finalizeUpload`). The
|
|
8462
|
+
* service never sees a path, so any provider can back it. `backups` is the
|
|
8463
|
+
* one kind that qualifies today.
|
|
8464
|
+
*
|
|
8465
|
+
* Before this existed, `recordings` was unreachable by SFTP/S3/WebDAV only as
|
|
8466
|
+
* an EMERGENT property of how the recorder happened to be written. Nothing
|
|
8467
|
+
* refused the configuration; the first write simply went somewhere wrong, and
|
|
8468
|
+
* a recording write that goes wrong surfaces as a silent black window rather
|
|
8469
|
+
* than an error (the read path does not `stat`). This turns that accident into
|
|
8470
|
+
* a declared, enforced, testable refusal.
|
|
8471
|
+
*/
|
|
8472
|
+
var StorageAccessSchema = _enum(["local-path", "cap-mediated"]);
|
|
8319
8473
|
var StorageLocationDeclarationSchema = object({
|
|
8320
8474
|
/**
|
|
8321
8475
|
* Global location identifier, e.g. `recordings` or `recordingsLow`.
|
|
@@ -8335,6 +8489,19 @@ var StorageLocationDeclarationSchema = object({
|
|
|
8335
8489
|
*/
|
|
8336
8490
|
cardinality: _enum(["single", "multi"]),
|
|
8337
8491
|
/**
|
|
8492
|
+
* HOW the declaring service reaches the bytes — and therefore WHICH
|
|
8493
|
+
* providers may back a location of this kind. See {@link StorageAccessSchema}
|
|
8494
|
+
* and {@link STORAGE_ACCESS_FALLBACK}.
|
|
8495
|
+
*
|
|
8496
|
+
* Absent means `'local-path'`. That default is FAIL-CLOSED on purpose: it
|
|
8497
|
+
* can only over-restrict (refuse a remote provider for a kind that might
|
|
8498
|
+
* have coped) and never under-restrict. Declaring `'cap-mediated'` is the
|
|
8499
|
+
* permissive direction and is therefore never inferred — a repo guard
|
|
8500
|
+
* (`scripts/check-storage-access-declarations.ts`) refuses to let it be
|
|
8501
|
+
* reached by omission.
|
|
8502
|
+
*/
|
|
8503
|
+
access: StorageAccessSchema.optional(),
|
|
8504
|
+
/**
|
|
8338
8505
|
* When set, the default instance for this location inherits its resolved
|
|
8339
8506
|
* root from the named location's default instance. Useful for derivative
|
|
8340
8507
|
* slots (e.g. `recordingsLow` → `recordings`) so operators only need to
|
|
@@ -17990,8 +18157,10 @@ var TrackSchema = object({
|
|
|
17990
18157
|
lastSeen: number(),
|
|
17991
18158
|
/** Frame-rate position history (subject to maxPositionHistory cap). */
|
|
17992
18159
|
positions: array(TrackPositionSchema).readonly(),
|
|
17993
|
-
/** Periodic snapshots at snapshotIntervalMs cadence
|
|
17994
|
-
*
|
|
18160
|
+
/** Periodic snapshots at snapshotIntervalMs cadence — DEBUG media, produced
|
|
18161
|
+
* only while `MediaSettings.debugMediaEnabled` is on for the camera (D299;
|
|
18162
|
+
* the retired `saveThumbnails` used to gate this and the rolling
|
|
18163
|
+
* `lastFrame` together). Empty is the healthy default, not a capture gap. */
|
|
17995
18164
|
snapshots: array(TrackSnapshotSchema).readonly(),
|
|
17996
18165
|
/** Deduplicated zones the track has entered at least once. Zone IDS. */
|
|
17997
18166
|
zonesVisited: array(string()).readonly(),
|
|
@@ -18851,7 +19020,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
18851
19020
|
}), method(RelocateMediaInputSchema, object({ jobId: string() }), {
|
|
18852
19021
|
kind: "mutation",
|
|
18853
19022
|
auth: "admin"
|
|
18854
|
-
}), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(
|
|
19023
|
+
}), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(RelocatableMediaCountInputSchema, RelocatableMediaCountSchema, {
|
|
19024
|
+
kind: "query",
|
|
19025
|
+
auth: "admin"
|
|
19026
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
18855
19027
|
kind: "query",
|
|
18856
19028
|
auth: "admin"
|
|
18857
19029
|
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
@@ -20810,6 +20982,9 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
|
|
|
20810
20982
|
}), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
20811
20983
|
kind: "mutation",
|
|
20812
20984
|
auth: "admin"
|
|
20985
|
+
}), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
|
|
20986
|
+
kind: "mutation",
|
|
20987
|
+
auth: "admin"
|
|
20813
20988
|
});
|
|
20814
20989
|
var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
|
|
20815
20990
|
providerId: string().min(1),
|
|
@@ -21208,12 +21383,38 @@ response: record(string(), unknown()) }), object({
|
|
|
21208
21383
|
*
|
|
21209
21384
|
* ## Why this is a capability and not a helper
|
|
21210
21385
|
*
|
|
21211
|
-
*
|
|
21212
|
-
*
|
|
21213
|
-
*
|
|
21214
|
-
*
|
|
21215
|
-
*
|
|
21216
|
-
*
|
|
21386
|
+
* This capability was introduced with the claim that SIX stores in
|
|
21387
|
+
* `addon-post-analysis` held vectors in a `JSON` settings-store column — object
|
|
21388
|
+
* CLIP, face, plate, vehicle, identity, and the event store's derivatives. That
|
|
21389
|
+
* claim was never true, and leaving it here made five stores look like pending
|
|
21390
|
+
* work when three of them have no vector at all. Counted column by column on
|
|
21391
|
+
* 2026-08-30, exactly THREE ever held one:
|
|
21392
|
+
*
|
|
21393
|
+
* - `object-clip` — 512-dim CLIP image embedding, migrated 2026-08-06.
|
|
21394
|
+
* - `faces.embedding` — 512-dim ArcFace face embedding, migrated 2026-08-30.
|
|
21395
|
+
* - `identity-samples.embedding` — the same ArcFace vector for an ENROLLED
|
|
21396
|
+
* face, migrated 2026-08-30 into its OWN index (see below).
|
|
21397
|
+
*
|
|
21398
|
+
* `plates` and `vehicle-samples` store a plate STRING and a score; `vehicles`
|
|
21399
|
+
* and `identities` store a name; the event store stores no derivative vector.
|
|
21400
|
+
* They are not migration candidates and never were.
|
|
21401
|
+
*
|
|
21402
|
+
* Measured on the live hub the JSON encoding cost ~11.7 KB per row (512 floats
|
|
21403
|
+
* as TEXT, `JSON.parse`d on every search) and made semantic search load 5,000
|
|
21404
|
+
* rows before ranking anything.
|
|
21405
|
+
*
|
|
21406
|
+
* ## One index per COMPARISON, never per encoder
|
|
21407
|
+
*
|
|
21408
|
+
* `faces` and `identity-samples` hold the same 512 ArcFace dims from the same
|
|
21409
|
+
* model, and they still get two indexes. An index is a set of things that are
|
|
21410
|
+
* ranked against each other and that live and die together, and these two are
|
|
21411
|
+
* neither: a `faces` row is TRACK-OWNED and cascades away with its track under
|
|
21412
|
+
* a per-camera capacity cap, an `identity-samples` row is retention-EXEMPT
|
|
21413
|
+
* forever and is the gallery every recognition ranks against. One index would
|
|
21414
|
+
* mean every gallery load and every reconcile carried a filter whose failure
|
|
21415
|
+
* mode is either ranking a candidate against itself or reclaiming an enrolled
|
|
21416
|
+
* person's only sample. The dimension they share is not a reason to share an
|
|
21417
|
+
* index; the question they answer is, and it differs.
|
|
21217
21418
|
*
|
|
21218
21419
|
* The fix is not a faster loop, it is a different backend — and the backend
|
|
21219
21420
|
* should be replaceable without touching six callers. So: a singleton
|
|
@@ -21318,7 +21519,20 @@ var VectorQueryResultSchema = object({
|
|
|
21318
21519
|
*/
|
|
21319
21520
|
scanned: number(),
|
|
21320
21521
|
/** True when the backend could not consider every row that passed the filter. */
|
|
21321
|
-
truncated: boolean()
|
|
21522
|
+
truncated: boolean(),
|
|
21523
|
+
/**
|
|
21524
|
+
* The `topK` the backend actually ran with.
|
|
21525
|
+
*
|
|
21526
|
+
* Every backend has a ceiling — sqlite-vec's is 4,096 — and a caller asking
|
|
21527
|
+
* past it used to learn nothing but a boolean, from a WARN in the provider's
|
|
21528
|
+
* own log rather than in its answer. That is how an audit asking for 20,000
|
|
21529
|
+
* consumed 4,096 and reported `examined: 4096` as if it had walked the index,
|
|
21530
|
+
* for weeks. `truncated` says THAT the answer was short; this says BY HOW
|
|
21531
|
+
* MUCH, in the return value, where the caller cannot fail to see it.
|
|
21532
|
+
*
|
|
21533
|
+
* Equals the requested `topK` whenever nothing was lowered.
|
|
21534
|
+
*/
|
|
21535
|
+
effectiveTopK: number().int().positive()
|
|
21322
21536
|
});
|
|
21323
21537
|
var VectorDeleteInputSchema = object({
|
|
21324
21538
|
index: string(),
|
|
@@ -21347,6 +21561,68 @@ var VectorGetResultSchema = object({ items: array(object({
|
|
|
21347
21561
|
id: string(),
|
|
21348
21562
|
metadata: VectorMetadataSchema
|
|
21349
21563
|
})) });
|
|
21564
|
+
/**
|
|
21565
|
+
* Ids to read back WITH their vectors.
|
|
21566
|
+
*
|
|
21567
|
+
* The sibling of {@link VectorGetResultSchema}, and deliberately a separate
|
|
21568
|
+
* method rather than a flag on it: `getByIds` promises no vectors and its one
|
|
21569
|
+
* caller depends on that promise. This one promises the opposite.
|
|
21570
|
+
*
|
|
21571
|
+
* It exists because a store cannot put its vectors here otherwise. An ArcFace
|
|
21572
|
+
* gallery is ranked IN PROCESS, per detection, against every enrolled sample —
|
|
21573
|
+
* a per-face cross-process KNN would be a network round trip inside the
|
|
21574
|
+
* recognition loop. So the gallery is loaded once and held in RAM, and loading
|
|
21575
|
+
* it requires the index to hand the floats back. Without this method the only
|
|
21576
|
+
* way to keep a readable vector is a JSON column, which is the thing this
|
|
21577
|
+
* capability exists to delete.
|
|
21578
|
+
*
|
|
21579
|
+
* BOUNDED BY THE CALLER: ids are named, never "everything". Enumerating an
|
|
21580
|
+
* index is {@link VectorScanInputSchema}'s job, and it returns no vectors.
|
|
21581
|
+
*/
|
|
21582
|
+
var VectorFetchInputSchema = object({
|
|
21583
|
+
index: string(),
|
|
21584
|
+
ids: array(string())
|
|
21585
|
+
});
|
|
21586
|
+
var VectorFetchResultSchema = object({ items: array(object({
|
|
21587
|
+
id: string(),
|
|
21588
|
+
/** base64 Float32LE — the same wire form `upsert` accepts. */
|
|
21589
|
+
vector: string(),
|
|
21590
|
+
metadata: VectorMetadataSchema
|
|
21591
|
+
})) });
|
|
21592
|
+
/**
|
|
21593
|
+
* ENUMERATE an index: one page of rows in a stable order, no ranking.
|
|
21594
|
+
*
|
|
21595
|
+
* A reconcile does not want the nearest rows, it wants ALL of them, and asking
|
|
21596
|
+
* a KNN for "all" is the wrong question twice over. It hits the backend's `k`
|
|
21597
|
+
* ceiling — 4,096 on sqlite-vec against a 22,128-row index — and it needs a
|
|
21598
|
+
* probe vector it does not have, so the audit passed a ZERO vector whose cosine
|
|
21599
|
+
* distance to every row is degenerate. `examined: 4096` then read as "we
|
|
21600
|
+
* looked" for as long as anyone cared to read it.
|
|
21601
|
+
*
|
|
21602
|
+
* This is the primitive that question actually needs: a bounded page, ordered
|
|
21603
|
+
* by the backend's own row order, costing no distance computation at all.
|
|
21604
|
+
* Vectors are NOT returned — an enumeration that shipped 2 KB per row would be
|
|
21605
|
+
* the full-table read this capability was built to stop.
|
|
21606
|
+
*/
|
|
21607
|
+
var VectorScanInputSchema = object({
|
|
21608
|
+
index: string(),
|
|
21609
|
+
/** Opaque resume point. `0` starts at the top; pass back `nextCursor`. */
|
|
21610
|
+
cursor: number().int().nonnegative().default(0),
|
|
21611
|
+
limit: number().int().positive()
|
|
21612
|
+
});
|
|
21613
|
+
var VectorScanResultSchema = object({
|
|
21614
|
+
items: array(object({
|
|
21615
|
+
id: string(),
|
|
21616
|
+
metadata: VectorMetadataSchema
|
|
21617
|
+
})),
|
|
21618
|
+
/**
|
|
21619
|
+
* Where the next page starts, or `null` when the walk reached the end.
|
|
21620
|
+
*
|
|
21621
|
+
* `null` is the ONLY end-of-index signal. A caller must not infer the end
|
|
21622
|
+
* from a short page: a backend is free to return fewer rows than asked.
|
|
21623
|
+
*/
|
|
21624
|
+
nextCursor: number().int().nonnegative().nullable()
|
|
21625
|
+
});
|
|
21350
21626
|
var VectorStatsInputSchema = object({ index: string() });
|
|
21351
21627
|
var VectorStatsResultSchema = object({
|
|
21352
21628
|
/** Provider id, so an operator can tell brute force from an ANN index. */
|
|
@@ -21365,7 +21641,7 @@ method(VectorDeclareIndexInputSchema, _void(), {
|
|
|
21365
21641
|
}), method(VectorUpsertInputSchema, VectorUpsertResultSchema, {
|
|
21366
21642
|
kind: "mutation",
|
|
21367
21643
|
auth: "admin"
|
|
21368
|
-
}), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
|
|
21644
|
+
}), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorFetchInputSchema, VectorFetchResultSchema, { auth: "admin" }), method(VectorScanInputSchema, VectorScanResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
|
|
21369
21645
|
kind: "mutation",
|
|
21370
21646
|
auth: "admin"
|
|
21371
21647
|
}), method(VectorDeleteByFilterInputSchema, VectorDeleteResultSchema, {
|
|
@@ -26269,6 +26545,9 @@ method(object({
|
|
|
26269
26545
|
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
26270
26546
|
kind: "query",
|
|
26271
26547
|
auth: "admin"
|
|
26548
|
+
}), method(RelocateResidueInputSchema, RelocateResidueSchema, {
|
|
26549
|
+
kind: "query",
|
|
26550
|
+
auth: "admin"
|
|
26272
26551
|
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
26273
26552
|
kind: "mutation",
|
|
26274
26553
|
auth: "admin"
|
|
@@ -31234,6 +31513,12 @@ Object.freeze({
|
|
|
31234
31513
|
addonId: null,
|
|
31235
31514
|
access: "create"
|
|
31236
31515
|
},
|
|
31516
|
+
"pipelineAnalytics.countRelocatableMedia": {
|
|
31517
|
+
capName: "pipeline-analytics",
|
|
31518
|
+
capScope: "device",
|
|
31519
|
+
addonId: null,
|
|
31520
|
+
access: "view"
|
|
31521
|
+
},
|
|
31237
31522
|
"pipelineAnalytics.countUnstampedEventMedia": {
|
|
31238
31523
|
capName: "pipeline-analytics",
|
|
31239
31524
|
capScope: "device",
|
|
@@ -32398,6 +32683,12 @@ Object.freeze({
|
|
|
32398
32683
|
addonId: null,
|
|
32399
32684
|
access: "view"
|
|
32400
32685
|
},
|
|
32686
|
+
"recording.getRelocateResidue": {
|
|
32687
|
+
capName: "recording",
|
|
32688
|
+
capScope: "system",
|
|
32689
|
+
addonId: null,
|
|
32690
|
+
access: "view"
|
|
32691
|
+
},
|
|
32401
32692
|
"recording.getStorageMigrationMoveStatus": {
|
|
32402
32693
|
capName: "recording",
|
|
32403
32694
|
capScope: "system",
|
|
@@ -32944,12 +33235,30 @@ Object.freeze({
|
|
|
32944
33235
|
addonId: null,
|
|
32945
33236
|
access: "create"
|
|
32946
33237
|
},
|
|
33238
|
+
"storageMigration.drain": {
|
|
33239
|
+
capName: "storage-migration",
|
|
33240
|
+
capScope: "system",
|
|
33241
|
+
addonId: null,
|
|
33242
|
+
access: "create"
|
|
33243
|
+
},
|
|
33244
|
+
"storageMigration.movers": {
|
|
33245
|
+
capName: "storage-migration",
|
|
33246
|
+
capScope: "system",
|
|
33247
|
+
addonId: null,
|
|
33248
|
+
access: "view"
|
|
33249
|
+
},
|
|
32947
33250
|
"storageMigration.plan": {
|
|
32948
33251
|
capName: "storage-migration",
|
|
32949
33252
|
capScope: "system",
|
|
32950
33253
|
addonId: null,
|
|
32951
33254
|
access: "view"
|
|
32952
33255
|
},
|
|
33256
|
+
"storageMigration.residue": {
|
|
33257
|
+
capName: "storage-migration",
|
|
33258
|
+
capScope: "system",
|
|
33259
|
+
addonId: null,
|
|
33260
|
+
access: "view"
|
|
33261
|
+
},
|
|
32953
33262
|
"storageMigration.start": {
|
|
32954
33263
|
capName: "storage-migration",
|
|
32955
33264
|
capScope: "system",
|
|
@@ -33784,6 +34093,12 @@ Object.freeze({
|
|
|
33784
34093
|
addonId: null,
|
|
33785
34094
|
access: "delete"
|
|
33786
34095
|
},
|
|
34096
|
+
"vectorStore.fetchByIds": {
|
|
34097
|
+
capName: "vector-store",
|
|
34098
|
+
capScope: "system",
|
|
34099
|
+
addonId: null,
|
|
34100
|
+
access: "view"
|
|
34101
|
+
},
|
|
33787
34102
|
"vectorStore.getByIds": {
|
|
33788
34103
|
capName: "vector-store",
|
|
33789
34104
|
capScope: "system",
|
|
@@ -33796,6 +34111,12 @@ Object.freeze({
|
|
|
33796
34111
|
addonId: null,
|
|
33797
34112
|
access: "view"
|
|
33798
34113
|
},
|
|
34114
|
+
"vectorStore.scan": {
|
|
34115
|
+
capName: "vector-store",
|
|
34116
|
+
capScope: "system",
|
|
34117
|
+
addonId: null,
|
|
34118
|
+
access: "view"
|
|
34119
|
+
},
|
|
33799
34120
|
"vectorStore.stats": {
|
|
33800
34121
|
capName: "vector-store",
|
|
33801
34122
|
capScope: "system",
|