@camstack/addon-remote-storage 1.2.41 → 1.2.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -0
- package/dist/index.mjs +2 -1
- package/dist/s3.addon.js +1 -1
- package/dist/s3.addon.mjs +1 -1
- package/dist/sftp.addon.js +5 -2
- package/dist/sftp.addon.mjs +5 -2
- package/dist/{shared-DMrHydd5.js → shared-CzYVi403.js} +452 -23
- package/dist/{shared-BgEt_GPp.mjs → shared-DsnRUNmJ.mjs} +452 -23
- package/dist/smb.addon.js +806 -0
- package/dist/smb.addon.mjs +796 -0
- package/dist/webdav.addon.js +1 -1
- package/dist/webdav.addon.mjs +1 -1
- package/package.json +40 -6
|
@@ -8024,18 +8024,61 @@ var RelocateFootageInputSchema = object({
|
|
|
8024
8024
|
* `RecordingConfig.enabled` or camera wrapper bindings. */
|
|
8025
8025
|
var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
|
|
8026
8026
|
var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
|
|
8027
|
+
/**
|
|
8028
|
+
* What a `relocateMedia` pass DOES. One engine, three passes — never a second
|
|
8029
|
+
* mover (the engine already walks both collections with a timestamp cursor and
|
|
8030
|
+
* already has a stamp-without-copy path).
|
|
8031
|
+
*
|
|
8032
|
+
* - `move` — the default and the historical behaviour: event-media and
|
|
8033
|
+
* retrain blobs move to `toLocationId` and their rows are
|
|
8034
|
+
* stamped. The enrolled gallery is skipped (D197).
|
|
8035
|
+
* - `seal` — ROWS ONLY, no bytes. Every row whose `locationId` is NULL is
|
|
8036
|
+
* stamped with `toLocationId`. `toLocationId` here is the id the
|
|
8037
|
+
* bytes ALREADY sit on — today's `eventMedia` default — because
|
|
8038
|
+
* a NULL row means "wherever `eventMedia` points *now*", and the
|
|
8039
|
+
* instant a repoint moves that pointer the row reads from the
|
|
8040
|
+
* new disk while its bytes are on the old one.
|
|
8041
|
+
* - `gallery` — the inverse selection of `move`: ONLY the retention-exempt
|
|
8042
|
+
* (enrolled-gallery) rows, which `move` deliberately skips.
|
|
8043
|
+
* `galleryMedia` is `cardinality: 'single'`, so this pass can
|
|
8044
|
+
* never run beside a live second location: it is stop-the-world
|
|
8045
|
+
* by construction, which is acceptable only because the gallery
|
|
8046
|
+
* is a few KB per enrolled sample.
|
|
8047
|
+
*/
|
|
8048
|
+
var MediaRelocateModeSchema = _enum([
|
|
8049
|
+
"move",
|
|
8050
|
+
"seal",
|
|
8051
|
+
"gallery"
|
|
8052
|
+
]);
|
|
8027
8053
|
var RelocateMediaInputSchema = object({
|
|
8028
8054
|
toLocationId: string(),
|
|
8029
|
-
throttleMbps: number().min(1).max(1e3).optional()
|
|
8055
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
8056
|
+
/** Omitted = `move`, the pre-existing behaviour. */
|
|
8057
|
+
mode: MediaRelocateModeSchema.optional()
|
|
8058
|
+
});
|
|
8059
|
+
/** How many rows still carry NO `locationId` — the population a repoint would
|
|
8060
|
+
* silently re-aim at a disk that does not hold their bytes. Zero is the only
|
|
8061
|
+
* value that permits a non-blocking `eventMedia` cutover. */
|
|
8062
|
+
var UnstampedEventMediaCountSchema = object({
|
|
8063
|
+
media: number().int().nonnegative(),
|
|
8064
|
+
retrainFrames: number().int().nonnegative(),
|
|
8065
|
+
total: number().int().nonnegative()
|
|
8030
8066
|
});
|
|
8031
8067
|
var StorageMigrationMediaMoveInputSchema = RelocateMediaInputSchema.extend({ leaseId: string().min(1) });
|
|
8032
|
-
/** The independently selectable logical storage classes
|
|
8033
|
-
*
|
|
8034
|
-
*
|
|
8068
|
+
/** The independently selectable logical storage classes — every class
|
|
8069
|
+
* `storage.listLocationDeclarations` reports, so an operator never meets a
|
|
8070
|
+
* Zod enum error where they should meet an explanation.
|
|
8071
|
+
*
|
|
8072
|
+
* `recordings` encompasses the high and mid segment profiles; `recordingsLow`
|
|
8073
|
+
* is low segments; `eventMedia` is post-analysis blobs; `galleryMedia` is the
|
|
8074
|
+
* enrolled gallery; `backups` is the system backup archive. The last two have
|
|
8075
|
+
* their own rules — see {@link StorageMigrationFindingCodeSchema}. */
|
|
8035
8076
|
var StorageMigrationClassSchema = _enum([
|
|
8036
8077
|
"recordings",
|
|
8037
8078
|
"recordingsLow",
|
|
8038
|
-
"eventMedia"
|
|
8079
|
+
"eventMedia",
|
|
8080
|
+
"backups",
|
|
8081
|
+
"galleryMedia"
|
|
8039
8082
|
]);
|
|
8040
8083
|
/** A destination is always an existing, fully-qualified location id. The
|
|
8041
8084
|
* migration API intentionally never changes a source location's `basePath`:
|
|
@@ -8043,20 +8086,56 @@ var StorageMigrationClassSchema = _enum([
|
|
|
8043
8086
|
var StorageMigrationDestinationsSchema = object({
|
|
8044
8087
|
recordings: string().min(1).optional(),
|
|
8045
8088
|
recordingsLow: string().min(1).optional(),
|
|
8046
|
-
eventMedia: string().min(1).optional()
|
|
8089
|
+
eventMedia: string().min(1).optional(),
|
|
8090
|
+
backups: string().min(1).optional(),
|
|
8091
|
+
galleryMedia: string().min(1).optional()
|
|
8047
8092
|
}).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
|
|
8093
|
+
/**
|
|
8094
|
+
* How a migration sequences the cutover against the byte move.
|
|
8095
|
+
*
|
|
8096
|
+
* - `blocking` — the historical order: pause, move every byte, repoint,
|
|
8097
|
+
* resume. Recording is stopped for the whole move. Right
|
|
8098
|
+
* for a small or a cold class, and the only legal mode for
|
|
8099
|
+
* a `cardinality: 'single'` class.
|
|
8100
|
+
* - `nonBlocking` — repoint FIRST, drain behind: seal, pause, repoint,
|
|
8101
|
+
* refresh, resume, then move the past with everything
|
|
8102
|
+
* running. The pause is three bounded instants (a detach +
|
|
8103
|
+
* attach round, a write-gate drain, a lease) instead of one
|
|
8104
|
+
* bounded by bytes. 1.09 TB at 7–14 MB/s is thirty hours of
|
|
8105
|
+
* stopped recording under `blocking`; the same move is
|
|
8106
|
+
* seconds of stopped recording under `nonBlocking`.
|
|
8107
|
+
*
|
|
8108
|
+
* The mode is on the JOB, not only on the input, because `status` is where an
|
|
8109
|
+
* operator finds out which one is running.
|
|
8110
|
+
*/
|
|
8111
|
+
var StorageMigrationModeSchema = _enum(["blocking", "nonBlocking"]);
|
|
8048
8112
|
/** Shared input for planning and starting an orchestrated storage migration. */
|
|
8049
8113
|
var StorageMigrationInputSchema = object({
|
|
8050
8114
|
destinations: StorageMigrationDestinationsSchema,
|
|
8051
|
-
throttleMbps: number().min(1).max(1e3).optional()
|
|
8115
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
8116
|
+
/** Omitted = `blocking`, which stays the default. */
|
|
8117
|
+
mode: StorageMigrationModeSchema.optional()
|
|
8052
8118
|
});
|
|
8053
|
-
/**
|
|
8054
|
-
*
|
|
8055
|
-
*
|
|
8119
|
+
/**
|
|
8120
|
+
* The durable coordinator state machine.
|
|
8121
|
+
*
|
|
8122
|
+
* `blocking`:
|
|
8123
|
+
* planning → pausing → moving → verifying → repointing → refreshing → resuming → done
|
|
8124
|
+
*
|
|
8125
|
+
* `nonBlocking`:
|
|
8126
|
+
* planning → sealing → pausing → repointing → refreshing → resuming → draining → verifying → done
|
|
8127
|
+
*
|
|
8128
|
+
* Same phases, different order plus two new ones — not a second mover.
|
|
8129
|
+
* `sealing` closes the `eventMedia` NULL-row hole BEFORE anything is paused;
|
|
8130
|
+
* `draining` runs the same movers UNLEASED, after every writer is back up.
|
|
8131
|
+
* `repointing` is still the only phase that changes a default location.
|
|
8132
|
+
*/
|
|
8056
8133
|
var StorageMigrationPhaseSchema = _enum([
|
|
8057
8134
|
"planning",
|
|
8135
|
+
"sealing",
|
|
8058
8136
|
"pausing",
|
|
8059
8137
|
"moving",
|
|
8138
|
+
"draining",
|
|
8060
8139
|
"verifying",
|
|
8061
8140
|
"repointing",
|
|
8062
8141
|
"refreshing",
|
|
@@ -8070,17 +8149,56 @@ var StorageMigrationParticipantSchema = _enum([
|
|
|
8070
8149
|
"recorder",
|
|
8071
8150
|
"analytics"
|
|
8072
8151
|
]);
|
|
8152
|
+
/**
|
|
8153
|
+
* The mover's own numbers, folded onto the coordinator's durable move record.
|
|
8154
|
+
*
|
|
8155
|
+
* The long half of a non-blocking migration is `draining`, and it is measured
|
|
8156
|
+
* in hours: 136 885 files at ~4 MB/s is about five of them. Before this shape
|
|
8157
|
+
* existed the only place those numbers appeared was a Loki line, so an operator
|
|
8158
|
+
* watching the Admin UI saw `phase: draining` and nothing else for a whole
|
|
8159
|
+
* afternoon.
|
|
8160
|
+
*
|
|
8161
|
+
* It is POLLED, never pushed. Events are telemetry and may be dropped
|
|
8162
|
+
* (D8/D11), and a dropped progress event is indistinguishable from a stalled
|
|
8163
|
+
* mover — which is the exact failure this is meant to end. The coordinator's
|
|
8164
|
+
* `waitForMoves` already fetches the whole {@link RelocateJob} on every tick to
|
|
8165
|
+
* read `state`; folding the counters costs no extra read and makes the durable
|
|
8166
|
+
* record say afterwards how far a move actually got.
|
|
8167
|
+
*
|
|
8168
|
+
* `filesTotal` is `null` for "no honest denominator" and is never zero-filled:
|
|
8169
|
+
* a windowed footage job (`sinceMs`) and a node with no ledger both genuinely
|
|
8170
|
+
* cannot say M, and a 0 there would render as "100 % done".
|
|
8171
|
+
*/
|
|
8172
|
+
var StorageMigrationMoveProgressSchema = object({
|
|
8173
|
+
filesMoved: number().int().nonnegative(),
|
|
8174
|
+
/** The archive census — the **M** of "N of M" (D295). `null` = unknowable. */
|
|
8175
|
+
filesTotal: number().int().nonnegative().nullable(),
|
|
8176
|
+
bytesMoved: number().int().nonnegative(),
|
|
8177
|
+
/** The MOVER's start, not the migration's: a drain restarted after an addon
|
|
8178
|
+
* crash gets a new mover, and a rate computed from the migration's start
|
|
8179
|
+
* would silently average in the time nothing was running. */
|
|
8180
|
+
startedAt: number(),
|
|
8181
|
+
/** When the coordinator last read these numbers. Paired with `startedAt` it
|
|
8182
|
+
* is the only honest rate: both clocks are the hub's, so a UI never has to
|
|
8183
|
+
* subtract its own. */
|
|
8184
|
+
observedAt: number()
|
|
8185
|
+
});
|
|
8073
8186
|
var StorageMigrationMoveSchema = object({
|
|
8074
8187
|
storageClass: StorageMigrationClassSchema,
|
|
8075
8188
|
fromLocationId: string(),
|
|
8076
8189
|
toLocationId: string(),
|
|
8077
8190
|
moverJobId: string().nullable(),
|
|
8078
8191
|
state: RelocateJobStateSchema.nullable(),
|
|
8079
|
-
error: string().nullable()
|
|
8192
|
+
error: string().nullable(),
|
|
8193
|
+
/** Last observed mover counters; `null` until the mover has been polled once. */
|
|
8194
|
+
progress: StorageMigrationMoveProgressSchema.nullable()
|
|
8080
8195
|
});
|
|
8081
8196
|
var StorageMigrationJobSchema = object({
|
|
8082
8197
|
jobId: string(),
|
|
8083
8198
|
phase: StorageMigrationPhaseSchema,
|
|
8199
|
+
/** Which order this job is running. `status` is the only place an operator
|
|
8200
|
+
* can tell a seconds-long cutover from a thirty-hour one. */
|
|
8201
|
+
mode: StorageMigrationModeSchema,
|
|
8084
8202
|
destinations: StorageMigrationDestinationsSchema,
|
|
8085
8203
|
throttleMbps: number(),
|
|
8086
8204
|
moves: array(StorageMigrationMoveSchema),
|
|
@@ -8093,13 +8211,122 @@ var StorageMigrationJobSchema = object({
|
|
|
8093
8211
|
finishedAt: number().nullable(),
|
|
8094
8212
|
error: string().nullable()
|
|
8095
8213
|
});
|
|
8214
|
+
var StorageMigrationFindingSchema = object({
|
|
8215
|
+
code: _enum([
|
|
8216
|
+
"sharesDeviceWithSource",
|
|
8217
|
+
"deviceIdentityUnknown",
|
|
8218
|
+
"unstampedEventMediaRows",
|
|
8219
|
+
"blockingOnly",
|
|
8220
|
+
"noMover"
|
|
8221
|
+
]),
|
|
8222
|
+
storageClass: StorageMigrationClassSchema,
|
|
8223
|
+
/** Human-readable, already carrying the ids and counts. */
|
|
8224
|
+
message: string()
|
|
8225
|
+
});
|
|
8096
8226
|
var StorageMigrationPlanSchema = object({
|
|
8097
8227
|
destinations: StorageMigrationDestinationsSchema,
|
|
8228
|
+
/** The mode this plan was built for. A plan is only valid for its mode: the
|
|
8229
|
+
* `eventMedia` seal gate and the single-cardinality refusal both depend on
|
|
8230
|
+
* it. */
|
|
8231
|
+
mode: StorageMigrationModeSchema,
|
|
8098
8232
|
moves: array(object({
|
|
8099
8233
|
storageClass: StorageMigrationClassSchema,
|
|
8100
8234
|
fromLocationId: string(),
|
|
8101
8235
|
toLocationId: string()
|
|
8102
|
-
}))
|
|
8236
|
+
})),
|
|
8237
|
+
findings: array(StorageMigrationFindingSchema)
|
|
8238
|
+
});
|
|
8239
|
+
/**
|
|
8240
|
+
* A mover as it exists RIGHT NOW, whether or not a migration job owns it.
|
|
8241
|
+
*
|
|
8242
|
+
* The coordinator's job record is the state of record for a migration, and its
|
|
8243
|
+
* moves carry {@link StorageMigrationMoveProgress}. But the movers are usable
|
|
8244
|
+
* standalone — `recording.relocateFootage` and `pipelineAnalytics.relocateMedia`
|
|
8245
|
+
* are both operator-callable, and on 2026-08-29 a five-hour drain was armed that
|
|
8246
|
+
* way because no supported UI path existed. A mover armed like that has no job
|
|
8247
|
+
* to fold progress into, so it has to be readable on its own or it is invisible.
|
|
8248
|
+
*
|
|
8249
|
+
* `migrationJobId` is what tells the two apart: `null` means nothing here
|
|
8250
|
+
* orchestrated it.
|
|
8251
|
+
*/
|
|
8252
|
+
var StorageMigrationMoverSchema = object({
|
|
8253
|
+
lane: _enum(["footage", "media"]),
|
|
8254
|
+
job: RelocateJobSchema,
|
|
8255
|
+
/** The coordinator job that armed this mover, or `null` for a mover armed
|
|
8256
|
+
* directly against the owning addon. */
|
|
8257
|
+
migrationJobId: string().nullable(),
|
|
8258
|
+
/** When the hub read these counters. Stamped here so a rate is `bytesMoved`
|
|
8259
|
+
* over (`observedAt` − `job.startedAt`) with BOTH ends on the hub's clock —
|
|
8260
|
+
* a browser subtracting its own `Date.now()` from a server `startedAt` is a
|
|
8261
|
+
* rate made of two different clocks. */
|
|
8262
|
+
observedAt: number()
|
|
8263
|
+
});
|
|
8264
|
+
/**
|
|
8265
|
+
* What a SOURCE still holds for one storage class — the number that makes a
|
|
8266
|
+
* "drain remaining" action honest rather than hopeful.
|
|
8267
|
+
*
|
|
8268
|
+
* It comes from the archive (`SegmentHourLedger.census` for footage, the media
|
|
8269
|
+
* engine's own selection count for media), never from the resident index: a
|
|
8270
|
+
* drain sized off `RecordingIndex` is what reported `done` over 80.3 GB it had
|
|
8271
|
+
* never been told about (D295).
|
|
8272
|
+
*
|
|
8273
|
+
* `items`/`bytes` are `null` for "the archive could not be asked", which is
|
|
8274
|
+
* deliberately NOT zero: a drain is still offered for an unknown residue,
|
|
8275
|
+
* because refusing on an unanswerable read would hide exactly the case an
|
|
8276
|
+
* operator needs to act on.
|
|
8277
|
+
*/
|
|
8278
|
+
var StorageMigrationResidueSchema = object({
|
|
8279
|
+
storageClass: StorageMigrationClassSchema,
|
|
8280
|
+
/** The location still holding the data. `'*'` for the media lane, whose rows
|
|
8281
|
+
* move from wherever they are rather than from one named source. */
|
|
8282
|
+
fromLocationId: string(),
|
|
8283
|
+
/** Where a drain would move it — the class's CURRENT default. */
|
|
8284
|
+
toLocationId: string(),
|
|
8285
|
+
/** Segments (footage lane) or rows (media lane) still on the source. */
|
|
8286
|
+
items: number().int().nonnegative().nullable(),
|
|
8287
|
+
/** Bytes on the source; `null` when the lane counts rows rather than bytes. */
|
|
8288
|
+
bytes: number().int().nonnegative().nullable()
|
|
8289
|
+
});
|
|
8290
|
+
/**
|
|
8291
|
+
* Run the DRAIN half and nothing else.
|
|
8292
|
+
*
|
|
8293
|
+
* A migration that reached `done` has already repointed, so `start` correctly
|
|
8294
|
+
* refuses its destination ("already the default") — there is nothing left to
|
|
8295
|
+
* repoint. But the drain can fail, be cancelled, be interrupted by a restart,
|
|
8296
|
+
* or finish against a work list that was a tenth of the archive (D295), and
|
|
8297
|
+
* before this there was no supported way to run only that half: the only way
|
|
8298
|
+
* through was calling `recording.relocateFootage` by hand over admin tRPC.
|
|
8299
|
+
*
|
|
8300
|
+
* `drain` NEVER calls `setDefaultLocations`. That is what keeps `start`'s
|
|
8301
|
+
* refusal meaningful: the two verbs are disjoint, so nothing here can silently
|
|
8302
|
+
* re-repoint a class that is already migrated.
|
|
8303
|
+
*/
|
|
8304
|
+
var StorageMigrationDrainInputSchema = object({
|
|
8305
|
+
/** The classes to drain. Each must appear in `storageMigration.residue`, so
|
|
8306
|
+
* a class whose source is already empty is refused rather than started. */
|
|
8307
|
+
classes: array(StorageMigrationClassSchema).min(1),
|
|
8308
|
+
throttleMbps: number().min(1).max(1e3).optional()
|
|
8309
|
+
});
|
|
8310
|
+
/** What a footage source still holds, asked of the durable hour ledger. */
|
|
8311
|
+
var RelocateResidueInputSchema = object({
|
|
8312
|
+
fromLocationId: string().min(1),
|
|
8313
|
+
/** Narrow to one logical class; omit for every profile on the location. */
|
|
8314
|
+
footageClass: RelocateFootageClassSchema.optional()
|
|
8315
|
+
});
|
|
8316
|
+
/** `null` = the archive could not answer (no ledger on this node, or the
|
|
8317
|
+
* aggregate failed). Never conflated with an empty source. */
|
|
8318
|
+
var RelocateResidueSchema = object({
|
|
8319
|
+
segments: number().int().nonnegative(),
|
|
8320
|
+
bytes: number().int().nonnegative()
|
|
8321
|
+
}).nullable();
|
|
8322
|
+
/** How many rows a media pass would still act on against a given target — the
|
|
8323
|
+
* media lane's denominator AND its residue, from ONE derivation so the two can
|
|
8324
|
+
* never disagree. `null` = the count could not be taken. */
|
|
8325
|
+
var RelocatableMediaCountSchema = object({ rows: number().int().nonnegative() }).nullable();
|
|
8326
|
+
var RelocatableMediaCountInputSchema = object({
|
|
8327
|
+
toLocationId: string().min(1),
|
|
8328
|
+
/** Omitted = `move`. */
|
|
8329
|
+
mode: MediaRelocateModeSchema.optional()
|
|
8103
8330
|
});
|
|
8104
8331
|
/**
|
|
8105
8332
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
@@ -8205,6 +8432,32 @@ var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(
|
|
|
8205
8432
|
* two addons declaring the same `id` must agree on `cardinality` (validated
|
|
8206
8433
|
* at kernel aggregation time, not here).
|
|
8207
8434
|
*/
|
|
8435
|
+
/**
|
|
8436
|
+
* `StorageAccess` — how the service that DECLARED a storage-location kind
|
|
8437
|
+
* actually reaches the bytes. It is the constraint that decides which
|
|
8438
|
+
* `storage-provider`s may back a location of that kind.
|
|
8439
|
+
*
|
|
8440
|
+
* - `'local-path'` — the service asks `storage.resolve` for a path string and
|
|
8441
|
+
* then does its own `node:fs` I/O on it (the recorder's segment writer, the
|
|
8442
|
+
* post-analysis media roots). Only a provider that serves a genuine local
|
|
8443
|
+
* filesystem (`getProviderInfo().nodeLocal === true`) can satisfy that: a
|
|
8444
|
+
* remote provider's `resolve` returns a path on the REMOTE host, and
|
|
8445
|
+
* `fs.readdir` of it on this node either fails or — far worse — succeeds
|
|
8446
|
+
* against a same-named local directory that is something else entirely.
|
|
8447
|
+
*
|
|
8448
|
+
* - `'cap-mediated'` — every byte travels through the `storage` cap
|
|
8449
|
+
* (`read`/`write`, or `beginUpload`/`writeChunk`/`finalizeUpload`). The
|
|
8450
|
+
* service never sees a path, so any provider can back it. `backups` is the
|
|
8451
|
+
* one kind that qualifies today.
|
|
8452
|
+
*
|
|
8453
|
+
* Before this existed, `recordings` was unreachable by SFTP/S3/WebDAV only as
|
|
8454
|
+
* an EMERGENT property of how the recorder happened to be written. Nothing
|
|
8455
|
+
* refused the configuration; the first write simply went somewhere wrong, and
|
|
8456
|
+
* a recording write that goes wrong surfaces as a silent black window rather
|
|
8457
|
+
* than an error (the read path does not `stat`). This turns that accident into
|
|
8458
|
+
* a declared, enforced, testable refusal.
|
|
8459
|
+
*/
|
|
8460
|
+
var StorageAccessSchema = _enum(["local-path", "cap-mediated"]);
|
|
8208
8461
|
var StorageLocationDeclarationSchema = object({
|
|
8209
8462
|
/**
|
|
8210
8463
|
* Global location identifier, e.g. `recordings` or `recordingsLow`.
|
|
@@ -8224,6 +8477,19 @@ var StorageLocationDeclarationSchema = object({
|
|
|
8224
8477
|
*/
|
|
8225
8478
|
cardinality: _enum(["single", "multi"]),
|
|
8226
8479
|
/**
|
|
8480
|
+
* HOW the declaring service reaches the bytes — and therefore WHICH
|
|
8481
|
+
* providers may back a location of this kind. See {@link StorageAccessSchema}
|
|
8482
|
+
* and {@link STORAGE_ACCESS_FALLBACK}.
|
|
8483
|
+
*
|
|
8484
|
+
* Absent means `'local-path'`. That default is FAIL-CLOSED on purpose: it
|
|
8485
|
+
* can only over-restrict (refuse a remote provider for a kind that might
|
|
8486
|
+
* have coped) and never under-restrict. Declaring `'cap-mediated'` is the
|
|
8487
|
+
* permissive direction and is therefore never inferred — a repo guard
|
|
8488
|
+
* (`scripts/check-storage-access-declarations.ts`) refuses to let it be
|
|
8489
|
+
* reached by omission.
|
|
8490
|
+
*/
|
|
8491
|
+
access: StorageAccessSchema.optional(),
|
|
8492
|
+
/**
|
|
8227
8493
|
* When set, the default instance for this location inherits its resolved
|
|
8228
8494
|
* root from the named location's default instance. Useful for derivative
|
|
8229
8495
|
* slots (e.g. `recordingsLow` → `recordings`) so operators only need to
|
|
@@ -17749,8 +18015,10 @@ var TrackSchema = object({
|
|
|
17749
18015
|
lastSeen: number(),
|
|
17750
18016
|
/** Frame-rate position history (subject to maxPositionHistory cap). */
|
|
17751
18017
|
positions: array(TrackPositionSchema).readonly(),
|
|
17752
|
-
/** Periodic snapshots at snapshotIntervalMs cadence
|
|
17753
|
-
*
|
|
18018
|
+
/** Periodic snapshots at snapshotIntervalMs cadence — DEBUG media, produced
|
|
18019
|
+
* only while `MediaSettings.debugMediaEnabled` is on for the camera (D299;
|
|
18020
|
+
* the retired `saveThumbnails` used to gate this and the rolling
|
|
18021
|
+
* `lastFrame` together). Empty is the healthy default, not a capture gap. */
|
|
17754
18022
|
snapshots: array(TrackSnapshotSchema).readonly(),
|
|
17755
18023
|
/** Deduplicated zones the track has entered at least once. Zone IDS. */
|
|
17756
18024
|
zonesVisited: array(string()).readonly(),
|
|
@@ -18610,6 +18878,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
18610
18878
|
}), method(RelocateMediaInputSchema, object({ jobId: string() }), {
|
|
18611
18879
|
kind: "mutation",
|
|
18612
18880
|
auth: "admin"
|
|
18881
|
+
}), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(RelocatableMediaCountInputSchema, RelocatableMediaCountSchema, {
|
|
18882
|
+
kind: "query",
|
|
18883
|
+
auth: "admin"
|
|
18613
18884
|
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
18614
18885
|
kind: "query",
|
|
18615
18886
|
auth: "admin"
|
|
@@ -20517,7 +20788,10 @@ method(object({
|
|
|
20517
20788
|
}), StorageLocationSchema, {
|
|
20518
20789
|
kind: "mutation",
|
|
20519
20790
|
auth: "admin"
|
|
20520
|
-
}), method(object({
|
|
20791
|
+
}), method(object({
|
|
20792
|
+
id: string(),
|
|
20793
|
+
force: boolean().optional()
|
|
20794
|
+
}), _void(), {
|
|
20521
20795
|
kind: "mutation",
|
|
20522
20796
|
auth: "admin"
|
|
20523
20797
|
}), method(object({ id: string() }), object({
|
|
@@ -20566,6 +20840,9 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
|
|
|
20566
20840
|
}), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
20567
20841
|
kind: "mutation",
|
|
20568
20842
|
auth: "admin"
|
|
20843
|
+
}), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
|
|
20844
|
+
kind: "mutation",
|
|
20845
|
+
auth: "admin"
|
|
20569
20846
|
});
|
|
20570
20847
|
var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
|
|
20571
20848
|
providerId: string().min(1),
|
|
@@ -21024,12 +21301,38 @@ response: record(string(), unknown()) }), object({
|
|
|
21024
21301
|
*
|
|
21025
21302
|
* ## Why this is a capability and not a helper
|
|
21026
21303
|
*
|
|
21027
|
-
*
|
|
21028
|
-
*
|
|
21029
|
-
*
|
|
21030
|
-
*
|
|
21031
|
-
*
|
|
21032
|
-
*
|
|
21304
|
+
* This capability was introduced with the claim that SIX stores in
|
|
21305
|
+
* `addon-post-analysis` held vectors in a `JSON` settings-store column — object
|
|
21306
|
+
* CLIP, face, plate, vehicle, identity, and the event store's derivatives. That
|
|
21307
|
+
* claim was never true, and leaving it here made five stores look like pending
|
|
21308
|
+
* work when three of them have no vector at all. Counted column by column on
|
|
21309
|
+
* 2026-08-30, exactly THREE ever held one:
|
|
21310
|
+
*
|
|
21311
|
+
* - `object-clip` — 512-dim CLIP image embedding, migrated 2026-08-06.
|
|
21312
|
+
* - `faces.embedding` — 512-dim ArcFace face embedding, migrated 2026-08-30.
|
|
21313
|
+
* - `identity-samples.embedding` — the same ArcFace vector for an ENROLLED
|
|
21314
|
+
* face, migrated 2026-08-30 into its OWN index (see below).
|
|
21315
|
+
*
|
|
21316
|
+
* `plates` and `vehicle-samples` store a plate STRING and a score; `vehicles`
|
|
21317
|
+
* and `identities` store a name; the event store stores no derivative vector.
|
|
21318
|
+
* They are not migration candidates and never were.
|
|
21319
|
+
*
|
|
21320
|
+
* Measured on the live hub the JSON encoding cost ~11.7 KB per row (512 floats
|
|
21321
|
+
* as TEXT, `JSON.parse`d on every search) and made semantic search load 5,000
|
|
21322
|
+
* rows before ranking anything.
|
|
21323
|
+
*
|
|
21324
|
+
* ## One index per COMPARISON, never per encoder
|
|
21325
|
+
*
|
|
21326
|
+
* `faces` and `identity-samples` hold the same 512 ArcFace dims from the same
|
|
21327
|
+
* model, and they still get two indexes. An index is a set of things that are
|
|
21328
|
+
* ranked against each other and that live and die together, and these two are
|
|
21329
|
+
* neither: a `faces` row is TRACK-OWNED and cascades away with its track under
|
|
21330
|
+
* a per-camera capacity cap, an `identity-samples` row is retention-EXEMPT
|
|
21331
|
+
* forever and is the gallery every recognition ranks against. One index would
|
|
21332
|
+
* mean every gallery load and every reconcile carried a filter whose failure
|
|
21333
|
+
* mode is either ranking a candidate against itself or reclaiming an enrolled
|
|
21334
|
+
* person's only sample. The dimension they share is not a reason to share an
|
|
21335
|
+
* index; the question they answer is, and it differs.
|
|
21033
21336
|
*
|
|
21034
21337
|
* The fix is not a faster loop, it is a different backend — and the backend
|
|
21035
21338
|
* should be replaceable without touching six callers. So: a singleton
|
|
@@ -21134,7 +21437,20 @@ var VectorQueryResultSchema = object({
|
|
|
21134
21437
|
*/
|
|
21135
21438
|
scanned: number(),
|
|
21136
21439
|
/** True when the backend could not consider every row that passed the filter. */
|
|
21137
|
-
truncated: boolean()
|
|
21440
|
+
truncated: boolean(),
|
|
21441
|
+
/**
|
|
21442
|
+
* The `topK` the backend actually ran with.
|
|
21443
|
+
*
|
|
21444
|
+
* Every backend has a ceiling — sqlite-vec's is 4,096 — and a caller asking
|
|
21445
|
+
* past it used to learn nothing but a boolean, from a WARN in the provider's
|
|
21446
|
+
* own log rather than in its answer. That is how an audit asking for 20,000
|
|
21447
|
+
* consumed 4,096 and reported `examined: 4096` as if it had walked the index,
|
|
21448
|
+
* for weeks. `truncated` says THAT the answer was short; this says BY HOW
|
|
21449
|
+
* MUCH, in the return value, where the caller cannot fail to see it.
|
|
21450
|
+
*
|
|
21451
|
+
* Equals the requested `topK` whenever nothing was lowered.
|
|
21452
|
+
*/
|
|
21453
|
+
effectiveTopK: number().int().positive()
|
|
21138
21454
|
});
|
|
21139
21455
|
var VectorDeleteInputSchema = object({
|
|
21140
21456
|
index: string(),
|
|
@@ -21163,6 +21479,68 @@ var VectorGetResultSchema = object({ items: array(object({
|
|
|
21163
21479
|
id: string(),
|
|
21164
21480
|
metadata: VectorMetadataSchema
|
|
21165
21481
|
})) });
|
|
21482
|
+
/**
|
|
21483
|
+
* Ids to read back WITH their vectors.
|
|
21484
|
+
*
|
|
21485
|
+
* The sibling of {@link VectorGetResultSchema}, and deliberately a separate
|
|
21486
|
+
* method rather than a flag on it: `getByIds` promises no vectors and its one
|
|
21487
|
+
* caller depends on that promise. This one promises the opposite.
|
|
21488
|
+
*
|
|
21489
|
+
* It exists because a store cannot put its vectors here otherwise. An ArcFace
|
|
21490
|
+
* gallery is ranked IN PROCESS, per detection, against every enrolled sample —
|
|
21491
|
+
* a per-face cross-process KNN would be a network round trip inside the
|
|
21492
|
+
* recognition loop. So the gallery is loaded once and held in RAM, and loading
|
|
21493
|
+
* it requires the index to hand the floats back. Without this method the only
|
|
21494
|
+
* way to keep a readable vector is a JSON column, which is the thing this
|
|
21495
|
+
* capability exists to delete.
|
|
21496
|
+
*
|
|
21497
|
+
* BOUNDED BY THE CALLER: ids are named, never "everything". Enumerating an
|
|
21498
|
+
* index is {@link VectorScanInputSchema}'s job, and it returns no vectors.
|
|
21499
|
+
*/
|
|
21500
|
+
var VectorFetchInputSchema = object({
|
|
21501
|
+
index: string(),
|
|
21502
|
+
ids: array(string())
|
|
21503
|
+
});
|
|
21504
|
+
var VectorFetchResultSchema = object({ items: array(object({
|
|
21505
|
+
id: string(),
|
|
21506
|
+
/** base64 Float32LE — the same wire form `upsert` accepts. */
|
|
21507
|
+
vector: string(),
|
|
21508
|
+
metadata: VectorMetadataSchema
|
|
21509
|
+
})) });
|
|
21510
|
+
/**
|
|
21511
|
+
* ENUMERATE an index: one page of rows in a stable order, no ranking.
|
|
21512
|
+
*
|
|
21513
|
+
* A reconcile does not want the nearest rows, it wants ALL of them, and asking
|
|
21514
|
+
* a KNN for "all" is the wrong question twice over. It hits the backend's `k`
|
|
21515
|
+
* ceiling — 4,096 on sqlite-vec against a 22,128-row index — and it needs a
|
|
21516
|
+
* probe vector it does not have, so the audit passed a ZERO vector whose cosine
|
|
21517
|
+
* distance to every row is degenerate. `examined: 4096` then read as "we
|
|
21518
|
+
* looked" for as long as anyone cared to read it.
|
|
21519
|
+
*
|
|
21520
|
+
* This is the primitive that question actually needs: a bounded page, ordered
|
|
21521
|
+
* by the backend's own row order, costing no distance computation at all.
|
|
21522
|
+
* Vectors are NOT returned — an enumeration that shipped 2 KB per row would be
|
|
21523
|
+
* the full-table read this capability was built to stop.
|
|
21524
|
+
*/
|
|
21525
|
+
var VectorScanInputSchema = object({
|
|
21526
|
+
index: string(),
|
|
21527
|
+
/** Opaque resume point. `0` starts at the top; pass back `nextCursor`. */
|
|
21528
|
+
cursor: number().int().nonnegative().default(0),
|
|
21529
|
+
limit: number().int().positive()
|
|
21530
|
+
});
|
|
21531
|
+
var VectorScanResultSchema = object({
|
|
21532
|
+
items: array(object({
|
|
21533
|
+
id: string(),
|
|
21534
|
+
metadata: VectorMetadataSchema
|
|
21535
|
+
})),
|
|
21536
|
+
/**
|
|
21537
|
+
* Where the next page starts, or `null` when the walk reached the end.
|
|
21538
|
+
*
|
|
21539
|
+
* `null` is the ONLY end-of-index signal. A caller must not infer the end
|
|
21540
|
+
* from a short page: a backend is free to return fewer rows than asked.
|
|
21541
|
+
*/
|
|
21542
|
+
nextCursor: number().int().nonnegative().nullable()
|
|
21543
|
+
});
|
|
21166
21544
|
var VectorStatsInputSchema = object({ index: string() });
|
|
21167
21545
|
var VectorStatsResultSchema = object({
|
|
21168
21546
|
/** Provider id, so an operator can tell brute force from an ANN index. */
|
|
@@ -21181,7 +21559,7 @@ method(VectorDeclareIndexInputSchema, _void(), {
|
|
|
21181
21559
|
}), method(VectorUpsertInputSchema, VectorUpsertResultSchema, {
|
|
21182
21560
|
kind: "mutation",
|
|
21183
21561
|
auth: "admin"
|
|
21184
|
-
}), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
|
|
21562
|
+
}), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorFetchInputSchema, VectorFetchResultSchema, { auth: "admin" }), method(VectorScanInputSchema, VectorScanResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
|
|
21185
21563
|
kind: "mutation",
|
|
21186
21564
|
auth: "admin"
|
|
21187
21565
|
}), method(VectorDeleteByFilterInputSchema, VectorDeleteResultSchema, {
|
|
@@ -26085,6 +26463,9 @@ method(object({
|
|
|
26085
26463
|
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
26086
26464
|
kind: "query",
|
|
26087
26465
|
auth: "admin"
|
|
26466
|
+
}), method(RelocateResidueInputSchema, RelocateResidueSchema, {
|
|
26467
|
+
kind: "query",
|
|
26468
|
+
auth: "admin"
|
|
26088
26469
|
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
26089
26470
|
kind: "mutation",
|
|
26090
26471
|
auth: "admin"
|
|
@@ -31050,6 +31431,18 @@ Object.freeze({
|
|
|
31050
31431
|
addonId: null,
|
|
31051
31432
|
access: "create"
|
|
31052
31433
|
},
|
|
31434
|
+
"pipelineAnalytics.countRelocatableMedia": {
|
|
31435
|
+
capName: "pipeline-analytics",
|
|
31436
|
+
capScope: "device",
|
|
31437
|
+
addonId: null,
|
|
31438
|
+
access: "view"
|
|
31439
|
+
},
|
|
31440
|
+
"pipelineAnalytics.countUnstampedEventMedia": {
|
|
31441
|
+
capName: "pipeline-analytics",
|
|
31442
|
+
capScope: "device",
|
|
31443
|
+
addonId: null,
|
|
31444
|
+
access: "view"
|
|
31445
|
+
},
|
|
31053
31446
|
"pipelineAnalytics.deleteDeviceEvents": {
|
|
31054
31447
|
capName: "pipeline-analytics",
|
|
31055
31448
|
capScope: "device",
|
|
@@ -32208,6 +32601,12 @@ Object.freeze({
|
|
|
32208
32601
|
addonId: null,
|
|
32209
32602
|
access: "view"
|
|
32210
32603
|
},
|
|
32604
|
+
"recording.getRelocateResidue": {
|
|
32605
|
+
capName: "recording",
|
|
32606
|
+
capScope: "system",
|
|
32607
|
+
addonId: null,
|
|
32608
|
+
access: "view"
|
|
32609
|
+
},
|
|
32211
32610
|
"recording.getStorageMigrationMoveStatus": {
|
|
32212
32611
|
capName: "recording",
|
|
32213
32612
|
capScope: "system",
|
|
@@ -32754,12 +33153,30 @@ Object.freeze({
|
|
|
32754
33153
|
addonId: null,
|
|
32755
33154
|
access: "create"
|
|
32756
33155
|
},
|
|
33156
|
+
"storageMigration.drain": {
|
|
33157
|
+
capName: "storage-migration",
|
|
33158
|
+
capScope: "system",
|
|
33159
|
+
addonId: null,
|
|
33160
|
+
access: "create"
|
|
33161
|
+
},
|
|
33162
|
+
"storageMigration.movers": {
|
|
33163
|
+
capName: "storage-migration",
|
|
33164
|
+
capScope: "system",
|
|
33165
|
+
addonId: null,
|
|
33166
|
+
access: "view"
|
|
33167
|
+
},
|
|
32757
33168
|
"storageMigration.plan": {
|
|
32758
33169
|
capName: "storage-migration",
|
|
32759
33170
|
capScope: "system",
|
|
32760
33171
|
addonId: null,
|
|
32761
33172
|
access: "view"
|
|
32762
33173
|
},
|
|
33174
|
+
"storageMigration.residue": {
|
|
33175
|
+
capName: "storage-migration",
|
|
33176
|
+
capScope: "system",
|
|
33177
|
+
addonId: null,
|
|
33178
|
+
access: "view"
|
|
33179
|
+
},
|
|
32763
33180
|
"storageMigration.start": {
|
|
32764
33181
|
capName: "storage-migration",
|
|
32765
33182
|
capScope: "system",
|
|
@@ -33594,6 +34011,12 @@ Object.freeze({
|
|
|
33594
34011
|
addonId: null,
|
|
33595
34012
|
access: "delete"
|
|
33596
34013
|
},
|
|
34014
|
+
"vectorStore.fetchByIds": {
|
|
34015
|
+
capName: "vector-store",
|
|
34016
|
+
capScope: "system",
|
|
34017
|
+
addonId: null,
|
|
34018
|
+
access: "view"
|
|
34019
|
+
},
|
|
33597
34020
|
"vectorStore.getByIds": {
|
|
33598
34021
|
capName: "vector-store",
|
|
33599
34022
|
capScope: "system",
|
|
@@ -33606,6 +34029,12 @@ Object.freeze({
|
|
|
33606
34029
|
addonId: null,
|
|
33607
34030
|
access: "view"
|
|
33608
34031
|
},
|
|
34032
|
+
"vectorStore.scan": {
|
|
34033
|
+
capName: "vector-store",
|
|
34034
|
+
capScope: "system",
|
|
34035
|
+
addonId: null,
|
|
34036
|
+
access: "view"
|
|
34037
|
+
},
|
|
33609
34038
|
"vectorStore.stats": {
|
|
33610
34039
|
capName: "vector-store",
|
|
33611
34040
|
capScope: "system",
|