@camstack/types 1.2.124 → 1.2.127

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/addon.js CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_event_category = require("./event-category-BaEgqJNv.js");
3
- const require_sleep = require("./sleep-CJrvRDlD.js");
3
+ const require_sleep = require("./sleep-CWWLTM6W.js");
4
4
  const require_err_msg = require("./err-msg-COpsHMw2.js");
5
5
  //#region src/generated/cap-input-defaults.ts
6
6
  /**
@@ -16,7 +16,7 @@ const require_err_msg = require("./err-msg-COpsHMw2.js");
16
16
  * Plain data, zero Zod: a forked runner must not import the schema barrel
17
17
  * (~144MB RSS per runner — D28).
18
18
  *
19
- * Coverage: 24 caps, 53 methods with defaults.
19
+ * Coverage: 24 caps, 54 methods with defaults.
20
20
  */
21
21
  var CAP_INPUT_DEFAULTS = Object.freeze({
22
22
  "addons": { "getLogs": { "limit": 100 } },
@@ -236,7 +236,10 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
236
236
  "createApiKey": { "isAdmin": false },
237
237
  "createUser": { "isAdmin": false }
238
238
  },
239
- "vector-store": { "declareIndex": { "metric": "cosine" } },
239
+ "vector-store": {
240
+ "declareIndex": { "metric": "cosine" },
241
+ "scan": { "cursor": 0 }
242
+ },
240
243
  "zones": {
241
244
  "addZone": { "zone": { "__nested__": {
242
245
  "kind": "polygon",
package/dist/addon.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as EventCategory } from "./event-category-BZL-fdNj.mjs";
2
- import { B as ReadinessRegistry, E as adminUiCapability, L as nodePin, R as readNodePin, St as emitReadiness, T as DeviceType, V as ReadinessTimeoutError, W as scopeKey, _t as DisposerChain, a as asJsonObject, b as deviceOpsCapability, d as BOOT_RECOVERY_BACKOFF_MS, f as DEVICE_SCOPED_CAPS, gt as DATAPLANE_SECRET_HEADER, h as createEventBusSliceSource, j as expandCapMethods, m as createDeviceProxy, p as isDeviceScopedCap, s as asString, t as sleep, u as parseJsonUnknown, vt as BaseAddon, x as viewerUiCapability, yt as normalizeAddonInitResult } from "./sleep-L5-bG_a_.mjs";
2
+ import { B as ReadinessRegistry, E as adminUiCapability, L as nodePin, R as readNodePin, St as emitReadiness, T as DeviceType, V as ReadinessTimeoutError, W as scopeKey, _t as DisposerChain, a as asJsonObject, b as deviceOpsCapability, d as BOOT_RECOVERY_BACKOFF_MS, f as DEVICE_SCOPED_CAPS, gt as DATAPLANE_SECRET_HEADER, h as createEventBusSliceSource, j as expandCapMethods, m as createDeviceProxy, p as isDeviceScopedCap, s as asString, t as sleep, u as parseJsonUnknown, vt as BaseAddon, x as viewerUiCapability, yt as normalizeAddonInitResult } from "./sleep-bm0x6zZF.mjs";
3
3
  import { t as errMsg } from "./err-msg-IQTHeDzc.mjs";
4
4
  //#region src/generated/cap-input-defaults.ts
5
5
  /**
@@ -15,7 +15,7 @@ import { t as errMsg } from "./err-msg-IQTHeDzc.mjs";
15
15
  * Plain data, zero Zod: a forked runner must not import the schema barrel
16
16
  * (~144MB RSS per runner — D28).
17
17
  *
18
- * Coverage: 24 caps, 53 methods with defaults.
18
+ * Coverage: 24 caps, 54 methods with defaults.
19
19
  */
20
20
  var CAP_INPUT_DEFAULTS = Object.freeze({
21
21
  "addons": { "getLogs": { "limit": 100 } },
@@ -235,7 +235,10 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
235
235
  "createApiKey": { "isAdmin": false },
236
236
  "createUser": { "isAdmin": false }
237
237
  },
238
- "vector-store": { "declareIndex": { "metric": "cosine" } },
238
+ "vector-store": {
239
+ "declareIndex": { "metric": "cosine" },
240
+ "scan": { "cursor": 0 }
241
+ },
239
242
  "zones": {
240
243
  "addZone": { "zone": { "__nested__": {
241
244
  "kind": "polygon",
@@ -982,6 +982,15 @@ export declare const deviceManagerCapability: {
982
982
  * calls are sync. Bindings change rarely (only on wrapper toggle or
983
983
  * device add/remove) — clients invalidate via the
984
984
  * `capability.binding-changed` event.
985
+ *
986
+ * "A single round-trip" describes the CLIENT's side and used not to
987
+ * describe the server's: until 2026-08-30 the resolver read the persisted
988
+ * wrapper activations once per device, so answering this cost one
989
+ * settings-door RPC per device — 1 020 on the live 1 019-device hub, and
990
+ * it did not return in 240 s against `SystemMirror.init`'s 15 s budget.
991
+ * The server side is now two reads for the whole fleet. Anything PERIODIC
992
+ * still belongs on `getBindings` / `getBindingsBatch` (D12); this remains
993
+ * a warm seed.
985
994
  */
986
995
  readonly getAllBindings: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{}, z.core.$strip>, z.ZodArray<z.ZodObject<{
987
996
  deviceId: z.ZodNumber;
@@ -2421,6 +2421,7 @@ export declare const pipelineAnalyticsCapability: {
2421
2421
  filesMoved: z.ZodNumber;
2422
2422
  bytesMoved: z.ZodNumber;
2423
2423
  filesTotal: z.ZodNullable<z.ZodNumber>;
2424
+ rowsReconciled: z.ZodOptional<z.ZodNumber>;
2424
2425
  startedAt: z.ZodNumber;
2425
2426
  finishedAt: z.ZodNullable<z.ZodNumber>;
2426
2427
  error: z.ZodNullable<z.ZodString>;
@@ -2458,12 +2459,51 @@ export declare const pipelineAnalyticsCapability: {
2458
2459
  * happens to stamp it. This count is what the migration planner's
2459
2460
  * non-blocking gate reads; `relocateMedia({ mode: 'seal' })` is what drives
2460
2461
  * it to zero.
2462
+ *
2463
+ * TWO indexed statements per collection, not a walk. It used to page the
2464
+ * whole collection at 200 rows per RPC ordered by an unindexed column, so
2465
+ * on the live hub — 1 254 576 rows — it hit the 60 s RPC deadline every
2466
+ * time it was called, and the migration it gates could never start. The
2467
+ * cheap question (`present`: is there at least one) is asked first and
2468
+ * separately from the expensive one (`rows`), because only the first has
2469
+ * to be answerable for the gate to do its job.
2470
+ *
2471
+ * **`null` is "not measurable", never zero** — at either level. An
2472
+ * unreadable collection must not read as a sealed one.
2461
2473
  */
2462
- readonly countUnstampedEventMedia: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
2463
- media: z.ZodNumber;
2464
- retrainFrames: z.ZodNumber;
2465
- total: z.ZodNumber;
2466
- }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
2474
+ readonly countUnstampedEventMedia: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{}, z.core.$strip>, z.ZodNullable<z.ZodObject<{
2475
+ media: z.ZodObject<{
2476
+ present: z.ZodBoolean;
2477
+ rows: z.ZodNullable<z.ZodNumber>;
2478
+ }, z.core.$strip>;
2479
+ retrainFrames: z.ZodObject<{
2480
+ present: z.ZodBoolean;
2481
+ rows: z.ZodNullable<z.ZodNumber>;
2482
+ }, z.core.$strip>;
2483
+ anyPresent: z.ZodBoolean;
2484
+ total: z.ZodNullable<z.ZodNumber>;
2485
+ }, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
2486
+ /**
2487
+ * How many rows a pass would STILL act on against `toLocationId`.
2488
+ *
2489
+ * One derivation, two consumers: it is the media lane's denominator (the
2490
+ * **M** the footage lane gets from the ledger census — D295) and it is the
2491
+ * residue behind "drain remaining". Deriving them separately is how "N of M"
2492
+ * ends up comparing two different populations.
2493
+ *
2494
+ * `null` means the count could not be taken; it is never zero-filled,
2495
+ * because a zero here reads as "nothing left to move".
2496
+ */
2497
+ readonly countRelocatableMedia: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
2498
+ toLocationId: z.ZodString;
2499
+ mode: z.ZodOptional<z.ZodEnum<{
2500
+ move: "move";
2501
+ seal: "seal";
2502
+ gallery: "gallery";
2503
+ }>>;
2504
+ }, z.core.$strip>, z.ZodNullable<z.ZodObject<{
2505
+ rows: z.ZodNumber;
2506
+ }, z.core.$strip>>, "query">;
2467
2507
  /** Every relocate job this addon knows about, newest first (in RAM: the
2468
2508
  * move is resumable, so a lost list costs nothing but the display). */
2469
2509
  readonly listRelocateMediaJobs: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{}, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
@@ -2482,6 +2522,7 @@ export declare const pipelineAnalyticsCapability: {
2482
2522
  filesMoved: z.ZodNumber;
2483
2523
  bytesMoved: z.ZodNumber;
2484
2524
  filesTotal: z.ZodNullable<z.ZodNumber>;
2525
+ rowsReconciled: z.ZodOptional<z.ZodNumber>;
2485
2526
  startedAt: z.ZodNumber;
2486
2527
  finishedAt: z.ZodNullable<z.ZodNumber>;
2487
2528
  error: z.ZodNullable<z.ZodString>;
@@ -665,6 +665,7 @@ export declare const recordingCapability: {
665
665
  filesMoved: z.ZodNumber;
666
666
  bytesMoved: z.ZodNumber;
667
667
  filesTotal: z.ZodNullable<z.ZodNumber>;
668
+ rowsReconciled: z.ZodOptional<z.ZodNumber>;
668
669
  startedAt: z.ZodNumber;
669
670
  finishedAt: z.ZodNullable<z.ZodNumber>;
670
671
  error: z.ZodNullable<z.ZodString>;
@@ -714,10 +715,31 @@ export declare const recordingCapability: {
714
715
  filesMoved: z.ZodNumber;
715
716
  bytesMoved: z.ZodNumber;
716
717
  filesTotal: z.ZodNullable<z.ZodNumber>;
718
+ rowsReconciled: z.ZodOptional<z.ZodNumber>;
717
719
  startedAt: z.ZodNumber;
718
720
  finishedAt: z.ZodNullable<z.ZodNumber>;
719
721
  error: z.ZodNullable<z.ZodString>;
720
722
  }, z.core.$strip>>>, "query">;
723
+ /**
724
+ * What a location STILL holds, asked of the durable hour ledger.
725
+ *
726
+ * The number behind "drain remaining": segments and bytes that would still
727
+ * have to move off `fromLocationId`. It is a ledger aggregate — the archive
728
+ * — because the resident index is not the archive (D295), and a drain sized
729
+ * off the index is exactly what reported `done` over 80.3 GB on 2026-08-29.
730
+ * `null` means the archive could not be asked (no ledger on this node, or
731
+ * the aggregate failed) and is never conflated with an empty source.
732
+ */
733
+ readonly getRelocateResidue: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
734
+ fromLocationId: z.ZodString;
735
+ footageClass: z.ZodOptional<z.ZodEnum<{
736
+ recordings: "recordings";
737
+ recordingsLow: "recordingsLow";
738
+ }>>;
739
+ }, z.core.$strip>, z.ZodNullable<z.ZodObject<{
740
+ segments: z.ZodNumber;
741
+ bytes: z.ZodNumber;
742
+ }, z.core.$strip>>, "query">;
721
743
  /** Cancel a running or queued relocate job. A queued job never runs. */
722
744
  readonly cancelRelocateJob: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
723
745
  jobId: z.ZodString;
@@ -129,6 +129,14 @@ export declare const storageMigrationCapability: {
129
129
  cancelled: "cancelled";
130
130
  }>>;
131
131
  error: z.ZodNullable<z.ZodString>;
132
+ progress: z.ZodNullable<z.ZodObject<{
133
+ filesMoved: z.ZodNumber;
134
+ filesTotal: z.ZodNullable<z.ZodNumber>;
135
+ bytesMoved: z.ZodNumber;
136
+ rowsReconciled: z.ZodOptional<z.ZodNumber>;
137
+ startedAt: z.ZodNumber;
138
+ observedAt: z.ZodNumber;
139
+ }, z.core.$strip>>;
132
140
  }, z.core.$strip>>;
133
141
  pauseLeaseId: z.ZodNullable<z.ZodString>;
134
142
  pausedParticipants: z.ZodArray<z.ZodEnum<{
@@ -148,6 +156,83 @@ export declare const storageMigrationCapability: {
148
156
  }, z.core.$strip>, z.ZodObject<{
149
157
  cancelled: z.ZodBoolean;
150
158
  }, z.core.$strip>, "mutation">;
159
+ /**
160
+ * Every mover running RIGHT NOW, in both lanes, with its counters.
161
+ *
162
+ * `status` covers a migration's own moves — the coordinator folds their
163
+ * progress onto the durable job record it is already polling. This covers
164
+ * the other case, and it is not hypothetical: a drain armed straight against
165
+ * `recording.relocateFootage` (the only path that existed before
166
+ * {@link drain}) has no job to fold into and would otherwise be invisible.
167
+ */
168
+ readonly movers: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{}, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
169
+ lane: z.ZodEnum<{
170
+ media: "media";
171
+ footage: "footage";
172
+ }>;
173
+ job: z.ZodObject<{
174
+ jobId: z.ZodString;
175
+ state: z.ZodEnum<{
176
+ failed: "failed";
177
+ running: "running";
178
+ queued: "queued";
179
+ done: "done";
180
+ cancelled: "cancelled";
181
+ }>;
182
+ fromLocationId: z.ZodString;
183
+ toLocationId: z.ZodString;
184
+ deviceId: z.ZodNullable<z.ZodNumber>;
185
+ entities: z.ZodArray<z.ZodString>;
186
+ filesMoved: z.ZodNumber;
187
+ bytesMoved: z.ZodNumber;
188
+ filesTotal: z.ZodNullable<z.ZodNumber>;
189
+ rowsReconciled: z.ZodOptional<z.ZodNumber>;
190
+ startedAt: z.ZodNumber;
191
+ finishedAt: z.ZodNullable<z.ZodNumber>;
192
+ error: z.ZodNullable<z.ZodString>;
193
+ }, z.core.$strip>;
194
+ migrationJobId: z.ZodNullable<z.ZodString>;
195
+ observedAt: z.ZodNumber;
196
+ }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
197
+ /**
198
+ * What each class's SOURCE still holds, from the archive — never from the
199
+ * resident index (D295). Only classes with something left (or something
200
+ * unknown) are listed, so an empty list means there is nothing to drain and
201
+ * the UI has no honest button to offer.
202
+ */
203
+ readonly residue: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{}, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
204
+ storageClass: z.ZodEnum<{
205
+ recordings: "recordings";
206
+ recordingsLow: "recordingsLow";
207
+ eventMedia: "eventMedia";
208
+ backups: "backups";
209
+ galleryMedia: "galleryMedia";
210
+ }>;
211
+ fromLocationId: z.ZodString;
212
+ toLocationId: z.ZodString;
213
+ items: z.ZodNullable<z.ZodNumber>;
214
+ bytes: z.ZodNullable<z.ZodNumber>;
215
+ }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
216
+ /**
217
+ * Run the drain half alone, on a class whose default has ALREADY moved.
218
+ *
219
+ * It never repoints anything, which is what lets `start` keep refusing a
220
+ * destination that is already the default: the two verbs cannot be confused
221
+ * for one another, and no operator can re-repoint a migrated class through
222
+ * this door.
223
+ */
224
+ readonly drain: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
225
+ classes: z.ZodArray<z.ZodEnum<{
226
+ recordings: "recordings";
227
+ recordingsLow: "recordingsLow";
228
+ eventMedia: "eventMedia";
229
+ backups: "backups";
230
+ galleryMedia: "galleryMedia";
231
+ }>>;
232
+ throttleMbps: z.ZodOptional<z.ZodNumber>;
233
+ }, z.core.$strip>, z.ZodObject<{
234
+ jobId: z.ZodString;
235
+ }, z.core.$strip>, "mutation">;
151
236
  };
152
237
  };
153
238
  export type IStorageMigrationProvider = InferProvider<typeof storageMigrationCapability>;
@@ -131,6 +131,10 @@ export declare const storageCapability: {
131
131
  single: "single";
132
132
  multi: "multi";
133
133
  }>;
134
+ access: z.ZodOptional<z.ZodEnum<{
135
+ "local-path": "local-path";
136
+ "cap-mediated": "cap-mediated";
137
+ }>>;
134
138
  defaultsTo: z.ZodOptional<z.ZodString>;
135
139
  defaultRoot: z.ZodOptional<z.ZodEnum<{
136
140
  data: "data";
@@ -5,12 +5,38 @@ import { type InferProvider } from './capability-definition.js';
5
5
  *
6
6
  * ## Why this is a capability and not a helper
7
7
  *
8
- * Six stores in `addon-post-analysis` already hold vectors object CLIP, face,
9
- * plate, vehicle, identity, and the event store's derivativesand every one of
10
- * them keeps its vectors in a `JSON` settings-store column and ranks them by
11
- * brute-force cosine in JS. Measured on the live hub that costs ~11.7 KB per row
12
- * (512 floats as TEXT, `JSON.parse`d on every search) and made semantic search
13
- * load 5,000 rows before ranking anything.
8
+ * This capability was introduced with the claim that SIX stores in
9
+ * `addon-post-analysis` held vectors in a `JSON` settings-store columnobject
10
+ * CLIP, face, plate, vehicle, identity, and the event store's derivatives. That
11
+ * claim was never true, and leaving it here made five stores look like pending
12
+ * work when three of them have no vector at all. Counted column by column on
13
+ * 2026-08-30, exactly THREE ever held one:
14
+ *
15
+ * - `object-clip` — 512-dim CLIP image embedding, migrated 2026-08-06.
16
+ * - `faces.embedding` — 512-dim ArcFace face embedding, migrated 2026-08-30.
17
+ * - `identity-samples.embedding` — the same ArcFace vector for an ENROLLED
18
+ * face, migrated 2026-08-30 into its OWN index (see below).
19
+ *
20
+ * `plates` and `vehicle-samples` store a plate STRING and a score; `vehicles`
21
+ * and `identities` store a name; the event store stores no derivative vector.
22
+ * They are not migration candidates and never were.
23
+ *
24
+ * Measured on the live hub the JSON encoding cost ~11.7 KB per row (512 floats
25
+ * as TEXT, `JSON.parse`d on every search) and made semantic search load 5,000
26
+ * rows before ranking anything.
27
+ *
28
+ * ## One index per COMPARISON, never per encoder
29
+ *
30
+ * `faces` and `identity-samples` hold the same 512 ArcFace dims from the same
31
+ * model, and they still get two indexes. An index is a set of things that are
32
+ * ranked against each other and that live and die together, and these two are
33
+ * neither: a `faces` row is TRACK-OWNED and cascades away with its track under
34
+ * a per-camera capacity cap, an `identity-samples` row is retention-EXEMPT
35
+ * forever and is the gallery every recognition ranks against. One index would
36
+ * mean every gallery load and every reconcile carried a filter whose failure
37
+ * mode is either ranking a candidate against itself or reclaiming an enrolled
38
+ * person's only sample. The dimension they share is not a reason to share an
39
+ * index; the question they answer is, and it differs.
14
40
  *
15
41
  * The fix is not a faster loop, it is a different backend — and the backend
16
42
  * should be replaceable without touching six callers. So: a singleton
@@ -114,6 +140,7 @@ export declare const VectorQueryResultSchema: z.ZodObject<{
114
140
  }, z.core.$strip>>;
115
141
  scanned: z.ZodNumber;
116
142
  truncated: z.ZodBoolean;
143
+ effectiveTopK: z.ZodNumber;
117
144
  }, z.core.$strip>;
118
145
  export declare const VectorDeleteInputSchema: z.ZodObject<{
119
146
  index: z.ZodString;
@@ -149,6 +176,62 @@ export declare const VectorGetResultSchema: z.ZodObject<{
149
176
  metadata: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
150
177
  }, z.core.$strip>>;
151
178
  }, z.core.$strip>;
179
+ /**
180
+ * Ids to read back WITH their vectors.
181
+ *
182
+ * The sibling of {@link VectorGetResultSchema}, and deliberately a separate
183
+ * method rather than a flag on it: `getByIds` promises no vectors and its one
184
+ * caller depends on that promise. This one promises the opposite.
185
+ *
186
+ * It exists because a store cannot put its vectors here otherwise. An ArcFace
187
+ * gallery is ranked IN PROCESS, per detection, against every enrolled sample —
188
+ * a per-face cross-process KNN would be a network round trip inside the
189
+ * recognition loop. So the gallery is loaded once and held in RAM, and loading
190
+ * it requires the index to hand the floats back. Without this method the only
191
+ * way to keep a readable vector is a JSON column, which is the thing this
192
+ * capability exists to delete.
193
+ *
194
+ * BOUNDED BY THE CALLER: ids are named, never "everything". Enumerating an
195
+ * index is {@link VectorScanInputSchema}'s job, and it returns no vectors.
196
+ */
197
+ export declare const VectorFetchInputSchema: z.ZodObject<{
198
+ index: z.ZodString;
199
+ ids: z.ZodArray<z.ZodString>;
200
+ }, z.core.$strip>;
201
+ export declare const VectorFetchResultSchema: z.ZodObject<{
202
+ items: z.ZodArray<z.ZodObject<{
203
+ id: z.ZodString;
204
+ vector: z.ZodString;
205
+ metadata: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
206
+ }, z.core.$strip>>;
207
+ }, z.core.$strip>;
208
+ /**
209
+ * ENUMERATE an index: one page of rows in a stable order, no ranking.
210
+ *
211
+ * A reconcile does not want the nearest rows, it wants ALL of them, and asking
212
+ * a KNN for "all" is the wrong question twice over. It hits the backend's `k`
213
+ * ceiling — 4,096 on sqlite-vec against a 22,128-row index — and it needs a
214
+ * probe vector it does not have, so the audit passed a ZERO vector whose cosine
215
+ * distance to every row is degenerate. `examined: 4096` then read as "we
216
+ * looked" for as long as anyone cared to read it.
217
+ *
218
+ * This is the primitive that question actually needs: a bounded page, ordered
219
+ * by the backend's own row order, costing no distance computation at all.
220
+ * Vectors are NOT returned — an enumeration that shipped 2 KB per row would be
221
+ * the full-table read this capability was built to stop.
222
+ */
223
+ export declare const VectorScanInputSchema: z.ZodObject<{
224
+ index: z.ZodString;
225
+ cursor: z.ZodDefault<z.ZodNumber>;
226
+ limit: z.ZodNumber;
227
+ }, z.core.$strip>;
228
+ export declare const VectorScanResultSchema: z.ZodObject<{
229
+ items: z.ZodArray<z.ZodObject<{
230
+ id: z.ZodString;
231
+ metadata: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
232
+ }, z.core.$strip>>;
233
+ nextCursor: z.ZodNullable<z.ZodNumber>;
234
+ }, z.core.$strip>;
152
235
  export declare const VectorStatsInputSchema: z.ZodObject<{
153
236
  index: z.ZodString;
154
237
  }, z.core.$strip>;
@@ -216,6 +299,7 @@ export declare const vectorStoreCapability: {
216
299
  }, z.core.$strip>>;
217
300
  scanned: z.ZodNumber;
218
301
  truncated: z.ZodBoolean;
302
+ effectiveTopK: z.ZodNumber;
219
303
  }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
220
304
  /** Metadata by id, no vectors — see {@link VectorGetResultSchema}. */
221
305
  readonly getByIds: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
@@ -227,6 +311,29 @@ export declare const vectorStoreCapability: {
227
311
  metadata: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
228
312
  }, z.core.$strip>>;
229
313
  }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
314
+ /** Metadata AND vectors, by named id — see {@link VectorFetchInputSchema}. */
315
+ readonly fetchByIds: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
316
+ index: z.ZodString;
317
+ ids: z.ZodArray<z.ZodString>;
318
+ }, z.core.$strip>, z.ZodObject<{
319
+ items: z.ZodArray<z.ZodObject<{
320
+ id: z.ZodString;
321
+ vector: z.ZodString;
322
+ metadata: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
323
+ }, z.core.$strip>>;
324
+ }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
325
+ /** One page of the whole index, unranked — see {@link VectorScanInputSchema}. */
326
+ readonly scan: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
327
+ index: z.ZodString;
328
+ cursor: z.ZodDefault<z.ZodNumber>;
329
+ limit: z.ZodNumber;
330
+ }, z.core.$strip>, z.ZodObject<{
331
+ items: z.ZodArray<z.ZodObject<{
332
+ id: z.ZodString;
333
+ metadata: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
334
+ }, z.core.$strip>>;
335
+ nextCursor: z.ZodNullable<z.ZodNumber>;
336
+ }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
230
337
  readonly deleteByIds: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
231
338
  index: z.ZodString;
232
339
  ids: z.ZodArray<z.ZodString>;
@@ -57,6 +57,13 @@ export interface SystemMirrorApi extends SliceHandleApi {
57
57
  /**
58
58
  * Whole-fleet binding dump. WARM BOOT ONLY — 903 ms and 373 KB on a
59
59
  * 524-device hub. Anything on the event path uses `getBindings`.
60
+ *
61
+ * `init` gives this 15 s, and on 2026-08-30 it took longer than 240 s on a
62
+ * 1 019-device hub: the server-side resolver read the wrapper-activation
63
+ * blob once PER DEVICE, so answering cost 1 020 settings-door RPCs. Fixed
64
+ * in `device-bindings-store.ts` (two reads for the whole fleet). Worth
65
+ * knowing here because the symptom is always this timeout, and the cause
66
+ * is never in this file.
60
67
  */
61
68
  readonly getAllBindings: {
62
69
  query(input: Record<string, never>): Promise<ReadonlyArray<DeviceBinding>>;
@@ -5128,6 +5128,13 @@ export type AppRouter = TrpcCoreRouter<{
5128
5128
  output: z.infer<typeof pipelineAnalyticsCapability.methods.countUnstampedEventMedia.output>;
5129
5129
  meta: object;
5130
5130
  }>;
5131
+ countRelocatableMedia: TRPCQueryProcedure<{
5132
+ input: {
5133
+ [x: string]: unknown;
5134
+ } & z.input<typeof pipelineAnalyticsCapability.methods.countRelocatableMedia.input>;
5135
+ output: z.infer<typeof pipelineAnalyticsCapability.methods.countRelocatableMedia.output>;
5136
+ meta: object;
5137
+ }>;
5131
5138
  listRelocateMediaJobs: TRPCQueryProcedure<{
5132
5139
  input: {
5133
5140
  [x: string]: unknown;
@@ -6578,6 +6585,13 @@ export type AppRouter = TrpcCoreRouter<{
6578
6585
  output: z.infer<typeof recordingCapability.methods.listRelocateJobs.output>;
6579
6586
  meta: object;
6580
6587
  }>;
6588
+ getRelocateResidue: TRPCQueryProcedure<{
6589
+ input: {
6590
+ [x: string]: unknown;
6591
+ } & z.input<typeof recordingCapability.methods.getRelocateResidue.input>;
6592
+ output: z.infer<typeof recordingCapability.methods.getRelocateResidue.output>;
6593
+ meta: object;
6594
+ }>;
6581
6595
  cancelRelocateJob: TRPCMutationProcedure<{
6582
6596
  input: {
6583
6597
  [x: string]: unknown;
@@ -7252,6 +7266,27 @@ export type AppRouter = TrpcCoreRouter<{
7252
7266
  output: z.infer<typeof storageMigrationCapability.methods.cancel.output>;
7253
7267
  meta: object;
7254
7268
  }>;
7269
+ movers: TRPCQueryProcedure<{
7270
+ input: {
7271
+ [x: string]: unknown;
7272
+ } & z.input<typeof storageMigrationCapability.methods.movers.input>;
7273
+ output: z.infer<typeof storageMigrationCapability.methods.movers.output>;
7274
+ meta: object;
7275
+ }>;
7276
+ residue: TRPCQueryProcedure<{
7277
+ input: {
7278
+ [x: string]: unknown;
7279
+ } & z.input<typeof storageMigrationCapability.methods.residue.input>;
7280
+ output: z.infer<typeof storageMigrationCapability.methods.residue.output>;
7281
+ meta: object;
7282
+ }>;
7283
+ drain: TRPCMutationProcedure<{
7284
+ input: {
7285
+ [x: string]: unknown;
7286
+ } & z.input<typeof storageMigrationCapability.methods.drain.input>;
7287
+ output: z.infer<typeof storageMigrationCapability.methods.drain.output>;
7288
+ meta: object;
7289
+ }>;
7255
7290
  }>>;
7256
7291
  storageProvider: TRPCBuiltRouter<{
7257
7292
  ctx: TrpcContext;
@@ -8403,6 +8438,20 @@ export type AppRouter = TrpcCoreRouter<{
8403
8438
  output: z.infer<typeof vectorStoreCapability.methods.getByIds.output>;
8404
8439
  meta: object;
8405
8440
  }>;
8441
+ fetchByIds: TRPCQueryProcedure<{
8442
+ input: {
8443
+ [x: string]: unknown;
8444
+ } & z.input<typeof vectorStoreCapability.methods.fetchByIds.input>;
8445
+ output: z.infer<typeof vectorStoreCapability.methods.fetchByIds.output>;
8446
+ meta: object;
8447
+ }>;
8448
+ scan: TRPCQueryProcedure<{
8449
+ input: {
8450
+ [x: string]: unknown;
8451
+ } & z.input<typeof vectorStoreCapability.methods.scan.input>;
8452
+ output: z.infer<typeof vectorStoreCapability.methods.scan.output>;
8453
+ meta: object;
8454
+ }>;
8406
8455
  deleteByIds: TRPCMutationProcedure<{
8407
8456
  input: {
8408
8457
  [x: string]: unknown;
@@ -11,7 +11,7 @@
11
11
  * Plain data, zero Zod: a forked runner must not import the schema barrel
12
12
  * (~144MB RSS per runner — D28).
13
13
  *
14
- * Coverage: 24 caps, 53 methods with defaults.
14
+ * Coverage: 24 caps, 54 methods with defaults.
15
15
  */
16
16
  export declare const CAP_INPUT_DEFAULTS: Readonly<Record<string, Readonly<Record<string, Readonly<Record<string, unknown>>>>>>;
17
17
  /**
@@ -6,7 +6,7 @@
6
6
  * scope+access check inside `protectedProcedure` (see
7
7
  * `server/backend/src/api/trpc/trpc.middleware.ts`).
8
8
  *
9
- * Coverage: 979 method paths across 126 capabilities.
9
+ * Coverage: 986 method paths across 126 capabilities.
10
10
  */
11
11
  import type { CapabilityMethodAccess } from '../capabilities/capability-definition.js';
12
12
  export interface MethodAccessRecord {
@@ -87,12 +87,12 @@ export interface SystemProxy {
87
87
  readonly pipelineOrchestrator: Pick<InferProvider<typeof pipelineOrchestratorCapability>, 'pauseForStorageMigration' | 'resumeForStorageMigration' | 'rebalance' | 'getPipelineAssignments' | 'getAgentLoad' | 'getGlobalMetrics' | 'getCapabilityBindings' | 'setCapabilityBinding' | 'getIngestOwner' | 'getAudioNodeLoad' | 'getAgentSettings' | 'listAgentSettings' | 'removeAgentSettings' | 'setAgentMaxCameras' | 'setAgentDetectWeight' | 'setAgentCapabilities' | 'setAgentReachableHost' | 'setAgentInferenceDevices' | 'getNodeInferenceDevices' | 'resetNodePipelineDefaults' | 'getCameraStatuses' | 'reconcileFromDisk' | 'getReconcileFromDiskStatus' | 'listTemplates' | 'saveTemplate' | 'updateTemplate' | 'deleteTemplate'>;
88
88
  readonly pipelineRunner: Pick<InferProvider<typeof pipelineRunnerCapability>, 'attachCamera' | 'reportMotion' | 'getLocalLoad' | 'getLocalMetrics' | 'getAllCameraMetrics' | 'getLocalCameras' | 'getNativeCrop' | 'runStatelessStep'>;
89
89
  readonly plateGallery: Pick<InferProvider<typeof plateGalleryCapability>, 'getPlateMedia' | 'searchPlates' | 'suggestPlateClusters' | 'correctPlateText' | 'deletePlate' | 'listVehicles' | 'createVehicle' | 'renameVehicle' | 'deleteVehicle' | 'listVehicleSamples' | 'removeVehicleSample' | 'assignPlate' | 'unassignPlate' | 'assignPlates' | 'unassignPlates'>;
90
- readonly recording: Pick<InferProvider<typeof recordingCapability>, 'getStorageUsage' | 'listOpsLog' | 'pauseForStorageMigration' | 'resumeForStorageMigration' | 'refreshStorageLocationsForMigration' | 'startStorageMigrationMove' | 'getStorageMigrationMoveStatus' | 'cancelStorageMigrationMove' | 'relocateFootage' | 'listRelocateJobs' | 'cancelRelocateJob' | 'planStorageRebalance' | 'startStorageRebalance'>;
90
+ readonly recording: Pick<InferProvider<typeof recordingCapability>, 'getStorageUsage' | 'listOpsLog' | 'pauseForStorageMigration' | 'resumeForStorageMigration' | 'refreshStorageLocationsForMigration' | 'startStorageMigrationMove' | 'getStorageMigrationMoveStatus' | 'cancelStorageMigrationMove' | 'relocateFootage' | 'listRelocateJobs' | 'getRelocateResidue' | 'cancelRelocateJob' | 'planStorageRebalance' | 'startStorageRebalance'>;
91
91
  readonly recordingExport: Pick<InferProvider<typeof recordingExportCapability>, 'createExport' | 'getExport' | 'cancelExport' | 'deleteExport' | 'getDownloadUrl' | 'readExportBytes'>;
92
92
  readonly serverManagement: Pick<InferProvider<typeof serverManagementCapability>, 'getServerPackageStatus' | 'checkServerUpdate' | 'applyServerUpdate' | 'rollbackServerUpdate' | 'restartServer'>;
93
93
  readonly settingsStore: Pick<InferProvider<typeof settingsStoreCapability>, 'get' | 'set' | 'query' | 'insert' | 'insertMany' | 'update' | 'delete' | 'deleteWhere' | 'updateWhere' | 'count' | 'aggregate' | 'histogram' | 'isEmpty' | 'declareCollection'>;
94
94
  readonly storage: Pick<InferProvider<typeof storageCapability>, 'resolve' | 'write' | 'read' | 'exists' | 'list' | 'delete' | 'getAvailableSpace' | 'beginUpload' | 'writeChunk' | 'finalizeUpload' | 'abortUpload' | 'beginDownload' | 'readChunk' | 'endDownload' | 'listLocations' | 'getDefaultLocation' | 'listLocationDeclarations' | 'upsertLocation' | 'deleteLocation' | 'testLocation' | 'listProviders' | 'testConfig'>;
95
- readonly storageMigration: Pick<InferProvider<typeof storageMigrationCapability>, 'plan' | 'start' | 'status' | 'cancel'>;
95
+ readonly storageMigration: Pick<InferProvider<typeof storageMigrationCapability>, 'plan' | 'start' | 'status' | 'cancel' | 'movers' | 'residue' | 'drain'>;
96
96
  readonly streamBroker: Pick<InferProvider<typeof streamBrokerCapability>, 'fetchEventMedia' | 'listAllCameraStreams' | 'listAllProfileSlots' | 'getBrokerStats' | 'probeStream' | 'listClients' | 'killClient' | 'getStreamUrl' | 'getStreamWithCodec' | 'releaseStreamWithCodec' | 'acquireEgressTranscode' | 'releaseEgressTranscode' | 'subscribeAudioChunks' | 'pullAudioChunks' | 'unsubscribeAudioChunks' | 'subscribeFrames' | 'pullFrameHandles' | 'unsubscribeFrames' | 'setPreBufferDuration' | 'getPreBufferInfo' | 'getRtspPort' | 'getAllRtspEntries' | 'getRtspEntry' | 'regenerateRtspToken' | 'setRtspEnabled' | 'isRtspEnabled'>;
97
97
  readonly system: Pick<InferProvider<typeof systemCapability>, 'info' | 'health' | 'featureFlags' | 'networkAddresses' | 'getRetentionConfig' | 'setRetentionConfig' | 'forceRetentionCleanup' | 'getSiteLocation' | 'setSiteLocation' | 'detectSiteLocation' | 'getRequestCensus' | 'getLoadContributions' | 'getFailureContributions' | 'getLoggingSettings' | 'setLoggingSettings'>;
98
98
  readonly terminalSession: Pick<InferProvider<typeof terminalSessionCapability>, 'listProfiles' | 'listInstances' | 'createInstance' | 'updateInstance' | 'deleteInstance' | 'setInstanceEnabled' | 'listLegacyCameras' | 'adoptLegacyMonitor' | 'listSessions' | 'openSession' | 'resize' | 'pullOutput' | 'writeInput' | 'close'>;
package/dist/index.d.ts CHANGED
@@ -38,6 +38,7 @@ export type * from './interfaces/config-port.js';
38
38
  export type * from './interfaces/config-ui.js';
39
39
  export type { HydratedFieldEntry } from './interfaces/config-ui.js';
40
40
  export { collectHydratedFieldEntries, collectHydratedFieldValues, hydrateSchema, resolveHydratedFieldValue, WELL_KNOWN_TAB_MAP, WELL_KNOWN_TABS, } from './interfaces/config-ui.js';
41
+ export { collectSecretConfigKeys, isSecretConfigField, REDACTED_SECRET, schemaDeclaresAnyField, } from './interfaces/config-ui-secrets.js';
41
42
  export type * from './interfaces/context.js';
42
43
  export type * from './interfaces/decoder.js';
43
44
  export type * from './interfaces/detection-addon.js';
@@ -92,8 +93,8 @@ export type * from './interfaces/server-network.js';
92
93
  export type * from './interfaces/storage.js';
93
94
  export type { StorageLocation, StorageLocationRef, } from './interfaces/storage-location.js';
94
95
  export { StorageLocationRefSchema, StorageLocationSchema, StorageLocationTypeSchema, } from './interfaces/storage-location.js';
95
- export type { StorageLocationDeclaration } from './interfaces/storage-location-declaration.js';
96
- export { StorageLocationDeclarationSchema } from './interfaces/storage-location-declaration.js';
96
+ export type { StorageAccess, StorageLocationDeclaration, } from './interfaces/storage-location-declaration.js';
97
+ export { STORAGE_ACCESS_FALLBACK, StorageAccessSchema, StorageLocationDeclarationSchema, } from './interfaces/storage-location-declaration.js';
97
98
  export * from './interfaces/stream-broker.js';
98
99
  export type * from './interfaces/task-handler.js';
99
100
  export type { Timezone, TimezoneDstRule, Weekday } from './interfaces/timezones.js';