@camstack/addon-pipeline 1.2.373 → 1.2.374

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 (35) hide show
  1. package/dist/audio-analyzer/index.js +3 -3
  2. package/dist/audio-analyzer/index.mjs +3 -3
  3. package/dist/{custom-model-catalog-UaaDgBow.mjs → custom-model-catalog-1LDuDw8S.mjs} +2 -2
  4. package/dist/{custom-model-catalog-M-ECFeNJ.js → custom-model-catalog-W0DHDhfo.js} +2 -2
  5. package/dist/detection-pipeline/index.js +4 -4
  6. package/dist/detection-pipeline/index.mjs +4 -4
  7. package/dist/{dist-QBVFmPYQ.js → dist-CBEUVjTS.js} +172 -24
  8. package/dist/{dist-BT3uSeR7.mjs → dist-CmdLCb_F.mjs} +167 -25
  9. package/dist/{model-catalogs-ChW0i2P6.mjs → model-catalogs-BnCdB2A3.mjs} +1 -1
  10. package/dist/{model-catalogs-C42Mo0jo.js → model-catalogs-D5YksA5A.js} +1 -1
  11. package/dist/motion-wasm/index.js +1 -1
  12. package/dist/motion-wasm/index.mjs +1 -1
  13. package/dist/{node-BVRFl1hZ.mjs → node-C3r8kiOo.mjs} +1 -1
  14. package/dist/{node-B6ev-Hqa.js → node-DMgi6pND.js} +1 -1
  15. package/dist/pipeline-runner/index.js +3 -3
  16. package/dist/pipeline-runner/index.mjs +3 -3
  17. package/dist/{process-memory-Cdf2A2qg.js → process-memory-GFR7fxpJ.js} +1 -1
  18. package/dist/{process-memory-DdeedEgU.mjs → process-memory-X0ws1SGJ.mjs} +1 -1
  19. package/dist/recorder/index.js +251 -94
  20. package/dist/recorder/index.mjs +249 -92
  21. package/dist/{segment-demux-js-Dp0OI-2n.js → segment-demux-js-CSQVhbFI.js} +1 -1
  22. package/dist/{segment-demux-js-8CfbEFeD.mjs → segment-demux-js-IKEO1XBz.mjs} +1 -1
  23. package/dist/stream-broker/_stub.js +2 -2
  24. package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-Dl3wrJnM.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-DPFTlVoW.mjs} +2 -2
  25. package/dist/stream-broker/{_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-C3ssSNKh.mjs → _virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-B7wsxLrK.mjs} +1 -1
  26. package/dist/stream-broker/{_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-BFRtKBOe.mjs → _virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-BohOb2Cl.mjs} +1 -1
  27. package/dist/stream-broker/demux-worker-child.js +1 -1
  28. package/dist/stream-broker/demux-worker-child.mjs +1 -1
  29. package/dist/stream-broker/{hostInit-Bq36nWMP.mjs → hostInit-BOp1_Hhk.mjs} +2 -2
  30. package/dist/stream-broker/index.js +683 -265
  31. package/dist/stream-broker/index.mjs +683 -265
  32. package/dist/stream-broker/remoteEntry.js +1 -1
  33. package/package.json +5 -1
  34. package/dist/retire-root-keys-Csb8z2f3.js +0 -338
  35. package/dist/retire-root-keys-DZvlso2l.mjs +0 -327
@@ -1,4 +1,4 @@
1
- import { Hn as hfModelUrl } from "./dist-BT3uSeR7.mjs";
1
+ import { Hn as hfModelUrl } from "./dist-CmdLCb_F.mjs";
2
2
  //#region src/detection-pipeline/registry/model-licenses.ts
3
3
  var COCO_DATA = {
4
4
  name: "COCO 2017",
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-QBVFmPYQ.js");
1
+ const require_dist = require("./dist-CBEUVjTS.js");
2
2
  //#region src/detection-pipeline/registry/model-licenses.ts
3
3
  var COCO_DATA = {
4
4
  name: "COCO 2017",
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-QBVFmPYQ.js");
5
+ const require_dist = require("../dist-CBEUVjTS.js");
6
6
  const require_lazy_sharp = require("../lazy-sharp-BuwKlQLR.js");
7
7
  let node_fs = require("node:fs");
8
8
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { Mn as BaseAddon, St as evaluateZoneRules, Un as hydrateSchema, Wt as motionDetectionCapability, kn as DeviceType } from "../dist-BT3uSeR7.mjs";
1
+ import { Mn as BaseAddon, St as evaluateZoneRules, Un as hydrateSchema, Wt as motionDetectionCapability, kn as DeviceType } from "../dist-CmdLCb_F.mjs";
2
2
  import { t as getSharp } from "../lazy-sharp-DXsqwpph.mjs";
3
3
  import { readFileSync } from "node:fs";
4
4
  import { join } from "node:path";
@@ -1,4 +1,4 @@
1
- import { An as errMsg, Cn as Fmp4BoxSplitter, Dn as isSoftwareDecode, wn as buildFfmpegArgs } from "./dist-BT3uSeR7.mjs";
1
+ import { An as errMsg, Cn as Fmp4BoxSplitter, Dn as isSoftwareDecode, wn as buildFfmpegArgs } from "./dist-CmdLCb_F.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { realpathSync } from "node:fs";
4
4
  import path from "node:path";
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-emK7D4bc.js");
2
- const require_dist = require("./dist-QBVFmPYQ.js");
2
+ const require_dist = require("./dist-CBEUVjTS.js");
3
3
  require("node:os");
4
4
  let node_crypto = require("node:crypto");
5
5
  let node_fs = require("node:fs");
@@ -3,9 +3,9 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../chunk-emK7D4bc.js");
6
- const require_dist = require("../dist-QBVFmPYQ.js");
7
- const require_node = require("../node-B6ev-Hqa.js");
8
- const require_custom_model_catalog = require("../custom-model-catalog-M-ECFeNJ.js");
6
+ const require_dist = require("../dist-CBEUVjTS.js");
7
+ const require_node = require("../node-DMgi6pND.js");
8
+ const require_custom_model_catalog = require("../custom-model-catalog-W0DHDhfo.js");
9
9
  const require_hub_hostname = require("../hub-hostname-DAJXlOgV.js");
10
10
  const require_lazy_sharp = require("../lazy-sharp-BuwKlQLR.js");
11
11
  const require_restream_intent = require("../restream-intent-7uDNqMKs.js");
@@ -1,6 +1,6 @@
1
- import { $n as _enum, A as NativeLeaseAdmissionSchema, An as errMsg, Bn as defineCustomActions, E as FailureCounters, Et as failureContributionCapability, Ft as loadContributionCapability, In as MODEL_FORMATS, Jn as nodePin, Jt as pickDetailCropConvention, M as NodeBenchRunnerInputSchema, Mn as BaseAddon, P as PIPELINE_RAMP, Pt as linkedStepOf, Rn as createEvent, V as ROOT_SUPPLIABLE_STEP_IDS, Y as allowedSuppliedEffect, Yt as pickNativeLeaseOverride, Zt as pipelineRunnerCapability, _ as DEFAULT_DETAIL_CROP_CONVENTION, a as BackgroundRunRegistry, ar as number, dn as rootSuppliesOf, dr as EventCategory, er as array, gt as deriveRootFaceRefineRect, ir as literal, j as NativeLeaseSettingsSchema, lr as string, m as CROP_SUPPLY_SOURCES, mt as deriveDetailCropRect, nt as buildBenchStepTree, or as object, rr as lazy, rt as cameraOwnsMotionViaSensor, sn as resolveModelBoundSetting, tr as boolean, un as resolveRootSupply, x as DEVICE_RAMP, y as DEFAULT_NATIVE_LEASE_SETTINGS, zn as customAction } from "../dist-BT3uSeR7.mjs";
2
- import { i as NO_COST_CLAIM, t as ChildCostRegistry } from "../node-BVRFl1hZ.mjs";
3
- import { a as stepsForElectedPool, b as getStepDefinition, d as rootObjectGate, f as localFrameRegistry, h as resolveFrameViewGeometry, i as placeDetailStep, l as resolveDefaultDetectionModel, m as createSessionDecodeCoordinator, p as isSessionDecodeReadGone, s as resolveDeviceEngine, t as CustomModelCatalog, u as macroGateVerdict, y as getStep } from "../custom-model-catalog-UaaDgBow.mjs";
1
+ import { A as NativeLeaseAdmissionSchema, An as errMsg, Bn as defineCustomActions, E as FailureCounters, Et as failureContributionCapability, Ft as loadContributionCapability, In as MODEL_FORMATS, Jt as pickDetailCropConvention, M as NodeBenchRunnerInputSchema, Mn as BaseAddon, P as PIPELINE_RAMP, Pt as linkedStepOf, Rn as createEvent, V as ROOT_SUPPLIABLE_STEP_IDS, Y as allowedSuppliedEffect, Yn as nodePin, Yt as pickNativeLeaseOverride, Zt as pipelineRunnerCapability, _ as DEFAULT_DETAIL_CROP_CONVENTION, a as BackgroundRunRegistry, ar as literal, dn as rootSuppliesOf, er as _enum, fr as EventCategory, gt as deriveRootFaceRefineRect, ir as lazy, j as NativeLeaseSettingsSchema, m as CROP_SUPPLY_SOURCES, mt as deriveDetailCropRect, nr as boolean, nt as buildBenchStepTree, or as number, rt as cameraOwnsMotionViaSensor, sn as resolveModelBoundSetting, sr as object, tr as array, un as resolveRootSupply, ur as string, x as DEVICE_RAMP, y as DEFAULT_NATIVE_LEASE_SETTINGS, zn as customAction } from "../dist-CmdLCb_F.mjs";
2
+ import { i as NO_COST_CLAIM, t as ChildCostRegistry } from "../node-C3r8kiOo.mjs";
3
+ import { a as stepsForElectedPool, b as getStepDefinition, d as rootObjectGate, f as localFrameRegistry, h as resolveFrameViewGeometry, i as placeDetailStep, l as resolveDefaultDetectionModel, m as createSessionDecodeCoordinator, p as isSessionDecodeReadGone, s as resolveDeviceEngine, t as CustomModelCatalog, u as macroGateVerdict, y as getStep } from "../custom-model-catalog-1LDuDw8S.mjs";
4
4
  import { t as resolveHubHostname } from "../hub-hostname-cCknRYKj.mjs";
5
5
  import { t as getSharp } from "../lazy-sharp-DXsqwpph.mjs";
6
6
  import { c as withDetectionIntent, o as preRollRequestOf, t as DETECTION_PRE_ROLL_REQUEST_MS } from "../restream-intent-DyGmLAU9.mjs";
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-emK7D4bc.js");
2
- const require_dist = require("./dist-QBVFmPYQ.js");
2
+ const require_dist = require("./dist-CBEUVjTS.js");
3
3
  let node_fs = require("node:fs");
4
4
  node_fs = require_chunk.__toESM(node_fs);
5
5
  let node_child_process = require("node:child_process");
@@ -1,4 +1,4 @@
1
- import { Kt as parseProcStatus } from "./dist-BT3uSeR7.mjs";
1
+ import { Kt as parseProcStatus } from "./dist-CmdLCb_F.mjs";
2
2
  import * as fs from "node:fs";
3
3
  import { execFile } from "node:child_process";
4
4
  //#region src/shared/node-topology-platform.ts
@@ -3,11 +3,10 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../chunk-emK7D4bc.js");
6
- const require_dist = require("../dist-QBVFmPYQ.js");
7
- const require_node = require("../node-B6ev-Hqa.js");
6
+ const require_dist = require("../dist-CBEUVjTS.js");
7
+ const require_node = require("../node-DMgi6pND.js");
8
8
  const require_hub_hostname = require("../hub-hostname-DAJXlOgV.js");
9
9
  const require_restream_intent = require("../restream-intent-7uDNqMKs.js");
10
- const require_retire_root_keys = require("../retire-root-keys-Csb8z2f3.js");
11
10
  let node_crypto = require("node:crypto");
12
11
  let node_fs = require("node:fs");
13
12
  let node_path = require("node:path");
@@ -5054,12 +5053,8 @@ var DeviceSettingsConfigsState = class {
5054
5053
  }
5055
5054
  async readAllRaw() {
5056
5055
  const out = /* @__PURE__ */ new Map();
5057
- const list = this.deps.settings.listDeviceStoreIds;
5058
- const fallback = this.deps.listDeviceIds;
5059
- if (list === void 0 && fallback === void 0) throw new Error("the per-device settings cannot list their devices on this view");
5060
- const ids = list !== void 0 ? await list.call(this.deps.settings) : fallback !== void 0 ? await fallback() : [];
5061
- const batch = this.deps.settings.readDeviceStoreBatch;
5062
- const blobs = batch === void 0 ? new Map(await Promise.all(ids.map(async (id) => [id, await this.deps.settings.readDeviceStore(id)]))) : await batch.call(this.deps.settings, ids);
5056
+ const ids = await this.deps.settings.listDeviceStoreIds();
5057
+ const blobs = await this.deps.settings.readDeviceStoreBatch(ids);
5063
5058
  for (const [id, blob] of blobs) {
5064
5059
  const held = blob[RECORDING_CONFIG_KEY];
5065
5060
  if (held !== void 0) out.set(String(id), held);
@@ -8360,6 +8355,249 @@ function buildExportArgs(input) {
8360
8355
  outPath
8361
8356
  ];
8362
8357
  }
8358
+ var ROW_MAP_VALUE_COLUMN = "value";
8359
+ var RowMapStore = class RowMapStore {
8360
+ spec;
8361
+ store;
8362
+ logger;
8363
+ constructor(deps) {
8364
+ this.spec = deps.spec;
8365
+ this.store = deps.store;
8366
+ this.logger = deps.logger;
8367
+ }
8368
+ /** The collection this store owns — for the caller's own log lines. */
8369
+ get collection() {
8370
+ return this.spec.collection;
8371
+ }
8372
+ /**
8373
+ * Register the collection. MUST run at boot, before any read or write: the
8374
+ * SQLite backend answers 412 for an undeclared collection.
8375
+ */
8376
+ static declare(store, spec) {
8377
+ return store.declareCollection.mutate({
8378
+ collection: spec.collection,
8379
+ columns: [
8380
+ {
8381
+ name: "id",
8382
+ type: "TEXT",
8383
+ primaryKey: true,
8384
+ notNull: true
8385
+ },
8386
+ ...spec.columns,
8387
+ {
8388
+ name: ROW_MAP_VALUE_COLUMN,
8389
+ type: "JSON",
8390
+ notNull: true
8391
+ }
8392
+ ],
8393
+ ...spec.indexes !== void 0 ? { indexes: [...spec.indexes] } : {}
8394
+ });
8395
+ }
8396
+ declare() {
8397
+ return RowMapStore.declare(this.store, this.spec);
8398
+ }
8399
+ /** One entry, by key. `null` when absent OR unparseable (which is said aloud). */
8400
+ async read(key) {
8401
+ const raw = await this.store.get.query({
8402
+ collection: this.spec.collection,
8403
+ key
8404
+ });
8405
+ if (!isRecord(raw)) return null;
8406
+ const row = raw;
8407
+ const parsed = this.spec.schema.safeParse(row[ROW_MAP_VALUE_COLUMN]);
8408
+ if (!parsed.success) {
8409
+ this.logger.warn("row-map row skipped as unparseable", {
8410
+ ...this.deviceTags(row),
8411
+ meta: {
8412
+ collection: this.spec.collection,
8413
+ key,
8414
+ error: parsed.error.message
8415
+ }
8416
+ });
8417
+ return null;
8418
+ }
8419
+ return parsed.data;
8420
+ }
8421
+ /**
8422
+ * Every entry, keyed. Unparseable rows are skipped — one bad entry costs that
8423
+ * entry, never the map.
8424
+ */
8425
+ async readAll() {
8426
+ const records = await this.store.query.query({
8427
+ collection: this.spec.collection,
8428
+ filter: { limit: this.spec.loadLimit }
8429
+ });
8430
+ const out = /* @__PURE__ */ new Map();
8431
+ let skipped = 0;
8432
+ for (const record of records) {
8433
+ const parsed = this.spec.schema.safeParse(record.data[ROW_MAP_VALUE_COLUMN]);
8434
+ if (!parsed.success) {
8435
+ skipped += 1;
8436
+ continue;
8437
+ }
8438
+ out.set(record.id, parsed.data);
8439
+ }
8440
+ if (skipped > 0) this.logger.warn("row-map rows skipped as unparseable", { meta: {
8441
+ collection: this.spec.collection,
8442
+ skipped,
8443
+ kept: out.size
8444
+ } });
8445
+ if (records.length >= this.spec.loadLimit) this.logger.warn("row-map read hit its own bound — the map may be truncated", { meta: {
8446
+ collection: this.spec.collection,
8447
+ loadLimit: this.spec.loadLimit
8448
+ } });
8449
+ return out;
8450
+ }
8451
+ /**
8452
+ * Every entry as it was WRITTEN, unvalidated and unparsed — the read a
8453
+ * MIGRATION needs.
8454
+ *
8455
+ * {@link readAll} answers through the CURRENT schema, which is exactly what a
8456
+ * migration must not do: a retired key is stripped by a non-strict `z.object`
8457
+ * before the migration could see it, so the row it is there to rescue looks
8458
+ * like a row that never needed rescuing. Only a migration should call this;
8459
+ * everything else wants the validated read.
8460
+ */
8461
+ async readAllRaw() {
8462
+ const records = await this.store.query.query({
8463
+ collection: this.spec.collection,
8464
+ filter: { limit: this.spec.loadLimit }
8465
+ });
8466
+ const out = /* @__PURE__ */ new Map();
8467
+ for (const record of records) out.set(record.id, record.data[ROW_MAP_VALUE_COLUMN]);
8468
+ return out;
8469
+ }
8470
+ /** Insert or replace ONE entry. Validates at the boundary. */
8471
+ async write(key, value) {
8472
+ const validated = this.spec.schema.parse(value);
8473
+ const columns = this.spec.project(key, validated);
8474
+ await this.store.set.mutate({
8475
+ collection: this.spec.collection,
8476
+ key,
8477
+ value: {
8478
+ ...columns,
8479
+ [ROW_MAP_VALUE_COLUMN]: validated
8480
+ }
8481
+ });
8482
+ }
8483
+ /** Drop ONE entry. Idempotent. */
8484
+ async remove(key) {
8485
+ await this.store.delete.mutate({
8486
+ collection: this.spec.collection,
8487
+ key
8488
+ });
8489
+ }
8490
+ /**
8491
+ * Make the collection hold exactly `next` — the write path for an owner whose
8492
+ * in-memory map IS the authority (a persister handed the complete set).
8493
+ *
8494
+ * Returns how many rows were DELETED, and says so out loud when any were: a
8495
+ * replace that silently drops rows is indistinguishable from one that never
8496
+ * had them. Only an owner holding an authoritative set may call this — a
8497
+ * prune driven by a fallible read is work destroyed (D130, D49).
8498
+ */
8499
+ async replaceAll(next) {
8500
+ const held = await this.store.query.query({
8501
+ collection: this.spec.collection,
8502
+ filter: { limit: this.spec.loadLimit }
8503
+ });
8504
+ for (const [key, value] of next) await this.write(key, value);
8505
+ const doomed = held.filter((record) => !next.has(record.id));
8506
+ for (const record of doomed) await this.remove(record.id);
8507
+ if (doomed.length > 0) this.logger.warn("row-map replaceAll dropped rows", { meta: {
8508
+ collection: this.spec.collection,
8509
+ dropped: doomed.length,
8510
+ keys: doomed.slice(0, 20).map((r) => r.id),
8511
+ remaining: next.size
8512
+ } });
8513
+ return doomed.length;
8514
+ }
8515
+ /**
8516
+ * The entries matching a projected-column predicate, in the order asked for.
8517
+ *
8518
+ * This is what projecting columns BUYS: "every export for camera 617, newest
8519
+ * first, capped at 50" is an indexed `WHERE` + `ORDER BY` + `LIMIT`, not a
8520
+ * parse of the whole map followed by a filter in JS.
8521
+ *
8522
+ * A `limit` is REQUIRED — `settings-store.query` silently caps an unbounded
8523
+ * read at 2 000 rows and answers as if that were everything.
8524
+ */
8525
+ async readWhere(filter) {
8526
+ const records = await this.store.query.query({
8527
+ collection: this.spec.collection,
8528
+ filter: {
8529
+ ...filter.where !== void 0 ? { where: filter.where } : {},
8530
+ ...filter.whereIn !== void 0 ? { whereIn: filter.whereIn } : {},
8531
+ ...filter.whereBetween !== void 0 ? { whereBetween: filter.whereBetween } : {},
8532
+ ...filter.orderBy !== void 0 ? { orderBy: filter.orderBy } : {},
8533
+ ...filter.offset !== void 0 ? { offset: filter.offset } : {},
8534
+ limit: filter.limit ?? this.spec.loadLimit
8535
+ }
8536
+ });
8537
+ const out = [];
8538
+ let skipped = 0;
8539
+ for (const record of records) {
8540
+ const parsed = this.spec.schema.safeParse(record.data[ROW_MAP_VALUE_COLUMN]);
8541
+ if (!parsed.success) {
8542
+ skipped += 1;
8543
+ continue;
8544
+ }
8545
+ out.push({
8546
+ key: record.id,
8547
+ value: parsed.data
8548
+ });
8549
+ }
8550
+ if (skipped > 0) this.logger.warn("row-map rows skipped as unparseable", { meta: {
8551
+ collection: this.spec.collection,
8552
+ skipped,
8553
+ kept: out.length
8554
+ } });
8555
+ return out;
8556
+ }
8557
+ /** How many rows match, without materialising one. */
8558
+ async count(filter) {
8559
+ return this.store.count.query({
8560
+ collection: this.spec.collection,
8561
+ ...filter !== void 0 ? { filter: {
8562
+ ...filter.where !== void 0 ? { where: filter.where } : {},
8563
+ ...filter.whereIn !== void 0 ? { whereIn: filter.whereIn } : {},
8564
+ ...filter.whereBetween !== void 0 ? { whereBetween: filter.whereBetween } : {}
8565
+ } } : {}
8566
+ });
8567
+ }
8568
+ /**
8569
+ * Delete every row matching a predicate, in ONE statement. Returns how many
8570
+ * went, and says so — a retention trim that silently drops rows is
8571
+ * indistinguishable from one that had nothing to do.
8572
+ *
8573
+ * The predicate is REQUIRED and the engine REFUSES one that compiles to
8574
+ * nothing: deleting a whole collection is a legitimate intent, but it must be
8575
+ * asked for by name rather than reached through an empty object.
8576
+ */
8577
+ async deleteWhere(filter) {
8578
+ const { deleted } = await this.store.deleteWhere.mutate({
8579
+ collection: this.spec.collection,
8580
+ filter
8581
+ });
8582
+ if (deleted > 0) this.logger.warn("row-map deleteWhere dropped rows", { meta: {
8583
+ collection: this.spec.collection,
8584
+ deleted,
8585
+ filter
8586
+ } });
8587
+ return deleted;
8588
+ }
8589
+ /** `tags: { deviceId }` off the PROJECTED column, when the spec names one. */
8590
+ deviceTags(row) {
8591
+ const column = this.spec.deviceIdColumn;
8592
+ if (column === void 0) return {};
8593
+ const raw = row[column];
8594
+ return typeof raw === "number" && Number.isInteger(raw) ? { tags: { deviceId: raw } } : {};
8595
+ }
8596
+ };
8597
+ /** A store payload that is a plain object, or `null`. A type guard, not a cast. */
8598
+ function isRecord(value) {
8599
+ return value !== null && typeof value === "object" && !Array.isArray(value);
8600
+ }
8363
8601
  //#endregion
8364
8602
  //#region src/recorder/addon/export-store.ts
8365
8603
  /**
@@ -8485,7 +8723,7 @@ var RECORDING_EXPORTS_SPEC = {
8485
8723
  };
8486
8724
  /** Build the handle. `declare()` MUST run once at boot before any read/write. */
8487
8725
  function recordingExportsState(store, logger) {
8488
- return new require_retire_root_keys.RowMapStore({
8726
+ return new RowMapStore({
8489
8727
  spec: RECORDING_EXPORTS_SPEC,
8490
8728
  store,
8491
8729
  logger
@@ -14788,40 +15026,8 @@ var LocationRefresher = class {
14788
15026
  }
14789
15027
  }
14790
15028
  };
14791
- //#endregion
14792
- //#region src/recorder/addon/ops-log-store.ts
14793
- /**
14794
- * Recordings ops-log persistence for the recorder addon.
14795
- *
14796
- * ONE ROW PER OPERATION in `recorder:ops-log`, through {@link RowMapStore}. The
14797
- * ring is still bounded — `maxEntries` newest rows survive — but the eviction
14798
- * is now a single `DELETE … WHERE at BETWEEN`, and a listing is an indexed
14799
- * `WHERE deviceId … ORDER BY at DESC LIMIT`.
14800
- *
14801
- * ## What this replaced
14802
- *
14803
- * The ring lived in ONE key of the recorder's `addon-settings` / `root` blob,
14804
- * as a flat JSON array. On the reference hub it was 147 437 bytes of that row's
14805
- * 201 833 — so appending one audit line read, parsed, re-serialised and rewrote
14806
- * ~200 KB, and so did every unrelated reader of that row (`resolveConfig`,
14807
- * `loadDeviceConfig`, the export progress patch). The ops log is the CHEAPEST
14808
- * thing in the recorder and it was paying for the most expensive.
14809
- *
14810
- * Writes stay BEST-EFFORT: `createRecordingOpsLogSink().append` never throws —
14811
- * a failed audit write must not fail the operation it records.
14812
- */
14813
- /**
14814
- * @durable class=audit owner=recorder
14815
- * write="one row per recordings operation (prune, evict, relocate, export, …), appended
14816
- * best-effort by `createRecordingOpsLogSink().append` — never read back by the system,
14817
- * only listed by an operator through the `recording.listOpsLog` cap method"
14818
- * retention="a bounded ring: every append trims to the newest OPS_LOG_RING_DEFAULT_MAX
14819
- * (500) rows with one `deleteWhere` on `at`. Rows tied on the cutoff millisecond
14820
- * survive, so the ring may hold a few MORE than the cap and never fewer."
14821
- */
14822
- var RECORDING_OPS_LOG_COLLECTION = "recorder:ops-log";
14823
15029
  var RECORDING_OPS_LOG_SPEC = {
14824
- collection: RECORDING_OPS_LOG_COLLECTION,
15030
+ collection: "recorder:ops-log",
14825
15031
  schema: require_dist.OpsLogEntrySchema,
14826
15032
  columns: [{
14827
15033
  name: "at",
@@ -14847,7 +15053,7 @@ var RECORDING_OPS_LOG_SPEC = {
14847
15053
  };
14848
15054
  /** Build the handle. `declare()` MUST run once at boot before any read/write. */
14849
15055
  function recordingOpsLogState(store, logger) {
14850
- return new require_retire_root_keys.RowMapStore({
15056
+ return new RowMapStore({
14851
15057
  spec: RECORDING_OPS_LOG_SPEC,
14852
15058
  store,
14853
15059
  logger
@@ -20963,25 +21169,6 @@ var RetentionSweeper = class {
20963
21169
  }
20964
21170
  };
20965
21171
  //#endregion
20966
- //#region src/recorder/addon/retired-root-keys.ts
20967
- var RECORDER_RETIRED_ROOT_KEYS = [
20968
- {
20969
- key: "recordingOpsLog",
20970
- successor: RECORDING_OPS_LOG_COLLECTION,
20971
- reason: "the audit ring is one row per operation since the flatten; as a blob it was 147 KB of the 201 KB root row, re-parsed by every unrelated reader of that row"
20972
- },
20973
- {
20974
- key: "recordingExports",
20975
- successor: RECORDING_EXPORTS_COLLECTION,
20976
- reason: "one row per export job since the flatten; as a blob a once-a-second progress patch rewrote 201 KB, and an overlapping createExport erased the row (2026-08-14)"
20977
- },
20978
- {
20979
- key: "recordingConfigs",
20980
- successor: "the recorder per-device settings (key recordingConfig)",
20981
- reason: "one row per camera since the flatten; as a blob, asking what camera 617 records parsed every camera in the installation"
20982
- }
20983
- ];
20984
- //#endregion
20985
21172
  //#region src/recorder/addon/heap-delta.ts
20986
21173
  /**
20987
21174
  * Name the unit of work that grows the recorder's heap.
@@ -23418,7 +23605,6 @@ var RecorderV2Addon = class extends require_dist.BaseAddon {
23418
23605
  return { providers: [] };
23419
23606
  }
23420
23607
  await this.declareRowCollections();
23421
- await this.purgeFlattenedSettingsKeys();
23422
23608
  this.segmentHours = new SegmentHourLedger({
23423
23609
  store: this.ctx.api.settingsStore,
23424
23610
  logger: this.ctx.logger,
@@ -25248,31 +25434,6 @@ var RecorderV2Addon = class extends require_dist.BaseAddon {
25248
25434
  await this.opsLogStore().declare();
25249
25435
  }
25250
25436
  /**
25251
- * Drop the flattened keys from `recorder:addon-settings` / `root`, each gated
25252
- * on its own successor collection being non-empty.
25253
- *
25254
- * `recordingPlacement` is NOT here: it stays a blob key. It is 1.4 KB of
25255
- * per-(camera, profile) assignments plus a handful of volume ids, written
25256
- * only when placement changes — and the row has to survive anyway, because it
25257
- * is where `BaseAddon.resolveConfig` reads the operator's config fields from.
25258
- * The problem was a 201 KB row, not a blob.
25259
- *
25260
- * Best-effort: a purge that throws must not take recording down. The keys are
25261
- * dead weight, not a fault.
25262
- */
25263
- async purgeFlattenedSettingsKeys() {
25264
- try {
25265
- await require_retire_root_keys.retireRootKeys({
25266
- store: this.ctx.api.settingsStore,
25267
- addonId: RECORDER_ADDON_ID,
25268
- logger: this.ctx.logger,
25269
- specs: RECORDER_RETIRED_ROOT_KEYS
25270
- });
25271
- } catch (err) {
25272
- this.ctx.logger.warn("recorder: retiring the flattened settings keys failed", { meta: { error: require_dist.errMsg(err) } });
25273
- }
25274
- }
25275
- /**
25276
25437
  * `ctx.api.settingsStore`, wrapped ONCE through {@link censusStoreClient}.
25277
25438
  *
25278
25439
  * LAZY (see `calendar` above): `ctx` is not assigned until `initialize()`
@@ -25291,11 +25452,7 @@ var RecorderV2Addon = class extends require_dist.BaseAddon {
25291
25452
  if (settings === void 0) throw new Error("recorder: device settings are not available");
25292
25453
  this.configsState ??= recordingConfigsState({
25293
25454
  settings,
25294
- logger: this.ctx.logger,
25295
- listDeviceIds: async () => (await this.ctx.api.deviceManager.listAll.query({
25296
- isCamera: true,
25297
- projection: "slim"
25298
- })).map((device) => device.id)
25455
+ logger: this.ctx.logger
25299
25456
  });
25300
25457
  return this.configsState;
25301
25458
  }