@camstack/server 1.2.728 → 1.2.729

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 (107) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/agent/main.js +2 -14
  3. package/dist/api/core/cap-providers.js +0 -7
  4. package/dist/api/trpc/generated-cap-mounts.js +2 -1
  5. package/dist/api/trpc/generated-cap-routers.js +1848 -1839
  6. package/dist/boot/boot-config.js +1 -1
  7. package/dist/core/addon/addon-package.service.js +3 -105
  8. package/dist/core/addon-bridge/addon-bridge.service.js +1 -5
  9. package/dist/launcher.js +12 -124
  10. package/package.json +21 -17
  11. package/system/dist/addon-runner.js +1 -2
  12. package/system/dist/addon-runner.mjs +1 -2
  13. package/system/dist/{agent-https-B1XLr4nm.js → agent-https-BMmfwElS.js} +1 -1
  14. package/system/dist/{agent-https-BsedJhrb.mjs → agent-https-BXB7X23w.mjs} +1 -1
  15. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  16. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  17. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  18. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  19. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  20. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  21. package/system/dist/builtins/autotrack/index.js +1 -1
  22. package/system/dist/builtins/autotrack/index.mjs +1 -1
  23. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  24. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  25. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  26. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  27. package/system/dist/builtins/camera-grid/index.js +1 -1
  28. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  29. package/system/dist/builtins/composer/composer.addon.js +3 -3
  30. package/system/dist/builtins/composer/composer.addon.mjs +3 -3
  31. package/system/dist/builtins/console-logging/index.js +1 -1
  32. package/system/dist/builtins/console-logging/index.mjs +1 -1
  33. package/system/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
  34. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
  35. package/system/dist/builtins/device-history/device-history.addon.d.ts +4 -0
  36. package/system/dist/builtins/device-history/device-history.addon.js +769 -17
  37. package/system/dist/builtins/device-history/device-history.addon.mjs +769 -17
  38. package/system/dist/builtins/device-history/runs/device-runs-provider.d.ts +7 -0
  39. package/system/dist/builtins/device-history/runs/device-runs-record-kinds.d.ts +15 -0
  40. package/system/dist/builtins/device-history/runs/device-runs-service.d.ts +42 -0
  41. package/system/dist/builtins/device-history/runs/energy-from-history.d.ts +22 -0
  42. package/system/dist/builtins/device-history/runs/run-recorder.d.ts +111 -0
  43. package/system/dist/builtins/device-history/runs/slice-readers.d.ts +9 -0
  44. package/system/dist/builtins/device-manager/device-manager.addon.js +1 -1
  45. package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  46. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  47. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  48. package/system/dist/builtins/keychain/index.js +47 -38
  49. package/system/dist/builtins/keychain/index.mjs +47 -38
  50. package/system/dist/builtins/keychain/key-sources.d.ts +12 -7
  51. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  52. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  53. package/system/dist/builtins/local-auth/local-auth.addon.js +3 -3
  54. package/system/dist/builtins/local-auth/local-auth.addon.mjs +3 -3
  55. package/system/dist/builtins/local-network/local-network.addon.js +2 -2
  56. package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
  57. package/system/dist/builtins/loki-logging/index.js +1 -1
  58. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  59. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  60. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  61. package/system/dist/builtins/platform-probe/index.js +1 -1
  62. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  63. package/system/dist/builtins/record-entries/index.js +1 -1
  64. package/system/dist/builtins/record-entries/index.mjs +1 -1
  65. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  66. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  67. package/system/dist/builtins/snapshot/index.js +1 -1
  68. package/system/dist/builtins/snapshot/index.mjs +1 -1
  69. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  70. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  71. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  72. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  73. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +2 -2
  74. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
  75. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  76. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  77. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  78. package/system/dist/builtins/system-config/system-config.addon.mjs +284 -284
  79. package/system/dist/builtins/winston-logging/index.js +1 -1
  80. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  81. package/system/dist/{composition-sources-BjuQ3xot.mjs → composition-sources-BCfgVe9V.mjs} +1 -1
  82. package/system/dist/{composition-sources-C5r8i46e.js → composition-sources-D6b0p8Hl.js} +1 -1
  83. package/system/dist/{constants-GnxjCxT3.mjs → constants-BQLyzulL.mjs} +1 -1
  84. package/system/dist/{constants-Bh5wQoTg.js → constants-ePrW9DMj.js} +1 -1
  85. package/system/dist/{device-ca-OWEYAYaG.mjs → device-ca-C8X1AGHU.mjs} +2 -2
  86. package/system/dist/{device-ca-oM-nuINR.js → device-ca-Dh9wjg_e.js} +2 -2
  87. package/system/dist/{dist-B9xpybTG.js → dist-D-7p7cJp.js} +198 -35
  88. package/system/dist/{dist-Cw8KtuQY.mjs → dist-XvOCXwnA.mjs} +187 -36
  89. package/system/dist/file-host-worker.js +1 -1
  90. package/system/dist/file-host-worker.mjs +1 -1
  91. package/system/dist/{hub-mdns-ciao-BPENkOKX.js → hub-mdns-ciao-BFZZAJIx.js} +2 -2
  92. package/system/dist/{hub-mdns-ciao-C3qMZFP0.mjs → hub-mdns-ciao-CGwz5__T.mjs} +2 -2
  93. package/system/dist/index.js +40 -186
  94. package/system/dist/index.mjs +41 -185
  95. package/system/dist/kernel/addon-installer.d.ts +9 -60
  96. package/system/dist/kernel/bootstrap-config.d.ts +3 -1
  97. package/system/dist/kernel/config-schema.d.ts +2 -11
  98. package/system/dist/kernel/fs-utils.d.ts +0 -6
  99. package/system/dist/kernel/index.d.ts +2 -3
  100. package/system/dist/{restore-archive-BiN1yKZV.js → restore-archive-3e5X8g6h.js} +1 -1
  101. package/system/dist/{restore-archive-DJv5ATV8.mjs → restore-archive-B3M3ZwAl.mjs} +82 -82
  102. package/system/dist/{retention-DQje-V4I.mjs → retention-BPxZj_Qf.mjs} +1 -1
  103. package/system/dist/{retention-BT7TgsUn.js → retention-DacNjIXz.js} +1 -1
  104. package/system/dist/{wal-maintenance-DM08Htuy.mjs → wal-maintenance-C4K7pX1x.mjs} +0 -0
  105. package/system/dist/{wal-maintenance-BLwgOIXb.js → wal-maintenance-Dguwwx4N.js} +0 -0
  106. package/system/package.json +5 -2
  107. package/system/dist/kernel/workspace-detect.d.ts +0 -9
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The `device-runs` capability over the run ledger. Reads go to the store, never
3
+ * to the recorder's mirror: an answered empty page is "no runs", and the open
4
+ * run is what is on disk (the open row is written through).
5
+ */
6
+ import type { DeviceRun, IDeviceRunsProvider, RecordKindHandle } from "@camstack/types";
7
+ export declare function createDeviceRunsProvider(runs: RecordKindHandle<DeviceRun>): IDeviceRunsProvider;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The record kind of the run ledger (D992). Declared by the device-history
3
+ * addon (owner stamp `device-history`) in the `events` file: a ring of the
4
+ * newest runs per device, with one row per run and the open row written
5
+ * through at the instant the run opens.
6
+ *
7
+ * Kept in a module with no side effects: the records guards import it.
8
+ */
9
+ import type { z } from "zod";
10
+ import { DeviceRunSchema, type DefinedRecordKind } from "@camstack/types";
11
+ export declare const DEVICE_RUNS_MAX_ROWS_PER_DEVICE = 500;
12
+ export type DeviceRunsRecordKindsMap = {
13
+ readonly "device-runs": DefinedRecordKind<z.ZodType<z.infer<typeof DeviceRunSchema>>>;
14
+ };
15
+ export declare const deviceRunsRecordKinds: DeviceRunsRecordKindsMap;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * The run ledger as the addon shell sees it: the declared kind, the recorder,
3
+ * the capability provider, the timer and the device-removal hook body (D865).
4
+ * The shell only forwards (`onHubReachable` -> {@link DeviceRunsService.open},
5
+ * the bus -> {@link DeviceRunsService.handleState}); everything with a rule is
6
+ * in the files beside this one.
7
+ */
8
+ import { type DeviceRun, type DeviceType, type EventCategory, type IDeviceRunsProvider, type IScopedLogger, type RecordsAccess } from "@camstack/types";
9
+ import type { SnapshotMap } from "../capture/capture-engine.js";
10
+ import type { Slice } from "./slice-readers.js";
11
+ export interface DeviceRunsServiceDeps {
12
+ readonly records: RecordsAccess;
13
+ readonly readSnapshots: () => Promise<SnapshotMap>;
14
+ readonly readCapSlice: (deviceId: number, capName: string) => Promise<Slice | null>;
15
+ readonly deviceTypeOf: (deviceId: number) => Promise<DeviceType | undefined>;
16
+ readonly energyFromHistory: (deviceId: number, from: number, to: number) => Promise<number | null>;
17
+ readonly emit: (category: EventCategory, run: DeviceRun) => void;
18
+ readonly logger: IScopedLogger;
19
+ readonly clock: () => number;
20
+ }
21
+ export declare class DeviceRunsService {
22
+ private readonly deps;
23
+ private recorder;
24
+ private handle;
25
+ private timer;
26
+ private provider;
27
+ constructor(deps: DeviceRunsServiceDeps);
28
+ /** Declare the kind, then the first reconcile; an unanswered one is retried by the timer. */
29
+ open(): Promise<{
30
+ readonly provider: IDeviceRunsProvider;
31
+ }>;
32
+ startTimer(): void;
33
+ handleState(deviceId: number, capName: string, slice: Slice, at: number): void;
34
+ stop(): Promise<void>;
35
+ /** The D865 hook body: how many run rows the removal deleted. */
36
+ removeDevice(deviceId: number): Promise<number>;
37
+ /** Run rows per device, for the admin clean-up listing. */
38
+ countByDevice(): Promise<readonly {
39
+ deviceId: number;
40
+ count: number;
41
+ }[]>;
42
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The energy of a window from device-history's OWN stored series - the
3
+ * fallback when the meter counter could not give `end - start` (D992).
4
+ *
5
+ * It sums the per-bucket `delta` of the derived energy key. Buckets are five
6
+ * minutes wide, so a window shorter than {@link MIN_HISTORY_WINDOW_MS} is never
7
+ * answered from them: a number built from one partial bucket would be a guess.
8
+ */
9
+ import { type DeviceHistorySubject, type DeviceHistoryQueryResult } from "@camstack/types";
10
+ export declare const MIN_HISTORY_WINDOW_MS: number;
11
+ export interface EnergyHistoryQuery {
12
+ (input: {
13
+ readonly key: string;
14
+ readonly subject: DeviceHistorySubject;
15
+ readonly from: number;
16
+ readonly to: number;
17
+ readonly resolution: "5m";
18
+ readonly maxPoints: number;
19
+ }): Promise<DeviceHistoryQueryResult>;
20
+ }
21
+ /** kWh over `[from, to]`, or `null` when the series cannot say (no meter, no points, too short). */
22
+ export declare function energyKwhFromHistory(query: EnergyHistoryQuery, deviceId: number, from: number, to: number): Promise<number | null>;
@@ -0,0 +1,111 @@
1
+ /**
2
+ * The run recorder (D992): turns the `running-state` flips of a device into one
3
+ * durable `device-runs` row per run.
4
+ *
5
+ * - open: `running` false -> true writes the OPEN row through, so a run that
6
+ * outlives this process is on disk from its first instant;
7
+ * - close: true -> false closes it, with the energy of the run and its outcome;
8
+ * - boot reconcile: the open rows are compared with the live snapshots - a
9
+ * device still running keeps its row, one that stopped while nobody watched
10
+ * closes `unknown`, one running with no row opens late. A run is never
11
+ * duplicated: a device has at most one open run, in the mirror and on disk.
12
+ *
13
+ * Nothing one-shot gates on a fallible read (D49): a failed load or snapshot
14
+ * read changes nothing and the next pass tries again; events that arrive before
15
+ * the first answered load wait in a bounded buffer and replay after it.
16
+ *
17
+ * Energy comes from device-history's own data: the meter counter at open minus
18
+ * the counter at close, else the stored history of the window. Both unknown is
19
+ * `null` - never `0`.
20
+ */
21
+ import { type DeviceRun, DeviceType, EventCategory, type IScopedLogger, type RecordKindHandle } from "@camstack/types";
22
+ import type { SnapshotMap } from "../capture/capture-engine.js";
23
+ import { type Slice } from "./slice-readers.js";
24
+ export declare const RUNNING_STATE_CAP = "running-state";
25
+ export declare const POWER_METER_CAP = "power-meter";
26
+ export declare const DISHWASHER_CAP = "dishwasher";
27
+ /** A run shorter than this that never reported a finishing phase is a dwell flap, not a cycle. */
28
+ export declare const ABORTED_BELOW_MS: number;
29
+ /** Events held before the first answered load; beyond it the oldest are dropped, counted and logged. */
30
+ export declare const MAX_BUFFERED_EVENTS = 2e3;
31
+ export declare const RECORDER_TICK_MS: number;
32
+ export declare const RECONCILE_EVERY_TICKS = 5;
33
+ export declare const FLUSH_EVERY_TICKS = 5;
34
+ export interface RunRecorderDeps {
35
+ readonly runs: RecordKindHandle<DeviceRun>;
36
+ readonly readSnapshots: () => Promise<SnapshotMap>;
37
+ readonly readCapSlice: (deviceId: number, capName: string) => Promise<Slice | null>;
38
+ readonly deviceTypeOf: (deviceId: number) => Promise<DeviceType | undefined>;
39
+ /** kWh of a window from the stored history, or `null`. */
40
+ readonly energyFromHistory: (deviceId: number, from: number, to: number) => Promise<number | null>;
41
+ readonly emit: (category: EventCategory, run: DeviceRun) => void;
42
+ readonly logger: IScopedLogger;
43
+ readonly clock: () => number;
44
+ }
45
+ export declare class RunRecorder {
46
+ private readonly deps;
47
+ private readonly open;
48
+ private readonly lastEnergy;
49
+ private readonly lastPower;
50
+ private readonly lastDishwasher;
51
+ private readonly chains;
52
+ private buffered;
53
+ private loaded;
54
+ private droppedWhileBuffering;
55
+ private ticks;
56
+ constructor(deps: RunRecorderDeps);
57
+ /**
58
+ * One minute of the owner's clock: retry the load until it answers, then
59
+ * compare against the snapshots every {@link RECONCILE_EVERY_TICKS} and save
60
+ * the open totals every {@link FLUSH_EVERY_TICKS}.
61
+ */
62
+ tick(): Promise<void>;
63
+ /** Has a load of the open rows ANSWERED? Until then flips are buffered. */
64
+ isLoaded(): boolean;
65
+ /** Resolves when every queued flip has been handled (specs, shutdown). */
66
+ idle(): Promise<void>;
67
+ /** The open run of a device, from the mirror. */
68
+ openRunOf(deviceId: number): DeviceRun | null;
69
+ /** Feed one `DeviceStateChanged` slice. Never throws; a failure is logged with the device. */
70
+ handleState(deviceId: number, capName: string, slice: Slice, at: number): void;
71
+ private buffer;
72
+ private enqueue;
73
+ private apply;
74
+ private notePower;
75
+ /** Close the interval since the previous reading at the watts it held. */
76
+ private accrue;
77
+ private powerOf;
78
+ private energyNow;
79
+ private measureEnergy;
80
+ private notePhase;
81
+ private openRun;
82
+ private closeRun;
83
+ private outcomeOf;
84
+ private announce;
85
+ /**
86
+ * Write the power totals of every open run (a crash then loses at most one
87
+ * interval of peak/mean, never the run). Timer-driven; a failed write leaves
88
+ * the run dirty for the next pass.
89
+ */
90
+ flushOpen(): Promise<void>;
91
+ /**
92
+ * Compare the open rows on disk with the live snapshots. Returns `false` when
93
+ * either read failed - nothing changed and the caller tries again (D49).
94
+ * Only the FIRST answered pass reads the rows (the mirror is the truth after
95
+ * it) and replays the flips buffered while it was pending; later passes
96
+ * compare the mirror with the snapshots, so a row read a moment before a
97
+ * close can never bring a closed run back.
98
+ */
99
+ reconcile(): Promise<boolean>;
100
+ private loadOpenRows;
101
+ private settleAgainst;
102
+ /** A mirrored run whose device now says it stopped closes `unknown` (a later pass, flips missed). */
103
+ private settleMirror;
104
+ /** A device running with no open run: open it late, from its own `since`. */
105
+ private openLate;
106
+ /** One device at a time; a failure is logged with the device and never aborts the pass. */
107
+ private exclusive;
108
+ private seedPower;
109
+ /** Put a stored open row back in the mirror, its power totals resumed from the row. */
110
+ private adopt;
111
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Typed reads of a device-state slice, which arrives as an untyped record.
3
+ * A field of the wrong type is "not said" (`null`), never coerced (D393).
4
+ */
5
+ export type Slice = Readonly<Record<string, unknown>>;
6
+ export declare function numberField(slice: Slice | null, key: string): number | null;
7
+ export declare function stringField(slice: Slice | null, key: string): string | null;
8
+ export declare function booleanField(slice: Slice | null, key: string): boolean | null;
9
+ export declare function isSlice(value: unknown): value is Slice;
@@ -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-B9xpybTG.js");
6
+ const require_dist = require("../../dist-D-7p7cJp.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");
@@ -1,4 +1,4 @@
1
- import { $ as FieldClaimModeSchema, $n as enumerateSchemaFields, $o as isDeviceConfigCap, As as DeviceType, Eo as SECRET_CLEAR, Es as userError, Gn as deviceExtensionCapability, Go as defineRecordKinds, K as DeviceStatusSchema, Lr as locationIconKey, Mr as legacyAutoLinkIds, Ms as EventCategory, Nn as createDeviceExtensionProvider, Nt as STREAM_PROFILE_META, Os as DeviceFeature, P as DAY_NAMES, Qa as BaseAddon, Qn as enumerateItemArrayFields, Ss as sleep$1, Ts as transformSecretWrite, Vn as defineExtensionSlotProvider, Vo as collectZodSecretPaths, Xi as siteZoneKey, Xn as deviceStatusCapability, Yn as deviceStateCapability, as as isSecretMarkerLike, bs as secretTreeFromPaths, et as FieldClaimSchema, fr as formatMinutes, g as CAMERA_SWITCH_ORDER, gn as canonicalIconKey, ht as MINUTES_PER_DAY, is as isSecretMarker, jo as WELL_KNOWN_TAB_MAP, js as errMsg, ks as DeviceRole, o as ALL_CAPABILITY_DEFINITIONS, pn as buildStreamParamsConfigSchema, q as DeviceTombstoneSchema, qn as deviceManagerCapability, ri as normalizeUnit, rr as expandContainer, rs as isSecretClear, ts as isKeychainStoredField, ui as parseStreamParamsFormPatch, v as CAP_NAMES_WITH_STATUS, vs as resolveSecretMarkers, ws as toSecretFieldView, zi as runtimeStatePolicyFor } from "../../dist-Cw8KtuQY.mjs";
1
+ import { As as DeviceFeature, Ds as transformSecretWrite, Es as toSecretFieldView, Hn as defineExtensionSlotProvider, J as DeviceTombstoneSchema, Jn as deviceManagerCapability, Kn as deviceExtensionCapability, Ms as DeviceType, No as WELL_KNOWN_TAB_MAP, Ns as errMsg, Oo as SECRET_CLEAR, Os as userError, P as DAY_NAMES, Pn as createDeviceExtensionProvider, Pr as legacyAutoLinkIds, Ps as EventCategory, Pt as STREAM_PROFILE_META, Qi as siteZoneKey, Qn as deviceStatusCapability, Ss as secretTreeFromPaths, Uo as collectZodSecretPaths, Vi as runtimeStatePolicyFor, Zn as deviceStateCapability, _n as canonicalIconKey, ai as normalizeUnit, ar as expandContainer, as as isSecretClear, bs as resolveSecretMarkers, eo as BaseAddon, er as enumerateItemArrayFields, et as FieldClaimModeSchema, fi as parseStreamParamsFormPatch, g as CAMERA_SWITCH_ORDER, gt as MINUTES_PER_DAY, js as DeviceRole, mn as buildStreamParamsConfigSchema, mr as formatMinutes, o as ALL_CAPABILITY_DEFINITIONS, os as isSecretMarker, q as DeviceStatusSchema, qo as defineRecordKinds, rs as isKeychainStoredField, ss as isSecretMarkerLike, tr as enumerateSchemaFields, ts as isDeviceConfigCap, tt as FieldClaimSchema, v as CAP_NAMES_WITH_STATUS, ws as sleep$1, zr as locationIconKey } from "../../dist-XvOCXwnA.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";
@@ -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-B9xpybTG.js");
6
+ const require_dist = require("../../dist-D-7p7cJp.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 { Br as logDestinationCapability, Qa as BaseAddon } from "../../dist-Cw8KtuQY.mjs";
1
+ import { Hr as logDestinationCapability, eo as BaseAddon } from "../../dist-XvOCXwnA.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-B9xpybTG.js");
7
- const require_device_ca = require("../../device-ca-oM-nuINR.js");
6
+ const require_dist = require("../../dist-D-7p7cJp.js");
7
+ const require_device_ca = require("../../device-ca-Dh9wjg_e.js");
8
8
  const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
9
- const require_constants = require("../../constants-Bh5wQoTg.js");
9
+ const require_constants = require("../../constants-ePrW9DMj.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");
@@ -115,24 +115,35 @@ function decryptValue(dek, ref, envelope) {
115
115
  //#endregion
116
116
  //#region src/builtins/keychain/key-sources.ts
117
117
  /**
118
- * Where the master key comes from (D788). Configuration only — NO env var
119
- * carries a key or a key path:
118
+ * Where the master key comes from (D788, amended by D991). FIXED paths only —
119
+ * no config key, NO env var carries a key or a key path:
120
120
  *
121
- * 1. `keychain.keyFile` in `config.yaml` — a file outside the data volume
122
- * (a read-only bind mount, a Docker secret). Recommended: a whole-volume
123
- * backup then holds the ciphertext but not the key.
121
+ * 1. `/run/secrets/camstack-master-key` — primary when the file EXISTS at boot
122
+ * (the Docker / Compose secrets convention; Unraid and Proxmox bind-mount a
123
+ * file there). A file outside the data volume: a whole-volume backup then
124
+ * holds the ciphertext but not the key. CamStack only READS it — it is
125
+ * never written and never created.
124
126
  * 2. The desktop app's OS keychain (`safeStorage`), handed to the hub over an
125
- * inherited pipe. Primary on a desktop hub with no key file configured.
127
+ * inherited pipe. Primary on a desktop hub with no mounted key file.
126
128
  * 3. `<dataDir>/.keychain/master.key` (0600, directory 0700), generated on
127
129
  * first boot. The fallback: it protects CamStack's own backups and stray
128
130
  * database copies (it is NOT in `DEFAULT_BACKUP_LOCATIONS`), but a tar of
129
131
  * the whole data directory carries key and database together, and the
130
132
  * Secrets page says so.
131
133
  *
132
- * `keychain.previousKeyFile` is consulted only to UNLOCK — so a move from one
133
- * key to another is a restart plus `rotateMasterKey`, with no window where
134
- * neither key works.
134
+ * `/run/secrets/camstack-master-key.previous` is consulted only to UNLOCK — so a
135
+ * move from one external key to another is a restart plus `rotateMasterKey`,
136
+ * with no window where neither key works.
135
137
  */
138
+ /** The directory the mounted key files live in (injectable for specs, never an env var). */
139
+ var DEFAULT_SECRETS_DIR = "/run/secrets";
140
+ /** The mounted primary key file, under the secrets directory. */
141
+ var MOUNTED_KEY_FILE_NAME = "camstack-master-key";
142
+ /** The mounted unlock-only key file, under the secrets directory. */
143
+ var PREVIOUS_MOUNTED_KEY_FILE_NAME = "camstack-master-key.previous";
144
+ /** Absolute form of both, for messages. */
145
+ var MOUNTED_KEY_FILE_PATH = `${DEFAULT_SECRETS_DIR}/${MOUNTED_KEY_FILE_NAME}`;
146
+ var PREVIOUS_MOUNTED_KEY_FILE_PATH = `${DEFAULT_SECRETS_DIR}/${PREVIOUS_MOUNTED_KEY_FILE_NAME}`;
136
147
  /** The default key file's location under the data root. */
137
148
  function defaultKeyFilePath(dataDir) {
138
149
  return node_path.join(dataDir, ".keychain", "master.key");
@@ -164,23 +175,34 @@ function fileSource(kind, file, sharesBackupWithDatabase) {
164
175
  sharesBackupWithDatabase
165
176
  };
166
177
  }
178
+ async function fileExists(file) {
179
+ try {
180
+ await node_fs.promises.access(file);
181
+ return true;
182
+ } catch {
183
+ return false;
184
+ }
185
+ }
167
186
  /** Every candidate, primary first. */
168
- function buildKeySourceCandidates(opts) {
187
+ async function buildKeySourceCandidates(opts) {
169
188
  const out = [];
189
+ const secretsDir = opts.secretsDir ?? "/run/secrets";
190
+ const mountedFile = node_path.join(secretsDir, MOUNTED_KEY_FILE_NAME);
191
+ const previousFile = node_path.join(secretsDir, PREVIOUS_MOUNTED_KEY_FILE_NAME);
170
192
  const defaultFile = defaultKeyFilePath(opts.dataDir);
171
193
  const platform = require_platform_key_source.getPlatformKeychainKey();
172
- const keyFile = opts.config.keyFile?.trim();
173
- const previousKeyFile = opts.config.previousKeyFile?.trim();
174
- const primaryKind = keyFile !== void 0 && keyFile.length > 0 ? "config-file" : platform !== null ? "platform" : "default-file";
175
- if (keyFile !== void 0 && keyFile.length > 0) out.push({
176
- source: fileSource("config-file", keyFile, false),
194
+ const hasMounted = await fileExists(mountedFile);
195
+ const hasPrevious = await fileExists(previousFile);
196
+ const primaryKind = hasMounted ? "mounted-file" : platform !== null ? "platform" : "default-file";
197
+ if (hasMounted) out.push({
198
+ source: fileSource("mounted-file", mountedFile, false),
177
199
  primary: true,
178
- load: () => loadKeyFile(keyFile)
200
+ load: () => loadKeyFile(mountedFile)
179
201
  });
180
- if (previousKeyFile !== void 0 && previousKeyFile.length > 0) out.push({
181
- source: fileSource("previous-config-file", previousKeyFile, false),
202
+ if (hasPrevious) out.push({
203
+ source: fileSource("previous-mounted-file", previousFile, false),
182
204
  primary: false,
183
- load: () => loadKeyFile(previousKeyFile)
205
+ load: () => loadKeyFile(previousFile)
184
206
  });
185
207
  if (platform !== null) out.push({
186
208
  source: {
@@ -914,7 +936,7 @@ var KeychainService = class {
914
936
  replace: true,
915
937
  nowMs: this.now()
916
938
  });
917
- } else throw new Error(`keychain: the ${primary.source.kind} key is already in use. Put the new key at its source, set the old one as keychain.previousKeyFile, restart, then rotate.`);
939
+ } else throw new Error(`keychain: the ${primary.source.kind} key is already in use. To move to a new external source: put the new key at ${MOUNTED_KEY_FILE_PATH}, the old one at ${PREVIOUS_MOUNTED_KEY_FILE_PATH}, restart, then rotate.`);
918
940
  const fingerprint = kekFingerprint(newKek);
919
941
  if (constantTimeEquals(fingerprint, unlocked.fingerprint)) throw new Error("keychain: the new master key is the one already in use");
920
942
  const wrap = {
@@ -1033,7 +1055,7 @@ var KeychainService = class {
1033
1055
  const loaded = await primary.load();
1034
1056
  if (loaded.kind === "loaded") return;
1035
1057
  const where = primary.source.path ?? primary.source.kind;
1036
- throw new KeychainResetRefusedError(loaded.kind === "absent" ? `the configured master key ${where} does not exist — put a new 32-byte key there (or remove keychain.keyFile to use the default file) first` : `the configured master key ${where} cannot be read (${loaded.error})`);
1058
+ throw new KeychainResetRefusedError(loaded.kind === "absent" ? `the mounted master key ${where} does not exist — put a new 32-byte key there (or unmount it to use the default file) first` : `the mounted master key ${where} cannot be read (${loaded.error})`);
1037
1059
  }
1038
1060
  /** What the last reset left to re-enter (see `keychain-admin.resetReport`). */
1039
1061
  async resetReport() {
@@ -1948,14 +1970,6 @@ function callerOf(input) {
1948
1970
  const raw = Reflect.get(input, "callerAddonId");
1949
1971
  return typeof raw === "string" && raw.length > 0 ? raw : null;
1950
1972
  }
1951
- function readKeyConfig(section) {
1952
- const keyFile = section["keyFile"];
1953
- const previousKeyFile = section["previousKeyFile"];
1954
- return {
1955
- keyFile: typeof keyFile === "string" && keyFile.length > 0 ? keyFile : void 0,
1956
- previousKeyFile: typeof previousKeyFile === "string" && previousKeyFile.length > 0 ? previousKeyFile : void 0
1957
- };
1958
- }
1959
1973
  var KeychainAddon = class extends require_dist.BaseAddon {
1960
1974
  id = "keychain";
1961
1975
  pruneTimer = null;
@@ -1984,12 +1998,7 @@ var KeychainAddon = class extends require_dist.BaseAddon {
1984
1998
  if (records !== void 0) await records.declare(keychainRecordKinds);
1985
1999
  const service = new KeychainService({
1986
2000
  repo: new KeychainRepository(door, records !== void 0 ? KeychainRepository.recordStoresOf(records) : void 0),
1987
- candidates: async () => {
1988
- return buildKeySourceCandidates({
1989
- config: readKeyConfig(await ctx.settings?.getSection("keychain") ?? {}),
1990
- dataDir
1991
- });
1992
- },
2001
+ candidates: () => buildKeySourceCandidates({ dataDir }),
1993
2002
  dataDir,
1994
2003
  events: { emit: (payload) => {
1995
2004
  ctx.eventBus.emit({
@@ -1,7 +1,7 @@
1
- import { Ar as keychainAdminCapability, Go as defineRecordKinds, Ms as EventCategory, Qa as BaseAddon, Yo as formatSecretScope, ds as normalizeSecretOwner, dt as KeychainResetRecordSchema, jr as keychainCapability, lt as KEYCHAIN_RESET_TRIGGER_ACTOR, ms as parseSecretRef, ut as KeychainAuditEntrySchema } from "../../dist-Cw8KtuQY.mjs";
2
- import { d as JWT_SIGNING_KEY_REF, n as DEVICE_CA_KEY_REF, p as SYSTEM_SECRET_OWNER } from "../../device-ca-OWEYAYaG.mjs";
1
+ import { Mr as keychainAdminCapability, Nr as keychainCapability, Ps as EventCategory, Zo as formatSecretScope, dt as KeychainAuditEntrySchema, eo as BaseAddon, ft as KeychainResetRecordSchema, gs as parseSecretRef, ps as normalizeSecretOwner, qo as defineRecordKinds, ut as KEYCHAIN_RESET_TRIGGER_ACTOR } from "../../dist-XvOCXwnA.mjs";
2
+ import { d as JWT_SIGNING_KEY_REF, n as DEVICE_CA_KEY_REF, p as SYSTEM_SECRET_OWNER } from "../../device-ca-C8X1AGHU.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-GnxjCxT3.mjs";
4
+ import { a as MESH_CA_KEY_REF } from "../../constants-BQLyzulL.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";
@@ -109,24 +109,35 @@ function decryptValue(dek, ref, envelope) {
109
109
  //#endregion
110
110
  //#region src/builtins/keychain/key-sources.ts
111
111
  /**
112
- * Where the master key comes from (D788). Configuration only — NO env var
113
- * carries a key or a key path:
112
+ * Where the master key comes from (D788, amended by D991). FIXED paths only —
113
+ * no config key, NO env var carries a key or a key path:
114
114
  *
115
- * 1. `keychain.keyFile` in `config.yaml` — a file outside the data volume
116
- * (a read-only bind mount, a Docker secret). Recommended: a whole-volume
117
- * backup then holds the ciphertext but not the key.
115
+ * 1. `/run/secrets/camstack-master-key` — primary when the file EXISTS at boot
116
+ * (the Docker / Compose secrets convention; Unraid and Proxmox bind-mount a
117
+ * file there). A file outside the data volume: a whole-volume backup then
118
+ * holds the ciphertext but not the key. CamStack only READS it — it is
119
+ * never written and never created.
118
120
  * 2. The desktop app's OS keychain (`safeStorage`), handed to the hub over an
119
- * inherited pipe. Primary on a desktop hub with no key file configured.
121
+ * inherited pipe. Primary on a desktop hub with no mounted key file.
120
122
  * 3. `<dataDir>/.keychain/master.key` (0600, directory 0700), generated on
121
123
  * first boot. The fallback: it protects CamStack's own backups and stray
122
124
  * database copies (it is NOT in `DEFAULT_BACKUP_LOCATIONS`), but a tar of
123
125
  * the whole data directory carries key and database together, and the
124
126
  * Secrets page says so.
125
127
  *
126
- * `keychain.previousKeyFile` is consulted only to UNLOCK — so a move from one
127
- * key to another is a restart plus `rotateMasterKey`, with no window where
128
- * neither key works.
128
+ * `/run/secrets/camstack-master-key.previous` is consulted only to UNLOCK — so a
129
+ * move from one external key to another is a restart plus `rotateMasterKey`,
130
+ * with no window where neither key works.
129
131
  */
132
+ /** The directory the mounted key files live in (injectable for specs, never an env var). */
133
+ var DEFAULT_SECRETS_DIR = "/run/secrets";
134
+ /** The mounted primary key file, under the secrets directory. */
135
+ var MOUNTED_KEY_FILE_NAME = "camstack-master-key";
136
+ /** The mounted unlock-only key file, under the secrets directory. */
137
+ var PREVIOUS_MOUNTED_KEY_FILE_NAME = "camstack-master-key.previous";
138
+ /** Absolute form of both, for messages. */
139
+ var MOUNTED_KEY_FILE_PATH = `${DEFAULT_SECRETS_DIR}/${MOUNTED_KEY_FILE_NAME}`;
140
+ var PREVIOUS_MOUNTED_KEY_FILE_PATH = `${DEFAULT_SECRETS_DIR}/${PREVIOUS_MOUNTED_KEY_FILE_NAME}`;
130
141
  /** The default key file's location under the data root. */
131
142
  function defaultKeyFilePath(dataDir) {
132
143
  return path$1.join(dataDir, ".keychain", "master.key");
@@ -158,23 +169,34 @@ function fileSource(kind, file, sharesBackupWithDatabase) {
158
169
  sharesBackupWithDatabase
159
170
  };
160
171
  }
172
+ async function fileExists(file) {
173
+ try {
174
+ await promises.access(file);
175
+ return true;
176
+ } catch {
177
+ return false;
178
+ }
179
+ }
161
180
  /** Every candidate, primary first. */
162
- function buildKeySourceCandidates(opts) {
181
+ async function buildKeySourceCandidates(opts) {
163
182
  const out = [];
183
+ const secretsDir = opts.secretsDir ?? "/run/secrets";
184
+ const mountedFile = path$1.join(secretsDir, MOUNTED_KEY_FILE_NAME);
185
+ const previousFile = path$1.join(secretsDir, PREVIOUS_MOUNTED_KEY_FILE_NAME);
164
186
  const defaultFile = defaultKeyFilePath(opts.dataDir);
165
187
  const platform = getPlatformKeychainKey();
166
- const keyFile = opts.config.keyFile?.trim();
167
- const previousKeyFile = opts.config.previousKeyFile?.trim();
168
- const primaryKind = keyFile !== void 0 && keyFile.length > 0 ? "config-file" : platform !== null ? "platform" : "default-file";
169
- if (keyFile !== void 0 && keyFile.length > 0) out.push({
170
- source: fileSource("config-file", keyFile, false),
188
+ const hasMounted = await fileExists(mountedFile);
189
+ const hasPrevious = await fileExists(previousFile);
190
+ const primaryKind = hasMounted ? "mounted-file" : platform !== null ? "platform" : "default-file";
191
+ if (hasMounted) out.push({
192
+ source: fileSource("mounted-file", mountedFile, false),
171
193
  primary: true,
172
- load: () => loadKeyFile(keyFile)
194
+ load: () => loadKeyFile(mountedFile)
173
195
  });
174
- if (previousKeyFile !== void 0 && previousKeyFile.length > 0) out.push({
175
- source: fileSource("previous-config-file", previousKeyFile, false),
196
+ if (hasPrevious) out.push({
197
+ source: fileSource("previous-mounted-file", previousFile, false),
176
198
  primary: false,
177
- load: () => loadKeyFile(previousKeyFile)
199
+ load: () => loadKeyFile(previousFile)
178
200
  });
179
201
  if (platform !== null) out.push({
180
202
  source: {
@@ -908,7 +930,7 @@ var KeychainService = class {
908
930
  replace: true,
909
931
  nowMs: this.now()
910
932
  });
911
- } else throw new Error(`keychain: the ${primary.source.kind} key is already in use. Put the new key at its source, set the old one as keychain.previousKeyFile, restart, then rotate.`);
933
+ } else throw new Error(`keychain: the ${primary.source.kind} key is already in use. To move to a new external source: put the new key at ${MOUNTED_KEY_FILE_PATH}, the old one at ${PREVIOUS_MOUNTED_KEY_FILE_PATH}, restart, then rotate.`);
912
934
  const fingerprint = kekFingerprint(newKek);
913
935
  if (constantTimeEquals(fingerprint, unlocked.fingerprint)) throw new Error("keychain: the new master key is the one already in use");
914
936
  const wrap = {
@@ -1027,7 +1049,7 @@ var KeychainService = class {
1027
1049
  const loaded = await primary.load();
1028
1050
  if (loaded.kind === "loaded") return;
1029
1051
  const where = primary.source.path ?? primary.source.kind;
1030
- throw new KeychainResetRefusedError(loaded.kind === "absent" ? `the configured master key ${where} does not exist — put a new 32-byte key there (or remove keychain.keyFile to use the default file) first` : `the configured master key ${where} cannot be read (${loaded.error})`);
1052
+ throw new KeychainResetRefusedError(loaded.kind === "absent" ? `the mounted master key ${where} does not exist — put a new 32-byte key there (or unmount it to use the default file) first` : `the mounted master key ${where} cannot be read (${loaded.error})`);
1031
1053
  }
1032
1054
  /** What the last reset left to re-enter (see `keychain-admin.resetReport`). */
1033
1055
  async resetReport() {
@@ -1942,14 +1964,6 @@ function callerOf(input) {
1942
1964
  const raw = Reflect.get(input, "callerAddonId");
1943
1965
  return typeof raw === "string" && raw.length > 0 ? raw : null;
1944
1966
  }
1945
- function readKeyConfig(section) {
1946
- const keyFile = section["keyFile"];
1947
- const previousKeyFile = section["previousKeyFile"];
1948
- return {
1949
- keyFile: typeof keyFile === "string" && keyFile.length > 0 ? keyFile : void 0,
1950
- previousKeyFile: typeof previousKeyFile === "string" && previousKeyFile.length > 0 ? previousKeyFile : void 0
1951
- };
1952
- }
1953
1967
  var KeychainAddon = class extends BaseAddon {
1954
1968
  id = "keychain";
1955
1969
  pruneTimer = null;
@@ -1978,12 +1992,7 @@ var KeychainAddon = class extends BaseAddon {
1978
1992
  if (records !== void 0) await records.declare(keychainRecordKinds);
1979
1993
  const service = new KeychainService({
1980
1994
  repo: new KeychainRepository(door, records !== void 0 ? KeychainRepository.recordStoresOf(records) : void 0),
1981
- candidates: async () => {
1982
- return buildKeySourceCandidates({
1983
- config: readKeyConfig(await ctx.settings?.getSection("keychain") ?? {}),
1984
- dataDir
1985
- });
1986
- },
1995
+ candidates: () => buildKeySourceCandidates({ dataDir }),
1987
1996
  dataDir,
1988
1997
  events: { emit: (payload) => {
1989
1998
  ctx.eventBus.emit({
@@ -1,9 +1,13 @@
1
1
  import type { KeychainKeySource } from "@camstack/types";
2
- /** The `keychain` section of `config.yaml`. */
3
- export interface KeychainKeyConfig {
4
- readonly keyFile?: string | undefined;
5
- readonly previousKeyFile?: string | undefined;
6
- }
2
+ /** The directory the mounted key files live in (injectable for specs, never an env var). */
3
+ export declare const DEFAULT_SECRETS_DIR = "/run/secrets";
4
+ /** The mounted primary key file, under the secrets directory. */
5
+ export declare const MOUNTED_KEY_FILE_NAME = "camstack-master-key";
6
+ /** The mounted unlock-only key file, under the secrets directory. */
7
+ export declare const PREVIOUS_MOUNTED_KEY_FILE_NAME = "camstack-master-key.previous";
8
+ /** Absolute form of both, for messages. */
9
+ export declare const MOUNTED_KEY_FILE_PATH: string;
10
+ export declare const PREVIOUS_MOUNTED_KEY_FILE_PATH: string;
7
11
  export type KeyLoadResult = {
8
12
  readonly kind: "loaded";
9
13
  readonly key: Buffer;
@@ -21,11 +25,12 @@ export interface KeySourceCandidate {
21
25
  /** The default key file's location under the data root. */
22
26
  export declare function defaultKeyFilePath(dataDir: string): string;
23
27
  export interface KeySourceOptions {
24
- readonly config: KeychainKeyConfig;
25
28
  readonly dataDir: string;
29
+ /** Where the mounted key files live. Defaults to {@link DEFAULT_SECRETS_DIR}. */
30
+ readonly secretsDir?: string | undefined;
26
31
  }
27
32
  /** Every candidate, primary first. */
28
- export declare function buildKeySourceCandidates(opts: KeySourceOptions): readonly KeySourceCandidate[];
33
+ export declare function buildKeySourceCandidates(opts: KeySourceOptions): Promise<readonly KeySourceCandidate[]>;
29
34
  /**
30
35
  * Write a master key to the default location: directory 0700, file 0600,
31
36
  * atomically (temp + rename), never over an existing file unless `replace`.
@@ -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-B9xpybTG.js");
3
+ const require_dist = require("../../dist-D-7p7cJp.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 { Et as RECORDING_SOURCE_CAMSTACK_ADDON, Ho as createEvent, Ms as EventCategory, Ot as RecordingStatusSchema, Qa as BaseAddon, Wr as mayWriteToLocation, js as errMsg } from "../../dist-Cw8KtuQY.mjs";
1
+ import { Dt as RECORDING_SOURCE_CAMSTACK_ADDON, Kr as mayWriteToLocation, Ns as errMsg, Ps as EventCategory, Wo as createEvent, eo as BaseAddon, kt as RecordingStatusSchema } from "../../dist-XvOCXwnA.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-B9xpybTG.js");
6
+ const require_dist = require("../../dist-D-7p7cJp.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-oM-nuINR.js");
9
+ const require_device_ca = require("../../device-ca-Dh9wjg_e.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");
@@ -8894,7 +8894,7 @@ var JwtSigningKeyKeeper = class {
8894
8894
  }
8895
8895
  if (previous.state === "ready") return;
8896
8896
  require_device_ca.setProcessJwtSigningKey(next);
8897
- this.deps.logger.error("Sessions are UNAVAILABLE: the session signing key cannot be read from the keychain. No one can sign in and no session token verifies until the keychain unlocks (Data → Secrets; or fix keychain.keyFile in config.yaml and restart). No fallback key is used.", { meta: {
8897
+ this.deps.logger.error("Sessions are UNAVAILABLE: the session signing key cannot be read from the keychain. No one can sign in and no session token verifies until the keychain unlocks (Data → Secrets; or fix the mounted key at /run/secrets/camstack-master-key and restart). No fallback key is used.", { meta: {
8898
8898
  reason: next.reason,
8899
8899
  ref: require_device_ca.JWT_SIGNING_KEY_REF
8900
8900
  } });