@camstack/system 1.2.483 → 1.2.485

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 (87) hide show
  1. package/dist/{agent-https-CHZpVx3I.js → agent-https-DBP7P-ee.js} +1 -1
  2. package/dist/{agent-https-NP141VCW.mjs → agent-https-_EXvi6F8.mjs} +1 -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/autotrack/index.js +1 -1
  10. package/dist/builtins/autotrack/index.mjs +1 -1
  11. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  12. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  13. package/dist/builtins/calendars/calendars.addon.js +1 -1
  14. package/dist/builtins/calendars/calendars.addon.mjs +1 -1
  15. package/dist/builtins/camera-grid/index.js +1 -1
  16. package/dist/builtins/camera-grid/index.mjs +1 -1
  17. package/dist/builtins/composer/composer.addon.js +13 -5
  18. package/dist/builtins/composer/composer.addon.mjs +13 -5
  19. package/dist/builtins/console-logging/index.js +1 -1
  20. package/dist/builtins/console-logging/index.mjs +1 -1
  21. package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
  22. package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
  23. package/dist/builtins/device-history/device-history.addon.d.ts +2 -0
  24. package/dist/builtins/device-history/device-history.addon.js +248 -4
  25. package/dist/builtins/device-history/device-history.addon.mjs +248 -4
  26. package/dist/builtins/device-history/query/history-query.d.ts +5 -1
  27. package/dist/builtins/device-history/runtime/history-runtime.d.ts +18 -1
  28. package/dist/builtins/device-history/store/history-schema.d.ts +2 -0
  29. package/dist/builtins/device-history/store/history-store.d.ts +11 -0
  30. package/dist/builtins/device-history/store/series-scale.d.ts +37 -0
  31. package/dist/builtins/device-manager/device-manager.addon.js +3 -2
  32. package/dist/builtins/device-manager/device-manager.addon.mjs +3 -2
  33. package/dist/builtins/hub-forwarder/index.js +1 -1
  34. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  35. package/dist/builtins/keychain/index.js +3 -3
  36. package/dist/builtins/keychain/index.mjs +3 -3
  37. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  38. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  39. package/dist/builtins/local-auth/local-auth.addon.js +2 -2
  40. package/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  41. package/dist/builtins/local-network/local-network.addon.js +2 -2
  42. package/dist/builtins/local-network/local-network.addon.mjs +2 -2
  43. package/dist/builtins/loki-logging/index.js +1 -1
  44. package/dist/builtins/loki-logging/index.mjs +1 -1
  45. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  46. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  47. package/dist/builtins/platform-probe/index.js +1 -1
  48. package/dist/builtins/platform-probe/index.mjs +1 -1
  49. package/dist/builtins/record-entries/index.js +1 -1
  50. package/dist/builtins/record-entries/index.mjs +1 -1
  51. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  52. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  53. package/dist/builtins/snapshot/index.js +1 -1
  54. package/dist/builtins/snapshot/index.mjs +1 -1
  55. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  56. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  57. package/dist/builtins/sqlite-storage/index.js +1 -1
  58. package/dist/builtins/sqlite-storage/index.mjs +1 -1
  59. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +2 -2
  60. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
  61. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  62. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  63. package/dist/builtins/system-config/system-config.addon.js +3 -3
  64. package/dist/builtins/system-config/system-config.addon.mjs +280 -280
  65. package/dist/builtins/winston-logging/index.js +1 -1
  66. package/dist/builtins/winston-logging/index.mjs +1 -1
  67. package/dist/{composition-sources-CQxrCexr.js → composition-sources-BSQneZV9.js} +1 -1
  68. package/dist/{composition-sources-CC13wGKL.mjs → composition-sources-BnZpIA8u.mjs} +1 -1
  69. package/dist/{constants-DMB-ex5z.mjs → constants-7D7xjw0h.mjs} +1 -1
  70. package/dist/{constants-Bt0NFXDm.js → constants-CQfTeCnB.js} +1 -1
  71. package/dist/{device-ca-HQKcvofS.mjs → device-ca-Bzd6UO_c.mjs} +1 -1
  72. package/dist/{device-ca-CSLMfr4Q.js → device-ca-D_4dI5gv.js} +1 -1
  73. package/dist/{dist-DvKEKSap.mjs → dist-Df6c0RX_.mjs} +614 -522
  74. package/dist/{dist-2gZWO597.js → dist-xCNJAQMh.js} +625 -521
  75. package/dist/file-host-worker.js +1 -1
  76. package/dist/file-host-worker.mjs +1 -1
  77. package/dist/{hub-mdns-ciao-CVf6mxIZ.mjs → hub-mdns-ciao-D7GMnEz0.mjs} +2 -2
  78. package/dist/{hub-mdns-ciao-Bs3cn9C1.js → hub-mdns-ciao-DRfmLR_Z.js} +2 -2
  79. package/dist/index.js +7 -7
  80. package/dist/index.mjs +7 -7
  81. package/dist/{restore-archive-EFYeCdrG.mjs → restore-archive-Co70oRya.mjs} +78 -78
  82. package/dist/{restore-archive-_mgadWlk.js → restore-archive-DA7N6ZZA.js} +1 -1
  83. package/dist/{retention-qugQGYuY.js → retention-DNDOPW7Z.js} +1 -1
  84. package/dist/{retention-FFJW3-3P.mjs → retention-DfCW-dZS.mjs} +1 -1
  85. package/dist/{wal-maintenance-TCW_esAc.mjs → wal-maintenance-71-j48Ci.mjs} +0 -0
  86. package/dist/{wal-maintenance-DbUC_wdC.js → wal-maintenance-CA0L6WZ9.js} +0 -0
  87. package/package.json +7 -2
@@ -1,5 +1,5 @@
1
- import { B as HISTORY_ITEM_CATALOG, Ct as armRemovalReconcile, D as DEVICE_HISTORY_ENERGY_KEY, Xi as emitReadiness, en as deviceHistoryCapability, ka as EventCategory, ni as BaseAddon, nn as deviceRemovalHookCapability, z as HISTORY_CATALOG } from "../../dist-DvKEKSap.mjs";
2
- import { S as subjectIdOf, _ as readUnit, a as FIVE_MINUTES_MS, b as SeriesRegistry, c as bucketEndOf, d as CAP_KEY_PREFIX, f as CaptureEngine, g as readPath, h as catalogMetrics, i as DAY_MS, l as bucketStartOf, m as capSeriesKey, n as RetentionJob, o as HOUR_MS, p as capItemSeriesKey, r as DepartureTracker, s as ROLLUP_GRACE_MS, t as DEFAULT_RETENTION, u as floorTo, v as DeviceDirectory, x as identityOf, y as isRealDeviceType } from "../../retention-FFJW3-3P.mjs";
1
+ import { B as HISTORY_ITEM_CATALOG, Ct as armRemovalReconcile, D as DEVICE_HISTORY_ENERGY_KEY, Xi as emitReadiness, aa as isReadingQuantity, ea as historyUnitFor, en as deviceHistoryCapability, ja as EventCategory, ni as BaseAddon, nn as deviceRemovalHookCapability, z as HISTORY_CATALOG } from "../../dist-Df6c0RX_.mjs";
2
+ import { S as subjectIdOf, _ as readUnit, a as FIVE_MINUTES_MS, b as SeriesRegistry, c as bucketEndOf, d as CAP_KEY_PREFIX, f as CaptureEngine, g as readPath, h as catalogMetrics, i as DAY_MS, l as bucketStartOf, m as capSeriesKey, n as RetentionJob, o as HOUR_MS, p as capItemSeriesKey, r as DepartureTracker, s as ROLLUP_GRACE_MS, t as DEFAULT_RETENTION, u as floorTo, v as DeviceDirectory, x as identityOf, y as isRealDeviceType } from "../../retention-DfCW-dZS.mjs";
3
3
  //#region src/builtins/device-history/capture/point-writer.ts
4
4
  var FLUSH_INTERVAL_MS = 1e4;
5
5
  var MAX_BUFFER_AGE_MS = 6e4;
@@ -446,6 +446,13 @@ var MAX_SCOPES = 50;
446
446
  /** The power-meter series the energy key is derived from, meter first. */
447
447
  var ENERGY_METER_KEY = capSeriesKey("power-meter", "kwhTotal");
448
448
  var ENERGY_POWER_KEY = capSeriesKey("power-meter", "watts");
449
+ /**
450
+ * Series whose quantity is chosen per device (D944). Weather is not here:
451
+ * each weather field has its own quantity on the capability, and the catalog
452
+ * unit is that base. A past weather point stored in another unit cannot be
453
+ * rescaled — the unit at sample time was not kept.
454
+ */
455
+ var DEVICE_QUANTITY_KEYS = new Set([capSeriesKey("numeric-sensor", "value")]);
449
456
  function retentionMsOf(tier, policy) {
450
457
  if (tier === "raw") return policy.rawDays * DAY_MS;
451
458
  if (tier === "5m") return policy.fiveMinuteDays * DAY_MS;
@@ -712,12 +719,26 @@ var HistoryQuery = class {
712
719
  /** The metric's fixed unit, else the device's own (a `unitFrom` field), else unknown. */
713
720
  async unitOf(subject, series, fixed, slices) {
714
721
  if (fixed !== null || subject.kind !== "device" || !series.key.startsWith("cap:")) return fixed;
722
+ if (DEVICE_QUANTITY_KEYS.has(series.key)) {
723
+ const quantity = await this.quantityOf(subject.deviceId);
724
+ if (quantity === null || quantity === "device" || quantity === "none") return null;
725
+ return historyUnitFor(quantity) ?? null;
726
+ }
715
727
  const spec = this.specOf(series.key);
716
728
  if (spec?.unitFrom === void 0) return null;
717
729
  const capName = series.key.slice(CAP_KEY_PREFIX.length, series.key.indexOf("."));
718
730
  const slice = await this.sliceOf(subject.deviceId, capName, slices);
719
731
  return slice === null ? null : readUnit(slice, spec.unitFrom);
720
732
  }
733
+ quantityOf(deviceId) {
734
+ const pending = this.quantities.get(deviceId);
735
+ if (pending !== void 0) return pending;
736
+ const read = this.deps.readDeviceQuantity;
737
+ const run = read === void 0 ? Promise.resolve(null) : read(deviceId).catch(() => null);
738
+ this.quantities.set(deviceId, run);
739
+ return run;
740
+ }
741
+ quantities = /* @__PURE__ */ new Map();
721
742
  specOf(key) {
722
743
  const body = key.slice(CAP_KEY_PREFIX.length);
723
744
  const dot = body.indexOf(".");
@@ -877,6 +898,59 @@ var OrphanSeries = class {
877
898
  }
878
899
  };
879
900
  //#endregion
901
+ //#region src/builtins/device-history/store/series-scale.ts
902
+ /**
903
+ * One-shot rescales of series whose every stored point shared one factor
904
+ * (D944). A reading already in the base unit is at or above `legacyMax` and
905
+ * is left alone, so a second pass does not multiply it again.
906
+ *
907
+ * Rollup `sum` / `tw_sum` follow the bucket when min, max and last are still
908
+ * in the old unit. Judging the sum itself would skip a day's samples of a
909
+ * large gauge (many × GiB already exceeds the ceiling) and keep the raw
910
+ * points and the rollup in different units.
911
+ */
912
+ var GIB_TO_BYTES = 1024 ** 3;
913
+ var DAY_TO_SECONDS = 86400;
914
+ /** A homelab array in GiB is below 1 MiB; the same array in bytes is not. */
915
+ var INFORMATION_LEGACY_MAX = 1024 ** 2;
916
+ /** Desiccant life in days is below this; the same life in seconds is not. */
917
+ var DESICCANT_LEGACY_MAX_DAYS = 1e4;
918
+ var DESICCANT_SERIES_KEY = "cap:pet-feeder.desiccantLeftDays";
919
+ var DESICCANT_SCALE_ID = "pet-feeder-desiccant-days-to-seconds";
920
+ var UNRAID_INFORMATION_KEYS = [
921
+ "array_total",
922
+ "array_used",
923
+ "array_free"
924
+ ];
925
+ var NUMERIC_SENSOR_SERIES_KEY = "cap:numeric-sensor.value";
926
+ /** The stored number after one rescale, or the same number when it is already base. */
927
+ function scaledMagnitude(value, factor, legacyMax) {
928
+ if (!Number.isFinite(value) || value === 0) return value;
929
+ if (Math.abs(value) >= legacyMax) return value;
930
+ return value * factor;
931
+ }
932
+ function rollupIsLegacy(row, legacyMax) {
933
+ const samples = [
934
+ row.min,
935
+ row.max,
936
+ ...row.last === null ? [] : [row.last]
937
+ ];
938
+ if (samples.some((value) => !Number.isFinite(value))) return false;
939
+ if (samples.every((value) => value === 0)) return false;
940
+ return samples.every((value) => Math.abs(value) < legacyMax);
941
+ }
942
+ /** Unraid array capacity children. Other numeric sensors on the same key stay put. */
943
+ function unraidInformationScale(deviceId, entityKey) {
944
+ if (!UNRAID_INFORMATION_KEYS.includes(entityKey)) return null;
945
+ return {
946
+ seriesKey: NUMERIC_SENSOR_SERIES_KEY,
947
+ deviceId,
948
+ factor: GIB_TO_BYTES,
949
+ legacyMax: INFORMATION_LEGACY_MAX,
950
+ migrationId: `unraid-gib-to-bytes:${String(deviceId)}`
951
+ };
952
+ }
953
+ //#endregion
880
954
  //#region src/builtins/device-history/store/history-schema.ts
881
955
  var HISTORY_NAMESPACE = "device-history";
882
956
  var COLLECTIONS = {
@@ -887,7 +961,9 @@ var COLLECTIONS = {
887
961
  rollup1h: "rollup-1h",
888
962
  rollup1d: "rollup-1d",
889
963
  optOuts: "device-opt-outs",
890
- departures: "device-departures"
964
+ departures: "device-departures",
965
+ /** One row per applied base-unit rescale, in history.db so it travels with the points. */
966
+ appliedScales: "applied-scales"
891
967
  };
892
968
  function rollupCollectionOf(tier) {
893
969
  if (tier === "5m") return COLLECTIONS.rollup5m;
@@ -1140,6 +1216,21 @@ var HISTORY_DECLARATIONS = [
1140
1216
  columns: ["device_id"],
1141
1217
  unique: true
1142
1218
  }]
1219
+ },
1220
+ {
1221
+ namespace: HISTORY_NAMESPACE,
1222
+ collection: COLLECTIONS.appliedScales,
1223
+ database: "history",
1224
+ columns: [{
1225
+ name: "id",
1226
+ type: "TEXT",
1227
+ primaryKey: true,
1228
+ notNull: true
1229
+ }, {
1230
+ name: "applied_at",
1231
+ type: "INTEGER",
1232
+ notNull: true
1233
+ }]
1143
1234
  }
1144
1235
  ];
1145
1236
  //#endregion
@@ -1556,7 +1647,98 @@ var HistoryStore = class {
1556
1647
  filter: { where: { device_id: deviceId } }
1557
1648
  });
1558
1649
  }
1650
+ /** True when this rescale already finished. A missing row is "not yet". */
1651
+ async scaleApplied(id) {
1652
+ return (await this.door.query.query({
1653
+ namespace: HISTORY_NAMESPACE,
1654
+ collection: COLLECTIONS.appliedScales,
1655
+ filter: {
1656
+ where: { id },
1657
+ limit: 1
1658
+ }
1659
+ })).length > 0;
1660
+ }
1661
+ async markScale(id, at) {
1662
+ await this.door.upsertMany.mutate({
1663
+ namespace: HISTORY_NAMESPACE,
1664
+ collection: COLLECTIONS.appliedScales,
1665
+ conflict: ["id"],
1666
+ records: [{
1667
+ id,
1668
+ data: {
1669
+ id,
1670
+ applied_at: at
1671
+ }
1672
+ }]
1673
+ });
1674
+ }
1675
+ /**
1676
+ * Multiply one series' raw points and rollups that are still in the old
1677
+ * unit. Points already at or above `legacyMax` stay. Returns how many rows
1678
+ * changed.
1679
+ */
1680
+ async scaleSeries(seriesId, factor, legacyMax) {
1681
+ const raw = await this.scaleRaw(seriesId, factor, legacyMax);
1682
+ let rollups = 0;
1683
+ for (const tier of [
1684
+ "5m",
1685
+ "1h",
1686
+ "1d"
1687
+ ]) rollups += await this.scaleRollupTier(tier, seriesId, factor, legacyMax);
1688
+ return raw + rollups;
1689
+ }
1690
+ async scaleRaw(seriesId, factor, legacyMax) {
1691
+ let after = -1;
1692
+ let changed = 0;
1693
+ for (;;) {
1694
+ const rows = await this.readRaw(seriesId, after + 1, Number.MAX_SAFE_INTEGER, READ_PAGE, "asc");
1695
+ if (rows.length === 0) break;
1696
+ const next = rows.flatMap((row) => {
1697
+ const value = scaledMagnitude(row.value, factor, legacyMax);
1698
+ return value === row.value ? [] : [{
1699
+ seriesId,
1700
+ ts: row.ts,
1701
+ value
1702
+ }];
1703
+ });
1704
+ if (next.length > 0) {
1705
+ await this.upsertRaw(next);
1706
+ changed += next.length;
1707
+ }
1708
+ const last = rows[rows.length - 1];
1709
+ if (last === void 0 || rows.length < 5e3) break;
1710
+ after = last.ts;
1711
+ }
1712
+ return changed;
1713
+ }
1714
+ async scaleRollupTier(tier, seriesId, factor, legacyMax) {
1715
+ let after = -1;
1716
+ let changed = 0;
1717
+ for (;;) {
1718
+ const rows = await this.readRollups(tier, seriesId, after + 1, Number.MAX_SAFE_INTEGER, READ_PAGE, "asc");
1719
+ if (rows.length === 0) break;
1720
+ const next = rows.flatMap((row) => rollupIsLegacy(row, legacyMax) ? [scaleRollup(row, factor)] : []);
1721
+ if (next.length > 0) {
1722
+ await this.upsertRollups(tier, next);
1723
+ changed += next.length;
1724
+ }
1725
+ const last = rows[rows.length - 1];
1726
+ if (last === void 0 || rows.length < 5e3) break;
1727
+ after = last.bucketStart;
1728
+ }
1729
+ return changed;
1730
+ }
1559
1731
  };
1732
+ function scaleRollup(row, factor) {
1733
+ return {
1734
+ ...row,
1735
+ sum: row.sum * factor,
1736
+ min: row.min * factor,
1737
+ max: row.max * factor,
1738
+ last: row.last === null ? null : row.last * factor,
1739
+ twSum: row.twSum === null ? null : row.twSum * factor
1740
+ };
1741
+ }
1560
1742
  //#endregion
1561
1743
  //#region src/builtins/device-history/rollup/rollup-math.ts
1562
1744
  /**
@@ -2126,7 +2308,8 @@ var HistoryRuntime = class {
2126
2308
  retention: deps.retention,
2127
2309
  catalog,
2128
2310
  itemCatalog,
2129
- readCapSlice: deps.readCapSlice
2311
+ readCapSlice: deps.readCapSlice,
2312
+ readDeviceQuantity: deps.readDeviceQuantity
2130
2313
  });
2131
2314
  this.departures = new DepartureTracker(this.store, this.registry, logger);
2132
2315
  this.registry.onRemove((series) => {
@@ -2162,10 +2345,53 @@ var HistoryRuntime = class {
2162
2345
  await this.capture.seed();
2163
2346
  }
2164
2347
  async finishBoot() {
2348
+ await this.applyLegacyScales();
2165
2349
  const series = await this.rollup.bootRecompute(this.deps.clock());
2166
2350
  this.deps.logger.info("device-history: recent rollup window rebuilt", { meta: { series } });
2167
2351
  await this.reconcile();
2168
2352
  }
2353
+ /**
2354
+ * PetKit desiccant was stored in days; the quantity base is seconds.
2355
+ * Unraid array counters were stored in GiB; the base is bytes. Both
2356
+ * factors are honest because the unit never varied inside the series.
2357
+ * Weather and numeric-sensor are not rescaled: the unit at sample time
2358
+ * was not stored, so a factor would invent a number (D393).
2359
+ */
2360
+ async applyLegacyScales() {
2361
+ await this.scaleMatching(DESICCANT_SERIES_KEY, void 0, DAY_TO_SECONDS, DESICCANT_LEGACY_MAX_DAYS, DESICCANT_SCALE_ID);
2362
+ const list = this.deps.listLegacyScales;
2363
+ if (list === void 0) return;
2364
+ let subjects;
2365
+ try {
2366
+ subjects = await list();
2367
+ } catch (err) {
2368
+ this.deps.logger.warn("device-history: legacy scale listing failed — stored points unchanged", { meta: { error: err instanceof Error ? err.message : String(err) } });
2369
+ return;
2370
+ }
2371
+ for (const subject of subjects) await this.scaleMatching(subject.seriesKey, subject.deviceId, subject.factor, subject.legacyMax, subject.migrationId);
2372
+ }
2373
+ async scaleMatching(key, deviceId, factor, legacyMax, migrationId) {
2374
+ if (await this.store.scaleApplied(migrationId)) return;
2375
+ const subject = deviceId === void 0 ? void 0 : subjectIdOf({
2376
+ kind: "device",
2377
+ deviceId
2378
+ });
2379
+ const series = this.registry.all().filter((row) => {
2380
+ if (row.key !== key) return false;
2381
+ return subject === void 0 || row.subject === subject;
2382
+ });
2383
+ let changed = 0;
2384
+ for (const row of series) changed += await this.store.scaleSeries(row.id, factor, legacyMax);
2385
+ await this.store.markScale(migrationId, this.deps.clock());
2386
+ if (changed > 0) this.deps.logger.info("device-history: rescaled a series into its base unit", {
2387
+ ...deviceId === void 0 ? {} : { tags: { deviceId } },
2388
+ meta: {
2389
+ migrationId,
2390
+ key,
2391
+ changed
2392
+ }
2393
+ });
2394
+ }
2169
2395
  startTimers() {
2170
2396
  const every = (ms, run) => {
2171
2397
  const timer = setInterval(() => {
@@ -2443,6 +2669,19 @@ var DeviceHistoryAddon = class extends BaseAddon {
2443
2669
  dayDays: positiveOr(c.dayDays, 0) > 0 ? c.dayDays : null
2444
2670
  };
2445
2671
  }
2672
+ /** Unraid array counters still stored in GiB. A failed listing throws to the caller. */
2673
+ async legacyScales() {
2674
+ const devices = await this.ctx.api.deviceManager.listAll.query({});
2675
+ const scales = [];
2676
+ for (const device of devices) {
2677
+ if (device.addonId !== "provider-unraid") continue;
2678
+ const entityKey = device.config["entityKey"];
2679
+ if (typeof entityKey !== "string") continue;
2680
+ const scale = unraidInformationScale(device.id, entityKey);
2681
+ if (scale !== null) scales.push(scale);
2682
+ }
2683
+ return scales;
2684
+ }
2446
2685
  requireRuntime() {
2447
2686
  if (this.runtime === null) throw new Error("device-history is starting — the history store is not open yet");
2448
2687
  return this.runtime;
@@ -2536,6 +2775,11 @@ var DeviceHistoryAddon = class extends BaseAddon {
2536
2775
  deviceId,
2537
2776
  capName
2538
2777
  }),
2778
+ readDeviceQuantity: async (deviceId) => {
2779
+ const quantity = (await api.deviceManager.getDevice.query({ deviceId }))?.sourceInfo?.quantity;
2780
+ return isReadingQuantity(quantity) ? quantity : null;
2781
+ },
2782
+ listLegacyScales: () => this.legacyScales(),
2539
2783
  retention: () => this.retention(),
2540
2784
  logger: this.ctx.logger,
2541
2785
  clock: () => Date.now()
@@ -19,7 +19,7 @@
19
19
  * One place makes that choice, so two charts of one device cannot disagree, and
20
20
  * it covers every hour of history recorded before the key existed.
21
21
  */
22
- import { type CapabilityHistoryField, type CapabilityHistoryItems, type DeviceHistoryQueryManyEntry, type DeviceHistoryQueryManyItem, type DeviceHistoryQueryPoint, type DeviceHistoryResolution, type DeviceHistorySeriesInfo, type DeviceHistorySubject } from "@camstack/types";
22
+ import { type CapabilityHistoryField, type CapabilityHistoryItems, type DeviceHistoryQueryManyEntry, type DeviceHistoryQueryManyItem, type DeviceHistoryQueryPoint, type DeviceHistoryResolution, type DeviceHistorySeriesInfo, type DeviceHistorySubject, type ReadingQuantity } from "@camstack/types";
23
23
  import { type RetentionPolicy } from "../retention/retention.js";
24
24
  import type { HistoryStore } from "../store/history-store.js";
25
25
  import { type SeriesRegistry } from "../store/series-registry.js";
@@ -69,6 +69,8 @@ export interface QueryDeps {
69
69
  readonly itemCatalog: HistoryItemCatalog;
70
70
  /** The device's current slice of a cap, for a `unitFrom` series; `null` when unreadable. */
71
71
  readonly readCapSlice: (deviceId: number, capName: string) => Promise<Readonly<Record<string, unknown>> | null>;
72
+ /** `null` when the device has no chosen quantity. A failed read is `null`. */
73
+ readonly readDeviceQuantity?: (deviceId: number) => Promise<ReadingQuantity | null>;
72
74
  }
73
75
  export declare class HistoryQuery {
74
76
  private readonly deps;
@@ -99,6 +101,8 @@ export declare class HistoryQuery {
99
101
  private sliceOf;
100
102
  /** The metric's fixed unit, else the device's own (a `unitFrom` field), else unknown. */
101
103
  private unitOf;
104
+ private quantityOf;
105
+ private readonly quantities;
102
106
  private specOf;
103
107
  }
104
108
  /** One keyed-item field (D917), by its series key. */
@@ -11,7 +11,7 @@
11
11
  * Then {@link HistoryRuntime.startTimers} arms flush (10 s), rollups (60 s),
12
12
  * reconcile (5 min), retention (10 min) and the row counts (30 min).
13
13
  */
14
- import type { DeviceHistoryOrphanDeleteEntry, DeviceHistoryOrphanList, DeviceHistoryStatus, IScopedLogger } from "@camstack/types";
14
+ import type { DeviceHistoryOrphanDeleteEntry, DeviceHistoryOrphanList, DeviceHistoryStatus, IScopedLogger, ReadingQuantity } from "@camstack/types";
15
15
  import { CaptureEngine, type HistoryCatalog, type HistoryItemCatalog, type SnapshotMap } from "../capture/capture-engine.js";
16
16
  import { DeviceDirectory, type DeviceTypeSource } from "../capture/device-directory.js";
17
17
  import { PointWriter } from "../capture/point-writer.js";
@@ -24,6 +24,7 @@ import { RollupEngine } from "../rollup/rollup-engine.js";
24
24
  import { HistoryCounters } from "../status/counters.js";
25
25
  import type { HistoryDoor } from "../store/history-door.js";
26
26
  import { HistoryStore } from "../store/history-store.js";
27
+ import { type LegacyScale } from "../store/series-scale.js";
27
28
  import { SeriesRegistry } from "../store/series-registry.js";
28
29
  export declare const ROLLUP_INTERVAL_MS: number;
29
30
  export declare const RECONCILE_INTERVAL_MS: number;
@@ -42,6 +43,13 @@ export interface HistoryRuntimeDeps {
42
43
  readonly deviceSource: DeviceTypeSource;
43
44
  readonly readSnapshots: () => Promise<SnapshotMap>;
44
45
  readonly readCapSlice: (deviceId: number, capName: string) => Promise<Readonly<Record<string, unknown>> | null>;
46
+ /** Polymorphic series (`numeric-sensor.value`): the quantity chosen at adopt. */
47
+ readonly readDeviceQuantity?: (deviceId: number) => Promise<ReadingQuantity | null>;
48
+ /**
49
+ * Series whose stored points are still in a retired unit (Unraid GiB).
50
+ * A failed read scales nothing (D49).
51
+ */
52
+ readonly listLegacyScales?: () => Promise<readonly LegacyScale[]>;
45
53
  readonly retention: () => RetentionPolicy;
46
54
  readonly logger: IScopedLogger;
47
55
  readonly clock: () => number;
@@ -69,6 +77,15 @@ export declare class HistoryRuntime {
69
77
  constructor(deps: HistoryRuntimeDeps);
70
78
  prepare(): Promise<void>;
71
79
  finishBoot(): Promise<void>;
80
+ /**
81
+ * PetKit desiccant was stored in days; the quantity base is seconds.
82
+ * Unraid array counters were stored in GiB; the base is bytes. Both
83
+ * factors are honest because the unit never varied inside the series.
84
+ * Weather and numeric-sensor are not rescaled: the unit at sample time
85
+ * was not stored, so a factor would invent a number (D393).
86
+ */
87
+ private applyLegacyScales;
88
+ private scaleMatching;
72
89
  startTimers(): void;
73
90
  stop(): Promise<void>;
74
91
  /** Emit pending trailing points, then write the buffer. */
@@ -18,6 +18,8 @@ export declare const COLLECTIONS: {
18
18
  readonly rollup1d: "rollup-1d";
19
19
  readonly optOuts: "device-opt-outs";
20
20
  readonly departures: "device-departures";
21
+ /** One row per applied base-unit rescale, in history.db so it travels with the points. */
22
+ readonly appliedScales: "applied-scales";
21
23
  };
22
24
  export type TierCollection = (typeof COLLECTIONS)["rollup5m" | "rollup1h" | "rollup1d"];
23
25
  export declare function rollupCollectionOf(tier: RollupTier): TierCollection;
@@ -95,4 +95,15 @@ export declare class HistoryStore {
95
95
  markMissing(deviceIds: readonly number[], at: number): Promise<void>;
96
96
  clearMissing(deviceIds: readonly number[]): Promise<void>;
97
97
  clearOptOut(deviceId: number): Promise<void>;
98
+ /** True when this rescale already finished. A missing row is "not yet". */
99
+ scaleApplied(id: string): Promise<boolean>;
100
+ markScale(id: string, at: number): Promise<void>;
101
+ /**
102
+ * Multiply one series' raw points and rollups that are still in the old
103
+ * unit. Points already at or above `legacyMax` stay. Returns how many rows
104
+ * changed.
105
+ */
106
+ scaleSeries(seriesId: number, factor: number, legacyMax: number): Promise<number>;
107
+ private scaleRaw;
108
+ private scaleRollupTier;
98
109
  }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * One-shot rescales of series whose every stored point shared one factor
3
+ * (D944). A reading already in the base unit is at or above `legacyMax` and
4
+ * is left alone, so a second pass does not multiply it again.
5
+ *
6
+ * Rollup `sum` / `tw_sum` follow the bucket when min, max and last are still
7
+ * in the old unit. Judging the sum itself would skip a day's samples of a
8
+ * large gauge (many × GiB already exceeds the ceiling) and keep the raw
9
+ * points and the rollup in different units.
10
+ */
11
+ export declare const GIB_TO_BYTES: number;
12
+ export declare const DAY_TO_SECONDS: number;
13
+ /** A homelab array in GiB is below 1 MiB; the same array in bytes is not. */
14
+ export declare const INFORMATION_LEGACY_MAX: number;
15
+ /** Desiccant life in days is below this; the same life in seconds is not. */
16
+ export declare const DESICCANT_LEGACY_MAX_DAYS: number;
17
+ export declare const DESICCANT_SERIES_KEY: string;
18
+ export declare const DESICCANT_SCALE_ID: string;
19
+ export declare const UNRAID_INFORMATION_KEYS: readonly string[];
20
+ export declare const NUMERIC_SENSOR_SERIES_KEY: string;
21
+ export declare const UNRAID_ADDON_ID: string;
22
+ export interface LegacyScale {
23
+ readonly seriesKey: string;
24
+ readonly deviceId: number;
25
+ readonly factor: number;
26
+ readonly legacyMax: number;
27
+ readonly migrationId: string;
28
+ }
29
+ /** The stored number after one rescale, or the same number when it is already base. */
30
+ export declare function scaledMagnitude(value: number, factor: number, legacyMax: number): number;
31
+ export declare function rollupIsLegacy(row: {
32
+ readonly min: number;
33
+ readonly max: number;
34
+ readonly last: number | null;
35
+ }, legacyMax: number): boolean;
36
+ /** Unraid array capacity children. Other numeric sensors on the same key stay put. */
37
+ export declare function unraidInformationScale(deviceId: number, entityKey: string): LegacyScale | null;
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-2gZWO597.js");
6
+ const require_dist = require("../../dist-xCNJAQMh.js");
7
7
  const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
8
8
  const require_prefix_range = require("../../prefix-range-D_KueXbQ.js");
9
9
  const require_prefix_walk = require("../../prefix-walk-Dv6MLZlM.js");
@@ -4337,7 +4337,8 @@ function wireableEntryForDef(capName, def) {
4337
4337
  path: f.path,
4338
4338
  kind: f.kind,
4339
4339
  ...f.enumValues !== void 0 ? { enumValues: [...f.enumValues] } : {},
4340
- ...f.item === true ? { item: true } : {}
4340
+ ...f.item === true ? { item: true } : {},
4341
+ ...f.quantity !== void 0 ? { quantity: f.quantity } : {}
4341
4342
  }));
4342
4343
  if (fields.length === 0) return null;
4343
4344
  return {
@@ -1,4 +1,4 @@
1
- import { $r as DeviceRole, $t as deviceExtensionCapability, Ca as sleep$1, Da as userError, Ea as transformSecretWrite, F as DeviceTombstoneSchema, In as locationIconKey, Ji as defineRecordKinds, L as FieldClaimModeSchema, Mn as legacyAutoLinkIds, P as DeviceStatusSchema, Pi as WELL_KNOWN_TAB_MAP, Pt as canonicalIconKey, Qr as DeviceFeature, R as FieldClaimSchema, Sr as siteZoneKey, Ta as toSecretFieldView, Wi as collectZodSecretPaths, Wt as createDeviceExtensionProvider, Y as MINUTES_PER_DAY, Yt as defineExtensionSlotProvider, Zn as parseStreamParamsFormPatch, aa as isSecretMarker, ei as DeviceType, gn as formatMinutes, gr as runtimeStatePolicyFor, ia as isSecretClear, in as deviceStatusCapability, jt as buildStreamParamsConfigSchema, ka as EventCategory, ki as SECRET_CLEAR, l as CAP_NAMES_WITH_STATUS, ni as BaseAddon, oa as isSecretMarkerLike, on as enumerateItemArrayFields, ot as STREAM_PROFILE_META, qn as normalizeUnit, r as ALL_CAPABILITY_DEFINITIONS, ra as isKeychainStoredField, rn as deviceStateCapability, s as CAMERA_SWITCH_ORDER, sn as enumerateSchemaFields, ta as isDeviceConfigCap, ti as errMsg, tn as deviceManagerCapability, un as expandContainer, w as DAY_NAMES, xa as secretTreeFromPaths, ya as resolveSecretMarkers } from "../../dist-DvKEKSap.mjs";
1
+ import { $r as DeviceRole, $t as deviceExtensionCapability, Ca as secretTreeFromPaths, Da as toSecretFieldView, F as DeviceTombstoneSchema, In as locationIconKey, Ji as defineRecordKinds, L as FieldClaimModeSchema, Mn as legacyAutoLinkIds, Oa as transformSecretWrite, P as DeviceStatusSchema, Pi as WELL_KNOWN_TAB_MAP, Pt as canonicalIconKey, Qr as DeviceFeature, R as FieldClaimSchema, Sr as siteZoneKey, Ta as sleep$1, Wi as collectZodSecretPaths, Wt as createDeviceExtensionProvider, Y as MINUTES_PER_DAY, Yt as defineExtensionSlotProvider, Zn as parseStreamParamsFormPatch, ca as isSecretMarkerLike, ei as DeviceType, gn as formatMinutes, gr as runtimeStatePolicyFor, ia as isKeychainStoredField, in as deviceStatusCapability, ja as EventCategory, jt as buildStreamParamsConfigSchema, ka as userError, ki as SECRET_CLEAR, l as CAP_NAMES_WITH_STATUS, na as isDeviceConfigCap, ni as BaseAddon, oa as isSecretClear, on as enumerateItemArrayFields, ot as STREAM_PROFILE_META, qn as normalizeUnit, r as ALL_CAPABILITY_DEFINITIONS, rn as deviceStateCapability, s as CAMERA_SWITCH_ORDER, sa as isSecretMarker, sn as enumerateSchemaFields, ti as errMsg, tn as deviceManagerCapability, un as expandContainer, w as DAY_NAMES, xa as resolveSecretMarkers } from "../../dist-Df6c0RX_.mjs";
2
2
  import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
3
3
  import { t as prefixRange } from "../../prefix-range-Dl0znowN.mjs";
4
4
  import { t as loadPrefixed } from "../../prefix-walk-DAOBSyH1.mjs";
@@ -4332,7 +4332,8 @@ function wireableEntryForDef(capName, def) {
4332
4332
  path: f.path,
4333
4333
  kind: f.kind,
4334
4334
  ...f.enumValues !== void 0 ? { enumValues: [...f.enumValues] } : {},
4335
- ...f.item === true ? { item: true } : {}
4335
+ ...f.item === true ? { item: true } : {},
4336
+ ...f.quantity !== void 0 ? { quantity: f.quantity } : {}
4336
4337
  }));
4337
4338
  if (fields.length === 0) return null;
4338
4339
  return {
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-2gZWO597.js");
6
+ const require_dist = require("../../dist-xCNJAQMh.js");
7
7
  const require_formatter = require("../../formatter-xbxeV4GD.js");
8
8
  //#region src/builtins/hub-forwarder/hub-forwarder-destination.ts
9
9
  var DEFAULT_OUTBOUND_BUFFER_SIZE = 500;
@@ -1,4 +1,4 @@
1
- import { Ln as logDestinationCapability, ni as BaseAddon } from "../../dist-DvKEKSap.mjs";
1
+ import { Ln as logDestinationCapability, ni as BaseAddon } from "../../dist-Df6c0RX_.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-DkYZ4LXp.mjs";
3
3
  //#region src/builtins/hub-forwarder/hub-forwarder-destination.ts
4
4
  var DEFAULT_OUTBOUND_BUFFER_SIZE = 500;
@@ -3,10 +3,10 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-2gZWO597.js");
7
- const require_device_ca = require("../../device-ca-CSLMfr4Q.js");
6
+ const require_dist = require("../../dist-xCNJAQMh.js");
7
+ const require_device_ca = require("../../device-ca-D_4dI5gv.js");
8
8
  const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
9
- const require_constants = require("../../constants-Bt0NFXDm.js");
9
+ const require_constants = require("../../constants-CQfTeCnB.js");
10
10
  const require_platform_key_source = require("../../platform-key-source-Di7HrlGR.js");
11
11
  let node_crypto = require("node:crypto");
12
12
  let _camstack_types_node = require("@camstack/types/node");
@@ -1,7 +1,7 @@
1
- import { An as keychainAdminCapability, G as KeychainResetRecordSchema, Ji as defineRecordKinds, Qi as formatSecretScope, U as KEYCHAIN_RESET_TRIGGER_ACTOR, W as KeychainAuditEntrySchema, fa as normalizeSecretOwner, ha as parseSecretRef, jn as keychainCapability, ka as EventCategory, ni as BaseAddon } from "../../dist-DvKEKSap.mjs";
2
- import { d as JWT_SIGNING_KEY_REF, n as DEVICE_CA_KEY_REF, p as SYSTEM_SECRET_OWNER } from "../../device-ca-HQKcvofS.mjs";
1
+ import { An as keychainAdminCapability, G as KeychainResetRecordSchema, Ji as defineRecordKinds, Qi as formatSecretScope, U as KEYCHAIN_RESET_TRIGGER_ACTOR, W as KeychainAuditEntrySchema, _a as parseSecretRef, ja as EventCategory, jn as keychainCapability, ma as normalizeSecretOwner, ni as BaseAddon } from "../../dist-Df6c0RX_.mjs";
2
+ import { d as JWT_SIGNING_KEY_REF, n as DEVICE_CA_KEY_REF, p as SYSTEM_SECRET_OWNER } from "../../device-ca-Bzd6UO_c.mjs";
3
3
  import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
4
- import { a as MESH_CA_KEY_REF } from "../../constants-DMB-ex5z.mjs";
4
+ import { a as MESH_CA_KEY_REF } from "../../constants-7D7xjw0h.mjs";
5
5
  import { n as getPlatformKeychainKey } from "../../platform-key-source-BWlq0jjn.mjs";
6
6
  import { createCipheriv, createDecipheriv, createHmac, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
7
7
  import { restrictDirToOwnerSync, restrictFileToOwnerSync, writeOwnerOnlyFileSync } from "@camstack/types/node";
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("../../chunk-Cek0wNdY.js");
3
- const require_dist = require("../../dist-2gZWO597.js");
3
+ const require_dist = require("../../dist-xCNJAQMh.js");
4
4
  let node_fs_promises = require("node:fs/promises");
5
5
  node_fs_promises = require_chunk.__toESM(node_fs_promises);
6
6
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { Gi as createEvent, Vn as mayWriteToLocation, it as RecordingStatusSchema, ka as EventCategory, ni as BaseAddon, nt as RECORDING_SOURCE_CAMSTACK_ADDON, ti as errMsg } from "../../dist-DvKEKSap.mjs";
1
+ import { Gi as createEvent, Vn as mayWriteToLocation, it as RecordingStatusSchema, ja as EventCategory, ni as BaseAddon, nt as RECORDING_SOURCE_CAMSTACK_ADDON, ti as errMsg } from "../../dist-Df6c0RX_.mjs";
2
2
  import * as fsp from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import { constants } from "node:fs";
@@ -3,10 +3,10 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-2gZWO597.js");
6
+ const require_dist = require("../../dist-xCNJAQMh.js");
7
7
  const require_safe_buffer$1 = require("../../safe-buffer-D3aoa-7X.js");
8
8
  const require_ms$1 = require("../../ms-LB3giGoU.js");
9
- const require_device_ca = require("../../device-ca-CSLMfr4Q.js");
9
+ const require_device_ca = require("../../device-ca-D_4dI5gv.js");
10
10
  const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
11
11
  let zod = require("zod");
12
12
  let node_crypto = require("node:crypto");
@@ -1,8 +1,8 @@
1
1
  import { i as __require, o as __toESM, t as __commonJSMin } from "../../chunk-CNf5ZN-e.mjs";
2
- import { $ as PreferenceDeviceIdSchema, At as buildDeviceSignatureMessage, Da as userError, E as DEVICE_ENROLLMENT_TTL_MS, Ji as defineRecordKinds, Nr as userManagementCapability, O as DEVICE_NONCE_TTL_MS, Q as PREFERENCES_MAX_VALUE_BYTES, Qt as deviceCredentialsCapability, aa as isSecretMarker, ca as makeSecretMarker, et as PreferenceNamespaceSchema, gt as UserRecordSchema, h as CREDENTIAL_TOKEN_AUDIENCE, hn as formatDeviceRevoker, kt as buildDeviceEnrollmentLink, lt as SsoBridgeClaimsSchema, mt as TokenScopeSchema, ni as BaseAddon, st as ScopedTokenSchema, tt as PreferenceValueSchema, wn as isCredentialTokenPayload, wt as authProviderCapability, y as CredentialTokenClaimsSchema } from "../../dist-DvKEKSap.mjs";
2
+ import { $ as PreferenceDeviceIdSchema, At as buildDeviceSignatureMessage, E as DEVICE_ENROLLMENT_TTL_MS, Ji as defineRecordKinds, Nr as userManagementCapability, O as DEVICE_NONCE_TTL_MS, Q as PREFERENCES_MAX_VALUE_BYTES, Qt as deviceCredentialsCapability, et as PreferenceNamespaceSchema, gt as UserRecordSchema, h as CREDENTIAL_TOKEN_AUDIENCE, hn as formatDeviceRevoker, ka as userError, kt as buildDeviceEnrollmentLink, lt as SsoBridgeClaimsSchema, mt as TokenScopeSchema, ni as BaseAddon, sa as isSecretMarker, st as ScopedTokenSchema, tt as PreferenceValueSchema, ua as makeSecretMarker, wn as isCredentialTokenPayload, wt as authProviderCapability, y as CredentialTokenClaimsSchema } from "../../dist-Df6c0RX_.mjs";
3
3
  import { t as require_safe_buffer } from "../../safe-buffer-B1OjL1I9.mjs";
4
4
  import { t as require_ms } from "../../ms-CgH2OFlD.mjs";
5
- import { _ as setProcessJwtSigningKey, a as importDevicePublicKey, c as rebuildDeviceCaCertificate, d as JWT_SIGNING_KEY_REF, g as processJwtSigningKey, h as loadJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, r as DEVICE_CA_SETTINGS_SECTION, s as loadDeviceCa, t as DEVICE_CA_FIELD, u as verifyDeviceSignature } from "../../device-ca-HQKcvofS.mjs";
5
+ import { _ as setProcessJwtSigningKey, a as importDevicePublicKey, c as rebuildDeviceCaCertificate, d as JWT_SIGNING_KEY_REF, g as processJwtSigningKey, h as loadJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, r as DEVICE_CA_SETTINGS_SECTION, s as loadDeviceCa, t as DEVICE_CA_FIELD, u as verifyDeviceSignature } from "../../device-ca-Bzd6UO_c.mjs";
6
6
  import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
7
7
  import { z } from "zod";
8
8
  import * as crypto$1 from "node:crypto";
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("../../chunk-Cek0wNdY.js");
3
- const require_dist = require("../../dist-2gZWO597.js");
4
- const require_hub_mdns_ciao = require("../../hub-mdns-ciao-Bs3cn9C1.js");
3
+ const require_dist = require("../../dist-xCNJAQMh.js");
4
+ const require_hub_mdns_ciao = require("../../hub-mdns-ciao-DRfmLR_Z.js");
5
5
  let zod = require("zod");
6
6
  let node_net = require("node:net");
7
7
  let node_os = require("node:os");
@@ -1,5 +1,5 @@
1
- import { Fn as localNetworkCapability, Fr as validateCustomAddress, Ft as checkRoleAddress, H as HUB_MDNS_TXT_KEYS, Qn as pickAppLinkHub, Tn as isDefaultAppConnectionEndpoint, V as HUB_MDNS_SERVICE_TYPE, Z as NetworkTunnelStartedDataSchema, c as CAMSTACK_APP_LINK_ORIGIN, cr as resolveAppConnections, fr as resolveHubAddressRoles, hr as resolveNotificationTapAddress, ka as EventCategory, ni as BaseAddon, ti as errMsg, xn as isAppLinkBase, xr as shortHostname } from "../../dist-DvKEKSap.mjs";
2
- import { P as readLanHttpState, a as storeUploadedCertificate, d as servedHttpsLeafFingerprint, g as readTlsMode, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as applyLanHttp, k as DEFAULT_LAN_HTTP_PORT, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, r as regenerateCertificate, t as createCiaoPublisher, v as writeExtraSans, w as ensureTlsCert } from "../../hub-mdns-ciao-CVf6mxIZ.mjs";
1
+ import { Fn as localNetworkCapability, Fr as validateCustomAddress, Ft as checkRoleAddress, H as HUB_MDNS_TXT_KEYS, Qn as pickAppLinkHub, Tn as isDefaultAppConnectionEndpoint, V as HUB_MDNS_SERVICE_TYPE, Z as NetworkTunnelStartedDataSchema, c as CAMSTACK_APP_LINK_ORIGIN, cr as resolveAppConnections, fr as resolveHubAddressRoles, hr as resolveNotificationTapAddress, ja as EventCategory, ni as BaseAddon, ti as errMsg, xn as isAppLinkBase, xr as shortHostname } from "../../dist-Df6c0RX_.mjs";
2
+ import { P as readLanHttpState, a as storeUploadedCertificate, d as servedHttpsLeafFingerprint, g as readTlsMode, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as applyLanHttp, k as DEFAULT_LAN_HTTP_PORT, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, r as regenerateCertificate, t as createCiaoPublisher, v as writeExtraSans, w as ensureTlsCert } from "../../hub-mdns-ciao-D7GMnEz0.mjs";
3
3
  import { z } from "zod";
4
4
  import { isIP } from "node:net";
5
5
  import * as os$1 from "node:os";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-2gZWO597.js");
6
+ const require_dist = require("../../dist-xCNJAQMh.js");
7
7
  const require_log_read_filter = require("../../log-read-filter-Bi066jwU.js");
8
8
  let zod = require("zod");
9
9
  //#region src/builtins/loki-logging/loki-payload.ts
@@ -1,4 +1,4 @@
1
- import { Ln as logDestinationCapability, ni as BaseAddon } from "../../dist-DvKEKSap.mjs";
1
+ import { Ln as logDestinationCapability, ni as BaseAddon } from "../../dist-Df6c0RX_.mjs";
2
2
  import { n as compileLogFilter, o as lineMatches } from "../../log-read-filter-D7Ev3zm-.mjs";
3
3
  import { z } from "zod";
4
4
  //#region src/builtins/loki-logging/loki-payload.ts