@camstack/system 1.2.157 → 1.2.159

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 (65) hide show
  1. package/dist/addon-runner.js +17 -16
  2. package/dist/addon-runner.mjs +2 -1
  3. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  6. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  7. package/dist/builtins/alerts/alerts.addon.js +1 -1
  8. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  9. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
  10. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
  11. package/dist/builtins/console-logging/index.js +1 -1
  12. package/dist/builtins/console-logging/index.mjs +1 -1
  13. package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
  14. package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
  15. package/dist/builtins/device-manager/device-manager.addon.js +2 -2
  16. package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
  17. package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
  18. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
  19. package/dist/builtins/hub-forwarder/index.js +1 -1
  20. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  21. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  22. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  23. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  24. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  25. package/dist/builtins/local-network/local-network.addon.js +1 -1
  26. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  27. package/dist/builtins/loki-logging/index.js +1 -1
  28. package/dist/builtins/loki-logging/index.mjs +1 -1
  29. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  30. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  31. package/dist/builtins/platform-probe/index.js +1 -1
  32. package/dist/builtins/platform-probe/index.mjs +1 -1
  33. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  34. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  35. package/dist/builtins/snapshot/index.js +1 -1
  36. package/dist/builtins/snapshot/index.mjs +1 -1
  37. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  38. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  39. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
  40. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
  41. package/dist/builtins/sqlite-storage/vector-index-shared.d.ts +30 -5
  42. package/dist/builtins/sqlite-storage/vector-index-vec.d.ts +28 -6
  43. package/dist/builtins/storage-orchestrator/access-guards.d.ts +32 -0
  44. package/dist/builtins/storage-orchestrator/location-secrets.d.ts +33 -0
  45. package/dist/builtins/storage-orchestrator/storage-migration-coordinator.d.ts +71 -1
  46. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.d.ts +26 -0
  47. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +490 -8
  48. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +490 -8
  49. package/dist/builtins/storage-orchestrator/storage-orchestrator.service.d.ts +37 -1
  50. package/dist/builtins/system-config/system-config.addon.js +1 -1
  51. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  52. package/dist/builtins/winston-logging/index.js +1 -1
  53. package/dist/builtins/winston-logging/index.mjs +1 -1
  54. package/dist/{dist-CDgIzo82.js → dist-Ck2jkBZk.js} +463 -10
  55. package/dist/{dist-LvKus-mT.mjs → dist-DLh4_rn3.mjs} +446 -11
  56. package/dist/index.js +140 -139
  57. package/dist/index.mjs +3 -3
  58. package/dist/kernel/deps/manifest-system-deps.d.ts +15 -0
  59. package/dist/kernel/index.d.ts +2 -0
  60. package/dist/kernel/storage-location-registry.d.ts +16 -1
  61. package/dist/{manifest-python-deps-DVODn-qc.js → manifest-system-deps-8boi90D9.js} +202 -7
  62. package/dist/{manifest-python-deps-CD14Pv0-.mjs → manifest-system-deps-tZZYG3RR.mjs} +197 -8
  63. package/dist/{retired-settings-keys-CV4QVdXj.mjs → retired-settings-keys-Bi0ZKBjb.mjs} +1 -1
  64. package/dist/{retired-settings-keys-BfAzWvPC.js → retired-settings-keys-Dp_CyuCW.js} +1 -1
  65. package/package.json +2 -1
@@ -3682,6 +3682,53 @@ var CameraSwitchGroupSchema = zod.z.object({
3682
3682
  /** Unix ms when the group was composed server-side. */
3683
3683
  fetchedAt: zod.z.number()
3684
3684
  });
3685
+ /**
3686
+ * The value a redacted secret is replaced with on every read surface.
3687
+ *
3688
+ * It is also the WRITE-BACK token: an `upsertLocation` that sends this value
3689
+ * back for a key means "keep what is stored", which is what lets an operator
3690
+ * rename a location without retyping its password. A literal an operator could
3691
+ * plausibly choose as a real password would turn that convenience into a way
3692
+ * to lock yourself out, hence the sentinel shape.
3693
+ */
3694
+ var REDACTED_SECRET = "__camstack_redacted__";
3695
+ /**
3696
+ * Every config key in `schema` whose value is a secret, including keys nested
3697
+ * inside `group` / `sub-tabs` containers.
3698
+ */
3699
+ function collectSecretConfigKeys(schema) {
3700
+ const keys = /* @__PURE__ */ new Set();
3701
+ for (const section of sectionsOf(schema)) for (const field of fieldsOf(section)) walkField(field, keys);
3702
+ return keys;
3703
+ }
3704
+ function isRecord$2(value) {
3705
+ return typeof value === "object" && value !== null && !Array.isArray(value);
3706
+ }
3707
+ function sectionsOf(schema) {
3708
+ if (!isRecord$2(schema)) return [];
3709
+ const sections = schema["sections"];
3710
+ return Array.isArray(sections) ? sections : [];
3711
+ }
3712
+ function fieldsOf(node) {
3713
+ if (!isRecord$2(node)) return [];
3714
+ const fields = node["fields"];
3715
+ return Array.isArray(fields) ? fields : [];
3716
+ }
3717
+ function walkField(field, out) {
3718
+ if (!isRecord$2(field)) return;
3719
+ const type = field["type"];
3720
+ const key = field["key"];
3721
+ if ((type === "password" || field["secret"] === true) && typeof key === "string" && key.length > 0) out.add(key);
3722
+ if (type === "group") {
3723
+ for (const child of fieldsOf(field)) walkField(child, out);
3724
+ return;
3725
+ }
3726
+ if (type === "sub-tabs") {
3727
+ const tabs = field["tabs"];
3728
+ if (!Array.isArray(tabs)) return;
3729
+ for (const tab of tabs) for (const child of fieldsOf(tab)) walkField(child, out);
3730
+ }
3731
+ }
3685
3732
  /** Friendly display labels for stream quality IDs. */
3686
3733
  var STREAM_QUALITY_LABELS = {
3687
3734
  high: "High",
@@ -4291,13 +4338,49 @@ var StorageMigrationParticipantSchema = zod.z.enum([
4291
4338
  "recorder",
4292
4339
  "analytics"
4293
4340
  ]);
4341
+ /**
4342
+ * The mover's own numbers, folded onto the coordinator's durable move record.
4343
+ *
4344
+ * The long half of a non-blocking migration is `draining`, and it is measured
4345
+ * in hours: 136 885 files at ~4 MB/s is about five of them. Before this shape
4346
+ * existed the only place those numbers appeared was a Loki line, so an operator
4347
+ * watching the Admin UI saw `phase: draining` and nothing else for a whole
4348
+ * afternoon.
4349
+ *
4350
+ * It is POLLED, never pushed. Events are telemetry and may be dropped
4351
+ * (D8/D11), and a dropped progress event is indistinguishable from a stalled
4352
+ * mover — which is the exact failure this is meant to end. The coordinator's
4353
+ * `waitForMoves` already fetches the whole {@link RelocateJob} on every tick to
4354
+ * read `state`; folding the counters costs no extra read and makes the durable
4355
+ * record say afterwards how far a move actually got.
4356
+ *
4357
+ * `filesTotal` is `null` for "no honest denominator" and is never zero-filled:
4358
+ * a windowed footage job (`sinceMs`) and a node with no ledger both genuinely
4359
+ * cannot say M, and a 0 there would render as "100 % done".
4360
+ */
4361
+ var StorageMigrationMoveProgressSchema = zod.z.object({
4362
+ filesMoved: zod.z.number().int().nonnegative(),
4363
+ /** The archive census — the **M** of "N of M" (D295). `null` = unknowable. */
4364
+ filesTotal: zod.z.number().int().nonnegative().nullable(),
4365
+ bytesMoved: zod.z.number().int().nonnegative(),
4366
+ /** The MOVER's start, not the migration's: a drain restarted after an addon
4367
+ * crash gets a new mover, and a rate computed from the migration's start
4368
+ * would silently average in the time nothing was running. */
4369
+ startedAt: zod.z.number(),
4370
+ /** When the coordinator last read these numbers. Paired with `startedAt` it
4371
+ * is the only honest rate: both clocks are the hub's, so a UI never has to
4372
+ * subtract its own. */
4373
+ observedAt: zod.z.number()
4374
+ });
4294
4375
  var StorageMigrationMoveSchema = zod.z.object({
4295
4376
  storageClass: StorageMigrationClassSchema,
4296
4377
  fromLocationId: zod.z.string(),
4297
4378
  toLocationId: zod.z.string(),
4298
4379
  moverJobId: zod.z.string().nullable(),
4299
4380
  state: RelocateJobStateSchema.nullable(),
4300
- error: zod.z.string().nullable()
4381
+ error: zod.z.string().nullable(),
4382
+ /** Last observed mover counters; `null` until the mover has been polled once. */
4383
+ progress: StorageMigrationMoveProgressSchema.nullable()
4301
4384
  });
4302
4385
  var StorageMigrationJobSchema = zod.z.object({
4303
4386
  jobId: zod.z.string(),
@@ -4367,6 +4450,106 @@ var StorageMigrationPlanSchema = zod.z.object({
4367
4450
  findings: zod.z.array(StorageMigrationFindingSchema)
4368
4451
  });
4369
4452
  /**
4453
+ * Which single-flight engine owns a class of work.
4454
+ *
4455
+ * Shared rather than re-declared per consumer: the coordinator lanes its moves
4456
+ * by it, and `storageMigration.movers` labels a mover with it so an operator
4457
+ * can see *which* engine is busy when a drain refuses to start beside another.
4458
+ */
4459
+ var StorageMigrationLaneSchema = zod.z.enum(["footage", "media"]);
4460
+ /**
4461
+ * A mover as it exists RIGHT NOW, whether or not a migration job owns it.
4462
+ *
4463
+ * The coordinator's job record is the state of record for a migration, and its
4464
+ * moves carry {@link StorageMigrationMoveProgress}. But the movers are usable
4465
+ * standalone — `recording.relocateFootage` and `pipelineAnalytics.relocateMedia`
4466
+ * are both operator-callable, and on 2026-08-29 a five-hour drain was armed that
4467
+ * way because no supported UI path existed. A mover armed like that has no job
4468
+ * to fold progress into, so it has to be readable on its own or it is invisible.
4469
+ *
4470
+ * `migrationJobId` is what tells the two apart: `null` means nothing here
4471
+ * orchestrated it.
4472
+ */
4473
+ var StorageMigrationMoverSchema = zod.z.object({
4474
+ lane: StorageMigrationLaneSchema,
4475
+ job: RelocateJobSchema,
4476
+ /** The coordinator job that armed this mover, or `null` for a mover armed
4477
+ * directly against the owning addon. */
4478
+ migrationJobId: zod.z.string().nullable(),
4479
+ /** When the hub read these counters. Stamped here so a rate is `bytesMoved`
4480
+ * over (`observedAt` − `job.startedAt`) with BOTH ends on the hub's clock —
4481
+ * a browser subtracting its own `Date.now()` from a server `startedAt` is a
4482
+ * rate made of two different clocks. */
4483
+ observedAt: zod.z.number()
4484
+ });
4485
+ /**
4486
+ * What a SOURCE still holds for one storage class — the number that makes a
4487
+ * "drain remaining" action honest rather than hopeful.
4488
+ *
4489
+ * It comes from the archive (`SegmentHourLedger.census` for footage, the media
4490
+ * engine's own selection count for media), never from the resident index: a
4491
+ * drain sized off `RecordingIndex` is what reported `done` over 80.3 GB it had
4492
+ * never been told about (D295).
4493
+ *
4494
+ * `items`/`bytes` are `null` for "the archive could not be asked", which is
4495
+ * deliberately NOT zero: a drain is still offered for an unknown residue,
4496
+ * because refusing on an unanswerable read would hide exactly the case an
4497
+ * operator needs to act on.
4498
+ */
4499
+ var StorageMigrationResidueSchema = zod.z.object({
4500
+ storageClass: StorageMigrationClassSchema,
4501
+ /** The location still holding the data. `'*'` for the media lane, whose rows
4502
+ * move from wherever they are rather than from one named source. */
4503
+ fromLocationId: zod.z.string(),
4504
+ /** Where a drain would move it — the class's CURRENT default. */
4505
+ toLocationId: zod.z.string(),
4506
+ /** Segments (footage lane) or rows (media lane) still on the source. */
4507
+ items: zod.z.number().int().nonnegative().nullable(),
4508
+ /** Bytes on the source; `null` when the lane counts rows rather than bytes. */
4509
+ bytes: zod.z.number().int().nonnegative().nullable()
4510
+ });
4511
+ /**
4512
+ * Run the DRAIN half and nothing else.
4513
+ *
4514
+ * A migration that reached `done` has already repointed, so `start` correctly
4515
+ * refuses its destination ("already the default") — there is nothing left to
4516
+ * repoint. But the drain can fail, be cancelled, be interrupted by a restart,
4517
+ * or finish against a work list that was a tenth of the archive (D295), and
4518
+ * before this there was no supported way to run only that half: the only way
4519
+ * through was calling `recording.relocateFootage` by hand over admin tRPC.
4520
+ *
4521
+ * `drain` NEVER calls `setDefaultLocations`. That is what keeps `start`'s
4522
+ * refusal meaningful: the two verbs are disjoint, so nothing here can silently
4523
+ * re-repoint a class that is already migrated.
4524
+ */
4525
+ var StorageMigrationDrainInputSchema = zod.z.object({
4526
+ /** The classes to drain. Each must appear in `storageMigration.residue`, so
4527
+ * a class whose source is already empty is refused rather than started. */
4528
+ classes: zod.z.array(StorageMigrationClassSchema).min(1),
4529
+ throttleMbps: zod.z.number().min(1).max(1e3).optional()
4530
+ });
4531
+ /** What a footage source still holds, asked of the durable hour ledger. */
4532
+ var RelocateResidueInputSchema = zod.z.object({
4533
+ fromLocationId: zod.z.string().min(1),
4534
+ /** Narrow to one logical class; omit for every profile on the location. */
4535
+ footageClass: RelocateFootageClassSchema.optional()
4536
+ });
4537
+ /** `null` = the archive could not answer (no ledger on this node, or the
4538
+ * aggregate failed). Never conflated with an empty source. */
4539
+ var RelocateResidueSchema = zod.z.object({
4540
+ segments: zod.z.number().int().nonnegative(),
4541
+ bytes: zod.z.number().int().nonnegative()
4542
+ }).nullable();
4543
+ /** How many rows a media pass would still act on against a given target — the
4544
+ * media lane's denominator AND its residue, from ONE derivation so the two can
4545
+ * never disagree. `null` = the count could not be taken. */
4546
+ var RelocatableMediaCountSchema = zod.z.object({ rows: zod.z.number().int().nonnegative() }).nullable();
4547
+ var RelocatableMediaCountInputSchema = zod.z.object({
4548
+ toLocationId: zod.z.string().min(1),
4549
+ /** Omitted = `move`. */
4550
+ mode: MediaRelocateModeSchema.optional()
4551
+ });
4552
+ /**
4370
4553
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
4371
4554
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
4372
4555
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -4470,6 +4653,38 @@ var StorageLocationRefSchema = zod.z.union([StorageLocationTypeSchema, zod.z.str
4470
4653
  * two addons declaring the same `id` must agree on `cardinality` (validated
4471
4654
  * at kernel aggregation time, not here).
4472
4655
  */
4656
+ /**
4657
+ * `StorageAccess` — how the service that DECLARED a storage-location kind
4658
+ * actually reaches the bytes. It is the constraint that decides which
4659
+ * `storage-provider`s may back a location of that kind.
4660
+ *
4661
+ * - `'local-path'` — the service asks `storage.resolve` for a path string and
4662
+ * then does its own `node:fs` I/O on it (the recorder's segment writer, the
4663
+ * post-analysis media roots). Only a provider that serves a genuine local
4664
+ * filesystem (`getProviderInfo().nodeLocal === true`) can satisfy that: a
4665
+ * remote provider's `resolve` returns a path on the REMOTE host, and
4666
+ * `fs.readdir` of it on this node either fails or — far worse — succeeds
4667
+ * against a same-named local directory that is something else entirely.
4668
+ *
4669
+ * - `'cap-mediated'` — every byte travels through the `storage` cap
4670
+ * (`read`/`write`, or `beginUpload`/`writeChunk`/`finalizeUpload`). The
4671
+ * service never sees a path, so any provider can back it. `backups` is the
4672
+ * one kind that qualifies today.
4673
+ *
4674
+ * Before this existed, `recordings` was unreachable by SFTP/S3/WebDAV only as
4675
+ * an EMERGENT property of how the recorder happened to be written. Nothing
4676
+ * refused the configuration; the first write simply went somewhere wrong, and
4677
+ * a recording write that goes wrong surfaces as a silent black window rather
4678
+ * than an error (the read path does not `stat`). This turns that accident into
4679
+ * a declared, enforced, testable refusal.
4680
+ */
4681
+ var StorageAccessSchema = zod.z.enum(["local-path", "cap-mediated"]);
4682
+ /**
4683
+ * What an ABSENT `access` means. Fail-closed: a declaration that says nothing
4684
+ * is treated as if it does raw filesystem I/O, so a remote provider is
4685
+ * refused for it. The permissive value must be written down.
4686
+ */
4687
+ var STORAGE_ACCESS_FALLBACK = "local-path";
4473
4688
  var StorageLocationDeclarationSchema = zod.z.object({
4474
4689
  /**
4475
4690
  * Global location identifier, e.g. `recordings` or `recordingsLow`.
@@ -4489,6 +4704,19 @@ var StorageLocationDeclarationSchema = zod.z.object({
4489
4704
  */
4490
4705
  cardinality: zod.z.enum(["single", "multi"]),
4491
4706
  /**
4707
+ * HOW the declaring service reaches the bytes — and therefore WHICH
4708
+ * providers may back a location of this kind. See {@link StorageAccessSchema}
4709
+ * and {@link STORAGE_ACCESS_FALLBACK}.
4710
+ *
4711
+ * Absent means `'local-path'`. That default is FAIL-CLOSED on purpose: it
4712
+ * can only over-restrict (refuse a remote provider for a kind that might
4713
+ * have coped) and never under-restrict. Declaring `'cap-mediated'` is the
4714
+ * permissive direction and is therefore never inferred — a repo guard
4715
+ * (`scripts/check-storage-access-declarations.ts`) refuses to let it be
4716
+ * reached by omission.
4717
+ */
4718
+ access: StorageAccessSchema.optional(),
4719
+ /**
4492
4720
  * When set, the default instance for this location inherits its resolved
4493
4721
  * root from the named location's default instance. Useful for derivative
4494
4722
  * slots (e.g. `recordingsLow` → `recordings`) so operators only need to
@@ -16908,8 +17136,10 @@ var TrackSchema = zod.z.object({
16908
17136
  lastSeen: zod.z.number(),
16909
17137
  /** Frame-rate position history (subject to maxPositionHistory cap). */
16910
17138
  positions: zod.z.array(TrackPositionSchema).readonly(),
16911
- /** Periodic snapshots at snapshotIntervalMs cadence (subject to
16912
- * saveThumbnails policy). */
17139
+ /** Periodic snapshots at snapshotIntervalMs cadence DEBUG media, produced
17140
+ * only while `MediaSettings.debugMediaEnabled` is on for the camera (D299;
17141
+ * the retired `saveThumbnails` used to gate this and the rolling
17142
+ * `lastFrame` together). Empty is the healthy default, not a capture gap. */
16913
17143
  snapshots: zod.z.array(TrackSnapshotSchema).readonly(),
16914
17144
  /** Deduplicated zones the track has entered at least once. Zone IDS. */
16915
17145
  zonesVisited: zod.z.array(zod.z.string()).readonly(),
@@ -18001,6 +18231,21 @@ var pipelineAnalyticsCapability = {
18001
18231
  * it to zero.
18002
18232
  */
18003
18233
  countUnstampedEventMedia: method(zod.z.object({}), UnstampedEventMediaCountSchema, { auth: "admin" }),
18234
+ /**
18235
+ * How many rows a pass would STILL act on against `toLocationId`.
18236
+ *
18237
+ * One derivation, two consumers: it is the media lane's denominator (the
18238
+ * **M** the footage lane gets from the ledger census — D295) and it is the
18239
+ * residue behind "drain remaining". Deriving them separately is how "N of M"
18240
+ * ends up comparing two different populations.
18241
+ *
18242
+ * `null` means the count could not be taken; it is never zero-filled,
18243
+ * because a zero here reads as "nothing left to move".
18244
+ */
18245
+ countRelocatableMedia: method(RelocatableMediaCountInputSchema, RelocatableMediaCountSchema, {
18246
+ kind: "query",
18247
+ auth: "admin"
18248
+ }),
18004
18249
  /** Every relocate job this addon knows about, newest first (in RAM: the
18005
18250
  * move is resumable, so a lost list costs nothing but the display). */
18006
18251
  listRelocateMediaJobs: method(zod.z.object({}), zod.z.array(RelocateJobSchema).readonly(), {
@@ -20958,6 +21203,35 @@ var storageMigrationCapability = {
20958
21203
  cancel: method(zod.z.object({ jobId: zod.z.string() }), zod.z.object({ cancelled: zod.z.boolean() }), {
20959
21204
  kind: "mutation",
20960
21205
  auth: "admin"
21206
+ }),
21207
+ /**
21208
+ * Every mover running RIGHT NOW, in both lanes, with its counters.
21209
+ *
21210
+ * `status` covers a migration's own moves — the coordinator folds their
21211
+ * progress onto the durable job record it is already polling. This covers
21212
+ * the other case, and it is not hypothetical: a drain armed straight against
21213
+ * `recording.relocateFootage` (the only path that existed before
21214
+ * {@link drain}) has no job to fold into and would otherwise be invisible.
21215
+ */
21216
+ movers: method(zod.z.object({}), zod.z.array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }),
21217
+ /**
21218
+ * What each class's SOURCE still holds, from the archive — never from the
21219
+ * resident index (D295). Only classes with something left (or something
21220
+ * unknown) are listed, so an empty list means there is nothing to drain and
21221
+ * the UI has no honest button to offer.
21222
+ */
21223
+ residue: method(zod.z.object({}), zod.z.array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }),
21224
+ /**
21225
+ * Run the drain half alone, on a class whose default has ALREADY moved.
21226
+ *
21227
+ * It never repoints anything, which is what lets `start` keep refusing a
21228
+ * destination that is already the default: the two verbs cannot be confused
21229
+ * for one another, and no operator can re-repoint a migrated class through
21230
+ * this door.
21231
+ */
21232
+ drain: method(StorageMigrationDrainInputSchema, zod.z.object({ jobId: zod.z.string() }), {
21233
+ kind: "mutation",
21234
+ auth: "admin"
20961
21235
  })
20962
21236
  }
20963
21237
  };
@@ -21520,12 +21794,38 @@ response: zod.z.record(zod.z.string(), zod.z.unknown()) }), zod.z.object({
21520
21794
  *
21521
21795
  * ## Why this is a capability and not a helper
21522
21796
  *
21523
- * Six stores in `addon-post-analysis` already hold vectors object CLIP, face,
21524
- * plate, vehicle, identity, and the event store's derivativesand every one of
21525
- * them keeps its vectors in a `JSON` settings-store column and ranks them by
21526
- * brute-force cosine in JS. Measured on the live hub that costs ~11.7 KB per row
21527
- * (512 floats as TEXT, `JSON.parse`d on every search) and made semantic search
21528
- * load 5,000 rows before ranking anything.
21797
+ * This capability was introduced with the claim that SIX stores in
21798
+ * `addon-post-analysis` held vectors in a `JSON` settings-store columnobject
21799
+ * CLIP, face, plate, vehicle, identity, and the event store's derivatives. That
21800
+ * claim was never true, and leaving it here made five stores look like pending
21801
+ * work when three of them have no vector at all. Counted column by column on
21802
+ * 2026-08-30, exactly THREE ever held one:
21803
+ *
21804
+ * - `object-clip` — 512-dim CLIP image embedding, migrated 2026-08-06.
21805
+ * - `faces.embedding` — 512-dim ArcFace face embedding, migrated 2026-08-30.
21806
+ * - `identity-samples.embedding` — the same ArcFace vector for an ENROLLED
21807
+ * face, migrated 2026-08-30 into its OWN index (see below).
21808
+ *
21809
+ * `plates` and `vehicle-samples` store a plate STRING and a score; `vehicles`
21810
+ * and `identities` store a name; the event store stores no derivative vector.
21811
+ * They are not migration candidates and never were.
21812
+ *
21813
+ * Measured on the live hub the JSON encoding cost ~11.7 KB per row (512 floats
21814
+ * as TEXT, `JSON.parse`d on every search) and made semantic search load 5,000
21815
+ * rows before ranking anything.
21816
+ *
21817
+ * ## One index per COMPARISON, never per encoder
21818
+ *
21819
+ * `faces` and `identity-samples` hold the same 512 ArcFace dims from the same
21820
+ * model, and they still get two indexes. An index is a set of things that are
21821
+ * ranked against each other and that live and die together, and these two are
21822
+ * neither: a `faces` row is TRACK-OWNED and cascades away with its track under
21823
+ * a per-camera capacity cap, an `identity-samples` row is retention-EXEMPT
21824
+ * forever and is the gallery every recognition ranks against. One index would
21825
+ * mean every gallery load and every reconcile carried a filter whose failure
21826
+ * mode is either ranking a candidate against itself or reclaiming an enrolled
21827
+ * person's only sample. The dimension they share is not a reason to share an
21828
+ * index; the question they answer is, and it differs.
21529
21829
  *
21530
21830
  * The fix is not a faster loop, it is a different backend — and the backend
21531
21831
  * should be replaceable without touching six callers. So: a singleton
@@ -21630,7 +21930,20 @@ var VectorQueryResultSchema = zod.z.object({
21630
21930
  */
21631
21931
  scanned: zod.z.number(),
21632
21932
  /** True when the backend could not consider every row that passed the filter. */
21633
- truncated: zod.z.boolean()
21933
+ truncated: zod.z.boolean(),
21934
+ /**
21935
+ * The `topK` the backend actually ran with.
21936
+ *
21937
+ * Every backend has a ceiling — sqlite-vec's is 4,096 — and a caller asking
21938
+ * past it used to learn nothing but a boolean, from a WARN in the provider's
21939
+ * own log rather than in its answer. That is how an audit asking for 20,000
21940
+ * consumed 4,096 and reported `examined: 4096` as if it had walked the index,
21941
+ * for weeks. `truncated` says THAT the answer was short; this says BY HOW
21942
+ * MUCH, in the return value, where the caller cannot fail to see it.
21943
+ *
21944
+ * Equals the requested `topK` whenever nothing was lowered.
21945
+ */
21946
+ effectiveTopK: zod.z.number().int().positive()
21634
21947
  });
21635
21948
  var VectorDeleteInputSchema = zod.z.object({
21636
21949
  index: zod.z.string(),
@@ -21659,6 +21972,68 @@ var VectorGetResultSchema = zod.z.object({ items: zod.z.array(zod.z.object({
21659
21972
  id: zod.z.string(),
21660
21973
  metadata: VectorMetadataSchema
21661
21974
  })) });
21975
+ /**
21976
+ * Ids to read back WITH their vectors.
21977
+ *
21978
+ * The sibling of {@link VectorGetResultSchema}, and deliberately a separate
21979
+ * method rather than a flag on it: `getByIds` promises no vectors and its one
21980
+ * caller depends on that promise. This one promises the opposite.
21981
+ *
21982
+ * It exists because a store cannot put its vectors here otherwise. An ArcFace
21983
+ * gallery is ranked IN PROCESS, per detection, against every enrolled sample —
21984
+ * a per-face cross-process KNN would be a network round trip inside the
21985
+ * recognition loop. So the gallery is loaded once and held in RAM, and loading
21986
+ * it requires the index to hand the floats back. Without this method the only
21987
+ * way to keep a readable vector is a JSON column, which is the thing this
21988
+ * capability exists to delete.
21989
+ *
21990
+ * BOUNDED BY THE CALLER: ids are named, never "everything". Enumerating an
21991
+ * index is {@link VectorScanInputSchema}'s job, and it returns no vectors.
21992
+ */
21993
+ var VectorFetchInputSchema = zod.z.object({
21994
+ index: zod.z.string(),
21995
+ ids: zod.z.array(zod.z.string())
21996
+ });
21997
+ var VectorFetchResultSchema = zod.z.object({ items: zod.z.array(zod.z.object({
21998
+ id: zod.z.string(),
21999
+ /** base64 Float32LE — the same wire form `upsert` accepts. */
22000
+ vector: zod.z.string(),
22001
+ metadata: VectorMetadataSchema
22002
+ })) });
22003
+ /**
22004
+ * ENUMERATE an index: one page of rows in a stable order, no ranking.
22005
+ *
22006
+ * A reconcile does not want the nearest rows, it wants ALL of them, and asking
22007
+ * a KNN for "all" is the wrong question twice over. It hits the backend's `k`
22008
+ * ceiling — 4,096 on sqlite-vec against a 22,128-row index — and it needs a
22009
+ * probe vector it does not have, so the audit passed a ZERO vector whose cosine
22010
+ * distance to every row is degenerate. `examined: 4096` then read as "we
22011
+ * looked" for as long as anyone cared to read it.
22012
+ *
22013
+ * This is the primitive that question actually needs: a bounded page, ordered
22014
+ * by the backend's own row order, costing no distance computation at all.
22015
+ * Vectors are NOT returned — an enumeration that shipped 2 KB per row would be
22016
+ * the full-table read this capability was built to stop.
22017
+ */
22018
+ var VectorScanInputSchema = zod.z.object({
22019
+ index: zod.z.string(),
22020
+ /** Opaque resume point. `0` starts at the top; pass back `nextCursor`. */
22021
+ cursor: zod.z.number().int().nonnegative().default(0),
22022
+ limit: zod.z.number().int().positive()
22023
+ });
22024
+ var VectorScanResultSchema = zod.z.object({
22025
+ items: zod.z.array(zod.z.object({
22026
+ id: zod.z.string(),
22027
+ metadata: VectorMetadataSchema
22028
+ })),
22029
+ /**
22030
+ * Where the next page starts, or `null` when the walk reached the end.
22031
+ *
22032
+ * `null` is the ONLY end-of-index signal. A caller must not infer the end
22033
+ * from a short page: a backend is free to return fewer rows than asked.
22034
+ */
22035
+ nextCursor: zod.z.number().int().nonnegative().nullable()
22036
+ });
21662
22037
  var VectorStatsInputSchema = zod.z.object({ index: zod.z.string() });
21663
22038
  var VectorStatsResultSchema = zod.z.object({
21664
22039
  /** Provider id, so an operator can tell brute force from an ANN index. */
@@ -21697,6 +22072,10 @@ var vectorStoreCapability = {
21697
22072
  query: method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }),
21698
22073
  /** Metadata by id, no vectors — see {@link VectorGetResultSchema}. */
21699
22074
  getByIds: method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }),
22075
+ /** Metadata AND vectors, by named id — see {@link VectorFetchInputSchema}. */
22076
+ fetchByIds: method(VectorFetchInputSchema, VectorFetchResultSchema, { auth: "admin" }),
22077
+ /** One page of the whole index, unranked — see {@link VectorScanInputSchema}. */
22078
+ scan: method(VectorScanInputSchema, VectorScanResultSchema, { auth: "admin" }),
21700
22079
  deleteByIds: method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
21701
22080
  kind: "mutation",
21702
22081
  auth: "admin"
@@ -29398,6 +29777,20 @@ var recordingCapability = {
29398
29777
  kind: "query",
29399
29778
  auth: "admin"
29400
29779
  }),
29780
+ /**
29781
+ * What a location STILL holds, asked of the durable hour ledger.
29782
+ *
29783
+ * The number behind "drain remaining": segments and bytes that would still
29784
+ * have to move off `fromLocationId`. It is a ledger aggregate — the archive
29785
+ * — because the resident index is not the archive (D295), and a drain sized
29786
+ * off the index is exactly what reported `done` over 80.3 GB on 2026-08-29.
29787
+ * `null` means the archive could not be asked (no ledger on this node, or
29788
+ * the aggregate failed) and is never conflated with an empty source.
29789
+ */
29790
+ getRelocateResidue: method(RelocateResidueInputSchema, RelocateResidueSchema, {
29791
+ kind: "query",
29792
+ auth: "admin"
29793
+ }),
29401
29794
  /** Cancel a running or queued relocate job. A queued job never runs. */
29402
29795
  cancelRelocateJob: method(zod.z.object({ jobId: zod.z.string() }), zod.z.object({ cancelled: zod.z.boolean() }), {
29403
29796
  kind: "mutation",
@@ -36222,6 +36615,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
36222
36615
  addonId: null,
36223
36616
  access: "create"
36224
36617
  },
36618
+ "pipelineAnalytics.countRelocatableMedia": {
36619
+ capName: "pipeline-analytics",
36620
+ capScope: "device",
36621
+ addonId: null,
36622
+ access: "view"
36623
+ },
36225
36624
  "pipelineAnalytics.countUnstampedEventMedia": {
36226
36625
  capName: "pipeline-analytics",
36227
36626
  capScope: "device",
@@ -37386,6 +37785,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
37386
37785
  addonId: null,
37387
37786
  access: "view"
37388
37787
  },
37788
+ "recording.getRelocateResidue": {
37789
+ capName: "recording",
37790
+ capScope: "system",
37791
+ addonId: null,
37792
+ access: "view"
37793
+ },
37389
37794
  "recording.getStorageMigrationMoveStatus": {
37390
37795
  capName: "recording",
37391
37796
  capScope: "system",
@@ -37932,12 +38337,30 @@ var METHOD_ACCESS_MAP = Object.freeze({
37932
38337
  addonId: null,
37933
38338
  access: "create"
37934
38339
  },
38340
+ "storageMigration.drain": {
38341
+ capName: "storage-migration",
38342
+ capScope: "system",
38343
+ addonId: null,
38344
+ access: "create"
38345
+ },
38346
+ "storageMigration.movers": {
38347
+ capName: "storage-migration",
38348
+ capScope: "system",
38349
+ addonId: null,
38350
+ access: "view"
38351
+ },
37935
38352
  "storageMigration.plan": {
37936
38353
  capName: "storage-migration",
37937
38354
  capScope: "system",
37938
38355
  addonId: null,
37939
38356
  access: "view"
37940
38357
  },
38358
+ "storageMigration.residue": {
38359
+ capName: "storage-migration",
38360
+ capScope: "system",
38361
+ addonId: null,
38362
+ access: "view"
38363
+ },
37941
38364
  "storageMigration.start": {
37942
38365
  capName: "storage-migration",
37943
38366
  capScope: "system",
@@ -38772,6 +39195,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
38772
39195
  addonId: null,
38773
39196
  access: "delete"
38774
39197
  },
39198
+ "vectorStore.fetchByIds": {
39199
+ capName: "vector-store",
39200
+ capScope: "system",
39201
+ addonId: null,
39202
+ access: "view"
39203
+ },
38775
39204
  "vectorStore.getByIds": {
38776
39205
  capName: "vector-store",
38777
39206
  capScope: "system",
@@ -38784,6 +39213,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
38784
39213
  addonId: null,
38785
39214
  access: "view"
38786
39215
  },
39216
+ "vectorStore.scan": {
39217
+ capName: "vector-store",
39218
+ capScope: "system",
39219
+ addonId: null,
39220
+ access: "view"
39221
+ },
38787
39222
  "vectorStore.stats": {
38788
39223
  capName: "vector-store",
38789
39224
  capScope: "system",
@@ -41770,6 +42205,12 @@ Object.defineProperty(exports, "METHOD_ACCESS_MAP", {
41770
42205
  return METHOD_ACCESS_MAP;
41771
42206
  }
41772
42207
  });
42208
+ Object.defineProperty(exports, "REDACTED_SECRET", {
42209
+ enumerable: true,
42210
+ get: function() {
42211
+ return REDACTED_SECRET;
42212
+ }
42213
+ });
41773
42214
  Object.defineProperty(exports, "RUNTIME_DEFAULTS", {
41774
42215
  enumerable: true,
41775
42216
  get: function() {
@@ -41800,6 +42241,12 @@ Object.defineProperty(exports, "SOURCE_DEVICE_TYPES", {
41800
42241
  return SOURCE_DEVICE_TYPES;
41801
42242
  }
41802
42243
  });
42244
+ Object.defineProperty(exports, "STORAGE_ACCESS_FALLBACK", {
42245
+ enumerable: true,
42246
+ get: function() {
42247
+ return STORAGE_ACCESS_FALLBACK;
42248
+ }
42249
+ });
41803
42250
  Object.defineProperty(exports, "STREAM_PROFILE_META", {
41804
42251
  enumerable: true,
41805
42252
  get: function() {
@@ -41908,6 +42355,12 @@ Object.defineProperty(exports, "buildStreamParamsConfigSchema", {
41908
42355
  return buildStreamParamsConfigSchema;
41909
42356
  }
41910
42357
  });
42358
+ Object.defineProperty(exports, "collectSecretConfigKeys", {
42359
+ enumerable: true,
42360
+ get: function() {
42361
+ return collectSecretConfigKeys;
42362
+ }
42363
+ });
41911
42364
  Object.defineProperty(exports, "coreBlockAddonId", {
41912
42365
  enumerable: true,
41913
42366
  get: function() {