@camstack/addon-provider-reolink 1.2.66 → 1.2.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addon.js +333 -12
- package/dist/addon.mjs +333 -12
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -8454,13 +8454,49 @@ var StorageMigrationParticipantSchema = _enum([
|
|
|
8454
8454
|
"recorder",
|
|
8455
8455
|
"analytics"
|
|
8456
8456
|
]);
|
|
8457
|
+
/**
|
|
8458
|
+
* The mover's own numbers, folded onto the coordinator's durable move record.
|
|
8459
|
+
*
|
|
8460
|
+
* The long half of a non-blocking migration is `draining`, and it is measured
|
|
8461
|
+
* in hours: 136 885 files at ~4 MB/s is about five of them. Before this shape
|
|
8462
|
+
* existed the only place those numbers appeared was a Loki line, so an operator
|
|
8463
|
+
* watching the Admin UI saw `phase: draining` and nothing else for a whole
|
|
8464
|
+
* afternoon.
|
|
8465
|
+
*
|
|
8466
|
+
* It is POLLED, never pushed. Events are telemetry and may be dropped
|
|
8467
|
+
* (D8/D11), and a dropped progress event is indistinguishable from a stalled
|
|
8468
|
+
* mover — which is the exact failure this is meant to end. The coordinator's
|
|
8469
|
+
* `waitForMoves` already fetches the whole {@link RelocateJob} on every tick to
|
|
8470
|
+
* read `state`; folding the counters costs no extra read and makes the durable
|
|
8471
|
+
* record say afterwards how far a move actually got.
|
|
8472
|
+
*
|
|
8473
|
+
* `filesTotal` is `null` for "no honest denominator" and is never zero-filled:
|
|
8474
|
+
* a windowed footage job (`sinceMs`) and a node with no ledger both genuinely
|
|
8475
|
+
* cannot say M, and a 0 there would render as "100 % done".
|
|
8476
|
+
*/
|
|
8477
|
+
var StorageMigrationMoveProgressSchema = object({
|
|
8478
|
+
filesMoved: number().int().nonnegative(),
|
|
8479
|
+
/** The archive census — the **M** of "N of M" (D295). `null` = unknowable. */
|
|
8480
|
+
filesTotal: number().int().nonnegative().nullable(),
|
|
8481
|
+
bytesMoved: number().int().nonnegative(),
|
|
8482
|
+
/** The MOVER's start, not the migration's: a drain restarted after an addon
|
|
8483
|
+
* crash gets a new mover, and a rate computed from the migration's start
|
|
8484
|
+
* would silently average in the time nothing was running. */
|
|
8485
|
+
startedAt: number(),
|
|
8486
|
+
/** When the coordinator last read these numbers. Paired with `startedAt` it
|
|
8487
|
+
* is the only honest rate: both clocks are the hub's, so a UI never has to
|
|
8488
|
+
* subtract its own. */
|
|
8489
|
+
observedAt: number()
|
|
8490
|
+
});
|
|
8457
8491
|
var StorageMigrationMoveSchema = object({
|
|
8458
8492
|
storageClass: StorageMigrationClassSchema,
|
|
8459
8493
|
fromLocationId: string(),
|
|
8460
8494
|
toLocationId: string(),
|
|
8461
8495
|
moverJobId: string().nullable(),
|
|
8462
8496
|
state: RelocateJobStateSchema.nullable(),
|
|
8463
|
-
error: string().nullable()
|
|
8497
|
+
error: string().nullable(),
|
|
8498
|
+
/** Last observed mover counters; `null` until the mover has been polled once. */
|
|
8499
|
+
progress: StorageMigrationMoveProgressSchema.nullable()
|
|
8464
8500
|
});
|
|
8465
8501
|
var StorageMigrationJobSchema = object({
|
|
8466
8502
|
jobId: string(),
|
|
@@ -8506,6 +8542,98 @@ var StorageMigrationPlanSchema = object({
|
|
|
8506
8542
|
findings: array(StorageMigrationFindingSchema)
|
|
8507
8543
|
});
|
|
8508
8544
|
/**
|
|
8545
|
+
* A mover as it exists RIGHT NOW, whether or not a migration job owns it.
|
|
8546
|
+
*
|
|
8547
|
+
* The coordinator's job record is the state of record for a migration, and its
|
|
8548
|
+
* moves carry {@link StorageMigrationMoveProgress}. But the movers are usable
|
|
8549
|
+
* standalone — `recording.relocateFootage` and `pipelineAnalytics.relocateMedia`
|
|
8550
|
+
* are both operator-callable, and on 2026-08-29 a five-hour drain was armed that
|
|
8551
|
+
* way because no supported UI path existed. A mover armed like that has no job
|
|
8552
|
+
* to fold progress into, so it has to be readable on its own or it is invisible.
|
|
8553
|
+
*
|
|
8554
|
+
* `migrationJobId` is what tells the two apart: `null` means nothing here
|
|
8555
|
+
* orchestrated it.
|
|
8556
|
+
*/
|
|
8557
|
+
var StorageMigrationMoverSchema = object({
|
|
8558
|
+
lane: _enum(["footage", "media"]),
|
|
8559
|
+
job: RelocateJobSchema,
|
|
8560
|
+
/** The coordinator job that armed this mover, or `null` for a mover armed
|
|
8561
|
+
* directly against the owning addon. */
|
|
8562
|
+
migrationJobId: string().nullable(),
|
|
8563
|
+
/** When the hub read these counters. Stamped here so a rate is `bytesMoved`
|
|
8564
|
+
* over (`observedAt` − `job.startedAt`) with BOTH ends on the hub's clock —
|
|
8565
|
+
* a browser subtracting its own `Date.now()` from a server `startedAt` is a
|
|
8566
|
+
* rate made of two different clocks. */
|
|
8567
|
+
observedAt: number()
|
|
8568
|
+
});
|
|
8569
|
+
/**
|
|
8570
|
+
* What a SOURCE still holds for one storage class — the number that makes a
|
|
8571
|
+
* "drain remaining" action honest rather than hopeful.
|
|
8572
|
+
*
|
|
8573
|
+
* It comes from the archive (`SegmentHourLedger.census` for footage, the media
|
|
8574
|
+
* engine's own selection count for media), never from the resident index: a
|
|
8575
|
+
* drain sized off `RecordingIndex` is what reported `done` over 80.3 GB it had
|
|
8576
|
+
* never been told about (D295).
|
|
8577
|
+
*
|
|
8578
|
+
* `items`/`bytes` are `null` for "the archive could not be asked", which is
|
|
8579
|
+
* deliberately NOT zero: a drain is still offered for an unknown residue,
|
|
8580
|
+
* because refusing on an unanswerable read would hide exactly the case an
|
|
8581
|
+
* operator needs to act on.
|
|
8582
|
+
*/
|
|
8583
|
+
var StorageMigrationResidueSchema = object({
|
|
8584
|
+
storageClass: StorageMigrationClassSchema,
|
|
8585
|
+
/** The location still holding the data. `'*'` for the media lane, whose rows
|
|
8586
|
+
* move from wherever they are rather than from one named source. */
|
|
8587
|
+
fromLocationId: string(),
|
|
8588
|
+
/** Where a drain would move it — the class's CURRENT default. */
|
|
8589
|
+
toLocationId: string(),
|
|
8590
|
+
/** Segments (footage lane) or rows (media lane) still on the source. */
|
|
8591
|
+
items: number().int().nonnegative().nullable(),
|
|
8592
|
+
/** Bytes on the source; `null` when the lane counts rows rather than bytes. */
|
|
8593
|
+
bytes: number().int().nonnegative().nullable()
|
|
8594
|
+
});
|
|
8595
|
+
/**
|
|
8596
|
+
* Run the DRAIN half and nothing else.
|
|
8597
|
+
*
|
|
8598
|
+
* A migration that reached `done` has already repointed, so `start` correctly
|
|
8599
|
+
* refuses its destination ("already the default") — there is nothing left to
|
|
8600
|
+
* repoint. But the drain can fail, be cancelled, be interrupted by a restart,
|
|
8601
|
+
* or finish against a work list that was a tenth of the archive (D295), and
|
|
8602
|
+
* before this there was no supported way to run only that half: the only way
|
|
8603
|
+
* through was calling `recording.relocateFootage` by hand over admin tRPC.
|
|
8604
|
+
*
|
|
8605
|
+
* `drain` NEVER calls `setDefaultLocations`. That is what keeps `start`'s
|
|
8606
|
+
* refusal meaningful: the two verbs are disjoint, so nothing here can silently
|
|
8607
|
+
* re-repoint a class that is already migrated.
|
|
8608
|
+
*/
|
|
8609
|
+
var StorageMigrationDrainInputSchema = object({
|
|
8610
|
+
/** The classes to drain. Each must appear in `storageMigration.residue`, so
|
|
8611
|
+
* a class whose source is already empty is refused rather than started. */
|
|
8612
|
+
classes: array(StorageMigrationClassSchema).min(1),
|
|
8613
|
+
throttleMbps: number().min(1).max(1e3).optional()
|
|
8614
|
+
});
|
|
8615
|
+
/** What a footage source still holds, asked of the durable hour ledger. */
|
|
8616
|
+
var RelocateResidueInputSchema = object({
|
|
8617
|
+
fromLocationId: string().min(1),
|
|
8618
|
+
/** Narrow to one logical class; omit for every profile on the location. */
|
|
8619
|
+
footageClass: RelocateFootageClassSchema.optional()
|
|
8620
|
+
});
|
|
8621
|
+
/** `null` = the archive could not answer (no ledger on this node, or the
|
|
8622
|
+
* aggregate failed). Never conflated with an empty source. */
|
|
8623
|
+
var RelocateResidueSchema = object({
|
|
8624
|
+
segments: number().int().nonnegative(),
|
|
8625
|
+
bytes: number().int().nonnegative()
|
|
8626
|
+
}).nullable();
|
|
8627
|
+
/** How many rows a media pass would still act on against a given target — the
|
|
8628
|
+
* media lane's denominator AND its residue, from ONE derivation so the two can
|
|
8629
|
+
* never disagree. `null` = the count could not be taken. */
|
|
8630
|
+
var RelocatableMediaCountSchema = object({ rows: number().int().nonnegative() }).nullable();
|
|
8631
|
+
var RelocatableMediaCountInputSchema = object({
|
|
8632
|
+
toLocationId: string().min(1),
|
|
8633
|
+
/** Omitted = `move`. */
|
|
8634
|
+
mode: MediaRelocateModeSchema.optional()
|
|
8635
|
+
});
|
|
8636
|
+
/**
|
|
8509
8637
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
8510
8638
|
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
8511
8639
|
* so the persisted record schema and the consumer-facing cap can both consume it
|
|
@@ -8609,6 +8737,32 @@ var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(
|
|
|
8609
8737
|
* two addons declaring the same `id` must agree on `cardinality` (validated
|
|
8610
8738
|
* at kernel aggregation time, not here).
|
|
8611
8739
|
*/
|
|
8740
|
+
/**
|
|
8741
|
+
* `StorageAccess` — how the service that DECLARED a storage-location kind
|
|
8742
|
+
* actually reaches the bytes. It is the constraint that decides which
|
|
8743
|
+
* `storage-provider`s may back a location of that kind.
|
|
8744
|
+
*
|
|
8745
|
+
* - `'local-path'` — the service asks `storage.resolve` for a path string and
|
|
8746
|
+
* then does its own `node:fs` I/O on it (the recorder's segment writer, the
|
|
8747
|
+
* post-analysis media roots). Only a provider that serves a genuine local
|
|
8748
|
+
* filesystem (`getProviderInfo().nodeLocal === true`) can satisfy that: a
|
|
8749
|
+
* remote provider's `resolve` returns a path on the REMOTE host, and
|
|
8750
|
+
* `fs.readdir` of it on this node either fails or — far worse — succeeds
|
|
8751
|
+
* against a same-named local directory that is something else entirely.
|
|
8752
|
+
*
|
|
8753
|
+
* - `'cap-mediated'` — every byte travels through the `storage` cap
|
|
8754
|
+
* (`read`/`write`, or `beginUpload`/`writeChunk`/`finalizeUpload`). The
|
|
8755
|
+
* service never sees a path, so any provider can back it. `backups` is the
|
|
8756
|
+
* one kind that qualifies today.
|
|
8757
|
+
*
|
|
8758
|
+
* Before this existed, `recordings` was unreachable by SFTP/S3/WebDAV only as
|
|
8759
|
+
* an EMERGENT property of how the recorder happened to be written. Nothing
|
|
8760
|
+
* refused the configuration; the first write simply went somewhere wrong, and
|
|
8761
|
+
* a recording write that goes wrong surfaces as a silent black window rather
|
|
8762
|
+
* than an error (the read path does not `stat`). This turns that accident into
|
|
8763
|
+
* a declared, enforced, testable refusal.
|
|
8764
|
+
*/
|
|
8765
|
+
var StorageAccessSchema = _enum(["local-path", "cap-mediated"]);
|
|
8612
8766
|
var StorageLocationDeclarationSchema = object({
|
|
8613
8767
|
/**
|
|
8614
8768
|
* Global location identifier, e.g. `recordings` or `recordingsLow`.
|
|
@@ -8628,6 +8782,19 @@ var StorageLocationDeclarationSchema = object({
|
|
|
8628
8782
|
*/
|
|
8629
8783
|
cardinality: _enum(["single", "multi"]),
|
|
8630
8784
|
/**
|
|
8785
|
+
* HOW the declaring service reaches the bytes — and therefore WHICH
|
|
8786
|
+
* providers may back a location of this kind. See {@link StorageAccessSchema}
|
|
8787
|
+
* and {@link STORAGE_ACCESS_FALLBACK}.
|
|
8788
|
+
*
|
|
8789
|
+
* Absent means `'local-path'`. That default is FAIL-CLOSED on purpose: it
|
|
8790
|
+
* can only over-restrict (refuse a remote provider for a kind that might
|
|
8791
|
+
* have coped) and never under-restrict. Declaring `'cap-mediated'` is the
|
|
8792
|
+
* permissive direction and is therefore never inferred — a repo guard
|
|
8793
|
+
* (`scripts/check-storage-access-declarations.ts`) refuses to let it be
|
|
8794
|
+
* reached by omission.
|
|
8795
|
+
*/
|
|
8796
|
+
access: StorageAccessSchema.optional(),
|
|
8797
|
+
/**
|
|
8631
8798
|
* When set, the default instance for this location inherits its resolved
|
|
8632
8799
|
* root from the named location's default instance. Useful for derivative
|
|
8633
8800
|
* slots (e.g. `recordingsLow` → `recordings`) so operators only need to
|
|
@@ -18828,8 +18995,10 @@ var TrackSchema = object({
|
|
|
18828
18995
|
lastSeen: number(),
|
|
18829
18996
|
/** Frame-rate position history (subject to maxPositionHistory cap). */
|
|
18830
18997
|
positions: array(TrackPositionSchema).readonly(),
|
|
18831
|
-
/** Periodic snapshots at snapshotIntervalMs cadence
|
|
18832
|
-
*
|
|
18998
|
+
/** Periodic snapshots at snapshotIntervalMs cadence — DEBUG media, produced
|
|
18999
|
+
* only while `MediaSettings.debugMediaEnabled` is on for the camera (D299;
|
|
19000
|
+
* the retired `saveThumbnails` used to gate this and the rolling
|
|
19001
|
+
* `lastFrame` together). Empty is the healthy default, not a capture gap. */
|
|
18833
19002
|
snapshots: array(TrackSnapshotSchema).readonly(),
|
|
18834
19003
|
/** Deduplicated zones the track has entered at least once. Zone IDS. */
|
|
18835
19004
|
zonesVisited: array(string()).readonly(),
|
|
@@ -19689,7 +19858,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
19689
19858
|
}), method(RelocateMediaInputSchema, object({ jobId: string() }), {
|
|
19690
19859
|
kind: "mutation",
|
|
19691
19860
|
auth: "admin"
|
|
19692
|
-
}), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(
|
|
19861
|
+
}), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(RelocatableMediaCountInputSchema, RelocatableMediaCountSchema, {
|
|
19862
|
+
kind: "query",
|
|
19863
|
+
auth: "admin"
|
|
19864
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
19693
19865
|
kind: "query",
|
|
19694
19866
|
auth: "admin"
|
|
19695
19867
|
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
@@ -21752,6 +21924,9 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
|
|
|
21752
21924
|
}), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
21753
21925
|
kind: "mutation",
|
|
21754
21926
|
auth: "admin"
|
|
21927
|
+
}), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
|
|
21928
|
+
kind: "mutation",
|
|
21929
|
+
auth: "admin"
|
|
21755
21930
|
});
|
|
21756
21931
|
var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
|
|
21757
21932
|
providerId: string().min(1),
|
|
@@ -22150,12 +22325,38 @@ response: record(string(), unknown()) }), object({
|
|
|
22150
22325
|
*
|
|
22151
22326
|
* ## Why this is a capability and not a helper
|
|
22152
22327
|
*
|
|
22153
|
-
*
|
|
22154
|
-
*
|
|
22155
|
-
*
|
|
22156
|
-
*
|
|
22157
|
-
*
|
|
22158
|
-
*
|
|
22328
|
+
* This capability was introduced with the claim that SIX stores in
|
|
22329
|
+
* `addon-post-analysis` held vectors in a `JSON` settings-store column — object
|
|
22330
|
+
* CLIP, face, plate, vehicle, identity, and the event store's derivatives. That
|
|
22331
|
+
* claim was never true, and leaving it here made five stores look like pending
|
|
22332
|
+
* work when three of them have no vector at all. Counted column by column on
|
|
22333
|
+
* 2026-08-30, exactly THREE ever held one:
|
|
22334
|
+
*
|
|
22335
|
+
* - `object-clip` — 512-dim CLIP image embedding, migrated 2026-08-06.
|
|
22336
|
+
* - `faces.embedding` — 512-dim ArcFace face embedding, migrated 2026-08-30.
|
|
22337
|
+
* - `identity-samples.embedding` — the same ArcFace vector for an ENROLLED
|
|
22338
|
+
* face, migrated 2026-08-30 into its OWN index (see below).
|
|
22339
|
+
*
|
|
22340
|
+
* `plates` and `vehicle-samples` store a plate STRING and a score; `vehicles`
|
|
22341
|
+
* and `identities` store a name; the event store stores no derivative vector.
|
|
22342
|
+
* They are not migration candidates and never were.
|
|
22343
|
+
*
|
|
22344
|
+
* Measured on the live hub the JSON encoding cost ~11.7 KB per row (512 floats
|
|
22345
|
+
* as TEXT, `JSON.parse`d on every search) and made semantic search load 5,000
|
|
22346
|
+
* rows before ranking anything.
|
|
22347
|
+
*
|
|
22348
|
+
* ## One index per COMPARISON, never per encoder
|
|
22349
|
+
*
|
|
22350
|
+
* `faces` and `identity-samples` hold the same 512 ArcFace dims from the same
|
|
22351
|
+
* model, and they still get two indexes. An index is a set of things that are
|
|
22352
|
+
* ranked against each other and that live and die together, and these two are
|
|
22353
|
+
* neither: a `faces` row is TRACK-OWNED and cascades away with its track under
|
|
22354
|
+
* a per-camera capacity cap, an `identity-samples` row is retention-EXEMPT
|
|
22355
|
+
* forever and is the gallery every recognition ranks against. One index would
|
|
22356
|
+
* mean every gallery load and every reconcile carried a filter whose failure
|
|
22357
|
+
* mode is either ranking a candidate against itself or reclaiming an enrolled
|
|
22358
|
+
* person's only sample. The dimension they share is not a reason to share an
|
|
22359
|
+
* index; the question they answer is, and it differs.
|
|
22159
22360
|
*
|
|
22160
22361
|
* The fix is not a faster loop, it is a different backend — and the backend
|
|
22161
22362
|
* should be replaceable without touching six callers. So: a singleton
|
|
@@ -22260,7 +22461,20 @@ var VectorQueryResultSchema = object({
|
|
|
22260
22461
|
*/
|
|
22261
22462
|
scanned: number(),
|
|
22262
22463
|
/** True when the backend could not consider every row that passed the filter. */
|
|
22263
|
-
truncated: boolean()
|
|
22464
|
+
truncated: boolean(),
|
|
22465
|
+
/**
|
|
22466
|
+
* The `topK` the backend actually ran with.
|
|
22467
|
+
*
|
|
22468
|
+
* Every backend has a ceiling — sqlite-vec's is 4,096 — and a caller asking
|
|
22469
|
+
* past it used to learn nothing but a boolean, from a WARN in the provider's
|
|
22470
|
+
* own log rather than in its answer. That is how an audit asking for 20,000
|
|
22471
|
+
* consumed 4,096 and reported `examined: 4096` as if it had walked the index,
|
|
22472
|
+
* for weeks. `truncated` says THAT the answer was short; this says BY HOW
|
|
22473
|
+
* MUCH, in the return value, where the caller cannot fail to see it.
|
|
22474
|
+
*
|
|
22475
|
+
* Equals the requested `topK` whenever nothing was lowered.
|
|
22476
|
+
*/
|
|
22477
|
+
effectiveTopK: number().int().positive()
|
|
22264
22478
|
});
|
|
22265
22479
|
var VectorDeleteInputSchema = object({
|
|
22266
22480
|
index: string(),
|
|
@@ -22289,6 +22503,68 @@ var VectorGetResultSchema = object({ items: array(object({
|
|
|
22289
22503
|
id: string(),
|
|
22290
22504
|
metadata: VectorMetadataSchema
|
|
22291
22505
|
})) });
|
|
22506
|
+
/**
|
|
22507
|
+
* Ids to read back WITH their vectors.
|
|
22508
|
+
*
|
|
22509
|
+
* The sibling of {@link VectorGetResultSchema}, and deliberately a separate
|
|
22510
|
+
* method rather than a flag on it: `getByIds` promises no vectors and its one
|
|
22511
|
+
* caller depends on that promise. This one promises the opposite.
|
|
22512
|
+
*
|
|
22513
|
+
* It exists because a store cannot put its vectors here otherwise. An ArcFace
|
|
22514
|
+
* gallery is ranked IN PROCESS, per detection, against every enrolled sample —
|
|
22515
|
+
* a per-face cross-process KNN would be a network round trip inside the
|
|
22516
|
+
* recognition loop. So the gallery is loaded once and held in RAM, and loading
|
|
22517
|
+
* it requires the index to hand the floats back. Without this method the only
|
|
22518
|
+
* way to keep a readable vector is a JSON column, which is the thing this
|
|
22519
|
+
* capability exists to delete.
|
|
22520
|
+
*
|
|
22521
|
+
* BOUNDED BY THE CALLER: ids are named, never "everything". Enumerating an
|
|
22522
|
+
* index is {@link VectorScanInputSchema}'s job, and it returns no vectors.
|
|
22523
|
+
*/
|
|
22524
|
+
var VectorFetchInputSchema = object({
|
|
22525
|
+
index: string(),
|
|
22526
|
+
ids: array(string())
|
|
22527
|
+
});
|
|
22528
|
+
var VectorFetchResultSchema = object({ items: array(object({
|
|
22529
|
+
id: string(),
|
|
22530
|
+
/** base64 Float32LE — the same wire form `upsert` accepts. */
|
|
22531
|
+
vector: string(),
|
|
22532
|
+
metadata: VectorMetadataSchema
|
|
22533
|
+
})) });
|
|
22534
|
+
/**
|
|
22535
|
+
* ENUMERATE an index: one page of rows in a stable order, no ranking.
|
|
22536
|
+
*
|
|
22537
|
+
* A reconcile does not want the nearest rows, it wants ALL of them, and asking
|
|
22538
|
+
* a KNN for "all" is the wrong question twice over. It hits the backend's `k`
|
|
22539
|
+
* ceiling — 4,096 on sqlite-vec against a 22,128-row index — and it needs a
|
|
22540
|
+
* probe vector it does not have, so the audit passed a ZERO vector whose cosine
|
|
22541
|
+
* distance to every row is degenerate. `examined: 4096` then read as "we
|
|
22542
|
+
* looked" for as long as anyone cared to read it.
|
|
22543
|
+
*
|
|
22544
|
+
* This is the primitive that question actually needs: a bounded page, ordered
|
|
22545
|
+
* by the backend's own row order, costing no distance computation at all.
|
|
22546
|
+
* Vectors are NOT returned — an enumeration that shipped 2 KB per row would be
|
|
22547
|
+
* the full-table read this capability was built to stop.
|
|
22548
|
+
*/
|
|
22549
|
+
var VectorScanInputSchema = object({
|
|
22550
|
+
index: string(),
|
|
22551
|
+
/** Opaque resume point. `0` starts at the top; pass back `nextCursor`. */
|
|
22552
|
+
cursor: number().int().nonnegative().default(0),
|
|
22553
|
+
limit: number().int().positive()
|
|
22554
|
+
});
|
|
22555
|
+
var VectorScanResultSchema = object({
|
|
22556
|
+
items: array(object({
|
|
22557
|
+
id: string(),
|
|
22558
|
+
metadata: VectorMetadataSchema
|
|
22559
|
+
})),
|
|
22560
|
+
/**
|
|
22561
|
+
* Where the next page starts, or `null` when the walk reached the end.
|
|
22562
|
+
*
|
|
22563
|
+
* `null` is the ONLY end-of-index signal. A caller must not infer the end
|
|
22564
|
+
* from a short page: a backend is free to return fewer rows than asked.
|
|
22565
|
+
*/
|
|
22566
|
+
nextCursor: number().int().nonnegative().nullable()
|
|
22567
|
+
});
|
|
22292
22568
|
var VectorStatsInputSchema = object({ index: string() });
|
|
22293
22569
|
var VectorStatsResultSchema = object({
|
|
22294
22570
|
/** Provider id, so an operator can tell brute force from an ANN index. */
|
|
@@ -22307,7 +22583,7 @@ method(VectorDeclareIndexInputSchema, _void(), {
|
|
|
22307
22583
|
}), method(VectorUpsertInputSchema, VectorUpsertResultSchema, {
|
|
22308
22584
|
kind: "mutation",
|
|
22309
22585
|
auth: "admin"
|
|
22310
|
-
}), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
|
|
22586
|
+
}), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorFetchInputSchema, VectorFetchResultSchema, { auth: "admin" }), method(VectorScanInputSchema, VectorScanResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
|
|
22311
22587
|
kind: "mutation",
|
|
22312
22588
|
auth: "admin"
|
|
22313
22589
|
}), method(VectorDeleteByFilterInputSchema, VectorDeleteResultSchema, {
|
|
@@ -29013,6 +29289,9 @@ method(object({
|
|
|
29013
29289
|
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
29014
29290
|
kind: "query",
|
|
29015
29291
|
auth: "admin"
|
|
29292
|
+
}), method(RelocateResidueInputSchema, RelocateResidueSchema, {
|
|
29293
|
+
kind: "query",
|
|
29294
|
+
auth: "admin"
|
|
29016
29295
|
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
29017
29296
|
kind: "mutation",
|
|
29018
29297
|
auth: "admin"
|
|
@@ -36012,6 +36291,12 @@ Object.freeze({
|
|
|
36012
36291
|
addonId: null,
|
|
36013
36292
|
access: "create"
|
|
36014
36293
|
},
|
|
36294
|
+
"pipelineAnalytics.countRelocatableMedia": {
|
|
36295
|
+
capName: "pipeline-analytics",
|
|
36296
|
+
capScope: "device",
|
|
36297
|
+
addonId: null,
|
|
36298
|
+
access: "view"
|
|
36299
|
+
},
|
|
36015
36300
|
"pipelineAnalytics.countUnstampedEventMedia": {
|
|
36016
36301
|
capName: "pipeline-analytics",
|
|
36017
36302
|
capScope: "device",
|
|
@@ -37176,6 +37461,12 @@ Object.freeze({
|
|
|
37176
37461
|
addonId: null,
|
|
37177
37462
|
access: "view"
|
|
37178
37463
|
},
|
|
37464
|
+
"recording.getRelocateResidue": {
|
|
37465
|
+
capName: "recording",
|
|
37466
|
+
capScope: "system",
|
|
37467
|
+
addonId: null,
|
|
37468
|
+
access: "view"
|
|
37469
|
+
},
|
|
37179
37470
|
"recording.getStorageMigrationMoveStatus": {
|
|
37180
37471
|
capName: "recording",
|
|
37181
37472
|
capScope: "system",
|
|
@@ -37722,12 +38013,30 @@ Object.freeze({
|
|
|
37722
38013
|
addonId: null,
|
|
37723
38014
|
access: "create"
|
|
37724
38015
|
},
|
|
38016
|
+
"storageMigration.drain": {
|
|
38017
|
+
capName: "storage-migration",
|
|
38018
|
+
capScope: "system",
|
|
38019
|
+
addonId: null,
|
|
38020
|
+
access: "create"
|
|
38021
|
+
},
|
|
38022
|
+
"storageMigration.movers": {
|
|
38023
|
+
capName: "storage-migration",
|
|
38024
|
+
capScope: "system",
|
|
38025
|
+
addonId: null,
|
|
38026
|
+
access: "view"
|
|
38027
|
+
},
|
|
37725
38028
|
"storageMigration.plan": {
|
|
37726
38029
|
capName: "storage-migration",
|
|
37727
38030
|
capScope: "system",
|
|
37728
38031
|
addonId: null,
|
|
37729
38032
|
access: "view"
|
|
37730
38033
|
},
|
|
38034
|
+
"storageMigration.residue": {
|
|
38035
|
+
capName: "storage-migration",
|
|
38036
|
+
capScope: "system",
|
|
38037
|
+
addonId: null,
|
|
38038
|
+
access: "view"
|
|
38039
|
+
},
|
|
37731
38040
|
"storageMigration.start": {
|
|
37732
38041
|
capName: "storage-migration",
|
|
37733
38042
|
capScope: "system",
|
|
@@ -38562,6 +38871,12 @@ Object.freeze({
|
|
|
38562
38871
|
addonId: null,
|
|
38563
38872
|
access: "delete"
|
|
38564
38873
|
},
|
|
38874
|
+
"vectorStore.fetchByIds": {
|
|
38875
|
+
capName: "vector-store",
|
|
38876
|
+
capScope: "system",
|
|
38877
|
+
addonId: null,
|
|
38878
|
+
access: "view"
|
|
38879
|
+
},
|
|
38565
38880
|
"vectorStore.getByIds": {
|
|
38566
38881
|
capName: "vector-store",
|
|
38567
38882
|
capScope: "system",
|
|
@@ -38574,6 +38889,12 @@ Object.freeze({
|
|
|
38574
38889
|
addonId: null,
|
|
38575
38890
|
access: "view"
|
|
38576
38891
|
},
|
|
38892
|
+
"vectorStore.scan": {
|
|
38893
|
+
capName: "vector-store",
|
|
38894
|
+
capScope: "system",
|
|
38895
|
+
addonId: null,
|
|
38896
|
+
access: "view"
|
|
38897
|
+
},
|
|
38577
38898
|
"vectorStore.stats": {
|
|
38578
38899
|
capName: "vector-store",
|
|
38579
38900
|
capScope: "system",
|
package/dist/addon.mjs
CHANGED
|
@@ -8449,13 +8449,49 @@ var StorageMigrationParticipantSchema = _enum([
|
|
|
8449
8449
|
"recorder",
|
|
8450
8450
|
"analytics"
|
|
8451
8451
|
]);
|
|
8452
|
+
/**
|
|
8453
|
+
* The mover's own numbers, folded onto the coordinator's durable move record.
|
|
8454
|
+
*
|
|
8455
|
+
* The long half of a non-blocking migration is `draining`, and it is measured
|
|
8456
|
+
* in hours: 136 885 files at ~4 MB/s is about five of them. Before this shape
|
|
8457
|
+
* existed the only place those numbers appeared was a Loki line, so an operator
|
|
8458
|
+
* watching the Admin UI saw `phase: draining` and nothing else for a whole
|
|
8459
|
+
* afternoon.
|
|
8460
|
+
*
|
|
8461
|
+
* It is POLLED, never pushed. Events are telemetry and may be dropped
|
|
8462
|
+
* (D8/D11), and a dropped progress event is indistinguishable from a stalled
|
|
8463
|
+
* mover — which is the exact failure this is meant to end. The coordinator's
|
|
8464
|
+
* `waitForMoves` already fetches the whole {@link RelocateJob} on every tick to
|
|
8465
|
+
* read `state`; folding the counters costs no extra read and makes the durable
|
|
8466
|
+
* record say afterwards how far a move actually got.
|
|
8467
|
+
*
|
|
8468
|
+
* `filesTotal` is `null` for "no honest denominator" and is never zero-filled:
|
|
8469
|
+
* a windowed footage job (`sinceMs`) and a node with no ledger both genuinely
|
|
8470
|
+
* cannot say M, and a 0 there would render as "100 % done".
|
|
8471
|
+
*/
|
|
8472
|
+
var StorageMigrationMoveProgressSchema = object({
|
|
8473
|
+
filesMoved: number().int().nonnegative(),
|
|
8474
|
+
/** The archive census — the **M** of "N of M" (D295). `null` = unknowable. */
|
|
8475
|
+
filesTotal: number().int().nonnegative().nullable(),
|
|
8476
|
+
bytesMoved: number().int().nonnegative(),
|
|
8477
|
+
/** The MOVER's start, not the migration's: a drain restarted after an addon
|
|
8478
|
+
* crash gets a new mover, and a rate computed from the migration's start
|
|
8479
|
+
* would silently average in the time nothing was running. */
|
|
8480
|
+
startedAt: number(),
|
|
8481
|
+
/** When the coordinator last read these numbers. Paired with `startedAt` it
|
|
8482
|
+
* is the only honest rate: both clocks are the hub's, so a UI never has to
|
|
8483
|
+
* subtract its own. */
|
|
8484
|
+
observedAt: number()
|
|
8485
|
+
});
|
|
8452
8486
|
var StorageMigrationMoveSchema = object({
|
|
8453
8487
|
storageClass: StorageMigrationClassSchema,
|
|
8454
8488
|
fromLocationId: string(),
|
|
8455
8489
|
toLocationId: string(),
|
|
8456
8490
|
moverJobId: string().nullable(),
|
|
8457
8491
|
state: RelocateJobStateSchema.nullable(),
|
|
8458
|
-
error: string().nullable()
|
|
8492
|
+
error: string().nullable(),
|
|
8493
|
+
/** Last observed mover counters; `null` until the mover has been polled once. */
|
|
8494
|
+
progress: StorageMigrationMoveProgressSchema.nullable()
|
|
8459
8495
|
});
|
|
8460
8496
|
var StorageMigrationJobSchema = object({
|
|
8461
8497
|
jobId: string(),
|
|
@@ -8501,6 +8537,98 @@ var StorageMigrationPlanSchema = object({
|
|
|
8501
8537
|
findings: array(StorageMigrationFindingSchema)
|
|
8502
8538
|
});
|
|
8503
8539
|
/**
|
|
8540
|
+
* A mover as it exists RIGHT NOW, whether or not a migration job owns it.
|
|
8541
|
+
*
|
|
8542
|
+
* The coordinator's job record is the state of record for a migration, and its
|
|
8543
|
+
* moves carry {@link StorageMigrationMoveProgress}. But the movers are usable
|
|
8544
|
+
* standalone — `recording.relocateFootage` and `pipelineAnalytics.relocateMedia`
|
|
8545
|
+
* are both operator-callable, and on 2026-08-29 a five-hour drain was armed that
|
|
8546
|
+
* way because no supported UI path existed. A mover armed like that has no job
|
|
8547
|
+
* to fold progress into, so it has to be readable on its own or it is invisible.
|
|
8548
|
+
*
|
|
8549
|
+
* `migrationJobId` is what tells the two apart: `null` means nothing here
|
|
8550
|
+
* orchestrated it.
|
|
8551
|
+
*/
|
|
8552
|
+
var StorageMigrationMoverSchema = object({
|
|
8553
|
+
lane: _enum(["footage", "media"]),
|
|
8554
|
+
job: RelocateJobSchema,
|
|
8555
|
+
/** The coordinator job that armed this mover, or `null` for a mover armed
|
|
8556
|
+
* directly against the owning addon. */
|
|
8557
|
+
migrationJobId: string().nullable(),
|
|
8558
|
+
/** When the hub read these counters. Stamped here so a rate is `bytesMoved`
|
|
8559
|
+
* over (`observedAt` − `job.startedAt`) with BOTH ends on the hub's clock —
|
|
8560
|
+
* a browser subtracting its own `Date.now()` from a server `startedAt` is a
|
|
8561
|
+
* rate made of two different clocks. */
|
|
8562
|
+
observedAt: number()
|
|
8563
|
+
});
|
|
8564
|
+
/**
|
|
8565
|
+
* What a SOURCE still holds for one storage class — the number that makes a
|
|
8566
|
+
* "drain remaining" action honest rather than hopeful.
|
|
8567
|
+
*
|
|
8568
|
+
* It comes from the archive (`SegmentHourLedger.census` for footage, the media
|
|
8569
|
+
* engine's own selection count for media), never from the resident index: a
|
|
8570
|
+
* drain sized off `RecordingIndex` is what reported `done` over 80.3 GB it had
|
|
8571
|
+
* never been told about (D295).
|
|
8572
|
+
*
|
|
8573
|
+
* `items`/`bytes` are `null` for "the archive could not be asked", which is
|
|
8574
|
+
* deliberately NOT zero: a drain is still offered for an unknown residue,
|
|
8575
|
+
* because refusing on an unanswerable read would hide exactly the case an
|
|
8576
|
+
* operator needs to act on.
|
|
8577
|
+
*/
|
|
8578
|
+
var StorageMigrationResidueSchema = object({
|
|
8579
|
+
storageClass: StorageMigrationClassSchema,
|
|
8580
|
+
/** The location still holding the data. `'*'` for the media lane, whose rows
|
|
8581
|
+
* move from wherever they are rather than from one named source. */
|
|
8582
|
+
fromLocationId: string(),
|
|
8583
|
+
/** Where a drain would move it — the class's CURRENT default. */
|
|
8584
|
+
toLocationId: string(),
|
|
8585
|
+
/** Segments (footage lane) or rows (media lane) still on the source. */
|
|
8586
|
+
items: number().int().nonnegative().nullable(),
|
|
8587
|
+
/** Bytes on the source; `null` when the lane counts rows rather than bytes. */
|
|
8588
|
+
bytes: number().int().nonnegative().nullable()
|
|
8589
|
+
});
|
|
8590
|
+
/**
|
|
8591
|
+
* Run the DRAIN half and nothing else.
|
|
8592
|
+
*
|
|
8593
|
+
* A migration that reached `done` has already repointed, so `start` correctly
|
|
8594
|
+
* refuses its destination ("already the default") — there is nothing left to
|
|
8595
|
+
* repoint. But the drain can fail, be cancelled, be interrupted by a restart,
|
|
8596
|
+
* or finish against a work list that was a tenth of the archive (D295), and
|
|
8597
|
+
* before this there was no supported way to run only that half: the only way
|
|
8598
|
+
* through was calling `recording.relocateFootage` by hand over admin tRPC.
|
|
8599
|
+
*
|
|
8600
|
+
* `drain` NEVER calls `setDefaultLocations`. That is what keeps `start`'s
|
|
8601
|
+
* refusal meaningful: the two verbs are disjoint, so nothing here can silently
|
|
8602
|
+
* re-repoint a class that is already migrated.
|
|
8603
|
+
*/
|
|
8604
|
+
var StorageMigrationDrainInputSchema = object({
|
|
8605
|
+
/** The classes to drain. Each must appear in `storageMigration.residue`, so
|
|
8606
|
+
* a class whose source is already empty is refused rather than started. */
|
|
8607
|
+
classes: array(StorageMigrationClassSchema).min(1),
|
|
8608
|
+
throttleMbps: number().min(1).max(1e3).optional()
|
|
8609
|
+
});
|
|
8610
|
+
/** What a footage source still holds, asked of the durable hour ledger. */
|
|
8611
|
+
var RelocateResidueInputSchema = object({
|
|
8612
|
+
fromLocationId: string().min(1),
|
|
8613
|
+
/** Narrow to one logical class; omit for every profile on the location. */
|
|
8614
|
+
footageClass: RelocateFootageClassSchema.optional()
|
|
8615
|
+
});
|
|
8616
|
+
/** `null` = the archive could not answer (no ledger on this node, or the
|
|
8617
|
+
* aggregate failed). Never conflated with an empty source. */
|
|
8618
|
+
var RelocateResidueSchema = object({
|
|
8619
|
+
segments: number().int().nonnegative(),
|
|
8620
|
+
bytes: number().int().nonnegative()
|
|
8621
|
+
}).nullable();
|
|
8622
|
+
/** How many rows a media pass would still act on against a given target — the
|
|
8623
|
+
* media lane's denominator AND its residue, from ONE derivation so the two can
|
|
8624
|
+
* never disagree. `null` = the count could not be taken. */
|
|
8625
|
+
var RelocatableMediaCountSchema = object({ rows: number().int().nonnegative() }).nullable();
|
|
8626
|
+
var RelocatableMediaCountInputSchema = object({
|
|
8627
|
+
toLocationId: string().min(1),
|
|
8628
|
+
/** Omitted = `move`. */
|
|
8629
|
+
mode: MediaRelocateModeSchema.optional()
|
|
8630
|
+
});
|
|
8631
|
+
/**
|
|
8504
8632
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
8505
8633
|
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
8506
8634
|
* so the persisted record schema and the consumer-facing cap can both consume it
|
|
@@ -8604,6 +8732,32 @@ var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(
|
|
|
8604
8732
|
* two addons declaring the same `id` must agree on `cardinality` (validated
|
|
8605
8733
|
* at kernel aggregation time, not here).
|
|
8606
8734
|
*/
|
|
8735
|
+
/**
|
|
8736
|
+
* `StorageAccess` — how the service that DECLARED a storage-location kind
|
|
8737
|
+
* actually reaches the bytes. It is the constraint that decides which
|
|
8738
|
+
* `storage-provider`s may back a location of that kind.
|
|
8739
|
+
*
|
|
8740
|
+
* - `'local-path'` — the service asks `storage.resolve` for a path string and
|
|
8741
|
+
* then does its own `node:fs` I/O on it (the recorder's segment writer, the
|
|
8742
|
+
* post-analysis media roots). Only a provider that serves a genuine local
|
|
8743
|
+
* filesystem (`getProviderInfo().nodeLocal === true`) can satisfy that: a
|
|
8744
|
+
* remote provider's `resolve` returns a path on the REMOTE host, and
|
|
8745
|
+
* `fs.readdir` of it on this node either fails or — far worse — succeeds
|
|
8746
|
+
* against a same-named local directory that is something else entirely.
|
|
8747
|
+
*
|
|
8748
|
+
* - `'cap-mediated'` — every byte travels through the `storage` cap
|
|
8749
|
+
* (`read`/`write`, or `beginUpload`/`writeChunk`/`finalizeUpload`). The
|
|
8750
|
+
* service never sees a path, so any provider can back it. `backups` is the
|
|
8751
|
+
* one kind that qualifies today.
|
|
8752
|
+
*
|
|
8753
|
+
* Before this existed, `recordings` was unreachable by SFTP/S3/WebDAV only as
|
|
8754
|
+
* an EMERGENT property of how the recorder happened to be written. Nothing
|
|
8755
|
+
* refused the configuration; the first write simply went somewhere wrong, and
|
|
8756
|
+
* a recording write that goes wrong surfaces as a silent black window rather
|
|
8757
|
+
* than an error (the read path does not `stat`). This turns that accident into
|
|
8758
|
+
* a declared, enforced, testable refusal.
|
|
8759
|
+
*/
|
|
8760
|
+
var StorageAccessSchema = _enum(["local-path", "cap-mediated"]);
|
|
8607
8761
|
var StorageLocationDeclarationSchema = object({
|
|
8608
8762
|
/**
|
|
8609
8763
|
* Global location identifier, e.g. `recordings` or `recordingsLow`.
|
|
@@ -8623,6 +8777,19 @@ var StorageLocationDeclarationSchema = object({
|
|
|
8623
8777
|
*/
|
|
8624
8778
|
cardinality: _enum(["single", "multi"]),
|
|
8625
8779
|
/**
|
|
8780
|
+
* HOW the declaring service reaches the bytes — and therefore WHICH
|
|
8781
|
+
* providers may back a location of this kind. See {@link StorageAccessSchema}
|
|
8782
|
+
* and {@link STORAGE_ACCESS_FALLBACK}.
|
|
8783
|
+
*
|
|
8784
|
+
* Absent means `'local-path'`. That default is FAIL-CLOSED on purpose: it
|
|
8785
|
+
* can only over-restrict (refuse a remote provider for a kind that might
|
|
8786
|
+
* have coped) and never under-restrict. Declaring `'cap-mediated'` is the
|
|
8787
|
+
* permissive direction and is therefore never inferred — a repo guard
|
|
8788
|
+
* (`scripts/check-storage-access-declarations.ts`) refuses to let it be
|
|
8789
|
+
* reached by omission.
|
|
8790
|
+
*/
|
|
8791
|
+
access: StorageAccessSchema.optional(),
|
|
8792
|
+
/**
|
|
8626
8793
|
* When set, the default instance for this location inherits its resolved
|
|
8627
8794
|
* root from the named location's default instance. Useful for derivative
|
|
8628
8795
|
* slots (e.g. `recordingsLow` → `recordings`) so operators only need to
|
|
@@ -18823,8 +18990,10 @@ var TrackSchema = object({
|
|
|
18823
18990
|
lastSeen: number(),
|
|
18824
18991
|
/** Frame-rate position history (subject to maxPositionHistory cap). */
|
|
18825
18992
|
positions: array(TrackPositionSchema).readonly(),
|
|
18826
|
-
/** Periodic snapshots at snapshotIntervalMs cadence
|
|
18827
|
-
*
|
|
18993
|
+
/** Periodic snapshots at snapshotIntervalMs cadence — DEBUG media, produced
|
|
18994
|
+
* only while `MediaSettings.debugMediaEnabled` is on for the camera (D299;
|
|
18995
|
+
* the retired `saveThumbnails` used to gate this and the rolling
|
|
18996
|
+
* `lastFrame` together). Empty is the healthy default, not a capture gap. */
|
|
18828
18997
|
snapshots: array(TrackSnapshotSchema).readonly(),
|
|
18829
18998
|
/** Deduplicated zones the track has entered at least once. Zone IDS. */
|
|
18830
18999
|
zonesVisited: array(string()).readonly(),
|
|
@@ -19684,7 +19853,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
19684
19853
|
}), method(RelocateMediaInputSchema, object({ jobId: string() }), {
|
|
19685
19854
|
kind: "mutation",
|
|
19686
19855
|
auth: "admin"
|
|
19687
|
-
}), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(
|
|
19856
|
+
}), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(RelocatableMediaCountInputSchema, RelocatableMediaCountSchema, {
|
|
19857
|
+
kind: "query",
|
|
19858
|
+
auth: "admin"
|
|
19859
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
19688
19860
|
kind: "query",
|
|
19689
19861
|
auth: "admin"
|
|
19690
19862
|
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
@@ -21747,6 +21919,9 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
|
|
|
21747
21919
|
}), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
21748
21920
|
kind: "mutation",
|
|
21749
21921
|
auth: "admin"
|
|
21922
|
+
}), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
|
|
21923
|
+
kind: "mutation",
|
|
21924
|
+
auth: "admin"
|
|
21750
21925
|
});
|
|
21751
21926
|
var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
|
|
21752
21927
|
providerId: string().min(1),
|
|
@@ -22145,12 +22320,38 @@ response: record(string(), unknown()) }), object({
|
|
|
22145
22320
|
*
|
|
22146
22321
|
* ## Why this is a capability and not a helper
|
|
22147
22322
|
*
|
|
22148
|
-
*
|
|
22149
|
-
*
|
|
22150
|
-
*
|
|
22151
|
-
*
|
|
22152
|
-
*
|
|
22153
|
-
*
|
|
22323
|
+
* This capability was introduced with the claim that SIX stores in
|
|
22324
|
+
* `addon-post-analysis` held vectors in a `JSON` settings-store column — object
|
|
22325
|
+
* CLIP, face, plate, vehicle, identity, and the event store's derivatives. That
|
|
22326
|
+
* claim was never true, and leaving it here made five stores look like pending
|
|
22327
|
+
* work when three of them have no vector at all. Counted column by column on
|
|
22328
|
+
* 2026-08-30, exactly THREE ever held one:
|
|
22329
|
+
*
|
|
22330
|
+
* - `object-clip` — 512-dim CLIP image embedding, migrated 2026-08-06.
|
|
22331
|
+
* - `faces.embedding` — 512-dim ArcFace face embedding, migrated 2026-08-30.
|
|
22332
|
+
* - `identity-samples.embedding` — the same ArcFace vector for an ENROLLED
|
|
22333
|
+
* face, migrated 2026-08-30 into its OWN index (see below).
|
|
22334
|
+
*
|
|
22335
|
+
* `plates` and `vehicle-samples` store a plate STRING and a score; `vehicles`
|
|
22336
|
+
* and `identities` store a name; the event store stores no derivative vector.
|
|
22337
|
+
* They are not migration candidates and never were.
|
|
22338
|
+
*
|
|
22339
|
+
* Measured on the live hub the JSON encoding cost ~11.7 KB per row (512 floats
|
|
22340
|
+
* as TEXT, `JSON.parse`d on every search) and made semantic search load 5,000
|
|
22341
|
+
* rows before ranking anything.
|
|
22342
|
+
*
|
|
22343
|
+
* ## One index per COMPARISON, never per encoder
|
|
22344
|
+
*
|
|
22345
|
+
* `faces` and `identity-samples` hold the same 512 ArcFace dims from the same
|
|
22346
|
+
* model, and they still get two indexes. An index is a set of things that are
|
|
22347
|
+
* ranked against each other and that live and die together, and these two are
|
|
22348
|
+
* neither: a `faces` row is TRACK-OWNED and cascades away with its track under
|
|
22349
|
+
* a per-camera capacity cap, an `identity-samples` row is retention-EXEMPT
|
|
22350
|
+
* forever and is the gallery every recognition ranks against. One index would
|
|
22351
|
+
* mean every gallery load and every reconcile carried a filter whose failure
|
|
22352
|
+
* mode is either ranking a candidate against itself or reclaiming an enrolled
|
|
22353
|
+
* person's only sample. The dimension they share is not a reason to share an
|
|
22354
|
+
* index; the question they answer is, and it differs.
|
|
22154
22355
|
*
|
|
22155
22356
|
* The fix is not a faster loop, it is a different backend — and the backend
|
|
22156
22357
|
* should be replaceable without touching six callers. So: a singleton
|
|
@@ -22255,7 +22456,20 @@ var VectorQueryResultSchema = object({
|
|
|
22255
22456
|
*/
|
|
22256
22457
|
scanned: number(),
|
|
22257
22458
|
/** True when the backend could not consider every row that passed the filter. */
|
|
22258
|
-
truncated: boolean()
|
|
22459
|
+
truncated: boolean(),
|
|
22460
|
+
/**
|
|
22461
|
+
* The `topK` the backend actually ran with.
|
|
22462
|
+
*
|
|
22463
|
+
* Every backend has a ceiling — sqlite-vec's is 4,096 — and a caller asking
|
|
22464
|
+
* past it used to learn nothing but a boolean, from a WARN in the provider's
|
|
22465
|
+
* own log rather than in its answer. That is how an audit asking for 20,000
|
|
22466
|
+
* consumed 4,096 and reported `examined: 4096` as if it had walked the index,
|
|
22467
|
+
* for weeks. `truncated` says THAT the answer was short; this says BY HOW
|
|
22468
|
+
* MUCH, in the return value, where the caller cannot fail to see it.
|
|
22469
|
+
*
|
|
22470
|
+
* Equals the requested `topK` whenever nothing was lowered.
|
|
22471
|
+
*/
|
|
22472
|
+
effectiveTopK: number().int().positive()
|
|
22259
22473
|
});
|
|
22260
22474
|
var VectorDeleteInputSchema = object({
|
|
22261
22475
|
index: string(),
|
|
@@ -22284,6 +22498,68 @@ var VectorGetResultSchema = object({ items: array(object({
|
|
|
22284
22498
|
id: string(),
|
|
22285
22499
|
metadata: VectorMetadataSchema
|
|
22286
22500
|
})) });
|
|
22501
|
+
/**
|
|
22502
|
+
* Ids to read back WITH their vectors.
|
|
22503
|
+
*
|
|
22504
|
+
* The sibling of {@link VectorGetResultSchema}, and deliberately a separate
|
|
22505
|
+
* method rather than a flag on it: `getByIds` promises no vectors and its one
|
|
22506
|
+
* caller depends on that promise. This one promises the opposite.
|
|
22507
|
+
*
|
|
22508
|
+
* It exists because a store cannot put its vectors here otherwise. An ArcFace
|
|
22509
|
+
* gallery is ranked IN PROCESS, per detection, against every enrolled sample —
|
|
22510
|
+
* a per-face cross-process KNN would be a network round trip inside the
|
|
22511
|
+
* recognition loop. So the gallery is loaded once and held in RAM, and loading
|
|
22512
|
+
* it requires the index to hand the floats back. Without this method the only
|
|
22513
|
+
* way to keep a readable vector is a JSON column, which is the thing this
|
|
22514
|
+
* capability exists to delete.
|
|
22515
|
+
*
|
|
22516
|
+
* BOUNDED BY THE CALLER: ids are named, never "everything". Enumerating an
|
|
22517
|
+
* index is {@link VectorScanInputSchema}'s job, and it returns no vectors.
|
|
22518
|
+
*/
|
|
22519
|
+
var VectorFetchInputSchema = object({
|
|
22520
|
+
index: string(),
|
|
22521
|
+
ids: array(string())
|
|
22522
|
+
});
|
|
22523
|
+
var VectorFetchResultSchema = object({ items: array(object({
|
|
22524
|
+
id: string(),
|
|
22525
|
+
/** base64 Float32LE — the same wire form `upsert` accepts. */
|
|
22526
|
+
vector: string(),
|
|
22527
|
+
metadata: VectorMetadataSchema
|
|
22528
|
+
})) });
|
|
22529
|
+
/**
|
|
22530
|
+
* ENUMERATE an index: one page of rows in a stable order, no ranking.
|
|
22531
|
+
*
|
|
22532
|
+
* A reconcile does not want the nearest rows, it wants ALL of them, and asking
|
|
22533
|
+
* a KNN for "all" is the wrong question twice over. It hits the backend's `k`
|
|
22534
|
+
* ceiling — 4,096 on sqlite-vec against a 22,128-row index — and it needs a
|
|
22535
|
+
* probe vector it does not have, so the audit passed a ZERO vector whose cosine
|
|
22536
|
+
* distance to every row is degenerate. `examined: 4096` then read as "we
|
|
22537
|
+
* looked" for as long as anyone cared to read it.
|
|
22538
|
+
*
|
|
22539
|
+
* This is the primitive that question actually needs: a bounded page, ordered
|
|
22540
|
+
* by the backend's own row order, costing no distance computation at all.
|
|
22541
|
+
* Vectors are NOT returned — an enumeration that shipped 2 KB per row would be
|
|
22542
|
+
* the full-table read this capability was built to stop.
|
|
22543
|
+
*/
|
|
22544
|
+
var VectorScanInputSchema = object({
|
|
22545
|
+
index: string(),
|
|
22546
|
+
/** Opaque resume point. `0` starts at the top; pass back `nextCursor`. */
|
|
22547
|
+
cursor: number().int().nonnegative().default(0),
|
|
22548
|
+
limit: number().int().positive()
|
|
22549
|
+
});
|
|
22550
|
+
var VectorScanResultSchema = object({
|
|
22551
|
+
items: array(object({
|
|
22552
|
+
id: string(),
|
|
22553
|
+
metadata: VectorMetadataSchema
|
|
22554
|
+
})),
|
|
22555
|
+
/**
|
|
22556
|
+
* Where the next page starts, or `null` when the walk reached the end.
|
|
22557
|
+
*
|
|
22558
|
+
* `null` is the ONLY end-of-index signal. A caller must not infer the end
|
|
22559
|
+
* from a short page: a backend is free to return fewer rows than asked.
|
|
22560
|
+
*/
|
|
22561
|
+
nextCursor: number().int().nonnegative().nullable()
|
|
22562
|
+
});
|
|
22287
22563
|
var VectorStatsInputSchema = object({ index: string() });
|
|
22288
22564
|
var VectorStatsResultSchema = object({
|
|
22289
22565
|
/** Provider id, so an operator can tell brute force from an ANN index. */
|
|
@@ -22302,7 +22578,7 @@ method(VectorDeclareIndexInputSchema, _void(), {
|
|
|
22302
22578
|
}), method(VectorUpsertInputSchema, VectorUpsertResultSchema, {
|
|
22303
22579
|
kind: "mutation",
|
|
22304
22580
|
auth: "admin"
|
|
22305
|
-
}), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
|
|
22581
|
+
}), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorFetchInputSchema, VectorFetchResultSchema, { auth: "admin" }), method(VectorScanInputSchema, VectorScanResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
|
|
22306
22582
|
kind: "mutation",
|
|
22307
22583
|
auth: "admin"
|
|
22308
22584
|
}), method(VectorDeleteByFilterInputSchema, VectorDeleteResultSchema, {
|
|
@@ -29008,6 +29284,9 @@ method(object({
|
|
|
29008
29284
|
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
29009
29285
|
kind: "query",
|
|
29010
29286
|
auth: "admin"
|
|
29287
|
+
}), method(RelocateResidueInputSchema, RelocateResidueSchema, {
|
|
29288
|
+
kind: "query",
|
|
29289
|
+
auth: "admin"
|
|
29011
29290
|
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
29012
29291
|
kind: "mutation",
|
|
29013
29292
|
auth: "admin"
|
|
@@ -36007,6 +36286,12 @@ Object.freeze({
|
|
|
36007
36286
|
addonId: null,
|
|
36008
36287
|
access: "create"
|
|
36009
36288
|
},
|
|
36289
|
+
"pipelineAnalytics.countRelocatableMedia": {
|
|
36290
|
+
capName: "pipeline-analytics",
|
|
36291
|
+
capScope: "device",
|
|
36292
|
+
addonId: null,
|
|
36293
|
+
access: "view"
|
|
36294
|
+
},
|
|
36010
36295
|
"pipelineAnalytics.countUnstampedEventMedia": {
|
|
36011
36296
|
capName: "pipeline-analytics",
|
|
36012
36297
|
capScope: "device",
|
|
@@ -37171,6 +37456,12 @@ Object.freeze({
|
|
|
37171
37456
|
addonId: null,
|
|
37172
37457
|
access: "view"
|
|
37173
37458
|
},
|
|
37459
|
+
"recording.getRelocateResidue": {
|
|
37460
|
+
capName: "recording",
|
|
37461
|
+
capScope: "system",
|
|
37462
|
+
addonId: null,
|
|
37463
|
+
access: "view"
|
|
37464
|
+
},
|
|
37174
37465
|
"recording.getStorageMigrationMoveStatus": {
|
|
37175
37466
|
capName: "recording",
|
|
37176
37467
|
capScope: "system",
|
|
@@ -37717,12 +38008,30 @@ Object.freeze({
|
|
|
37717
38008
|
addonId: null,
|
|
37718
38009
|
access: "create"
|
|
37719
38010
|
},
|
|
38011
|
+
"storageMigration.drain": {
|
|
38012
|
+
capName: "storage-migration",
|
|
38013
|
+
capScope: "system",
|
|
38014
|
+
addonId: null,
|
|
38015
|
+
access: "create"
|
|
38016
|
+
},
|
|
38017
|
+
"storageMigration.movers": {
|
|
38018
|
+
capName: "storage-migration",
|
|
38019
|
+
capScope: "system",
|
|
38020
|
+
addonId: null,
|
|
38021
|
+
access: "view"
|
|
38022
|
+
},
|
|
37720
38023
|
"storageMigration.plan": {
|
|
37721
38024
|
capName: "storage-migration",
|
|
37722
38025
|
capScope: "system",
|
|
37723
38026
|
addonId: null,
|
|
37724
38027
|
access: "view"
|
|
37725
38028
|
},
|
|
38029
|
+
"storageMigration.residue": {
|
|
38030
|
+
capName: "storage-migration",
|
|
38031
|
+
capScope: "system",
|
|
38032
|
+
addonId: null,
|
|
38033
|
+
access: "view"
|
|
38034
|
+
},
|
|
37726
38035
|
"storageMigration.start": {
|
|
37727
38036
|
capName: "storage-migration",
|
|
37728
38037
|
capScope: "system",
|
|
@@ -38557,6 +38866,12 @@ Object.freeze({
|
|
|
38557
38866
|
addonId: null,
|
|
38558
38867
|
access: "delete"
|
|
38559
38868
|
},
|
|
38869
|
+
"vectorStore.fetchByIds": {
|
|
38870
|
+
capName: "vector-store",
|
|
38871
|
+
capScope: "system",
|
|
38872
|
+
addonId: null,
|
|
38873
|
+
access: "view"
|
|
38874
|
+
},
|
|
38560
38875
|
"vectorStore.getByIds": {
|
|
38561
38876
|
capName: "vector-store",
|
|
38562
38877
|
capScope: "system",
|
|
@@ -38569,6 +38884,12 @@ Object.freeze({
|
|
|
38569
38884
|
addonId: null,
|
|
38570
38885
|
access: "view"
|
|
38571
38886
|
},
|
|
38887
|
+
"vectorStore.scan": {
|
|
38888
|
+
capName: "vector-store",
|
|
38889
|
+
capScope: "system",
|
|
38890
|
+
addonId: null,
|
|
38891
|
+
access: "view"
|
|
38892
|
+
},
|
|
38572
38893
|
"vectorStore.stats": {
|
|
38573
38894
|
capName: "vector-store",
|
|
38574
38895
|
capScope: "system",
|