@camstack/addon-pipeline-orchestrator 1.2.122 → 1.2.125

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.mjs CHANGED
@@ -8887,18 +8887,61 @@ var RelocateFootageInputSchema = object({
8887
8887
  * `RecordingConfig.enabled` or camera wrapper bindings. */
8888
8888
  var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
8889
8889
  var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
8890
+ /**
8891
+ * What a `relocateMedia` pass DOES. One engine, three passes — never a second
8892
+ * mover (the engine already walks both collections with a timestamp cursor and
8893
+ * already has a stamp-without-copy path).
8894
+ *
8895
+ * - `move` — the default and the historical behaviour: event-media and
8896
+ * retrain blobs move to `toLocationId` and their rows are
8897
+ * stamped. The enrolled gallery is skipped (D197).
8898
+ * - `seal` — ROWS ONLY, no bytes. Every row whose `locationId` is NULL is
8899
+ * stamped with `toLocationId`. `toLocationId` here is the id the
8900
+ * bytes ALREADY sit on — today's `eventMedia` default — because
8901
+ * a NULL row means "wherever `eventMedia` points *now*", and the
8902
+ * instant a repoint moves that pointer the row reads from the
8903
+ * new disk while its bytes are on the old one.
8904
+ * - `gallery` — the inverse selection of `move`: ONLY the retention-exempt
8905
+ * (enrolled-gallery) rows, which `move` deliberately skips.
8906
+ * `galleryMedia` is `cardinality: 'single'`, so this pass can
8907
+ * never run beside a live second location: it is stop-the-world
8908
+ * by construction, which is acceptable only because the gallery
8909
+ * is a few KB per enrolled sample.
8910
+ */
8911
+ var MediaRelocateModeSchema = _enum([
8912
+ "move",
8913
+ "seal",
8914
+ "gallery"
8915
+ ]);
8890
8916
  var RelocateMediaInputSchema = object({
8891
8917
  toLocationId: string(),
8892
- throttleMbps: number().min(1).max(1e3).optional()
8918
+ throttleMbps: number().min(1).max(1e3).optional(),
8919
+ /** Omitted = `move`, the pre-existing behaviour. */
8920
+ mode: MediaRelocateModeSchema.optional()
8921
+ });
8922
+ /** How many rows still carry NO `locationId` — the population a repoint would
8923
+ * silently re-aim at a disk that does not hold their bytes. Zero is the only
8924
+ * value that permits a non-blocking `eventMedia` cutover. */
8925
+ var UnstampedEventMediaCountSchema = object({
8926
+ media: number().int().nonnegative(),
8927
+ retrainFrames: number().int().nonnegative(),
8928
+ total: number().int().nonnegative()
8893
8929
  });
8894
8930
  var StorageMigrationMediaMoveInputSchema = RelocateMediaInputSchema.extend({ leaseId: string().min(1) });
8895
- /** The independently selectable logical storage classes. `recordings`
8896
- * encompasses the high and mid segment profiles; `recordingsLow` is low
8897
- * segments; `eventMedia` is post-analysis blobs. */
8931
+ /** The independently selectable logical storage classes — every class
8932
+ * `storage.listLocationDeclarations` reports, so an operator never meets a
8933
+ * Zod enum error where they should meet an explanation.
8934
+ *
8935
+ * `recordings` encompasses the high and mid segment profiles; `recordingsLow`
8936
+ * is low segments; `eventMedia` is post-analysis blobs; `galleryMedia` is the
8937
+ * enrolled gallery; `backups` is the system backup archive. The last two have
8938
+ * their own rules — see {@link StorageMigrationFindingCodeSchema}. */
8898
8939
  var StorageMigrationClassSchema = _enum([
8899
8940
  "recordings",
8900
8941
  "recordingsLow",
8901
- "eventMedia"
8942
+ "eventMedia",
8943
+ "backups",
8944
+ "galleryMedia"
8902
8945
  ]);
8903
8946
  /** A destination is always an existing, fully-qualified location id. The
8904
8947
  * migration API intentionally never changes a source location's `basePath`:
@@ -8906,20 +8949,56 @@ var StorageMigrationClassSchema = _enum([
8906
8949
  var StorageMigrationDestinationsSchema = object({
8907
8950
  recordings: string().min(1).optional(),
8908
8951
  recordingsLow: string().min(1).optional(),
8909
- eventMedia: string().min(1).optional()
8952
+ eventMedia: string().min(1).optional(),
8953
+ backups: string().min(1).optional(),
8954
+ galleryMedia: string().min(1).optional()
8910
8955
  }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
8956
+ /**
8957
+ * How a migration sequences the cutover against the byte move.
8958
+ *
8959
+ * - `blocking` — the historical order: pause, move every byte, repoint,
8960
+ * resume. Recording is stopped for the whole move. Right
8961
+ * for a small or a cold class, and the only legal mode for
8962
+ * a `cardinality: 'single'` class.
8963
+ * - `nonBlocking` — repoint FIRST, drain behind: seal, pause, repoint,
8964
+ * refresh, resume, then move the past with everything
8965
+ * running. The pause is three bounded instants (a detach +
8966
+ * attach round, a write-gate drain, a lease) instead of one
8967
+ * bounded by bytes. 1.09 TB at 7–14 MB/s is thirty hours of
8968
+ * stopped recording under `blocking`; the same move is
8969
+ * seconds of stopped recording under `nonBlocking`.
8970
+ *
8971
+ * The mode is on the JOB, not only on the input, because `status` is where an
8972
+ * operator finds out which one is running.
8973
+ */
8974
+ var StorageMigrationModeSchema = _enum(["blocking", "nonBlocking"]);
8911
8975
  /** Shared input for planning and starting an orchestrated storage migration. */
8912
8976
  var StorageMigrationInputSchema = object({
8913
8977
  destinations: StorageMigrationDestinationsSchema,
8914
- throttleMbps: number().min(1).max(1e3).optional()
8978
+ throttleMbps: number().min(1).max(1e3).optional(),
8979
+ /** Omitted = `blocking`, which stays the default. */
8980
+ mode: StorageMigrationModeSchema.optional()
8915
8981
  });
8916
- /** The durable coordinator state machine. The only phase that changes default
8917
- * locations is `repointing`, after every selected mover has completed and been
8918
- * verified. */
8982
+ /**
8983
+ * The durable coordinator state machine.
8984
+ *
8985
+ * `blocking`:
8986
+ * planning → pausing → moving → verifying → repointing → refreshing → resuming → done
8987
+ *
8988
+ * `nonBlocking`:
8989
+ * planning → sealing → pausing → repointing → refreshing → resuming → draining → verifying → done
8990
+ *
8991
+ * Same phases, different order plus two new ones — not a second mover.
8992
+ * `sealing` closes the `eventMedia` NULL-row hole BEFORE anything is paused;
8993
+ * `draining` runs the same movers UNLEASED, after every writer is back up.
8994
+ * `repointing` is still the only phase that changes a default location.
8995
+ */
8919
8996
  var StorageMigrationPhaseSchema = _enum([
8920
8997
  "planning",
8998
+ "sealing",
8921
8999
  "pausing",
8922
9000
  "moving",
9001
+ "draining",
8923
9002
  "verifying",
8924
9003
  "repointing",
8925
9004
  "refreshing",
@@ -8933,17 +9012,56 @@ var StorageMigrationParticipantSchema = _enum([
8933
9012
  "recorder",
8934
9013
  "analytics"
8935
9014
  ]);
9015
+ /**
9016
+ * The mover's own numbers, folded onto the coordinator's durable move record.
9017
+ *
9018
+ * The long half of a non-blocking migration is `draining`, and it is measured
9019
+ * in hours: 136 885 files at ~4 MB/s is about five of them. Before this shape
9020
+ * existed the only place those numbers appeared was a Loki line, so an operator
9021
+ * watching the Admin UI saw `phase: draining` and nothing else for a whole
9022
+ * afternoon.
9023
+ *
9024
+ * It is POLLED, never pushed. Events are telemetry and may be dropped
9025
+ * (D8/D11), and a dropped progress event is indistinguishable from a stalled
9026
+ * mover — which is the exact failure this is meant to end. The coordinator's
9027
+ * `waitForMoves` already fetches the whole {@link RelocateJob} on every tick to
9028
+ * read `state`; folding the counters costs no extra read and makes the durable
9029
+ * record say afterwards how far a move actually got.
9030
+ *
9031
+ * `filesTotal` is `null` for "no honest denominator" and is never zero-filled:
9032
+ * a windowed footage job (`sinceMs`) and a node with no ledger both genuinely
9033
+ * cannot say M, and a 0 there would render as "100 % done".
9034
+ */
9035
+ var StorageMigrationMoveProgressSchema = object({
9036
+ filesMoved: number().int().nonnegative(),
9037
+ /** The archive census — the **M** of "N of M" (D295). `null` = unknowable. */
9038
+ filesTotal: number().int().nonnegative().nullable(),
9039
+ bytesMoved: number().int().nonnegative(),
9040
+ /** The MOVER's start, not the migration's: a drain restarted after an addon
9041
+ * crash gets a new mover, and a rate computed from the migration's start
9042
+ * would silently average in the time nothing was running. */
9043
+ startedAt: number(),
9044
+ /** When the coordinator last read these numbers. Paired with `startedAt` it
9045
+ * is the only honest rate: both clocks are the hub's, so a UI never has to
9046
+ * subtract its own. */
9047
+ observedAt: number()
9048
+ });
8936
9049
  var StorageMigrationMoveSchema = object({
8937
9050
  storageClass: StorageMigrationClassSchema,
8938
9051
  fromLocationId: string(),
8939
9052
  toLocationId: string(),
8940
9053
  moverJobId: string().nullable(),
8941
9054
  state: RelocateJobStateSchema.nullable(),
8942
- error: string().nullable()
9055
+ error: string().nullable(),
9056
+ /** Last observed mover counters; `null` until the mover has been polled once. */
9057
+ progress: StorageMigrationMoveProgressSchema.nullable()
8943
9058
  });
8944
9059
  var StorageMigrationJobSchema = object({
8945
9060
  jobId: string(),
8946
9061
  phase: StorageMigrationPhaseSchema,
9062
+ /** Which order this job is running. `status` is the only place an operator
9063
+ * can tell a seconds-long cutover from a thirty-hour one. */
9064
+ mode: StorageMigrationModeSchema,
8947
9065
  destinations: StorageMigrationDestinationsSchema,
8948
9066
  throttleMbps: number(),
8949
9067
  moves: array(StorageMigrationMoveSchema),
@@ -8956,13 +9074,122 @@ var StorageMigrationJobSchema = object({
8956
9074
  finishedAt: number().nullable(),
8957
9075
  error: string().nullable()
8958
9076
  });
9077
+ var StorageMigrationFindingSchema = object({
9078
+ code: _enum([
9079
+ "sharesDeviceWithSource",
9080
+ "deviceIdentityUnknown",
9081
+ "unstampedEventMediaRows",
9082
+ "blockingOnly",
9083
+ "noMover"
9084
+ ]),
9085
+ storageClass: StorageMigrationClassSchema,
9086
+ /** Human-readable, already carrying the ids and counts. */
9087
+ message: string()
9088
+ });
8959
9089
  var StorageMigrationPlanSchema = object({
8960
9090
  destinations: StorageMigrationDestinationsSchema,
9091
+ /** The mode this plan was built for. A plan is only valid for its mode: the
9092
+ * `eventMedia` seal gate and the single-cardinality refusal both depend on
9093
+ * it. */
9094
+ mode: StorageMigrationModeSchema,
8961
9095
  moves: array(object({
8962
9096
  storageClass: StorageMigrationClassSchema,
8963
9097
  fromLocationId: string(),
8964
9098
  toLocationId: string()
8965
- }))
9099
+ })),
9100
+ findings: array(StorageMigrationFindingSchema)
9101
+ });
9102
+ /**
9103
+ * A mover as it exists RIGHT NOW, whether or not a migration job owns it.
9104
+ *
9105
+ * The coordinator's job record is the state of record for a migration, and its
9106
+ * moves carry {@link StorageMigrationMoveProgress}. But the movers are usable
9107
+ * standalone — `recording.relocateFootage` and `pipelineAnalytics.relocateMedia`
9108
+ * are both operator-callable, and on 2026-08-29 a five-hour drain was armed that
9109
+ * way because no supported UI path existed. A mover armed like that has no job
9110
+ * to fold progress into, so it has to be readable on its own or it is invisible.
9111
+ *
9112
+ * `migrationJobId` is what tells the two apart: `null` means nothing here
9113
+ * orchestrated it.
9114
+ */
9115
+ var StorageMigrationMoverSchema = object({
9116
+ lane: _enum(["footage", "media"]),
9117
+ job: RelocateJobSchema,
9118
+ /** The coordinator job that armed this mover, or `null` for a mover armed
9119
+ * directly against the owning addon. */
9120
+ migrationJobId: string().nullable(),
9121
+ /** When the hub read these counters. Stamped here so a rate is `bytesMoved`
9122
+ * over (`observedAt` − `job.startedAt`) with BOTH ends on the hub's clock —
9123
+ * a browser subtracting its own `Date.now()` from a server `startedAt` is a
9124
+ * rate made of two different clocks. */
9125
+ observedAt: number()
9126
+ });
9127
+ /**
9128
+ * What a SOURCE still holds for one storage class — the number that makes a
9129
+ * "drain remaining" action honest rather than hopeful.
9130
+ *
9131
+ * It comes from the archive (`SegmentHourLedger.census` for footage, the media
9132
+ * engine's own selection count for media), never from the resident index: a
9133
+ * drain sized off `RecordingIndex` is what reported `done` over 80.3 GB it had
9134
+ * never been told about (D295).
9135
+ *
9136
+ * `items`/`bytes` are `null` for "the archive could not be asked", which is
9137
+ * deliberately NOT zero: a drain is still offered for an unknown residue,
9138
+ * because refusing on an unanswerable read would hide exactly the case an
9139
+ * operator needs to act on.
9140
+ */
9141
+ var StorageMigrationResidueSchema = object({
9142
+ storageClass: StorageMigrationClassSchema,
9143
+ /** The location still holding the data. `'*'` for the media lane, whose rows
9144
+ * move from wherever they are rather than from one named source. */
9145
+ fromLocationId: string(),
9146
+ /** Where a drain would move it — the class's CURRENT default. */
9147
+ toLocationId: string(),
9148
+ /** Segments (footage lane) or rows (media lane) still on the source. */
9149
+ items: number().int().nonnegative().nullable(),
9150
+ /** Bytes on the source; `null` when the lane counts rows rather than bytes. */
9151
+ bytes: number().int().nonnegative().nullable()
9152
+ });
9153
+ /**
9154
+ * Run the DRAIN half and nothing else.
9155
+ *
9156
+ * A migration that reached `done` has already repointed, so `start` correctly
9157
+ * refuses its destination ("already the default") — there is nothing left to
9158
+ * repoint. But the drain can fail, be cancelled, be interrupted by a restart,
9159
+ * or finish against a work list that was a tenth of the archive (D295), and
9160
+ * before this there was no supported way to run only that half: the only way
9161
+ * through was calling `recording.relocateFootage` by hand over admin tRPC.
9162
+ *
9163
+ * `drain` NEVER calls `setDefaultLocations`. That is what keeps `start`'s
9164
+ * refusal meaningful: the two verbs are disjoint, so nothing here can silently
9165
+ * re-repoint a class that is already migrated.
9166
+ */
9167
+ var StorageMigrationDrainInputSchema = object({
9168
+ /** The classes to drain. Each must appear in `storageMigration.residue`, so
9169
+ * a class whose source is already empty is refused rather than started. */
9170
+ classes: array(StorageMigrationClassSchema).min(1),
9171
+ throttleMbps: number().min(1).max(1e3).optional()
9172
+ });
9173
+ /** What a footage source still holds, asked of the durable hour ledger. */
9174
+ var RelocateResidueInputSchema = object({
9175
+ fromLocationId: string().min(1),
9176
+ /** Narrow to one logical class; omit for every profile on the location. */
9177
+ footageClass: RelocateFootageClassSchema.optional()
9178
+ });
9179
+ /** `null` = the archive could not answer (no ledger on this node, or the
9180
+ * aggregate failed). Never conflated with an empty source. */
9181
+ var RelocateResidueSchema = object({
9182
+ segments: number().int().nonnegative(),
9183
+ bytes: number().int().nonnegative()
9184
+ }).nullable();
9185
+ /** How many rows a media pass would still act on against a given target — the
9186
+ * media lane's denominator AND its residue, from ONE derivation so the two can
9187
+ * never disagree. `null` = the count could not be taken. */
9188
+ var RelocatableMediaCountSchema = object({ rows: number().int().nonnegative() }).nullable();
9189
+ var RelocatableMediaCountInputSchema = object({
9190
+ toLocationId: string().min(1),
9191
+ /** Omitted = `move`. */
9192
+ mode: MediaRelocateModeSchema.optional()
8966
9193
  });
8967
9194
  /**
8968
9195
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -9068,6 +9295,32 @@ var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(
9068
9295
  * two addons declaring the same `id` must agree on `cardinality` (validated
9069
9296
  * at kernel aggregation time, not here).
9070
9297
  */
9298
+ /**
9299
+ * `StorageAccess` — how the service that DECLARED a storage-location kind
9300
+ * actually reaches the bytes. It is the constraint that decides which
9301
+ * `storage-provider`s may back a location of that kind.
9302
+ *
9303
+ * - `'local-path'` — the service asks `storage.resolve` for a path string and
9304
+ * then does its own `node:fs` I/O on it (the recorder's segment writer, the
9305
+ * post-analysis media roots). Only a provider that serves a genuine local
9306
+ * filesystem (`getProviderInfo().nodeLocal === true`) can satisfy that: a
9307
+ * remote provider's `resolve` returns a path on the REMOTE host, and
9308
+ * `fs.readdir` of it on this node either fails or — far worse — succeeds
9309
+ * against a same-named local directory that is something else entirely.
9310
+ *
9311
+ * - `'cap-mediated'` — every byte travels through the `storage` cap
9312
+ * (`read`/`write`, or `beginUpload`/`writeChunk`/`finalizeUpload`). The
9313
+ * service never sees a path, so any provider can back it. `backups` is the
9314
+ * one kind that qualifies today.
9315
+ *
9316
+ * Before this existed, `recordings` was unreachable by SFTP/S3/WebDAV only as
9317
+ * an EMERGENT property of how the recorder happened to be written. Nothing
9318
+ * refused the configuration; the first write simply went somewhere wrong, and
9319
+ * a recording write that goes wrong surfaces as a silent black window rather
9320
+ * than an error (the read path does not `stat`). This turns that accident into
9321
+ * a declared, enforced, testable refusal.
9322
+ */
9323
+ var StorageAccessSchema = _enum(["local-path", "cap-mediated"]);
9071
9324
  var StorageLocationDeclarationSchema = object({
9072
9325
  /**
9073
9326
  * Global location identifier, e.g. `recordings` or `recordingsLow`.
@@ -9087,6 +9340,19 @@ var StorageLocationDeclarationSchema = object({
9087
9340
  */
9088
9341
  cardinality: _enum(["single", "multi"]),
9089
9342
  /**
9343
+ * HOW the declaring service reaches the bytes — and therefore WHICH
9344
+ * providers may back a location of this kind. See {@link StorageAccessSchema}
9345
+ * and {@link STORAGE_ACCESS_FALLBACK}.
9346
+ *
9347
+ * Absent means `'local-path'`. That default is FAIL-CLOSED on purpose: it
9348
+ * can only over-restrict (refuse a remote provider for a kind that might
9349
+ * have coped) and never under-restrict. Declaring `'cap-mediated'` is the
9350
+ * permissive direction and is therefore never inferred — a repo guard
9351
+ * (`scripts/check-storage-access-declarations.ts`) refuses to let it be
9352
+ * reached by omission.
9353
+ */
9354
+ access: StorageAccessSchema.optional(),
9355
+ /**
9090
9356
  * When set, the default instance for this location inherits its resolved
9091
9357
  * root from the named location's default instance. Useful for derivative
9092
9358
  * slots (e.g. `recordingsLow` → `recordings`) so operators only need to
@@ -18915,8 +19181,10 @@ var TrackSchema = object({
18915
19181
  lastSeen: number(),
18916
19182
  /** Frame-rate position history (subject to maxPositionHistory cap). */
18917
19183
  positions: array(TrackPositionSchema).readonly(),
18918
- /** Periodic snapshots at snapshotIntervalMs cadence (subject to
18919
- * saveThumbnails policy). */
19184
+ /** Periodic snapshots at snapshotIntervalMs cadence DEBUG media, produced
19185
+ * only while `MediaSettings.debugMediaEnabled` is on for the camera (D299;
19186
+ * the retired `saveThumbnails` used to gate this and the rolling
19187
+ * `lastFrame` together). Empty is the healthy default, not a capture gap. */
18920
19188
  snapshots: array(TrackSnapshotSchema).readonly(),
18921
19189
  /** Deduplicated zones the track has entered at least once. Zone IDS. */
18922
19190
  zonesVisited: array(string()).readonly(),
@@ -19776,6 +20044,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19776
20044
  }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
19777
20045
  kind: "mutation",
19778
20046
  auth: "admin"
20047
+ }), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(RelocatableMediaCountInputSchema, RelocatableMediaCountSchema, {
20048
+ kind: "query",
20049
+ auth: "admin"
19779
20050
  }), method(object({}), array(RelocateJobSchema).readonly(), {
19780
20051
  kind: "query",
19781
20052
  auth: "admin"
@@ -22164,7 +22435,10 @@ method(object({
22164
22435
  }), StorageLocationSchema, {
22165
22436
  kind: "mutation",
22166
22437
  auth: "admin"
22167
- }), method(object({ id: string() }), _void(), {
22438
+ }), method(object({
22439
+ id: string(),
22440
+ force: boolean().optional()
22441
+ }), _void(), {
22168
22442
  kind: "mutation",
22169
22443
  auth: "admin"
22170
22444
  }), method(object({ id: string() }), object({
@@ -22213,6 +22487,9 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
22213
22487
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
22214
22488
  kind: "mutation",
22215
22489
  auth: "admin"
22490
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
22491
+ kind: "mutation",
22492
+ auth: "admin"
22216
22493
  });
22217
22494
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
22218
22495
  providerId: string().min(1),
@@ -22611,12 +22888,38 @@ response: record(string(), unknown()) }), object({
22611
22888
  *
22612
22889
  * ## Why this is a capability and not a helper
22613
22890
  *
22614
- * Six stores in `addon-post-analysis` already hold vectors object CLIP, face,
22615
- * plate, vehicle, identity, and the event store's derivativesand every one of
22616
- * them keeps its vectors in a `JSON` settings-store column and ranks them by
22617
- * brute-force cosine in JS. Measured on the live hub that costs ~11.7 KB per row
22618
- * (512 floats as TEXT, `JSON.parse`d on every search) and made semantic search
22619
- * load 5,000 rows before ranking anything.
22891
+ * This capability was introduced with the claim that SIX stores in
22892
+ * `addon-post-analysis` held vectors in a `JSON` settings-store columnobject
22893
+ * CLIP, face, plate, vehicle, identity, and the event store's derivatives. That
22894
+ * claim was never true, and leaving it here made five stores look like pending
22895
+ * work when three of them have no vector at all. Counted column by column on
22896
+ * 2026-08-30, exactly THREE ever held one:
22897
+ *
22898
+ * - `object-clip` — 512-dim CLIP image embedding, migrated 2026-08-06.
22899
+ * - `faces.embedding` — 512-dim ArcFace face embedding, migrated 2026-08-30.
22900
+ * - `identity-samples.embedding` — the same ArcFace vector for an ENROLLED
22901
+ * face, migrated 2026-08-30 into its OWN index (see below).
22902
+ *
22903
+ * `plates` and `vehicle-samples` store a plate STRING and a score; `vehicles`
22904
+ * and `identities` store a name; the event store stores no derivative vector.
22905
+ * They are not migration candidates and never were.
22906
+ *
22907
+ * Measured on the live hub the JSON encoding cost ~11.7 KB per row (512 floats
22908
+ * as TEXT, `JSON.parse`d on every search) and made semantic search load 5,000
22909
+ * rows before ranking anything.
22910
+ *
22911
+ * ## One index per COMPARISON, never per encoder
22912
+ *
22913
+ * `faces` and `identity-samples` hold the same 512 ArcFace dims from the same
22914
+ * model, and they still get two indexes. An index is a set of things that are
22915
+ * ranked against each other and that live and die together, and these two are
22916
+ * neither: a `faces` row is TRACK-OWNED and cascades away with its track under
22917
+ * a per-camera capacity cap, an `identity-samples` row is retention-EXEMPT
22918
+ * forever and is the gallery every recognition ranks against. One index would
22919
+ * mean every gallery load and every reconcile carried a filter whose failure
22920
+ * mode is either ranking a candidate against itself or reclaiming an enrolled
22921
+ * person's only sample. The dimension they share is not a reason to share an
22922
+ * index; the question they answer is, and it differs.
22620
22923
  *
22621
22924
  * The fix is not a faster loop, it is a different backend — and the backend
22622
22925
  * should be replaceable without touching six callers. So: a singleton
@@ -22721,7 +23024,20 @@ var VectorQueryResultSchema = object({
22721
23024
  */
22722
23025
  scanned: number(),
22723
23026
  /** True when the backend could not consider every row that passed the filter. */
22724
- truncated: boolean()
23027
+ truncated: boolean(),
23028
+ /**
23029
+ * The `topK` the backend actually ran with.
23030
+ *
23031
+ * Every backend has a ceiling — sqlite-vec's is 4,096 — and a caller asking
23032
+ * past it used to learn nothing but a boolean, from a WARN in the provider's
23033
+ * own log rather than in its answer. That is how an audit asking for 20,000
23034
+ * consumed 4,096 and reported `examined: 4096` as if it had walked the index,
23035
+ * for weeks. `truncated` says THAT the answer was short; this says BY HOW
23036
+ * MUCH, in the return value, where the caller cannot fail to see it.
23037
+ *
23038
+ * Equals the requested `topK` whenever nothing was lowered.
23039
+ */
23040
+ effectiveTopK: number().int().positive()
22725
23041
  });
22726
23042
  var VectorDeleteInputSchema = object({
22727
23043
  index: string(),
@@ -22750,6 +23066,68 @@ var VectorGetResultSchema = object({ items: array(object({
22750
23066
  id: string(),
22751
23067
  metadata: VectorMetadataSchema
22752
23068
  })) });
23069
+ /**
23070
+ * Ids to read back WITH their vectors.
23071
+ *
23072
+ * The sibling of {@link VectorGetResultSchema}, and deliberately a separate
23073
+ * method rather than a flag on it: `getByIds` promises no vectors and its one
23074
+ * caller depends on that promise. This one promises the opposite.
23075
+ *
23076
+ * It exists because a store cannot put its vectors here otherwise. An ArcFace
23077
+ * gallery is ranked IN PROCESS, per detection, against every enrolled sample —
23078
+ * a per-face cross-process KNN would be a network round trip inside the
23079
+ * recognition loop. So the gallery is loaded once and held in RAM, and loading
23080
+ * it requires the index to hand the floats back. Without this method the only
23081
+ * way to keep a readable vector is a JSON column, which is the thing this
23082
+ * capability exists to delete.
23083
+ *
23084
+ * BOUNDED BY THE CALLER: ids are named, never "everything". Enumerating an
23085
+ * index is {@link VectorScanInputSchema}'s job, and it returns no vectors.
23086
+ */
23087
+ var VectorFetchInputSchema = object({
23088
+ index: string(),
23089
+ ids: array(string())
23090
+ });
23091
+ var VectorFetchResultSchema = object({ items: array(object({
23092
+ id: string(),
23093
+ /** base64 Float32LE — the same wire form `upsert` accepts. */
23094
+ vector: string(),
23095
+ metadata: VectorMetadataSchema
23096
+ })) });
23097
+ /**
23098
+ * ENUMERATE an index: one page of rows in a stable order, no ranking.
23099
+ *
23100
+ * A reconcile does not want the nearest rows, it wants ALL of them, and asking
23101
+ * a KNN for "all" is the wrong question twice over. It hits the backend's `k`
23102
+ * ceiling — 4,096 on sqlite-vec against a 22,128-row index — and it needs a
23103
+ * probe vector it does not have, so the audit passed a ZERO vector whose cosine
23104
+ * distance to every row is degenerate. `examined: 4096` then read as "we
23105
+ * looked" for as long as anyone cared to read it.
23106
+ *
23107
+ * This is the primitive that question actually needs: a bounded page, ordered
23108
+ * by the backend's own row order, costing no distance computation at all.
23109
+ * Vectors are NOT returned — an enumeration that shipped 2 KB per row would be
23110
+ * the full-table read this capability was built to stop.
23111
+ */
23112
+ var VectorScanInputSchema = object({
23113
+ index: string(),
23114
+ /** Opaque resume point. `0` starts at the top; pass back `nextCursor`. */
23115
+ cursor: number().int().nonnegative().default(0),
23116
+ limit: number().int().positive()
23117
+ });
23118
+ var VectorScanResultSchema = object({
23119
+ items: array(object({
23120
+ id: string(),
23121
+ metadata: VectorMetadataSchema
23122
+ })),
23123
+ /**
23124
+ * Where the next page starts, or `null` when the walk reached the end.
23125
+ *
23126
+ * `null` is the ONLY end-of-index signal. A caller must not infer the end
23127
+ * from a short page: a backend is free to return fewer rows than asked.
23128
+ */
23129
+ nextCursor: number().int().nonnegative().nullable()
23130
+ });
22753
23131
  var VectorStatsInputSchema = object({ index: string() });
22754
23132
  var VectorStatsResultSchema = object({
22755
23133
  /** Provider id, so an operator can tell brute force from an ANN index. */
@@ -22768,7 +23146,7 @@ method(VectorDeclareIndexInputSchema, _void(), {
22768
23146
  }), method(VectorUpsertInputSchema, VectorUpsertResultSchema, {
22769
23147
  kind: "mutation",
22770
23148
  auth: "admin"
22771
- }), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
23149
+ }), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorFetchInputSchema, VectorFetchResultSchema, { auth: "admin" }), method(VectorScanInputSchema, VectorScanResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
22772
23150
  kind: "mutation",
22773
23151
  auth: "admin"
22774
23152
  }), method(VectorDeleteByFilterInputSchema, VectorDeleteResultSchema, {
@@ -27672,6 +28050,9 @@ method(object({
27672
28050
  }), method(object({}), array(RelocateJobSchema).readonly(), {
27673
28051
  kind: "query",
27674
28052
  auth: "admin"
28053
+ }), method(RelocateResidueInputSchema, RelocateResidueSchema, {
28054
+ kind: "query",
28055
+ auth: "admin"
27675
28056
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
27676
28057
  kind: "mutation",
27677
28058
  auth: "admin"
@@ -32721,6 +33102,18 @@ Object.freeze({
32721
33102
  addonId: null,
32722
33103
  access: "create"
32723
33104
  },
33105
+ "pipelineAnalytics.countRelocatableMedia": {
33106
+ capName: "pipeline-analytics",
33107
+ capScope: "device",
33108
+ addonId: null,
33109
+ access: "view"
33110
+ },
33111
+ "pipelineAnalytics.countUnstampedEventMedia": {
33112
+ capName: "pipeline-analytics",
33113
+ capScope: "device",
33114
+ addonId: null,
33115
+ access: "view"
33116
+ },
32724
33117
  "pipelineAnalytics.deleteDeviceEvents": {
32725
33118
  capName: "pipeline-analytics",
32726
33119
  capScope: "device",
@@ -33879,6 +34272,12 @@ Object.freeze({
33879
34272
  addonId: null,
33880
34273
  access: "view"
33881
34274
  },
34275
+ "recording.getRelocateResidue": {
34276
+ capName: "recording",
34277
+ capScope: "system",
34278
+ addonId: null,
34279
+ access: "view"
34280
+ },
33882
34281
  "recording.getStorageMigrationMoveStatus": {
33883
34282
  capName: "recording",
33884
34283
  capScope: "system",
@@ -34425,12 +34824,30 @@ Object.freeze({
34425
34824
  addonId: null,
34426
34825
  access: "create"
34427
34826
  },
34827
+ "storageMigration.drain": {
34828
+ capName: "storage-migration",
34829
+ capScope: "system",
34830
+ addonId: null,
34831
+ access: "create"
34832
+ },
34833
+ "storageMigration.movers": {
34834
+ capName: "storage-migration",
34835
+ capScope: "system",
34836
+ addonId: null,
34837
+ access: "view"
34838
+ },
34428
34839
  "storageMigration.plan": {
34429
34840
  capName: "storage-migration",
34430
34841
  capScope: "system",
34431
34842
  addonId: null,
34432
34843
  access: "view"
34433
34844
  },
34845
+ "storageMigration.residue": {
34846
+ capName: "storage-migration",
34847
+ capScope: "system",
34848
+ addonId: null,
34849
+ access: "view"
34850
+ },
34434
34851
  "storageMigration.start": {
34435
34852
  capName: "storage-migration",
34436
34853
  capScope: "system",
@@ -35265,6 +35682,12 @@ Object.freeze({
35265
35682
  addonId: null,
35266
35683
  access: "delete"
35267
35684
  },
35685
+ "vectorStore.fetchByIds": {
35686
+ capName: "vector-store",
35687
+ capScope: "system",
35688
+ addonId: null,
35689
+ access: "view"
35690
+ },
35268
35691
  "vectorStore.getByIds": {
35269
35692
  capName: "vector-store",
35270
35693
  capScope: "system",
@@ -35277,6 +35700,12 @@ Object.freeze({
35277
35700
  addonId: null,
35278
35701
  access: "view"
35279
35702
  },
35703
+ "vectorStore.scan": {
35704
+ capName: "vector-store",
35705
+ capScope: "system",
35706
+ addonId: null,
35707
+ access: "view"
35708
+ },
35280
35709
  "vectorStore.stats": {
35281
35710
  capName: "vector-store",
35282
35711
  capScope: "system",
@@ -30,7 +30,7 @@ async function d(e) {
30
30
  }
31
31
  }
32
32
  async function f() {
33
- return l ||= d(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-Bdloemww.mjs")).catch((e) => {
33
+ return l ||= d(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-B6alraGf.mjs")).catch((e) => {
34
34
  throw l = void 0, e;
35
35
  }), l;
36
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-pipeline-orchestrator",
3
- "version": "1.2.122",
3
+ "version": "1.2.125",
4
4
  "description": "Hub-side camera-to-agent load balancer — tracks runner capacity and dispatches attachCamera calls to the optimal pipeline-runner instance",
5
5
  "keywords": [
6
6
  "camstack",