@camstack/addon-matter-broker 0.2.42 → 0.2.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addon.js +333 -12
- package/dist/addon.mjs +333 -12
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -8178,13 +8178,49 @@ var StorageMigrationParticipantSchema = _enum([
|
|
|
8178
8178
|
"recorder",
|
|
8179
8179
|
"analytics"
|
|
8180
8180
|
]);
|
|
8181
|
+
/**
|
|
8182
|
+
* The mover's own numbers, folded onto the coordinator's durable move record.
|
|
8183
|
+
*
|
|
8184
|
+
* The long half of a non-blocking migration is `draining`, and it is measured
|
|
8185
|
+
* in hours: 136 885 files at ~4 MB/s is about five of them. Before this shape
|
|
8186
|
+
* existed the only place those numbers appeared was a Loki line, so an operator
|
|
8187
|
+
* watching the Admin UI saw `phase: draining` and nothing else for a whole
|
|
8188
|
+
* afternoon.
|
|
8189
|
+
*
|
|
8190
|
+
* It is POLLED, never pushed. Events are telemetry and may be dropped
|
|
8191
|
+
* (D8/D11), and a dropped progress event is indistinguishable from a stalled
|
|
8192
|
+
* mover — which is the exact failure this is meant to end. The coordinator's
|
|
8193
|
+
* `waitForMoves` already fetches the whole {@link RelocateJob} on every tick to
|
|
8194
|
+
* read `state`; folding the counters costs no extra read and makes the durable
|
|
8195
|
+
* record say afterwards how far a move actually got.
|
|
8196
|
+
*
|
|
8197
|
+
* `filesTotal` is `null` for "no honest denominator" and is never zero-filled:
|
|
8198
|
+
* a windowed footage job (`sinceMs`) and a node with no ledger both genuinely
|
|
8199
|
+
* cannot say M, and a 0 there would render as "100 % done".
|
|
8200
|
+
*/
|
|
8201
|
+
var StorageMigrationMoveProgressSchema = object({
|
|
8202
|
+
filesMoved: number().int().nonnegative(),
|
|
8203
|
+
/** The archive census — the **M** of "N of M" (D295). `null` = unknowable. */
|
|
8204
|
+
filesTotal: number().int().nonnegative().nullable(),
|
|
8205
|
+
bytesMoved: number().int().nonnegative(),
|
|
8206
|
+
/** The MOVER's start, not the migration's: a drain restarted after an addon
|
|
8207
|
+
* crash gets a new mover, and a rate computed from the migration's start
|
|
8208
|
+
* would silently average in the time nothing was running. */
|
|
8209
|
+
startedAt: number(),
|
|
8210
|
+
/** When the coordinator last read these numbers. Paired with `startedAt` it
|
|
8211
|
+
* is the only honest rate: both clocks are the hub's, so a UI never has to
|
|
8212
|
+
* subtract its own. */
|
|
8213
|
+
observedAt: number()
|
|
8214
|
+
});
|
|
8181
8215
|
var StorageMigrationMoveSchema = object({
|
|
8182
8216
|
storageClass: StorageMigrationClassSchema,
|
|
8183
8217
|
fromLocationId: string$2(),
|
|
8184
8218
|
toLocationId: string$2(),
|
|
8185
8219
|
moverJobId: string$2().nullable(),
|
|
8186
8220
|
state: RelocateJobStateSchema.nullable(),
|
|
8187
|
-
error: string$2().nullable()
|
|
8221
|
+
error: string$2().nullable(),
|
|
8222
|
+
/** Last observed mover counters; `null` until the mover has been polled once. */
|
|
8223
|
+
progress: StorageMigrationMoveProgressSchema.nullable()
|
|
8188
8224
|
});
|
|
8189
8225
|
var StorageMigrationJobSchema = object({
|
|
8190
8226
|
jobId: string$2(),
|
|
@@ -8230,6 +8266,98 @@ var StorageMigrationPlanSchema = object({
|
|
|
8230
8266
|
findings: array(StorageMigrationFindingSchema)
|
|
8231
8267
|
});
|
|
8232
8268
|
/**
|
|
8269
|
+
* A mover as it exists RIGHT NOW, whether or not a migration job owns it.
|
|
8270
|
+
*
|
|
8271
|
+
* The coordinator's job record is the state of record for a migration, and its
|
|
8272
|
+
* moves carry {@link StorageMigrationMoveProgress}. But the movers are usable
|
|
8273
|
+
* standalone — `recording.relocateFootage` and `pipelineAnalytics.relocateMedia`
|
|
8274
|
+
* are both operator-callable, and on 2026-08-29 a five-hour drain was armed that
|
|
8275
|
+
* way because no supported UI path existed. A mover armed like that has no job
|
|
8276
|
+
* to fold progress into, so it has to be readable on its own or it is invisible.
|
|
8277
|
+
*
|
|
8278
|
+
* `migrationJobId` is what tells the two apart: `null` means nothing here
|
|
8279
|
+
* orchestrated it.
|
|
8280
|
+
*/
|
|
8281
|
+
var StorageMigrationMoverSchema = object({
|
|
8282
|
+
lane: _enum(["footage", "media"]),
|
|
8283
|
+
job: RelocateJobSchema,
|
|
8284
|
+
/** The coordinator job that armed this mover, or `null` for a mover armed
|
|
8285
|
+
* directly against the owning addon. */
|
|
8286
|
+
migrationJobId: string$2().nullable(),
|
|
8287
|
+
/** When the hub read these counters. Stamped here so a rate is `bytesMoved`
|
|
8288
|
+
* over (`observedAt` − `job.startedAt`) with BOTH ends on the hub's clock —
|
|
8289
|
+
* a browser subtracting its own `Date.now()` from a server `startedAt` is a
|
|
8290
|
+
* rate made of two different clocks. */
|
|
8291
|
+
observedAt: number()
|
|
8292
|
+
});
|
|
8293
|
+
/**
|
|
8294
|
+
* What a SOURCE still holds for one storage class — the number that makes a
|
|
8295
|
+
* "drain remaining" action honest rather than hopeful.
|
|
8296
|
+
*
|
|
8297
|
+
* It comes from the archive (`SegmentHourLedger.census` for footage, the media
|
|
8298
|
+
* engine's own selection count for media), never from the resident index: a
|
|
8299
|
+
* drain sized off `RecordingIndex` is what reported `done` over 80.3 GB it had
|
|
8300
|
+
* never been told about (D295).
|
|
8301
|
+
*
|
|
8302
|
+
* `items`/`bytes` are `null` for "the archive could not be asked", which is
|
|
8303
|
+
* deliberately NOT zero: a drain is still offered for an unknown residue,
|
|
8304
|
+
* because refusing on an unanswerable read would hide exactly the case an
|
|
8305
|
+
* operator needs to act on.
|
|
8306
|
+
*/
|
|
8307
|
+
var StorageMigrationResidueSchema = object({
|
|
8308
|
+
storageClass: StorageMigrationClassSchema,
|
|
8309
|
+
/** The location still holding the data. `'*'` for the media lane, whose rows
|
|
8310
|
+
* move from wherever they are rather than from one named source. */
|
|
8311
|
+
fromLocationId: string$2(),
|
|
8312
|
+
/** Where a drain would move it — the class's CURRENT default. */
|
|
8313
|
+
toLocationId: string$2(),
|
|
8314
|
+
/** Segments (footage lane) or rows (media lane) still on the source. */
|
|
8315
|
+
items: number().int().nonnegative().nullable(),
|
|
8316
|
+
/** Bytes on the source; `null` when the lane counts rows rather than bytes. */
|
|
8317
|
+
bytes: number().int().nonnegative().nullable()
|
|
8318
|
+
});
|
|
8319
|
+
/**
|
|
8320
|
+
* Run the DRAIN half and nothing else.
|
|
8321
|
+
*
|
|
8322
|
+
* A migration that reached `done` has already repointed, so `start` correctly
|
|
8323
|
+
* refuses its destination ("already the default") — there is nothing left to
|
|
8324
|
+
* repoint. But the drain can fail, be cancelled, be interrupted by a restart,
|
|
8325
|
+
* or finish against a work list that was a tenth of the archive (D295), and
|
|
8326
|
+
* before this there was no supported way to run only that half: the only way
|
|
8327
|
+
* through was calling `recording.relocateFootage` by hand over admin tRPC.
|
|
8328
|
+
*
|
|
8329
|
+
* `drain` NEVER calls `setDefaultLocations`. That is what keeps `start`'s
|
|
8330
|
+
* refusal meaningful: the two verbs are disjoint, so nothing here can silently
|
|
8331
|
+
* re-repoint a class that is already migrated.
|
|
8332
|
+
*/
|
|
8333
|
+
var StorageMigrationDrainInputSchema = object({
|
|
8334
|
+
/** The classes to drain. Each must appear in `storageMigration.residue`, so
|
|
8335
|
+
* a class whose source is already empty is refused rather than started. */
|
|
8336
|
+
classes: array(StorageMigrationClassSchema).min(1),
|
|
8337
|
+
throttleMbps: number().min(1).max(1e3).optional()
|
|
8338
|
+
});
|
|
8339
|
+
/** What a footage source still holds, asked of the durable hour ledger. */
|
|
8340
|
+
var RelocateResidueInputSchema = object({
|
|
8341
|
+
fromLocationId: string$2().min(1),
|
|
8342
|
+
/** Narrow to one logical class; omit for every profile on the location. */
|
|
8343
|
+
footageClass: RelocateFootageClassSchema.optional()
|
|
8344
|
+
});
|
|
8345
|
+
/** `null` = the archive could not answer (no ledger on this node, or the
|
|
8346
|
+
* aggregate failed). Never conflated with an empty source. */
|
|
8347
|
+
var RelocateResidueSchema = object({
|
|
8348
|
+
segments: number().int().nonnegative(),
|
|
8349
|
+
bytes: number().int().nonnegative()
|
|
8350
|
+
}).nullable();
|
|
8351
|
+
/** How many rows a media pass would still act on against a given target — the
|
|
8352
|
+
* media lane's denominator AND its residue, from ONE derivation so the two can
|
|
8353
|
+
* never disagree. `null` = the count could not be taken. */
|
|
8354
|
+
var RelocatableMediaCountSchema = object({ rows: number().int().nonnegative() }).nullable();
|
|
8355
|
+
var RelocatableMediaCountInputSchema = object({
|
|
8356
|
+
toLocationId: string$2().min(1),
|
|
8357
|
+
/** Omitted = `move`. */
|
|
8358
|
+
mode: MediaRelocateModeSchema.optional()
|
|
8359
|
+
});
|
|
8360
|
+
/**
|
|
8233
8361
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
8234
8362
|
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
8235
8363
|
* so the persisted record schema and the consumer-facing cap can both consume it
|
|
@@ -8333,6 +8461,32 @@ var StorageLocationRefSchema = union([StorageLocationTypeSchema, string$2().rege
|
|
|
8333
8461
|
* two addons declaring the same `id` must agree on `cardinality` (validated
|
|
8334
8462
|
* at kernel aggregation time, not here).
|
|
8335
8463
|
*/
|
|
8464
|
+
/**
|
|
8465
|
+
* `StorageAccess` — how the service that DECLARED a storage-location kind
|
|
8466
|
+
* actually reaches the bytes. It is the constraint that decides which
|
|
8467
|
+
* `storage-provider`s may back a location of that kind.
|
|
8468
|
+
*
|
|
8469
|
+
* - `'local-path'` — the service asks `storage.resolve` for a path string and
|
|
8470
|
+
* then does its own `node:fs` I/O on it (the recorder's segment writer, the
|
|
8471
|
+
* post-analysis media roots). Only a provider that serves a genuine local
|
|
8472
|
+
* filesystem (`getProviderInfo().nodeLocal === true`) can satisfy that: a
|
|
8473
|
+
* remote provider's `resolve` returns a path on the REMOTE host, and
|
|
8474
|
+
* `fs.readdir` of it on this node either fails or — far worse — succeeds
|
|
8475
|
+
* against a same-named local directory that is something else entirely.
|
|
8476
|
+
*
|
|
8477
|
+
* - `'cap-mediated'` — every byte travels through the `storage` cap
|
|
8478
|
+
* (`read`/`write`, or `beginUpload`/`writeChunk`/`finalizeUpload`). The
|
|
8479
|
+
* service never sees a path, so any provider can back it. `backups` is the
|
|
8480
|
+
* one kind that qualifies today.
|
|
8481
|
+
*
|
|
8482
|
+
* Before this existed, `recordings` was unreachable by SFTP/S3/WebDAV only as
|
|
8483
|
+
* an EMERGENT property of how the recorder happened to be written. Nothing
|
|
8484
|
+
* refused the configuration; the first write simply went somewhere wrong, and
|
|
8485
|
+
* a recording write that goes wrong surfaces as a silent black window rather
|
|
8486
|
+
* than an error (the read path does not `stat`). This turns that accident into
|
|
8487
|
+
* a declared, enforced, testable refusal.
|
|
8488
|
+
*/
|
|
8489
|
+
var StorageAccessSchema = _enum(["local-path", "cap-mediated"]);
|
|
8336
8490
|
var StorageLocationDeclarationSchema = object({
|
|
8337
8491
|
/**
|
|
8338
8492
|
* Global location identifier, e.g. `recordings` or `recordingsLow`.
|
|
@@ -8352,6 +8506,19 @@ var StorageLocationDeclarationSchema = object({
|
|
|
8352
8506
|
*/
|
|
8353
8507
|
cardinality: _enum(["single", "multi"]),
|
|
8354
8508
|
/**
|
|
8509
|
+
* HOW the declaring service reaches the bytes — and therefore WHICH
|
|
8510
|
+
* providers may back a location of this kind. See {@link StorageAccessSchema}
|
|
8511
|
+
* and {@link STORAGE_ACCESS_FALLBACK}.
|
|
8512
|
+
*
|
|
8513
|
+
* Absent means `'local-path'`. That default is FAIL-CLOSED on purpose: it
|
|
8514
|
+
* can only over-restrict (refuse a remote provider for a kind that might
|
|
8515
|
+
* have coped) and never under-restrict. Declaring `'cap-mediated'` is the
|
|
8516
|
+
* permissive direction and is therefore never inferred — a repo guard
|
|
8517
|
+
* (`scripts/check-storage-access-declarations.ts`) refuses to let it be
|
|
8518
|
+
* reached by omission.
|
|
8519
|
+
*/
|
|
8520
|
+
access: StorageAccessSchema.optional(),
|
|
8521
|
+
/**
|
|
8355
8522
|
* When set, the default instance for this location inherits its resolved
|
|
8356
8523
|
* root from the named location's default instance. Useful for derivative
|
|
8357
8524
|
* slots (e.g. `recordingsLow` → `recordings`) so operators only need to
|
|
@@ -18285,8 +18452,10 @@ var TrackSchema = object({
|
|
|
18285
18452
|
lastSeen: number(),
|
|
18286
18453
|
/** Frame-rate position history (subject to maxPositionHistory cap). */
|
|
18287
18454
|
positions: array(TrackPositionSchema).readonly(),
|
|
18288
|
-
/** Periodic snapshots at snapshotIntervalMs cadence
|
|
18289
|
-
*
|
|
18455
|
+
/** Periodic snapshots at snapshotIntervalMs cadence — DEBUG media, produced
|
|
18456
|
+
* only while `MediaSettings.debugMediaEnabled` is on for the camera (D299;
|
|
18457
|
+
* the retired `saveThumbnails` used to gate this and the rolling
|
|
18458
|
+
* `lastFrame` together). Empty is the healthy default, not a capture gap. */
|
|
18290
18459
|
snapshots: array(TrackSnapshotSchema).readonly(),
|
|
18291
18460
|
/** Deduplicated zones the track has entered at least once. Zone IDS. */
|
|
18292
18461
|
zonesVisited: array(string$2()).readonly(),
|
|
@@ -19146,7 +19315,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
19146
19315
|
}), method(RelocateMediaInputSchema, object({ jobId: string$2() }), {
|
|
19147
19316
|
kind: "mutation",
|
|
19148
19317
|
auth: "admin"
|
|
19149
|
-
}), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(
|
|
19318
|
+
}), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(RelocatableMediaCountInputSchema, RelocatableMediaCountSchema, {
|
|
19319
|
+
kind: "query",
|
|
19320
|
+
auth: "admin"
|
|
19321
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
19150
19322
|
kind: "query",
|
|
19151
19323
|
auth: "admin"
|
|
19152
19324
|
}), method(object({ jobId: string$2() }), object({ cancelled: boolean() }), {
|
|
@@ -21105,6 +21277,9 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
|
|
|
21105
21277
|
}), method(object({ jobId: string$2().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string$2() }), object({ cancelled: boolean() }), {
|
|
21106
21278
|
kind: "mutation",
|
|
21107
21279
|
auth: "admin"
|
|
21280
|
+
}), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string$2() }), {
|
|
21281
|
+
kind: "mutation",
|
|
21282
|
+
auth: "admin"
|
|
21108
21283
|
});
|
|
21109
21284
|
var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
|
|
21110
21285
|
providerId: string$2().min(1),
|
|
@@ -21503,12 +21678,38 @@ response: record(string$2(), unknown()) }), object({
|
|
|
21503
21678
|
*
|
|
21504
21679
|
* ## Why this is a capability and not a helper
|
|
21505
21680
|
*
|
|
21506
|
-
*
|
|
21507
|
-
*
|
|
21508
|
-
*
|
|
21509
|
-
*
|
|
21510
|
-
*
|
|
21511
|
-
*
|
|
21681
|
+
* This capability was introduced with the claim that SIX stores in
|
|
21682
|
+
* `addon-post-analysis` held vectors in a `JSON` settings-store column — object
|
|
21683
|
+
* CLIP, face, plate, vehicle, identity, and the event store's derivatives. That
|
|
21684
|
+
* claim was never true, and leaving it here made five stores look like pending
|
|
21685
|
+
* work when three of them have no vector at all. Counted column by column on
|
|
21686
|
+
* 2026-08-30, exactly THREE ever held one:
|
|
21687
|
+
*
|
|
21688
|
+
* - `object-clip` — 512-dim CLIP image embedding, migrated 2026-08-06.
|
|
21689
|
+
* - `faces.embedding` — 512-dim ArcFace face embedding, migrated 2026-08-30.
|
|
21690
|
+
* - `identity-samples.embedding` — the same ArcFace vector for an ENROLLED
|
|
21691
|
+
* face, migrated 2026-08-30 into its OWN index (see below).
|
|
21692
|
+
*
|
|
21693
|
+
* `plates` and `vehicle-samples` store a plate STRING and a score; `vehicles`
|
|
21694
|
+
* and `identities` store a name; the event store stores no derivative vector.
|
|
21695
|
+
* They are not migration candidates and never were.
|
|
21696
|
+
*
|
|
21697
|
+
* Measured on the live hub the JSON encoding cost ~11.7 KB per row (512 floats
|
|
21698
|
+
* as TEXT, `JSON.parse`d on every search) and made semantic search load 5,000
|
|
21699
|
+
* rows before ranking anything.
|
|
21700
|
+
*
|
|
21701
|
+
* ## One index per COMPARISON, never per encoder
|
|
21702
|
+
*
|
|
21703
|
+
* `faces` and `identity-samples` hold the same 512 ArcFace dims from the same
|
|
21704
|
+
* model, and they still get two indexes. An index is a set of things that are
|
|
21705
|
+
* ranked against each other and that live and die together, and these two are
|
|
21706
|
+
* neither: a `faces` row is TRACK-OWNED and cascades away with its track under
|
|
21707
|
+
* a per-camera capacity cap, an `identity-samples` row is retention-EXEMPT
|
|
21708
|
+
* forever and is the gallery every recognition ranks against. One index would
|
|
21709
|
+
* mean every gallery load and every reconcile carried a filter whose failure
|
|
21710
|
+
* mode is either ranking a candidate against itself or reclaiming an enrolled
|
|
21711
|
+
* person's only sample. The dimension they share is not a reason to share an
|
|
21712
|
+
* index; the question they answer is, and it differs.
|
|
21512
21713
|
*
|
|
21513
21714
|
* The fix is not a faster loop, it is a different backend — and the backend
|
|
21514
21715
|
* should be replaceable without touching six callers. So: a singleton
|
|
@@ -21613,7 +21814,20 @@ var VectorQueryResultSchema = object({
|
|
|
21613
21814
|
*/
|
|
21614
21815
|
scanned: number(),
|
|
21615
21816
|
/** True when the backend could not consider every row that passed the filter. */
|
|
21616
|
-
truncated: boolean()
|
|
21817
|
+
truncated: boolean(),
|
|
21818
|
+
/**
|
|
21819
|
+
* The `topK` the backend actually ran with.
|
|
21820
|
+
*
|
|
21821
|
+
* Every backend has a ceiling — sqlite-vec's is 4,096 — and a caller asking
|
|
21822
|
+
* past it used to learn nothing but a boolean, from a WARN in the provider's
|
|
21823
|
+
* own log rather than in its answer. That is how an audit asking for 20,000
|
|
21824
|
+
* consumed 4,096 and reported `examined: 4096` as if it had walked the index,
|
|
21825
|
+
* for weeks. `truncated` says THAT the answer was short; this says BY HOW
|
|
21826
|
+
* MUCH, in the return value, where the caller cannot fail to see it.
|
|
21827
|
+
*
|
|
21828
|
+
* Equals the requested `topK` whenever nothing was lowered.
|
|
21829
|
+
*/
|
|
21830
|
+
effectiveTopK: number().int().positive()
|
|
21617
21831
|
});
|
|
21618
21832
|
var VectorDeleteInputSchema = object({
|
|
21619
21833
|
index: string$2(),
|
|
@@ -21642,6 +21856,68 @@ var VectorGetResultSchema = object({ items: array(object({
|
|
|
21642
21856
|
id: string$2(),
|
|
21643
21857
|
metadata: VectorMetadataSchema
|
|
21644
21858
|
})) });
|
|
21859
|
+
/**
|
|
21860
|
+
* Ids to read back WITH their vectors.
|
|
21861
|
+
*
|
|
21862
|
+
* The sibling of {@link VectorGetResultSchema}, and deliberately a separate
|
|
21863
|
+
* method rather than a flag on it: `getByIds` promises no vectors and its one
|
|
21864
|
+
* caller depends on that promise. This one promises the opposite.
|
|
21865
|
+
*
|
|
21866
|
+
* It exists because a store cannot put its vectors here otherwise. An ArcFace
|
|
21867
|
+
* gallery is ranked IN PROCESS, per detection, against every enrolled sample —
|
|
21868
|
+
* a per-face cross-process KNN would be a network round trip inside the
|
|
21869
|
+
* recognition loop. So the gallery is loaded once and held in RAM, and loading
|
|
21870
|
+
* it requires the index to hand the floats back. Without this method the only
|
|
21871
|
+
* way to keep a readable vector is a JSON column, which is the thing this
|
|
21872
|
+
* capability exists to delete.
|
|
21873
|
+
*
|
|
21874
|
+
* BOUNDED BY THE CALLER: ids are named, never "everything". Enumerating an
|
|
21875
|
+
* index is {@link VectorScanInputSchema}'s job, and it returns no vectors.
|
|
21876
|
+
*/
|
|
21877
|
+
var VectorFetchInputSchema = object({
|
|
21878
|
+
index: string$2(),
|
|
21879
|
+
ids: array(string$2())
|
|
21880
|
+
});
|
|
21881
|
+
var VectorFetchResultSchema = object({ items: array(object({
|
|
21882
|
+
id: string$2(),
|
|
21883
|
+
/** base64 Float32LE — the same wire form `upsert` accepts. */
|
|
21884
|
+
vector: string$2(),
|
|
21885
|
+
metadata: VectorMetadataSchema
|
|
21886
|
+
})) });
|
|
21887
|
+
/**
|
|
21888
|
+
* ENUMERATE an index: one page of rows in a stable order, no ranking.
|
|
21889
|
+
*
|
|
21890
|
+
* A reconcile does not want the nearest rows, it wants ALL of them, and asking
|
|
21891
|
+
* a KNN for "all" is the wrong question twice over. It hits the backend's `k`
|
|
21892
|
+
* ceiling — 4,096 on sqlite-vec against a 22,128-row index — and it needs a
|
|
21893
|
+
* probe vector it does not have, so the audit passed a ZERO vector whose cosine
|
|
21894
|
+
* distance to every row is degenerate. `examined: 4096` then read as "we
|
|
21895
|
+
* looked" for as long as anyone cared to read it.
|
|
21896
|
+
*
|
|
21897
|
+
* This is the primitive that question actually needs: a bounded page, ordered
|
|
21898
|
+
* by the backend's own row order, costing no distance computation at all.
|
|
21899
|
+
* Vectors are NOT returned — an enumeration that shipped 2 KB per row would be
|
|
21900
|
+
* the full-table read this capability was built to stop.
|
|
21901
|
+
*/
|
|
21902
|
+
var VectorScanInputSchema = object({
|
|
21903
|
+
index: string$2(),
|
|
21904
|
+
/** Opaque resume point. `0` starts at the top; pass back `nextCursor`. */
|
|
21905
|
+
cursor: number().int().nonnegative().default(0),
|
|
21906
|
+
limit: number().int().positive()
|
|
21907
|
+
});
|
|
21908
|
+
var VectorScanResultSchema = object({
|
|
21909
|
+
items: array(object({
|
|
21910
|
+
id: string$2(),
|
|
21911
|
+
metadata: VectorMetadataSchema
|
|
21912
|
+
})),
|
|
21913
|
+
/**
|
|
21914
|
+
* Where the next page starts, or `null` when the walk reached the end.
|
|
21915
|
+
*
|
|
21916
|
+
* `null` is the ONLY end-of-index signal. A caller must not infer the end
|
|
21917
|
+
* from a short page: a backend is free to return fewer rows than asked.
|
|
21918
|
+
*/
|
|
21919
|
+
nextCursor: number().int().nonnegative().nullable()
|
|
21920
|
+
});
|
|
21645
21921
|
var VectorStatsInputSchema = object({ index: string$2() });
|
|
21646
21922
|
var VectorStatsResultSchema = object({
|
|
21647
21923
|
/** Provider id, so an operator can tell brute force from an ANN index. */
|
|
@@ -21660,7 +21936,7 @@ method(VectorDeclareIndexInputSchema, _void(), {
|
|
|
21660
21936
|
}), method(VectorUpsertInputSchema, VectorUpsertResultSchema, {
|
|
21661
21937
|
kind: "mutation",
|
|
21662
21938
|
auth: "admin"
|
|
21663
|
-
}), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
|
|
21939
|
+
}), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorFetchInputSchema, VectorFetchResultSchema, { auth: "admin" }), method(VectorScanInputSchema, VectorScanResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
|
|
21664
21940
|
kind: "mutation",
|
|
21665
21941
|
auth: "admin"
|
|
21666
21942
|
}), method(VectorDeleteByFilterInputSchema, VectorDeleteResultSchema, {
|
|
@@ -28296,6 +28572,9 @@ method(object({
|
|
|
28296
28572
|
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
28297
28573
|
kind: "query",
|
|
28298
28574
|
auth: "admin"
|
|
28575
|
+
}), method(RelocateResidueInputSchema, RelocateResidueSchema, {
|
|
28576
|
+
kind: "query",
|
|
28577
|
+
auth: "admin"
|
|
28299
28578
|
}), method(object({ jobId: string$2() }), object({ cancelled: boolean() }), {
|
|
28300
28579
|
kind: "mutation",
|
|
28301
28580
|
auth: "admin"
|
|
@@ -34930,6 +35209,12 @@ Object.freeze({
|
|
|
34930
35209
|
addonId: null,
|
|
34931
35210
|
access: "create"
|
|
34932
35211
|
},
|
|
35212
|
+
"pipelineAnalytics.countRelocatableMedia": {
|
|
35213
|
+
capName: "pipeline-analytics",
|
|
35214
|
+
capScope: "device",
|
|
35215
|
+
addonId: null,
|
|
35216
|
+
access: "view"
|
|
35217
|
+
},
|
|
34933
35218
|
"pipelineAnalytics.countUnstampedEventMedia": {
|
|
34934
35219
|
capName: "pipeline-analytics",
|
|
34935
35220
|
capScope: "device",
|
|
@@ -36094,6 +36379,12 @@ Object.freeze({
|
|
|
36094
36379
|
addonId: null,
|
|
36095
36380
|
access: "view"
|
|
36096
36381
|
},
|
|
36382
|
+
"recording.getRelocateResidue": {
|
|
36383
|
+
capName: "recording",
|
|
36384
|
+
capScope: "system",
|
|
36385
|
+
addonId: null,
|
|
36386
|
+
access: "view"
|
|
36387
|
+
},
|
|
36097
36388
|
"recording.getStorageMigrationMoveStatus": {
|
|
36098
36389
|
capName: "recording",
|
|
36099
36390
|
capScope: "system",
|
|
@@ -36640,12 +36931,30 @@ Object.freeze({
|
|
|
36640
36931
|
addonId: null,
|
|
36641
36932
|
access: "create"
|
|
36642
36933
|
},
|
|
36934
|
+
"storageMigration.drain": {
|
|
36935
|
+
capName: "storage-migration",
|
|
36936
|
+
capScope: "system",
|
|
36937
|
+
addonId: null,
|
|
36938
|
+
access: "create"
|
|
36939
|
+
},
|
|
36940
|
+
"storageMigration.movers": {
|
|
36941
|
+
capName: "storage-migration",
|
|
36942
|
+
capScope: "system",
|
|
36943
|
+
addonId: null,
|
|
36944
|
+
access: "view"
|
|
36945
|
+
},
|
|
36643
36946
|
"storageMigration.plan": {
|
|
36644
36947
|
capName: "storage-migration",
|
|
36645
36948
|
capScope: "system",
|
|
36646
36949
|
addonId: null,
|
|
36647
36950
|
access: "view"
|
|
36648
36951
|
},
|
|
36952
|
+
"storageMigration.residue": {
|
|
36953
|
+
capName: "storage-migration",
|
|
36954
|
+
capScope: "system",
|
|
36955
|
+
addonId: null,
|
|
36956
|
+
access: "view"
|
|
36957
|
+
},
|
|
36649
36958
|
"storageMigration.start": {
|
|
36650
36959
|
capName: "storage-migration",
|
|
36651
36960
|
capScope: "system",
|
|
@@ -37480,6 +37789,12 @@ Object.freeze({
|
|
|
37480
37789
|
addonId: null,
|
|
37481
37790
|
access: "delete"
|
|
37482
37791
|
},
|
|
37792
|
+
"vectorStore.fetchByIds": {
|
|
37793
|
+
capName: "vector-store",
|
|
37794
|
+
capScope: "system",
|
|
37795
|
+
addonId: null,
|
|
37796
|
+
access: "view"
|
|
37797
|
+
},
|
|
37483
37798
|
"vectorStore.getByIds": {
|
|
37484
37799
|
capName: "vector-store",
|
|
37485
37800
|
capScope: "system",
|
|
@@ -37492,6 +37807,12 @@ Object.freeze({
|
|
|
37492
37807
|
addonId: null,
|
|
37493
37808
|
access: "view"
|
|
37494
37809
|
},
|
|
37810
|
+
"vectorStore.scan": {
|
|
37811
|
+
capName: "vector-store",
|
|
37812
|
+
capScope: "system",
|
|
37813
|
+
addonId: null,
|
|
37814
|
+
access: "view"
|
|
37815
|
+
},
|
|
37495
37816
|
"vectorStore.stats": {
|
|
37496
37817
|
capName: "vector-store",
|
|
37497
37818
|
capScope: "system",
|
package/dist/addon.mjs
CHANGED
|
@@ -8176,13 +8176,49 @@ var StorageMigrationParticipantSchema = _enum([
|
|
|
8176
8176
|
"recorder",
|
|
8177
8177
|
"analytics"
|
|
8178
8178
|
]);
|
|
8179
|
+
/**
|
|
8180
|
+
* The mover's own numbers, folded onto the coordinator's durable move record.
|
|
8181
|
+
*
|
|
8182
|
+
* The long half of a non-blocking migration is `draining`, and it is measured
|
|
8183
|
+
* in hours: 136 885 files at ~4 MB/s is about five of them. Before this shape
|
|
8184
|
+
* existed the only place those numbers appeared was a Loki line, so an operator
|
|
8185
|
+
* watching the Admin UI saw `phase: draining` and nothing else for a whole
|
|
8186
|
+
* afternoon.
|
|
8187
|
+
*
|
|
8188
|
+
* It is POLLED, never pushed. Events are telemetry and may be dropped
|
|
8189
|
+
* (D8/D11), and a dropped progress event is indistinguishable from a stalled
|
|
8190
|
+
* mover — which is the exact failure this is meant to end. The coordinator's
|
|
8191
|
+
* `waitForMoves` already fetches the whole {@link RelocateJob} on every tick to
|
|
8192
|
+
* read `state`; folding the counters costs no extra read and makes the durable
|
|
8193
|
+
* record say afterwards how far a move actually got.
|
|
8194
|
+
*
|
|
8195
|
+
* `filesTotal` is `null` for "no honest denominator" and is never zero-filled:
|
|
8196
|
+
* a windowed footage job (`sinceMs`) and a node with no ledger both genuinely
|
|
8197
|
+
* cannot say M, and a 0 there would render as "100 % done".
|
|
8198
|
+
*/
|
|
8199
|
+
var StorageMigrationMoveProgressSchema = object({
|
|
8200
|
+
filesMoved: number().int().nonnegative(),
|
|
8201
|
+
/** The archive census — the **M** of "N of M" (D295). `null` = unknowable. */
|
|
8202
|
+
filesTotal: number().int().nonnegative().nullable(),
|
|
8203
|
+
bytesMoved: number().int().nonnegative(),
|
|
8204
|
+
/** The MOVER's start, not the migration's: a drain restarted after an addon
|
|
8205
|
+
* crash gets a new mover, and a rate computed from the migration's start
|
|
8206
|
+
* would silently average in the time nothing was running. */
|
|
8207
|
+
startedAt: number(),
|
|
8208
|
+
/** When the coordinator last read these numbers. Paired with `startedAt` it
|
|
8209
|
+
* is the only honest rate: both clocks are the hub's, so a UI never has to
|
|
8210
|
+
* subtract its own. */
|
|
8211
|
+
observedAt: number()
|
|
8212
|
+
});
|
|
8179
8213
|
var StorageMigrationMoveSchema = object({
|
|
8180
8214
|
storageClass: StorageMigrationClassSchema,
|
|
8181
8215
|
fromLocationId: string$2(),
|
|
8182
8216
|
toLocationId: string$2(),
|
|
8183
8217
|
moverJobId: string$2().nullable(),
|
|
8184
8218
|
state: RelocateJobStateSchema.nullable(),
|
|
8185
|
-
error: string$2().nullable()
|
|
8219
|
+
error: string$2().nullable(),
|
|
8220
|
+
/** Last observed mover counters; `null` until the mover has been polled once. */
|
|
8221
|
+
progress: StorageMigrationMoveProgressSchema.nullable()
|
|
8186
8222
|
});
|
|
8187
8223
|
var StorageMigrationJobSchema = object({
|
|
8188
8224
|
jobId: string$2(),
|
|
@@ -8228,6 +8264,98 @@ var StorageMigrationPlanSchema = object({
|
|
|
8228
8264
|
findings: array(StorageMigrationFindingSchema)
|
|
8229
8265
|
});
|
|
8230
8266
|
/**
|
|
8267
|
+
* A mover as it exists RIGHT NOW, whether or not a migration job owns it.
|
|
8268
|
+
*
|
|
8269
|
+
* The coordinator's job record is the state of record for a migration, and its
|
|
8270
|
+
* moves carry {@link StorageMigrationMoveProgress}. But the movers are usable
|
|
8271
|
+
* standalone — `recording.relocateFootage` and `pipelineAnalytics.relocateMedia`
|
|
8272
|
+
* are both operator-callable, and on 2026-08-29 a five-hour drain was armed that
|
|
8273
|
+
* way because no supported UI path existed. A mover armed like that has no job
|
|
8274
|
+
* to fold progress into, so it has to be readable on its own or it is invisible.
|
|
8275
|
+
*
|
|
8276
|
+
* `migrationJobId` is what tells the two apart: `null` means nothing here
|
|
8277
|
+
* orchestrated it.
|
|
8278
|
+
*/
|
|
8279
|
+
var StorageMigrationMoverSchema = object({
|
|
8280
|
+
lane: _enum(["footage", "media"]),
|
|
8281
|
+
job: RelocateJobSchema,
|
|
8282
|
+
/** The coordinator job that armed this mover, or `null` for a mover armed
|
|
8283
|
+
* directly against the owning addon. */
|
|
8284
|
+
migrationJobId: string$2().nullable(),
|
|
8285
|
+
/** When the hub read these counters. Stamped here so a rate is `bytesMoved`
|
|
8286
|
+
* over (`observedAt` − `job.startedAt`) with BOTH ends on the hub's clock —
|
|
8287
|
+
* a browser subtracting its own `Date.now()` from a server `startedAt` is a
|
|
8288
|
+
* rate made of two different clocks. */
|
|
8289
|
+
observedAt: number()
|
|
8290
|
+
});
|
|
8291
|
+
/**
|
|
8292
|
+
* What a SOURCE still holds for one storage class — the number that makes a
|
|
8293
|
+
* "drain remaining" action honest rather than hopeful.
|
|
8294
|
+
*
|
|
8295
|
+
* It comes from the archive (`SegmentHourLedger.census` for footage, the media
|
|
8296
|
+
* engine's own selection count for media), never from the resident index: a
|
|
8297
|
+
* drain sized off `RecordingIndex` is what reported `done` over 80.3 GB it had
|
|
8298
|
+
* never been told about (D295).
|
|
8299
|
+
*
|
|
8300
|
+
* `items`/`bytes` are `null` for "the archive could not be asked", which is
|
|
8301
|
+
* deliberately NOT zero: a drain is still offered for an unknown residue,
|
|
8302
|
+
* because refusing on an unanswerable read would hide exactly the case an
|
|
8303
|
+
* operator needs to act on.
|
|
8304
|
+
*/
|
|
8305
|
+
var StorageMigrationResidueSchema = object({
|
|
8306
|
+
storageClass: StorageMigrationClassSchema,
|
|
8307
|
+
/** The location still holding the data. `'*'` for the media lane, whose rows
|
|
8308
|
+
* move from wherever they are rather than from one named source. */
|
|
8309
|
+
fromLocationId: string$2(),
|
|
8310
|
+
/** Where a drain would move it — the class's CURRENT default. */
|
|
8311
|
+
toLocationId: string$2(),
|
|
8312
|
+
/** Segments (footage lane) or rows (media lane) still on the source. */
|
|
8313
|
+
items: number().int().nonnegative().nullable(),
|
|
8314
|
+
/** Bytes on the source; `null` when the lane counts rows rather than bytes. */
|
|
8315
|
+
bytes: number().int().nonnegative().nullable()
|
|
8316
|
+
});
|
|
8317
|
+
/**
|
|
8318
|
+
* Run the DRAIN half and nothing else.
|
|
8319
|
+
*
|
|
8320
|
+
* A migration that reached `done` has already repointed, so `start` correctly
|
|
8321
|
+
* refuses its destination ("already the default") — there is nothing left to
|
|
8322
|
+
* repoint. But the drain can fail, be cancelled, be interrupted by a restart,
|
|
8323
|
+
* or finish against a work list that was a tenth of the archive (D295), and
|
|
8324
|
+
* before this there was no supported way to run only that half: the only way
|
|
8325
|
+
* through was calling `recording.relocateFootage` by hand over admin tRPC.
|
|
8326
|
+
*
|
|
8327
|
+
* `drain` NEVER calls `setDefaultLocations`. That is what keeps `start`'s
|
|
8328
|
+
* refusal meaningful: the two verbs are disjoint, so nothing here can silently
|
|
8329
|
+
* re-repoint a class that is already migrated.
|
|
8330
|
+
*/
|
|
8331
|
+
var StorageMigrationDrainInputSchema = object({
|
|
8332
|
+
/** The classes to drain. Each must appear in `storageMigration.residue`, so
|
|
8333
|
+
* a class whose source is already empty is refused rather than started. */
|
|
8334
|
+
classes: array(StorageMigrationClassSchema).min(1),
|
|
8335
|
+
throttleMbps: number().min(1).max(1e3).optional()
|
|
8336
|
+
});
|
|
8337
|
+
/** What a footage source still holds, asked of the durable hour ledger. */
|
|
8338
|
+
var RelocateResidueInputSchema = object({
|
|
8339
|
+
fromLocationId: string$2().min(1),
|
|
8340
|
+
/** Narrow to one logical class; omit for every profile on the location. */
|
|
8341
|
+
footageClass: RelocateFootageClassSchema.optional()
|
|
8342
|
+
});
|
|
8343
|
+
/** `null` = the archive could not answer (no ledger on this node, or the
|
|
8344
|
+
* aggregate failed). Never conflated with an empty source. */
|
|
8345
|
+
var RelocateResidueSchema = object({
|
|
8346
|
+
segments: number().int().nonnegative(),
|
|
8347
|
+
bytes: number().int().nonnegative()
|
|
8348
|
+
}).nullable();
|
|
8349
|
+
/** How many rows a media pass would still act on against a given target — the
|
|
8350
|
+
* media lane's denominator AND its residue, from ONE derivation so the two can
|
|
8351
|
+
* never disagree. `null` = the count could not be taken. */
|
|
8352
|
+
var RelocatableMediaCountSchema = object({ rows: number().int().nonnegative() }).nullable();
|
|
8353
|
+
var RelocatableMediaCountInputSchema = object({
|
|
8354
|
+
toLocationId: string$2().min(1),
|
|
8355
|
+
/** Omitted = `move`. */
|
|
8356
|
+
mode: MediaRelocateModeSchema.optional()
|
|
8357
|
+
});
|
|
8358
|
+
/**
|
|
8231
8359
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
8232
8360
|
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
8233
8361
|
* so the persisted record schema and the consumer-facing cap can both consume it
|
|
@@ -8331,6 +8459,32 @@ var StorageLocationRefSchema = union([StorageLocationTypeSchema, string$2().rege
|
|
|
8331
8459
|
* two addons declaring the same `id` must agree on `cardinality` (validated
|
|
8332
8460
|
* at kernel aggregation time, not here).
|
|
8333
8461
|
*/
|
|
8462
|
+
/**
|
|
8463
|
+
* `StorageAccess` — how the service that DECLARED a storage-location kind
|
|
8464
|
+
* actually reaches the bytes. It is the constraint that decides which
|
|
8465
|
+
* `storage-provider`s may back a location of that kind.
|
|
8466
|
+
*
|
|
8467
|
+
* - `'local-path'` — the service asks `storage.resolve` for a path string and
|
|
8468
|
+
* then does its own `node:fs` I/O on it (the recorder's segment writer, the
|
|
8469
|
+
* post-analysis media roots). Only a provider that serves a genuine local
|
|
8470
|
+
* filesystem (`getProviderInfo().nodeLocal === true`) can satisfy that: a
|
|
8471
|
+
* remote provider's `resolve` returns a path on the REMOTE host, and
|
|
8472
|
+
* `fs.readdir` of it on this node either fails or — far worse — succeeds
|
|
8473
|
+
* against a same-named local directory that is something else entirely.
|
|
8474
|
+
*
|
|
8475
|
+
* - `'cap-mediated'` — every byte travels through the `storage` cap
|
|
8476
|
+
* (`read`/`write`, or `beginUpload`/`writeChunk`/`finalizeUpload`). The
|
|
8477
|
+
* service never sees a path, so any provider can back it. `backups` is the
|
|
8478
|
+
* one kind that qualifies today.
|
|
8479
|
+
*
|
|
8480
|
+
* Before this existed, `recordings` was unreachable by SFTP/S3/WebDAV only as
|
|
8481
|
+
* an EMERGENT property of how the recorder happened to be written. Nothing
|
|
8482
|
+
* refused the configuration; the first write simply went somewhere wrong, and
|
|
8483
|
+
* a recording write that goes wrong surfaces as a silent black window rather
|
|
8484
|
+
* than an error (the read path does not `stat`). This turns that accident into
|
|
8485
|
+
* a declared, enforced, testable refusal.
|
|
8486
|
+
*/
|
|
8487
|
+
var StorageAccessSchema = _enum(["local-path", "cap-mediated"]);
|
|
8334
8488
|
var StorageLocationDeclarationSchema = object({
|
|
8335
8489
|
/**
|
|
8336
8490
|
* Global location identifier, e.g. `recordings` or `recordingsLow`.
|
|
@@ -8350,6 +8504,19 @@ var StorageLocationDeclarationSchema = object({
|
|
|
8350
8504
|
*/
|
|
8351
8505
|
cardinality: _enum(["single", "multi"]),
|
|
8352
8506
|
/**
|
|
8507
|
+
* HOW the declaring service reaches the bytes — and therefore WHICH
|
|
8508
|
+
* providers may back a location of this kind. See {@link StorageAccessSchema}
|
|
8509
|
+
* and {@link STORAGE_ACCESS_FALLBACK}.
|
|
8510
|
+
*
|
|
8511
|
+
* Absent means `'local-path'`. That default is FAIL-CLOSED on purpose: it
|
|
8512
|
+
* can only over-restrict (refuse a remote provider for a kind that might
|
|
8513
|
+
* have coped) and never under-restrict. Declaring `'cap-mediated'` is the
|
|
8514
|
+
* permissive direction and is therefore never inferred — a repo guard
|
|
8515
|
+
* (`scripts/check-storage-access-declarations.ts`) refuses to let it be
|
|
8516
|
+
* reached by omission.
|
|
8517
|
+
*/
|
|
8518
|
+
access: StorageAccessSchema.optional(),
|
|
8519
|
+
/**
|
|
8353
8520
|
* When set, the default instance for this location inherits its resolved
|
|
8354
8521
|
* root from the named location's default instance. Useful for derivative
|
|
8355
8522
|
* slots (e.g. `recordingsLow` → `recordings`) so operators only need to
|
|
@@ -18283,8 +18450,10 @@ var TrackSchema = object({
|
|
|
18283
18450
|
lastSeen: number(),
|
|
18284
18451
|
/** Frame-rate position history (subject to maxPositionHistory cap). */
|
|
18285
18452
|
positions: array(TrackPositionSchema).readonly(),
|
|
18286
|
-
/** Periodic snapshots at snapshotIntervalMs cadence
|
|
18287
|
-
*
|
|
18453
|
+
/** Periodic snapshots at snapshotIntervalMs cadence — DEBUG media, produced
|
|
18454
|
+
* only while `MediaSettings.debugMediaEnabled` is on for the camera (D299;
|
|
18455
|
+
* the retired `saveThumbnails` used to gate this and the rolling
|
|
18456
|
+
* `lastFrame` together). Empty is the healthy default, not a capture gap. */
|
|
18288
18457
|
snapshots: array(TrackSnapshotSchema).readonly(),
|
|
18289
18458
|
/** Deduplicated zones the track has entered at least once. Zone IDS. */
|
|
18290
18459
|
zonesVisited: array(string$2()).readonly(),
|
|
@@ -19144,7 +19313,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
19144
19313
|
}), method(RelocateMediaInputSchema, object({ jobId: string$2() }), {
|
|
19145
19314
|
kind: "mutation",
|
|
19146
19315
|
auth: "admin"
|
|
19147
|
-
}), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(
|
|
19316
|
+
}), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(RelocatableMediaCountInputSchema, RelocatableMediaCountSchema, {
|
|
19317
|
+
kind: "query",
|
|
19318
|
+
auth: "admin"
|
|
19319
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
19148
19320
|
kind: "query",
|
|
19149
19321
|
auth: "admin"
|
|
19150
19322
|
}), method(object({ jobId: string$2() }), object({ cancelled: boolean() }), {
|
|
@@ -21103,6 +21275,9 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
|
|
|
21103
21275
|
}), method(object({ jobId: string$2().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string$2() }), object({ cancelled: boolean() }), {
|
|
21104
21276
|
kind: "mutation",
|
|
21105
21277
|
auth: "admin"
|
|
21278
|
+
}), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string$2() }), {
|
|
21279
|
+
kind: "mutation",
|
|
21280
|
+
auth: "admin"
|
|
21106
21281
|
});
|
|
21107
21282
|
var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
|
|
21108
21283
|
providerId: string$2().min(1),
|
|
@@ -21501,12 +21676,38 @@ response: record(string$2(), unknown()) }), object({
|
|
|
21501
21676
|
*
|
|
21502
21677
|
* ## Why this is a capability and not a helper
|
|
21503
21678
|
*
|
|
21504
|
-
*
|
|
21505
|
-
*
|
|
21506
|
-
*
|
|
21507
|
-
*
|
|
21508
|
-
*
|
|
21509
|
-
*
|
|
21679
|
+
* This capability was introduced with the claim that SIX stores in
|
|
21680
|
+
* `addon-post-analysis` held vectors in a `JSON` settings-store column — object
|
|
21681
|
+
* CLIP, face, plate, vehicle, identity, and the event store's derivatives. That
|
|
21682
|
+
* claim was never true, and leaving it here made five stores look like pending
|
|
21683
|
+
* work when three of them have no vector at all. Counted column by column on
|
|
21684
|
+
* 2026-08-30, exactly THREE ever held one:
|
|
21685
|
+
*
|
|
21686
|
+
* - `object-clip` — 512-dim CLIP image embedding, migrated 2026-08-06.
|
|
21687
|
+
* - `faces.embedding` — 512-dim ArcFace face embedding, migrated 2026-08-30.
|
|
21688
|
+
* - `identity-samples.embedding` — the same ArcFace vector for an ENROLLED
|
|
21689
|
+
* face, migrated 2026-08-30 into its OWN index (see below).
|
|
21690
|
+
*
|
|
21691
|
+
* `plates` and `vehicle-samples` store a plate STRING and a score; `vehicles`
|
|
21692
|
+
* and `identities` store a name; the event store stores no derivative vector.
|
|
21693
|
+
* They are not migration candidates and never were.
|
|
21694
|
+
*
|
|
21695
|
+
* Measured on the live hub the JSON encoding cost ~11.7 KB per row (512 floats
|
|
21696
|
+
* as TEXT, `JSON.parse`d on every search) and made semantic search load 5,000
|
|
21697
|
+
* rows before ranking anything.
|
|
21698
|
+
*
|
|
21699
|
+
* ## One index per COMPARISON, never per encoder
|
|
21700
|
+
*
|
|
21701
|
+
* `faces` and `identity-samples` hold the same 512 ArcFace dims from the same
|
|
21702
|
+
* model, and they still get two indexes. An index is a set of things that are
|
|
21703
|
+
* ranked against each other and that live and die together, and these two are
|
|
21704
|
+
* neither: a `faces` row is TRACK-OWNED and cascades away with its track under
|
|
21705
|
+
* a per-camera capacity cap, an `identity-samples` row is retention-EXEMPT
|
|
21706
|
+
* forever and is the gallery every recognition ranks against. One index would
|
|
21707
|
+
* mean every gallery load and every reconcile carried a filter whose failure
|
|
21708
|
+
* mode is either ranking a candidate against itself or reclaiming an enrolled
|
|
21709
|
+
* person's only sample. The dimension they share is not a reason to share an
|
|
21710
|
+
* index; the question they answer is, and it differs.
|
|
21510
21711
|
*
|
|
21511
21712
|
* The fix is not a faster loop, it is a different backend — and the backend
|
|
21512
21713
|
* should be replaceable without touching six callers. So: a singleton
|
|
@@ -21611,7 +21812,20 @@ var VectorQueryResultSchema = object({
|
|
|
21611
21812
|
*/
|
|
21612
21813
|
scanned: number(),
|
|
21613
21814
|
/** True when the backend could not consider every row that passed the filter. */
|
|
21614
|
-
truncated: boolean()
|
|
21815
|
+
truncated: boolean(),
|
|
21816
|
+
/**
|
|
21817
|
+
* The `topK` the backend actually ran with.
|
|
21818
|
+
*
|
|
21819
|
+
* Every backend has a ceiling — sqlite-vec's is 4,096 — and a caller asking
|
|
21820
|
+
* past it used to learn nothing but a boolean, from a WARN in the provider's
|
|
21821
|
+
* own log rather than in its answer. That is how an audit asking for 20,000
|
|
21822
|
+
* consumed 4,096 and reported `examined: 4096` as if it had walked the index,
|
|
21823
|
+
* for weeks. `truncated` says THAT the answer was short; this says BY HOW
|
|
21824
|
+
* MUCH, in the return value, where the caller cannot fail to see it.
|
|
21825
|
+
*
|
|
21826
|
+
* Equals the requested `topK` whenever nothing was lowered.
|
|
21827
|
+
*/
|
|
21828
|
+
effectiveTopK: number().int().positive()
|
|
21615
21829
|
});
|
|
21616
21830
|
var VectorDeleteInputSchema = object({
|
|
21617
21831
|
index: string$2(),
|
|
@@ -21640,6 +21854,68 @@ var VectorGetResultSchema = object({ items: array(object({
|
|
|
21640
21854
|
id: string$2(),
|
|
21641
21855
|
metadata: VectorMetadataSchema
|
|
21642
21856
|
})) });
|
|
21857
|
+
/**
|
|
21858
|
+
* Ids to read back WITH their vectors.
|
|
21859
|
+
*
|
|
21860
|
+
* The sibling of {@link VectorGetResultSchema}, and deliberately a separate
|
|
21861
|
+
* method rather than a flag on it: `getByIds` promises no vectors and its one
|
|
21862
|
+
* caller depends on that promise. This one promises the opposite.
|
|
21863
|
+
*
|
|
21864
|
+
* It exists because a store cannot put its vectors here otherwise. An ArcFace
|
|
21865
|
+
* gallery is ranked IN PROCESS, per detection, against every enrolled sample —
|
|
21866
|
+
* a per-face cross-process KNN would be a network round trip inside the
|
|
21867
|
+
* recognition loop. So the gallery is loaded once and held in RAM, and loading
|
|
21868
|
+
* it requires the index to hand the floats back. Without this method the only
|
|
21869
|
+
* way to keep a readable vector is a JSON column, which is the thing this
|
|
21870
|
+
* capability exists to delete.
|
|
21871
|
+
*
|
|
21872
|
+
* BOUNDED BY THE CALLER: ids are named, never "everything". Enumerating an
|
|
21873
|
+
* index is {@link VectorScanInputSchema}'s job, and it returns no vectors.
|
|
21874
|
+
*/
|
|
21875
|
+
var VectorFetchInputSchema = object({
|
|
21876
|
+
index: string$2(),
|
|
21877
|
+
ids: array(string$2())
|
|
21878
|
+
});
|
|
21879
|
+
var VectorFetchResultSchema = object({ items: array(object({
|
|
21880
|
+
id: string$2(),
|
|
21881
|
+
/** base64 Float32LE — the same wire form `upsert` accepts. */
|
|
21882
|
+
vector: string$2(),
|
|
21883
|
+
metadata: VectorMetadataSchema
|
|
21884
|
+
})) });
|
|
21885
|
+
/**
|
|
21886
|
+
* ENUMERATE an index: one page of rows in a stable order, no ranking.
|
|
21887
|
+
*
|
|
21888
|
+
* A reconcile does not want the nearest rows, it wants ALL of them, and asking
|
|
21889
|
+
* a KNN for "all" is the wrong question twice over. It hits the backend's `k`
|
|
21890
|
+
* ceiling — 4,096 on sqlite-vec against a 22,128-row index — and it needs a
|
|
21891
|
+
* probe vector it does not have, so the audit passed a ZERO vector whose cosine
|
|
21892
|
+
* distance to every row is degenerate. `examined: 4096` then read as "we
|
|
21893
|
+
* looked" for as long as anyone cared to read it.
|
|
21894
|
+
*
|
|
21895
|
+
* This is the primitive that question actually needs: a bounded page, ordered
|
|
21896
|
+
* by the backend's own row order, costing no distance computation at all.
|
|
21897
|
+
* Vectors are NOT returned — an enumeration that shipped 2 KB per row would be
|
|
21898
|
+
* the full-table read this capability was built to stop.
|
|
21899
|
+
*/
|
|
21900
|
+
var VectorScanInputSchema = object({
|
|
21901
|
+
index: string$2(),
|
|
21902
|
+
/** Opaque resume point. `0` starts at the top; pass back `nextCursor`. */
|
|
21903
|
+
cursor: number().int().nonnegative().default(0),
|
|
21904
|
+
limit: number().int().positive()
|
|
21905
|
+
});
|
|
21906
|
+
var VectorScanResultSchema = object({
|
|
21907
|
+
items: array(object({
|
|
21908
|
+
id: string$2(),
|
|
21909
|
+
metadata: VectorMetadataSchema
|
|
21910
|
+
})),
|
|
21911
|
+
/**
|
|
21912
|
+
* Where the next page starts, or `null` when the walk reached the end.
|
|
21913
|
+
*
|
|
21914
|
+
* `null` is the ONLY end-of-index signal. A caller must not infer the end
|
|
21915
|
+
* from a short page: a backend is free to return fewer rows than asked.
|
|
21916
|
+
*/
|
|
21917
|
+
nextCursor: number().int().nonnegative().nullable()
|
|
21918
|
+
});
|
|
21643
21919
|
var VectorStatsInputSchema = object({ index: string$2() });
|
|
21644
21920
|
var VectorStatsResultSchema = object({
|
|
21645
21921
|
/** Provider id, so an operator can tell brute force from an ANN index. */
|
|
@@ -21658,7 +21934,7 @@ method(VectorDeclareIndexInputSchema, _void(), {
|
|
|
21658
21934
|
}), method(VectorUpsertInputSchema, VectorUpsertResultSchema, {
|
|
21659
21935
|
kind: "mutation",
|
|
21660
21936
|
auth: "admin"
|
|
21661
|
-
}), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
|
|
21937
|
+
}), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorFetchInputSchema, VectorFetchResultSchema, { auth: "admin" }), method(VectorScanInputSchema, VectorScanResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
|
|
21662
21938
|
kind: "mutation",
|
|
21663
21939
|
auth: "admin"
|
|
21664
21940
|
}), method(VectorDeleteByFilterInputSchema, VectorDeleteResultSchema, {
|
|
@@ -28294,6 +28570,9 @@ method(object({
|
|
|
28294
28570
|
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
28295
28571
|
kind: "query",
|
|
28296
28572
|
auth: "admin"
|
|
28573
|
+
}), method(RelocateResidueInputSchema, RelocateResidueSchema, {
|
|
28574
|
+
kind: "query",
|
|
28575
|
+
auth: "admin"
|
|
28297
28576
|
}), method(object({ jobId: string$2() }), object({ cancelled: boolean() }), {
|
|
28298
28577
|
kind: "mutation",
|
|
28299
28578
|
auth: "admin"
|
|
@@ -34928,6 +35207,12 @@ Object.freeze({
|
|
|
34928
35207
|
addonId: null,
|
|
34929
35208
|
access: "create"
|
|
34930
35209
|
},
|
|
35210
|
+
"pipelineAnalytics.countRelocatableMedia": {
|
|
35211
|
+
capName: "pipeline-analytics",
|
|
35212
|
+
capScope: "device",
|
|
35213
|
+
addonId: null,
|
|
35214
|
+
access: "view"
|
|
35215
|
+
},
|
|
34931
35216
|
"pipelineAnalytics.countUnstampedEventMedia": {
|
|
34932
35217
|
capName: "pipeline-analytics",
|
|
34933
35218
|
capScope: "device",
|
|
@@ -36092,6 +36377,12 @@ Object.freeze({
|
|
|
36092
36377
|
addonId: null,
|
|
36093
36378
|
access: "view"
|
|
36094
36379
|
},
|
|
36380
|
+
"recording.getRelocateResidue": {
|
|
36381
|
+
capName: "recording",
|
|
36382
|
+
capScope: "system",
|
|
36383
|
+
addonId: null,
|
|
36384
|
+
access: "view"
|
|
36385
|
+
},
|
|
36095
36386
|
"recording.getStorageMigrationMoveStatus": {
|
|
36096
36387
|
capName: "recording",
|
|
36097
36388
|
capScope: "system",
|
|
@@ -36638,12 +36929,30 @@ Object.freeze({
|
|
|
36638
36929
|
addonId: null,
|
|
36639
36930
|
access: "create"
|
|
36640
36931
|
},
|
|
36932
|
+
"storageMigration.drain": {
|
|
36933
|
+
capName: "storage-migration",
|
|
36934
|
+
capScope: "system",
|
|
36935
|
+
addonId: null,
|
|
36936
|
+
access: "create"
|
|
36937
|
+
},
|
|
36938
|
+
"storageMigration.movers": {
|
|
36939
|
+
capName: "storage-migration",
|
|
36940
|
+
capScope: "system",
|
|
36941
|
+
addonId: null,
|
|
36942
|
+
access: "view"
|
|
36943
|
+
},
|
|
36641
36944
|
"storageMigration.plan": {
|
|
36642
36945
|
capName: "storage-migration",
|
|
36643
36946
|
capScope: "system",
|
|
36644
36947
|
addonId: null,
|
|
36645
36948
|
access: "view"
|
|
36646
36949
|
},
|
|
36950
|
+
"storageMigration.residue": {
|
|
36951
|
+
capName: "storage-migration",
|
|
36952
|
+
capScope: "system",
|
|
36953
|
+
addonId: null,
|
|
36954
|
+
access: "view"
|
|
36955
|
+
},
|
|
36647
36956
|
"storageMigration.start": {
|
|
36648
36957
|
capName: "storage-migration",
|
|
36649
36958
|
capScope: "system",
|
|
@@ -37478,6 +37787,12 @@ Object.freeze({
|
|
|
37478
37787
|
addonId: null,
|
|
37479
37788
|
access: "delete"
|
|
37480
37789
|
},
|
|
37790
|
+
"vectorStore.fetchByIds": {
|
|
37791
|
+
capName: "vector-store",
|
|
37792
|
+
capScope: "system",
|
|
37793
|
+
addonId: null,
|
|
37794
|
+
access: "view"
|
|
37795
|
+
},
|
|
37481
37796
|
"vectorStore.getByIds": {
|
|
37482
37797
|
capName: "vector-store",
|
|
37483
37798
|
capScope: "system",
|
|
@@ -37490,6 +37805,12 @@ Object.freeze({
|
|
|
37490
37805
|
addonId: null,
|
|
37491
37806
|
access: "view"
|
|
37492
37807
|
},
|
|
37808
|
+
"vectorStore.scan": {
|
|
37809
|
+
capName: "vector-store",
|
|
37810
|
+
capScope: "system",
|
|
37811
|
+
addonId: null,
|
|
37812
|
+
access: "view"
|
|
37813
|
+
},
|
|
37493
37814
|
"vectorStore.stats": {
|
|
37494
37815
|
capName: "vector-store",
|
|
37495
37816
|
capScope: "system",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-matter-broker",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.44",
|
|
4
4
|
"description": "Matter broker addon for CamStack — owns a Matter fabric (commissioning + the long-lived controller) via the matter.js controller and brokers commissioned Matter nodes into CamStack",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|