@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
@@ -3,7 +3,7 @@ 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_formatter = require("../../formatter-xbxeV4GD.js");
8
8
  const require_log_file_read_protocol = require("../../log-file-read-protocol-D0WcLbIV.js");
9
9
  let node_path = require("node:path");
@@ -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
  import { a as LogFileIndexStore, i as serveRead, n as isFromReader, t as CancelBook } from "../../log-file-read-protocol-B7M3X3bT.mjs";
4
4
  import { createRequire } from "node:module";
@@ -1,4 +1,4 @@
1
- import { Fa as compositionSourceKey, js as errMsg } from "./dist-Cw8KtuQY.mjs";
1
+ import { La as compositionSourceKey, Ns as errMsg } from "./dist-XvOCXwnA.mjs";
2
2
  //#region src/builtins/shared/device-state-changed.ts
3
3
  /** Structural narrowing helper for untrusted bus payloads. */
4
4
  function isRecord(value) {
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-B9xpybTG.js");
1
+ const require_dist = require("./dist-D-7p7cJp.js");
2
2
  //#region src/builtins/shared/device-state-changed.ts
3
3
  /** Structural narrowing helper for untrusted bus payloads. */
4
4
  function isRecord(value) {
@@ -1,4 +1,4 @@
1
- import { Lo as buildSecretRef } from "./dist-Cw8KtuQY.mjs";
1
+ import { zo as buildSecretRef } from "./dist-XvOCXwnA.mjs";
2
2
  /** `secret://system/global/meshCaKey` — EC P-256 PKCS#8 PEM of the hub mesh CA. */
3
3
  var MESH_CA_KEY_REF = buildSecretRef({
4
4
  owner: "system",
@@ -1,5 +1,5 @@
1
1
  /** `secret://system/global/meshCaKey` — EC P-256 PKCS#8 PEM of the hub mesh CA. */
2
- var MESH_CA_KEY_REF = require("./dist-B9xpybTG.js").buildSecretRef({
2
+ var MESH_CA_KEY_REF = require("./dist-D-7p7cJp.js").buildSecretRef({
3
3
  owner: "system",
4
4
  scope: { kind: "global" },
5
5
  fieldPath: "meshCaKey"
@@ -1,4 +1,4 @@
1
- import { H as DEVICE_SAN_USER_PREFIX, Lo as buildSecretRef, V as DEVICE_SAN_CREDENTIAL_PREFIX } from "./dist-Cw8KtuQY.mjs";
1
+ import { H as DEVICE_SAN_USER_PREFIX, V as DEVICE_SAN_CREDENTIAL_PREFIX, zo as buildSecretRef } from "./dist-XvOCXwnA.mjs";
2
2
  import { C as backdatedNotBefore, S as withUtcTimeEncoding, a as KeyUsageFlags, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension, u as SubjectAlternativeNameExtension } from "./x509.es-BRiJgOvu.mjs";
3
3
  import { X509Certificate, createPublicKey, randomBytes, verify, webcrypto } from "node:crypto";
4
4
  //#region src/auth/jwt-signing-key.ts
@@ -38,7 +38,7 @@ var JWT_SIGNING_KEY_REF = buildSecretRef({
38
38
  var JwtSigningKeyUnavailableError = class extends Error {
39
39
  reason;
40
40
  constructor(reason) {
41
- super(`sessions are unavailable: the session signing key could not be read from the keychain (${reason}). Unlock the keychain (Data → Secrets, or fix keychain.keyFile and restart).`);
41
+ super(`sessions are unavailable: the session signing key could not be read from the keychain (${reason}). Unlock the keychain (Data → Secrets, or fix the mounted key at /run/secrets/camstack-master-key and restart).`);
42
42
  this.reason = reason;
43
43
  this.name = "JwtSigningKeyUnavailableError";
44
44
  }
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-B9xpybTG.js");
1
+ const require_dist = require("./dist-D-7p7cJp.js");
2
2
  const require_x509_es = require("./x509.es-WtnRNyYS.js");
3
3
  let node_crypto = require("node:crypto");
4
4
  //#region src/auth/jwt-signing-key.ts
@@ -38,7 +38,7 @@ var JWT_SIGNING_KEY_REF = require_dist.buildSecretRef({
38
38
  var JwtSigningKeyUnavailableError = class extends Error {
39
39
  reason;
40
40
  constructor(reason) {
41
- super(`sessions are unavailable: the session signing key could not be read from the keychain (${reason}). Unlock the keychain (Data → Secrets, or fix keychain.keyFile and restart).`);
41
+ super(`sessions are unavailable: the session signing key could not be read from the keychain (${reason}). Unlock the keychain (Data → Secrets, or fix the mounted key at /run/secrets/camstack-master-key and restart).`);
42
42
  this.reason = reason;
43
43
  this.name = "JwtSigningKeyUnavailableError";
44
44
  }
@@ -1,6 +1,6 @@
1
1
  let zod = require("zod");
2
2
  require("node:crypto");
3
- //#region ../types/dist/event-category-CaURIwQA.mjs
3
+ //#region ../types/dist/event-category-BmPm98n0.mjs
4
4
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
5
5
  EventCategory["SystemBoot"] = "system.boot";
6
6
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -484,6 +484,10 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
484
484
  EventCategory["RunningStarted"] = "running.started";
485
485
  /** Mirrors `runningStateCapability.events.onFinished`. */
486
486
  EventCategory["RunningFinished"] = "running.finished";
487
+ /** Mirrors `deviceRunsCapability.events.onRunOpened` - a durable run record opened. */
488
+ EventCategory["DeviceRunOpened"] = "device-run.opened";
489
+ /** Mirrors `deviceRunsCapability.events.onRunClosed` - a durable run record closed. */
490
+ EventCategory["DeviceRunClosed"] = "device-run.closed";
487
491
  /**
488
492
  * Cap event fired by every device that registers the `event-emitter`
489
493
  * capability. Mirrors `eventEmitterCapability.events.onEvent`. Carries
@@ -1154,7 +1158,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
1154
1158
  return DeviceRole;
1155
1159
  }({});
1156
1160
  //#endregion
1157
- //#region ../types/dist/sleep-CSYuxssh.mjs
1161
+ //#region ../types/dist/sleep-BKzhQTSm.mjs
1158
1162
  /**
1159
1163
  * The audio chunk plane's byte format, and the ONE expansion from a coded
1160
1164
  * window to float samples (D455).
@@ -5889,6 +5893,7 @@ var CAP_NAMES = Object.freeze([
5889
5893
  "device-ops",
5890
5894
  "device-provider",
5891
5895
  "device-removal-hook",
5896
+ "device-runs",
5892
5897
  "device-state",
5893
5898
  "device-status",
5894
5899
  "dishwasher",
@@ -18364,6 +18369,14 @@ var APPLIANCE_CAP_VOCABULARY = {
18364
18369
  }
18365
18370
  } }
18366
18371
  },
18372
+ "device-runs": {
18373
+ scope: "device",
18374
+ noun: t("Runs", "Esecuzioni"),
18375
+ events: {
18376
+ onRunOpened: { notOperatorFacing: "the durable record of a run that the running-state start flip already announces" },
18377
+ onRunClosed: { notOperatorFacing: "the durable record of a run that the running-state finish flip already announces" }
18378
+ }
18379
+ },
18367
18380
  update: {
18368
18381
  scope: "device",
18369
18382
  noun: t("Firmware update", "Aggiornamento firmware"),
@@ -48248,6 +48261,10 @@ function unavailableFor(tf, role, mode, cap, at) {
48248
48261
  ok: true,
48249
48262
  unavailable: "unknown"
48250
48263
  };
48264
+ if (!tf.required) return {
48265
+ ok: true,
48266
+ unavailable: "omit"
48267
+ };
48251
48268
  return {
48252
48269
  ok: false,
48253
48270
  problem: problem("not-replaceable", at, `\`${cap}.${tf.path}\` reads a source but can say neither null nor 'unknown', and an ADDED capability has no native reading to fall back to`)
@@ -52745,6 +52762,125 @@ var deviceHistoryCapability = {
52745
52762
  })
52746
52763
  }
52747
52764
  };
52765
+ /**
52766
+ * device-runs - the durable record of ONE run of a device: a washing cycle, a
52767
+ * dishwasher cycle, later a mow or a clean (D992).
52768
+ *
52769
+ * A run is a DOCUMENT (opened at one instant, closed at another, carrying what
52770
+ * was measured over it), never a sample - device-history keeps the numbers over
52771
+ * time and its `device-runs` provider keeps these documents beside them, because
52772
+ * the energy of a run is a question about device-history's own series. The
52773
+ * record is written from the `running-state` flip on `DeviceStateChanged`; it
52774
+ * survives a restart (the open row is on disk) and a missed flip (boot compares
52775
+ * the open rows against the live snapshots).
52776
+ *
52777
+ * Every measurement is `number | null` and `null` means "could not be
52778
+ * measured", never `0` (D393). A run closed by the boot reconcile because the
52779
+ * device stopped while nobody was watching has `outcome: 'unknown'`.
52780
+ */
52781
+ var DeviceRunKindSchema = zod.z.enum([
52782
+ "appliance",
52783
+ "mower",
52784
+ "vacuum"
52785
+ ]);
52786
+ var DeviceRunStateSchema = zod.z.enum(["open", "closed"]);
52787
+ var DeviceRunOutcomeSchema = zod.z.enum([
52788
+ "completed",
52789
+ "aborted",
52790
+ "error",
52791
+ "unknown"
52792
+ ]);
52793
+ /** What opened or closed the run. `reconcile` is the boot comparison against live state. */
52794
+ var DeviceRunSourceSchema = zod.z.enum([
52795
+ "running-state",
52796
+ "activity",
52797
+ "reconcile"
52798
+ ]);
52799
+ /** How the energy of a run was obtained; `null` when it could not be. */
52800
+ var DeviceRunEnergyMethodSchema = zod.z.enum(["counter-delta", "history-integral"]);
52801
+ var DeviceRunPhaseSchema = zod.z.object({
52802
+ phase: zod.z.string(),
52803
+ at: zod.z.number()
52804
+ });
52805
+ /** What an appliance run measured. Every number is `null` when unknown, never `0`. */
52806
+ var ApplianceRunDetailSchema = zod.z.object({
52807
+ kind: zod.z.literal("appliance"),
52808
+ /** kWh used over the run. */
52809
+ energyKwh: zod.z.number().nullable().meta(readingMeta("energy")),
52810
+ energyMethod: DeviceRunEnergyMethodSchema.nullable(),
52811
+ /** Highest power seen while the run was open. */
52812
+ peakW: zod.z.number().nullable().meta(readingMeta("power")),
52813
+ /** Time-weighted mean power while the run was open. */
52814
+ avgW: zod.z.number().nullable().meta(readingMeta("power")),
52815
+ /** The program the appliance said it ran when the run opened. */
52816
+ program: zod.z.string().nullable(),
52817
+ remainingAtStartSec: zod.z.number().nullable().meta(readingMeta("duration")),
52818
+ /** The last phase the device reported before the run closed. */
52819
+ finalPhase: zod.z.string().nullable(),
52820
+ /**
52821
+ * The meter's energy counter when the run opened; `null` when the meter had
52822
+ * not said (or the run was opened late, by the boot reconcile). It lives in
52823
+ * the row so a run that outlives a restart still ends with `end - start`.
52824
+ */
52825
+ energyStartKwh: zod.z.number().nullable().meta(readingMeta("energy")),
52826
+ /** Milliseconds of power readings behind `avgW` - the weight a restart resumes the mean with. */
52827
+ powerObservedMs: zod.z.number()
52828
+ });
52829
+ /** The kind-specific block; a later phase adds a branch, nothing else changes. */
52830
+ var DeviceRunDetailSchema = zod.z.discriminatedUnion("kind", [ApplianceRunDetailSchema]);
52831
+ var DeviceRunSchema = zod.z.object({
52832
+ /** `${deviceId}:${startedAt}`. */
52833
+ runId: zod.z.string(),
52834
+ deviceId: zod.z.number().int(),
52835
+ kind: DeviceRunKindSchema,
52836
+ state: DeviceRunStateSchema,
52837
+ startedAt: zod.z.number(),
52838
+ endedAt: zod.z.number().nullable(),
52839
+ durationMs: zod.z.number().nullable(),
52840
+ outcome: DeviceRunOutcomeSchema.nullable(),
52841
+ startSource: DeviceRunSourceSchema,
52842
+ endSource: DeviceRunSourceSchema.nullable(),
52843
+ /** Where the device's running bit came from (`running-state.source`); `null` when it did not say. */
52844
+ runningSource: zod.z.enum(["native", "assigned"]).nullable(),
52845
+ phases: zod.z.array(DeviceRunPhaseSchema),
52846
+ detail: DeviceRunDetailSchema
52847
+ });
52848
+ var deviceRunsCapability = {
52849
+ name: "device-runs",
52850
+ scope: "device",
52851
+ mode: "singleton",
52852
+ kind: "wrapper",
52853
+ defaultActive: true,
52854
+ deviceTypes: [
52855
+ DeviceType.Washer,
52856
+ DeviceType.Dryer,
52857
+ DeviceType.Dishwasher
52858
+ ],
52859
+ methods: {
52860
+ /** Runs of a device, newest first. `limit` is bounded; page with `cursor`. */
52861
+ listRuns: method(zod.z.object({
52862
+ deviceId: zod.z.number().int(),
52863
+ outcome: DeviceRunOutcomeSchema.optional(),
52864
+ atFrom: zod.z.number().optional(),
52865
+ atTo: zod.z.number().optional(),
52866
+ limit: zod.z.number().int().positive().max(200).default(50),
52867
+ cursor: zod.z.string().optional()
52868
+ }), zod.z.object({
52869
+ runs: zod.z.array(DeviceRunSchema).readonly(),
52870
+ nextCursor: zod.z.string().nullable()
52871
+ })),
52872
+ getRun: method(zod.z.object({
52873
+ deviceId: zod.z.number().int(),
52874
+ runId: zod.z.string()
52875
+ }), DeviceRunSchema.nullable()),
52876
+ /** The run open right now, or `null` (answered: there is none). */
52877
+ getCurrentRun: method(zod.z.object({ deviceId: zod.z.number().int() }), DeviceRunSchema.nullable())
52878
+ },
52879
+ events: {
52880
+ onRunOpened: { data: DeviceRunSchema },
52881
+ onRunClosed: { data: DeviceRunSchema }
52882
+ }
52883
+ };
52748
52884
  var DeviceCaStatusSchema = zod.z.discriminatedUnion("state", [
52749
52885
  zod.z.object({ state: zod.z.literal("absent") }),
52750
52886
  zod.z.object({
@@ -52978,15 +53114,16 @@ var nodeCertificatesCapability = {
52978
53114
  * key itself, so the operator can keep a copy off the hub). Nothing else
52979
53115
  * returns a value.
52980
53116
  *
52981
- * The master key's LOCATION is configuration, never an env var (D788):
52982
- * `keychain.keyFile` in `config.yaml`, the OS keychain on a desktop hub, else
53117
+ * The master key's LOCATION is a fixed path, never an env var (D788, D991):
53118
+ * `/run/secrets/camstack-master-key` when that file exists, the OS keychain on
53119
+ * a desktop hub, else
52983
53120
  * `<dataDir>/.keychain/master.key` — which sits beside the database in every
52984
53121
  * whole-volume backup, and the status says so.
52985
53122
  */
52986
53123
  /** Where the master key in use came from. */
52987
53124
  var KeychainKeySourceKindSchema = zod.z.enum([
52988
- "config-file",
52989
- "previous-config-file",
53125
+ "mounted-file",
53126
+ "previous-mounted-file",
52990
53127
  "platform",
52991
53128
  "default-file"
52992
53129
  ]);
@@ -53172,8 +53309,8 @@ var keychainAdminCapability = {
53172
53309
  * under the primary. Otherwise, with the default file as primary: generate
53173
53310
  * a new master key, write it there, re-wrap. A file or OS-keychain primary
53174
53311
  * that is already in use cannot be replaced from here — put the new key at
53175
- * the source, keep the old one as `keychain.previousKeyFile`, restart, and
53176
- * rotate. No value is re-encrypted either way; the previous wrap is kept
53312
+ * the source, keep the old one at
53313
+ * `/run/secrets/camstack-master-key.previous`, restart, and rotate. No value is re-encrypted either way; the previous wrap is kept
53177
53314
  * (retired) until purged.
53178
53315
  */
53179
53316
  rotateMasterKey: method(zod.z.object({}), zod.z.object({
@@ -74200,12 +74337,6 @@ var addonsCapability = {
74200
74337
  kind: "mutation",
74201
74338
  auth: "admin"
74202
74339
  }),
74203
- installFromWorkspace: method(zod.z.object({ packageName: zod.z.string() }), InstallPackageResultSchema, {
74204
- kind: "mutation",
74205
- auth: "admin"
74206
- }),
74207
- isWorkspaceAvailable: method(zod.z.void(), zod.z.boolean()),
74208
- listWorkspacePackages: method(zod.z.void(), zod.z.array(zod.z.unknown()).readonly()),
74209
74340
  /**
74210
74341
  * Uninstall a package. `nodeId` omitted (or `'hub'`) uninstalls on the hub
74211
74342
  * — the original behaviour, which still THROWS on failure. An agent
@@ -92739,13 +92870,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
92739
92870
  access: "view",
92740
92871
  role: "admin"
92741
92872
  },
92742
- "addons.installFromWorkspace": {
92743
- capName: "addons",
92744
- capScope: "system",
92745
- addonId: null,
92746
- access: "create",
92747
- role: "admin"
92748
- },
92749
92873
  "addons.installPackage": {
92750
92874
  capName: "addons",
92751
92875
  capScope: "system",
@@ -92753,13 +92877,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
92753
92877
  access: "create",
92754
92878
  role: "admin"
92755
92879
  },
92756
- "addons.isWorkspaceAvailable": {
92757
- capName: "addons",
92758
- capScope: "system",
92759
- addonId: null,
92760
- access: "view",
92761
- role: "admin"
92762
- },
92763
92880
  "addons.list": {
92764
92881
  capName: "addons",
92765
92882
  capScope: "system",
@@ -92809,13 +92926,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
92809
92926
  access: "view",
92810
92927
  role: "admin"
92811
92928
  },
92812
- "addons.listWorkspacePackages": {
92813
- capName: "addons",
92814
- capScope: "system",
92815
- addonId: null,
92816
- access: "view",
92817
- role: "admin"
92818
- },
92819
92929
  "addons.onAddonLogs": {
92820
92930
  capName: "addons",
92821
92931
  capScope: "system",
@@ -95483,6 +95593,27 @@ var METHOD_ACCESS_MAP = Object.freeze({
95483
95593
  access: "create",
95484
95594
  role: "admin"
95485
95595
  },
95596
+ "deviceRuns.getCurrentRun": {
95597
+ capName: "device-runs",
95598
+ capScope: "device",
95599
+ addonId: null,
95600
+ access: "view",
95601
+ role: "viewer"
95602
+ },
95603
+ "deviceRuns.getRun": {
95604
+ capName: "device-runs",
95605
+ capScope: "device",
95606
+ addonId: null,
95607
+ access: "view",
95608
+ role: "viewer"
95609
+ },
95610
+ "deviceRuns.listRuns": {
95611
+ capName: "device-runs",
95612
+ capScope: "device",
95613
+ addonId: null,
95614
+ access: "view",
95615
+ role: "viewer"
95616
+ },
95486
95617
  "deviceState.claimFields": {
95487
95618
  capName: "device-state",
95488
95619
  capScope: "system",
@@ -103039,6 +103170,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
103039
103170
  deviceOpsCapability,
103040
103171
  deviceProviderCapability,
103041
103172
  deviceRemovalHookCapability,
103173
+ deviceRunsCapability,
103042
103174
  deviceStateCapability,
103043
103175
  deviceStatusCapability,
103044
103176
  dishwasherCapability,
@@ -103982,6 +104114,21 @@ Object.freeze({
103982
104114
  form: "single",
103983
104115
  optional: false
103984
104116
  }],
104117
+ "deviceRuns.getCurrentRun": [{
104118
+ name: "deviceId",
104119
+ form: "single",
104120
+ optional: false
104121
+ }],
104122
+ "deviceRuns.getRun": [{
104123
+ name: "deviceId",
104124
+ form: "single",
104125
+ optional: false
104126
+ }],
104127
+ "deviceRuns.listRuns": [{
104128
+ name: "deviceId",
104129
+ form: "single",
104130
+ optional: false
104131
+ }],
103985
104132
  "deviceState.claimFields": [{
103986
104133
  name: "deviceId",
103987
104134
  form: "single",
@@ -107163,6 +107310,10 @@ var STATE_SUMMARY_VARS = [
107163
107310
  [...RULE_TEXT],
107164
107311
  [...RULE_TEXT],
107165
107312
  [...RULE_TEXT],
107313
+ [...RULE_TEXT],
107314
+ [...RULE_TEXT],
107315
+ [...RULE_TEXT],
107316
+ [...RULE_TEXT],
107166
107317
  [...RULE_BODY_ONLY],
107167
107318
  [...RULE_TEXT],
107168
107319
  ([...RULE_TEXT], [...DEVICE_EVENTS]),
@@ -108618,6 +108769,12 @@ Object.defineProperty(exports, "DeviceRole", {
108618
108769
  return DeviceRole;
108619
108770
  }
108620
108771
  });
108772
+ Object.defineProperty(exports, "DeviceRunSchema", {
108773
+ enumerable: true,
108774
+ get: function() {
108775
+ return DeviceRunSchema;
108776
+ }
108777
+ });
108621
108778
  Object.defineProperty(exports, "DeviceStatusSchema", {
108622
108779
  enumerable: true,
108623
108780
  get: function() {
@@ -109620,6 +109777,12 @@ Object.defineProperty(exports, "deviceRemovalHookCapability", {
109620
109777
  return deviceRemovalHookCapability;
109621
109778
  }
109622
109779
  });
109780
+ Object.defineProperty(exports, "deviceRunsCapability", {
109781
+ enumerable: true,
109782
+ get: function() {
109783
+ return deviceRunsCapability;
109784
+ }
109785
+ });
109623
109786
  Object.defineProperty(exports, "deviceStateCapability", {
109624
109787
  enumerable: true,
109625
109788
  get: function() {