@camstack/addon-ai 0.4.36 → 0.4.38

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.
Files changed (3) hide show
  1. package/dist/addon.js +121 -13
  2. package/dist/addon.mjs +121 -13
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -8242,18 +8242,61 @@ var RelocateFootageInputSchema = object({
8242
8242
  * `RecordingConfig.enabled` or camera wrapper bindings. */
8243
8243
  var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
8244
8244
  var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
8245
+ /**
8246
+ * What a `relocateMedia` pass DOES. One engine, three passes — never a second
8247
+ * mover (the engine already walks both collections with a timestamp cursor and
8248
+ * already has a stamp-without-copy path).
8249
+ *
8250
+ * - `move` — the default and the historical behaviour: event-media and
8251
+ * retrain blobs move to `toLocationId` and their rows are
8252
+ * stamped. The enrolled gallery is skipped (D197).
8253
+ * - `seal` — ROWS ONLY, no bytes. Every row whose `locationId` is NULL is
8254
+ * stamped with `toLocationId`. `toLocationId` here is the id the
8255
+ * bytes ALREADY sit on — today's `eventMedia` default — because
8256
+ * a NULL row means "wherever `eventMedia` points *now*", and the
8257
+ * instant a repoint moves that pointer the row reads from the
8258
+ * new disk while its bytes are on the old one.
8259
+ * - `gallery` — the inverse selection of `move`: ONLY the retention-exempt
8260
+ * (enrolled-gallery) rows, which `move` deliberately skips.
8261
+ * `galleryMedia` is `cardinality: 'single'`, so this pass can
8262
+ * never run beside a live second location: it is stop-the-world
8263
+ * by construction, which is acceptable only because the gallery
8264
+ * is a few KB per enrolled sample.
8265
+ */
8266
+ var MediaRelocateModeSchema = _enum([
8267
+ "move",
8268
+ "seal",
8269
+ "gallery"
8270
+ ]);
8245
8271
  var RelocateMediaInputSchema = object({
8246
8272
  toLocationId: string(),
8247
- throttleMbps: number$1().min(1).max(1e3).optional()
8273
+ throttleMbps: number$1().min(1).max(1e3).optional(),
8274
+ /** Omitted = `move`, the pre-existing behaviour. */
8275
+ mode: MediaRelocateModeSchema.optional()
8276
+ });
8277
+ /** How many rows still carry NO `locationId` — the population a repoint would
8278
+ * silently re-aim at a disk that does not hold their bytes. Zero is the only
8279
+ * value that permits a non-blocking `eventMedia` cutover. */
8280
+ var UnstampedEventMediaCountSchema = object({
8281
+ media: number$1().int().nonnegative(),
8282
+ retrainFrames: number$1().int().nonnegative(),
8283
+ total: number$1().int().nonnegative()
8248
8284
  });
8249
8285
  var StorageMigrationMediaMoveInputSchema = RelocateMediaInputSchema.extend({ leaseId: string().min(1) });
8250
- /** The independently selectable logical storage classes. `recordings`
8251
- * encompasses the high and mid segment profiles; `recordingsLow` is low
8252
- * segments; `eventMedia` is post-analysis blobs. */
8286
+ /** The independently selectable logical storage classes — every class
8287
+ * `storage.listLocationDeclarations` reports, so an operator never meets a
8288
+ * Zod enum error where they should meet an explanation.
8289
+ *
8290
+ * `recordings` encompasses the high and mid segment profiles; `recordingsLow`
8291
+ * is low segments; `eventMedia` is post-analysis blobs; `galleryMedia` is the
8292
+ * enrolled gallery; `backups` is the system backup archive. The last two have
8293
+ * their own rules — see {@link StorageMigrationFindingCodeSchema}. */
8253
8294
  var StorageMigrationClassSchema = _enum([
8254
8295
  "recordings",
8255
8296
  "recordingsLow",
8256
- "eventMedia"
8297
+ "eventMedia",
8298
+ "backups",
8299
+ "galleryMedia"
8257
8300
  ]);
8258
8301
  /** A destination is always an existing, fully-qualified location id. The
8259
8302
  * migration API intentionally never changes a source location's `basePath`:
@@ -8261,20 +8304,56 @@ var StorageMigrationClassSchema = _enum([
8261
8304
  var StorageMigrationDestinationsSchema = object({
8262
8305
  recordings: string().min(1).optional(),
8263
8306
  recordingsLow: string().min(1).optional(),
8264
- eventMedia: string().min(1).optional()
8307
+ eventMedia: string().min(1).optional(),
8308
+ backups: string().min(1).optional(),
8309
+ galleryMedia: string().min(1).optional()
8265
8310
  }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
8311
+ /**
8312
+ * How a migration sequences the cutover against the byte move.
8313
+ *
8314
+ * - `blocking` — the historical order: pause, move every byte, repoint,
8315
+ * resume. Recording is stopped for the whole move. Right
8316
+ * for a small or a cold class, and the only legal mode for
8317
+ * a `cardinality: 'single'` class.
8318
+ * - `nonBlocking` — repoint FIRST, drain behind: seal, pause, repoint,
8319
+ * refresh, resume, then move the past with everything
8320
+ * running. The pause is three bounded instants (a detach +
8321
+ * attach round, a write-gate drain, a lease) instead of one
8322
+ * bounded by bytes. 1.09 TB at 7–14 MB/s is thirty hours of
8323
+ * stopped recording under `blocking`; the same move is
8324
+ * seconds of stopped recording under `nonBlocking`.
8325
+ *
8326
+ * The mode is on the JOB, not only on the input, because `status` is where an
8327
+ * operator finds out which one is running.
8328
+ */
8329
+ var StorageMigrationModeSchema = _enum(["blocking", "nonBlocking"]);
8266
8330
  /** Shared input for planning and starting an orchestrated storage migration. */
8267
8331
  var StorageMigrationInputSchema = object({
8268
8332
  destinations: StorageMigrationDestinationsSchema,
8269
- throttleMbps: number$1().min(1).max(1e3).optional()
8333
+ throttleMbps: number$1().min(1).max(1e3).optional(),
8334
+ /** Omitted = `blocking`, which stays the default. */
8335
+ mode: StorageMigrationModeSchema.optional()
8270
8336
  });
8271
- /** The durable coordinator state machine. The only phase that changes default
8272
- * locations is `repointing`, after every selected mover has completed and been
8273
- * verified. */
8337
+ /**
8338
+ * The durable coordinator state machine.
8339
+ *
8340
+ * `blocking`:
8341
+ * planning → pausing → moving → verifying → repointing → refreshing → resuming → done
8342
+ *
8343
+ * `nonBlocking`:
8344
+ * planning → sealing → pausing → repointing → refreshing → resuming → draining → verifying → done
8345
+ *
8346
+ * Same phases, different order plus two new ones — not a second mover.
8347
+ * `sealing` closes the `eventMedia` NULL-row hole BEFORE anything is paused;
8348
+ * `draining` runs the same movers UNLEASED, after every writer is back up.
8349
+ * `repointing` is still the only phase that changes a default location.
8350
+ */
8274
8351
  var StorageMigrationPhaseSchema = _enum([
8275
8352
  "planning",
8353
+ "sealing",
8276
8354
  "pausing",
8277
8355
  "moving",
8356
+ "draining",
8278
8357
  "verifying",
8279
8358
  "repointing",
8280
8359
  "refreshing",
@@ -8299,6 +8378,9 @@ var StorageMigrationMoveSchema = object({
8299
8378
  var StorageMigrationJobSchema = object({
8300
8379
  jobId: string(),
8301
8380
  phase: StorageMigrationPhaseSchema,
8381
+ /** Which order this job is running. `status` is the only place an operator
8382
+ * can tell a seconds-long cutover from a thirty-hour one. */
8383
+ mode: StorageMigrationModeSchema,
8302
8384
  destinations: StorageMigrationDestinationsSchema,
8303
8385
  throttleMbps: number$1(),
8304
8386
  moves: array(StorageMigrationMoveSchema),
@@ -8311,13 +8393,30 @@ var StorageMigrationJobSchema = object({
8311
8393
  finishedAt: number$1().nullable(),
8312
8394
  error: string().nullable()
8313
8395
  });
8396
+ var StorageMigrationFindingSchema = object({
8397
+ code: _enum([
8398
+ "sharesDeviceWithSource",
8399
+ "deviceIdentityUnknown",
8400
+ "unstampedEventMediaRows",
8401
+ "blockingOnly",
8402
+ "noMover"
8403
+ ]),
8404
+ storageClass: StorageMigrationClassSchema,
8405
+ /** Human-readable, already carrying the ids and counts. */
8406
+ message: string()
8407
+ });
8314
8408
  var StorageMigrationPlanSchema = object({
8315
8409
  destinations: StorageMigrationDestinationsSchema,
8410
+ /** The mode this plan was built for. A plan is only valid for its mode: the
8411
+ * `eventMedia` seal gate and the single-cardinality refusal both depend on
8412
+ * it. */
8413
+ mode: StorageMigrationModeSchema,
8316
8414
  moves: array(object({
8317
8415
  storageClass: StorageMigrationClassSchema,
8318
8416
  fromLocationId: string(),
8319
8417
  toLocationId: string()
8320
- }))
8418
+ })),
8419
+ findings: array(StorageMigrationFindingSchema)
8321
8420
  });
8322
8421
  /**
8323
8422
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -18922,7 +19021,7 @@ DeviceType.Camera, method(object({ deviceId: number$1() }), array(TrackSchema).r
18922
19021
  }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
18923
19022
  kind: "mutation",
18924
19023
  auth: "admin"
18925
- }), method(object({}), array(RelocateJobSchema).readonly(), {
19024
+ }), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(object({}), array(RelocateJobSchema).readonly(), {
18926
19025
  kind: "query",
18927
19026
  auth: "admin"
18928
19027
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
@@ -20829,7 +20928,10 @@ method(object({
20829
20928
  }), StorageLocationSchema, {
20830
20929
  kind: "mutation",
20831
20930
  auth: "admin"
20832
- }), method(object({ id: string() }), _void(), {
20931
+ }), method(object({
20932
+ id: string(),
20933
+ force: boolean().optional()
20934
+ }), _void(), {
20833
20935
  kind: "mutation",
20834
20936
  auth: "admin"
20835
20937
  }), method(object({ id: string() }), object({
@@ -31302,6 +31404,12 @@ Object.freeze({
31302
31404
  addonId: null,
31303
31405
  access: "create"
31304
31406
  },
31407
+ "pipelineAnalytics.countUnstampedEventMedia": {
31408
+ capName: "pipeline-analytics",
31409
+ capScope: "device",
31410
+ addonId: null,
31411
+ access: "view"
31412
+ },
31305
31413
  "pipelineAnalytics.deleteDeviceEvents": {
31306
31414
  capName: "pipeline-analytics",
31307
31415
  capScope: "device",
package/dist/addon.mjs CHANGED
@@ -8269,18 +8269,61 @@ var RelocateFootageInputSchema = object({
8269
8269
  * `RecordingConfig.enabled` or camera wrapper bindings. */
8270
8270
  var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
8271
8271
  var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
8272
+ /**
8273
+ * What a `relocateMedia` pass DOES. One engine, three passes — never a second
8274
+ * mover (the engine already walks both collections with a timestamp cursor and
8275
+ * already has a stamp-without-copy path).
8276
+ *
8277
+ * - `move` — the default and the historical behaviour: event-media and
8278
+ * retrain blobs move to `toLocationId` and their rows are
8279
+ * stamped. The enrolled gallery is skipped (D197).
8280
+ * - `seal` — ROWS ONLY, no bytes. Every row whose `locationId` is NULL is
8281
+ * stamped with `toLocationId`. `toLocationId` here is the id the
8282
+ * bytes ALREADY sit on — today's `eventMedia` default — because
8283
+ * a NULL row means "wherever `eventMedia` points *now*", and the
8284
+ * instant a repoint moves that pointer the row reads from the
8285
+ * new disk while its bytes are on the old one.
8286
+ * - `gallery` — the inverse selection of `move`: ONLY the retention-exempt
8287
+ * (enrolled-gallery) rows, which `move` deliberately skips.
8288
+ * `galleryMedia` is `cardinality: 'single'`, so this pass can
8289
+ * never run beside a live second location: it is stop-the-world
8290
+ * by construction, which is acceptable only because the gallery
8291
+ * is a few KB per enrolled sample.
8292
+ */
8293
+ var MediaRelocateModeSchema = _enum([
8294
+ "move",
8295
+ "seal",
8296
+ "gallery"
8297
+ ]);
8272
8298
  var RelocateMediaInputSchema = object({
8273
8299
  toLocationId: string(),
8274
- throttleMbps: number$1().min(1).max(1e3).optional()
8300
+ throttleMbps: number$1().min(1).max(1e3).optional(),
8301
+ /** Omitted = `move`, the pre-existing behaviour. */
8302
+ mode: MediaRelocateModeSchema.optional()
8303
+ });
8304
+ /** How many rows still carry NO `locationId` — the population a repoint would
8305
+ * silently re-aim at a disk that does not hold their bytes. Zero is the only
8306
+ * value that permits a non-blocking `eventMedia` cutover. */
8307
+ var UnstampedEventMediaCountSchema = object({
8308
+ media: number$1().int().nonnegative(),
8309
+ retrainFrames: number$1().int().nonnegative(),
8310
+ total: number$1().int().nonnegative()
8275
8311
  });
8276
8312
  var StorageMigrationMediaMoveInputSchema = RelocateMediaInputSchema.extend({ leaseId: string().min(1) });
8277
- /** The independently selectable logical storage classes. `recordings`
8278
- * encompasses the high and mid segment profiles; `recordingsLow` is low
8279
- * segments; `eventMedia` is post-analysis blobs. */
8313
+ /** The independently selectable logical storage classes — every class
8314
+ * `storage.listLocationDeclarations` reports, so an operator never meets a
8315
+ * Zod enum error where they should meet an explanation.
8316
+ *
8317
+ * `recordings` encompasses the high and mid segment profiles; `recordingsLow`
8318
+ * is low segments; `eventMedia` is post-analysis blobs; `galleryMedia` is the
8319
+ * enrolled gallery; `backups` is the system backup archive. The last two have
8320
+ * their own rules — see {@link StorageMigrationFindingCodeSchema}. */
8280
8321
  var StorageMigrationClassSchema = _enum([
8281
8322
  "recordings",
8282
8323
  "recordingsLow",
8283
- "eventMedia"
8324
+ "eventMedia",
8325
+ "backups",
8326
+ "galleryMedia"
8284
8327
  ]);
8285
8328
  /** A destination is always an existing, fully-qualified location id. The
8286
8329
  * migration API intentionally never changes a source location's `basePath`:
@@ -8288,20 +8331,56 @@ var StorageMigrationClassSchema = _enum([
8288
8331
  var StorageMigrationDestinationsSchema = object({
8289
8332
  recordings: string().min(1).optional(),
8290
8333
  recordingsLow: string().min(1).optional(),
8291
- eventMedia: string().min(1).optional()
8334
+ eventMedia: string().min(1).optional(),
8335
+ backups: string().min(1).optional(),
8336
+ galleryMedia: string().min(1).optional()
8292
8337
  }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
8338
+ /**
8339
+ * How a migration sequences the cutover against the byte move.
8340
+ *
8341
+ * - `blocking` — the historical order: pause, move every byte, repoint,
8342
+ * resume. Recording is stopped for the whole move. Right
8343
+ * for a small or a cold class, and the only legal mode for
8344
+ * a `cardinality: 'single'` class.
8345
+ * - `nonBlocking` — repoint FIRST, drain behind: seal, pause, repoint,
8346
+ * refresh, resume, then move the past with everything
8347
+ * running. The pause is three bounded instants (a detach +
8348
+ * attach round, a write-gate drain, a lease) instead of one
8349
+ * bounded by bytes. 1.09 TB at 7–14 MB/s is thirty hours of
8350
+ * stopped recording under `blocking`; the same move is
8351
+ * seconds of stopped recording under `nonBlocking`.
8352
+ *
8353
+ * The mode is on the JOB, not only on the input, because `status` is where an
8354
+ * operator finds out which one is running.
8355
+ */
8356
+ var StorageMigrationModeSchema = _enum(["blocking", "nonBlocking"]);
8293
8357
  /** Shared input for planning and starting an orchestrated storage migration. */
8294
8358
  var StorageMigrationInputSchema = object({
8295
8359
  destinations: StorageMigrationDestinationsSchema,
8296
- throttleMbps: number$1().min(1).max(1e3).optional()
8360
+ throttleMbps: number$1().min(1).max(1e3).optional(),
8361
+ /** Omitted = `blocking`, which stays the default. */
8362
+ mode: StorageMigrationModeSchema.optional()
8297
8363
  });
8298
- /** The durable coordinator state machine. The only phase that changes default
8299
- * locations is `repointing`, after every selected mover has completed and been
8300
- * verified. */
8364
+ /**
8365
+ * The durable coordinator state machine.
8366
+ *
8367
+ * `blocking`:
8368
+ * planning → pausing → moving → verifying → repointing → refreshing → resuming → done
8369
+ *
8370
+ * `nonBlocking`:
8371
+ * planning → sealing → pausing → repointing → refreshing → resuming → draining → verifying → done
8372
+ *
8373
+ * Same phases, different order plus two new ones — not a second mover.
8374
+ * `sealing` closes the `eventMedia` NULL-row hole BEFORE anything is paused;
8375
+ * `draining` runs the same movers UNLEASED, after every writer is back up.
8376
+ * `repointing` is still the only phase that changes a default location.
8377
+ */
8301
8378
  var StorageMigrationPhaseSchema = _enum([
8302
8379
  "planning",
8380
+ "sealing",
8303
8381
  "pausing",
8304
8382
  "moving",
8383
+ "draining",
8305
8384
  "verifying",
8306
8385
  "repointing",
8307
8386
  "refreshing",
@@ -8326,6 +8405,9 @@ var StorageMigrationMoveSchema = object({
8326
8405
  var StorageMigrationJobSchema = object({
8327
8406
  jobId: string(),
8328
8407
  phase: StorageMigrationPhaseSchema,
8408
+ /** Which order this job is running. `status` is the only place an operator
8409
+ * can tell a seconds-long cutover from a thirty-hour one. */
8410
+ mode: StorageMigrationModeSchema,
8329
8411
  destinations: StorageMigrationDestinationsSchema,
8330
8412
  throttleMbps: number$1(),
8331
8413
  moves: array(StorageMigrationMoveSchema),
@@ -8338,13 +8420,30 @@ var StorageMigrationJobSchema = object({
8338
8420
  finishedAt: number$1().nullable(),
8339
8421
  error: string().nullable()
8340
8422
  });
8423
+ var StorageMigrationFindingSchema = object({
8424
+ code: _enum([
8425
+ "sharesDeviceWithSource",
8426
+ "deviceIdentityUnknown",
8427
+ "unstampedEventMediaRows",
8428
+ "blockingOnly",
8429
+ "noMover"
8430
+ ]),
8431
+ storageClass: StorageMigrationClassSchema,
8432
+ /** Human-readable, already carrying the ids and counts. */
8433
+ message: string()
8434
+ });
8341
8435
  var StorageMigrationPlanSchema = object({
8342
8436
  destinations: StorageMigrationDestinationsSchema,
8437
+ /** The mode this plan was built for. A plan is only valid for its mode: the
8438
+ * `eventMedia` seal gate and the single-cardinality refusal both depend on
8439
+ * it. */
8440
+ mode: StorageMigrationModeSchema,
8343
8441
  moves: array(object({
8344
8442
  storageClass: StorageMigrationClassSchema,
8345
8443
  fromLocationId: string(),
8346
8444
  toLocationId: string()
8347
- }))
8445
+ })),
8446
+ findings: array(StorageMigrationFindingSchema)
8348
8447
  });
8349
8448
  /**
8350
8449
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -18949,7 +19048,7 @@ DeviceType.Camera, method(object({ deviceId: number$1() }), array(TrackSchema).r
18949
19048
  }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
18950
19049
  kind: "mutation",
18951
19050
  auth: "admin"
18952
- }), method(object({}), array(RelocateJobSchema).readonly(), {
19051
+ }), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(object({}), array(RelocateJobSchema).readonly(), {
18953
19052
  kind: "query",
18954
19053
  auth: "admin"
18955
19054
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
@@ -20856,7 +20955,10 @@ method(object({
20856
20955
  }), StorageLocationSchema, {
20857
20956
  kind: "mutation",
20858
20957
  auth: "admin"
20859
- }), method(object({ id: string() }), _void(), {
20958
+ }), method(object({
20959
+ id: string(),
20960
+ force: boolean().optional()
20961
+ }), _void(), {
20860
20962
  kind: "mutation",
20861
20963
  auth: "admin"
20862
20964
  }), method(object({ id: string() }), object({
@@ -31329,6 +31431,12 @@ Object.freeze({
31329
31431
  addonId: null,
31330
31432
  access: "create"
31331
31433
  },
31434
+ "pipelineAnalytics.countUnstampedEventMedia": {
31435
+ capName: "pipeline-analytics",
31436
+ capScope: "device",
31437
+ addonId: null,
31438
+ access: "view"
31439
+ },
31332
31440
  "pipelineAnalytics.deleteDeviceEvents": {
31333
31441
  capName: "pipeline-analytics",
31334
31442
  capScope: "device",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-ai",
3
- "version": "0.4.36",
3
+ "version": "0.4.38",
4
4
  "description": "AI addon for CamStack — the `llm` collection provider (cloud, LAN, and camstack-managed local llama.cpp profiles) plus the per-node `llm-runtime` managed executor.",
5
5
  "keywords": [
6
6
  "camstack",