@camstack/server 1.2.727 → 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.
- package/CHANGELOG.md +15 -0
- package/dist/agent/main.js +2 -14
- package/dist/api/core/cap-providers.js +0 -7
- package/dist/api/trpc/generated-cap-mounts.js +2 -1
- package/dist/api/trpc/generated-cap-routers.js +1872 -1847
- package/dist/boot/boot-config.js +1 -1
- package/dist/core/addon/addon-package.service.js +3 -105
- package/dist/core/addon-bridge/addon-bridge.service.js +1 -5
- package/dist/launcher.js +12 -124
- package/package.json +22 -11
- package/system/dist/addon-runner.js +1 -2
- package/system/dist/addon-runner.mjs +1 -2
- package/system/dist/{agent-https-Cm8wrQ3N.js → agent-https-BMmfwElS.js} +1 -1
- package/system/dist/{agent-https-BFjd0kVS.mjs → agent-https-BXB7X23w.mjs} +1 -1
- package/system/dist/auth/user-manager.d.ts +9 -0
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/alerts/alerts.addon.js +1 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/system/dist/builtins/autotrack/index.js +1 -1
- package/system/dist/builtins/autotrack/index.mjs +1 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- package/system/dist/builtins/calendars/calendars.addon.js +1 -1
- package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/system/dist/builtins/camera-grid/index.js +1 -1
- package/system/dist/builtins/camera-grid/index.mjs +1 -1
- package/system/dist/builtins/composer/composer.addon.js +3 -3
- package/system/dist/builtins/composer/composer.addon.mjs +3 -3
- package/system/dist/builtins/console-logging/index.js +1 -1
- package/system/dist/builtins/console-logging/index.mjs +1 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/system/dist/builtins/device-history/device-history.addon.d.ts +4 -0
- package/system/dist/builtins/device-history/device-history.addon.js +769 -17
- package/system/dist/builtins/device-history/device-history.addon.mjs +769 -17
- package/system/dist/builtins/device-history/runs/device-runs-provider.d.ts +7 -0
- package/system/dist/builtins/device-history/runs/device-runs-record-kinds.d.ts +15 -0
- package/system/dist/builtins/device-history/runs/device-runs-service.d.ts +42 -0
- package/system/dist/builtins/device-history/runs/energy-from-history.d.ts +22 -0
- package/system/dist/builtins/device-history/runs/run-recorder.d.ts +111 -0
- package/system/dist/builtins/device-history/runs/slice-readers.d.ts +9 -0
- package/system/dist/builtins/device-manager/device-manager.addon.js +1 -1
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
- package/system/dist/builtins/hub-forwarder/index.js +1 -1
- package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/system/dist/builtins/keychain/index.js +47 -38
- package/system/dist/builtins/keychain/index.mjs +47 -38
- package/system/dist/builtins/keychain/key-sources.d.ts +12 -7
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +21 -3
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +21 -3
- package/system/dist/builtins/local-network/local-network.addon.js +2 -2
- package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/system/dist/builtins/loki-logging/index.js +1 -1
- package/system/dist/builtins/loki-logging/index.mjs +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +1 -1
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +1 -1
- package/system/dist/builtins/snapshot/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +11 -3
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +11 -3
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/system-config/system-config.addon.js +3 -3
- package/system/dist/builtins/system-config/system-config.addon.mjs +284 -284
- package/system/dist/builtins/winston-logging/index.js +1 -1
- package/system/dist/builtins/winston-logging/index.mjs +1 -1
- package/system/dist/{composition-sources-CMLKuImu.mjs → composition-sources-BCfgVe9V.mjs} +1 -1
- package/system/dist/{composition-sources-DbRy2m6-.js → composition-sources-D6b0p8Hl.js} +1 -1
- package/system/dist/{constants-z0p-SIpO.mjs → constants-BQLyzulL.mjs} +1 -1
- package/system/dist/{constants-BpTCwvl7.js → constants-ePrW9DMj.js} +1 -1
- package/system/dist/{device-ca-IFiCeZUY.mjs → device-ca-C8X1AGHU.mjs} +2 -2
- package/system/dist/{device-ca-tXY-d38g.js → device-ca-Dh9wjg_e.js} +2 -2
- package/system/dist/{dist-BvVArCmo.js → dist-D-7p7cJp.js} +219 -36
- package/system/dist/{dist-8RpYuR_b.mjs → dist-XvOCXwnA.mjs} +208 -37
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-BGTQuEAj.js → hub-mdns-ciao-BFZZAJIx.js} +2 -2
- package/system/dist/{hub-mdns-ciao-ChnLH7jR.mjs → hub-mdns-ciao-CGwz5__T.mjs} +2 -2
- package/system/dist/index.js +40 -186
- package/system/dist/index.mjs +41 -185
- package/system/dist/kernel/addon-installer.d.ts +9 -60
- package/system/dist/kernel/bootstrap-config.d.ts +3 -1
- package/system/dist/kernel/config-schema.d.ts +2 -11
- package/system/dist/kernel/fs-utils.d.ts +0 -6
- package/system/dist/kernel/index.d.ts +2 -3
- package/system/dist/{restore-archive-CmljxWcJ.js → restore-archive-3e5X8g6h.js} +1 -1
- package/system/dist/{restore-archive-gcyWu7gb.mjs → restore-archive-B3M3ZwAl.mjs} +82 -82
- package/system/dist/{retention-DwnQVMqM.mjs → retention-BPxZj_Qf.mjs} +1 -1
- package/system/dist/{retention-DRAqh5oQ.js → retention-DacNjIXz.js} +1 -1
- package/system/dist/{wal-maintenance-CH6boUNm.mjs → wal-maintenance-C4K7pX1x.mjs} +0 -0
- package/system/dist/{wal-maintenance-DOIYwfc8.js → wal-maintenance-Dguwwx4N.js} +0 -0
- package/system/package.json +5 -2
- 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-
|
|
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 {
|
|
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 {
|
|
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,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-
|
|
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,
|
|
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
|
|
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-
|
|
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
|
|
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-
|
|
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-
|
|
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",
|
|
@@ -12083,7 +12088,13 @@ var MigrationLedgerEntrySchema = zod.z.object({
|
|
|
12083
12088
|
/** Why it is `blocked` or `held` (`dependency-failed`, `snapshot-refused`, …). */
|
|
12084
12089
|
reason: zod.z.string().nullable(),
|
|
12085
12090
|
nodeId: zod.z.string().nullable(),
|
|
12086
|
-
bootId: zod.z.string().nullable()
|
|
12091
|
+
bootId: zod.z.string().nullable(),
|
|
12092
|
+
/**
|
|
12093
|
+
* The catalogued meta of this id (description, body kind, store, `dependsOn`…),
|
|
12094
|
+
* joined by the engine from the catalogues it knows this boot. Absent when no
|
|
12095
|
+
* catalogue lists the id (a newer database).
|
|
12096
|
+
*/
|
|
12097
|
+
meta: MigrationMetaSchema.optional()
|
|
12087
12098
|
});
|
|
12088
12099
|
/** A catalogued migration that is not applied, with where it stands. */
|
|
12089
12100
|
var MigrationPendingEntrySchema = zod.z.object({
|
|
@@ -18358,6 +18369,14 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
18358
18369
|
}
|
|
18359
18370
|
} }
|
|
18360
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
|
+
},
|
|
18361
18380
|
update: {
|
|
18362
18381
|
scope: "device",
|
|
18363
18382
|
noun: t("Firmware update", "Aggiornamento firmware"),
|
|
@@ -48242,6 +48261,10 @@ function unavailableFor(tf, role, mode, cap, at) {
|
|
|
48242
48261
|
ok: true,
|
|
48243
48262
|
unavailable: "unknown"
|
|
48244
48263
|
};
|
|
48264
|
+
if (!tf.required) return {
|
|
48265
|
+
ok: true,
|
|
48266
|
+
unavailable: "omit"
|
|
48267
|
+
};
|
|
48245
48268
|
return {
|
|
48246
48269
|
ok: false,
|
|
48247
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`)
|
|
@@ -52739,6 +52762,125 @@ var deviceHistoryCapability = {
|
|
|
52739
52762
|
})
|
|
52740
52763
|
}
|
|
52741
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
|
+
};
|
|
52742
52884
|
var DeviceCaStatusSchema = zod.z.discriminatedUnion("state", [
|
|
52743
52885
|
zod.z.object({ state: zod.z.literal("absent") }),
|
|
52744
52886
|
zod.z.object({
|
|
@@ -52972,15 +53114,16 @@ var nodeCertificatesCapability = {
|
|
|
52972
53114
|
* key itself, so the operator can keep a copy off the hub). Nothing else
|
|
52973
53115
|
* returns a value.
|
|
52974
53116
|
*
|
|
52975
|
-
* The master key's LOCATION is
|
|
52976
|
-
* `
|
|
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
|
|
52977
53120
|
* `<dataDir>/.keychain/master.key` — which sits beside the database in every
|
|
52978
53121
|
* whole-volume backup, and the status says so.
|
|
52979
53122
|
*/
|
|
52980
53123
|
/** Where the master key in use came from. */
|
|
52981
53124
|
var KeychainKeySourceKindSchema = zod.z.enum([
|
|
52982
|
-
"
|
|
52983
|
-
"previous-
|
|
53125
|
+
"mounted-file",
|
|
53126
|
+
"previous-mounted-file",
|
|
52984
53127
|
"platform",
|
|
52985
53128
|
"default-file"
|
|
52986
53129
|
]);
|
|
@@ -53166,8 +53309,8 @@ var keychainAdminCapability = {
|
|
|
53166
53309
|
* under the primary. Otherwise, with the default file as primary: generate
|
|
53167
53310
|
* a new master key, write it there, re-wrap. A file or OS-keychain primary
|
|
53168
53311
|
* that is already in use cannot be replaced from here — put the new key at
|
|
53169
|
-
* the source, keep the old one
|
|
53170
|
-
* 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
|
|
53171
53314
|
* (retired) until purged.
|
|
53172
53315
|
*/
|
|
53173
53316
|
rotateMasterKey: method(zod.z.object({}), zod.z.object({
|
|
@@ -74194,12 +74337,6 @@ var addonsCapability = {
|
|
|
74194
74337
|
kind: "mutation",
|
|
74195
74338
|
auth: "admin"
|
|
74196
74339
|
}),
|
|
74197
|
-
installFromWorkspace: method(zod.z.object({ packageName: zod.z.string() }), InstallPackageResultSchema, {
|
|
74198
|
-
kind: "mutation",
|
|
74199
|
-
auth: "admin"
|
|
74200
|
-
}),
|
|
74201
|
-
isWorkspaceAvailable: method(zod.z.void(), zod.z.boolean()),
|
|
74202
|
-
listWorkspacePackages: method(zod.z.void(), zod.z.array(zod.z.unknown()).readonly()),
|
|
74203
74340
|
/**
|
|
74204
74341
|
* Uninstall a package. `nodeId` omitted (or `'hub'`) uninstalls on the hub
|
|
74205
74342
|
* — the original behaviour, which still THROWS on failure. An agent
|
|
@@ -88780,6 +88917,12 @@ var userManagementCapability = {
|
|
|
88780
88917
|
mode: "singleton",
|
|
88781
88918
|
methods: {
|
|
88782
88919
|
listUsers: method(zod.z.void(), zod.z.array(UserSummarySchema), { auth: "admin" }),
|
|
88920
|
+
/**
|
|
88921
|
+
* Read-only: does an admin account still carry the first-boot password
|
|
88922
|
+
* (D728, D797)? One typed boolean; the password and its hash never leave
|
|
88923
|
+
* the hub. Backs the `setup_wizard` admin step.
|
|
88924
|
+
*/
|
|
88925
|
+
getAdminBootstrapStatus: method(zod.z.void(), zod.z.object({ defaultPasswordInUse: zod.z.boolean() }), { auth: "admin" }),
|
|
88783
88926
|
createUser: method(CreateUserInputSchema, UserSummarySchema, {
|
|
88784
88927
|
kind: "mutation",
|
|
88785
88928
|
auth: "admin",
|
|
@@ -92727,13 +92870,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
92727
92870
|
access: "view",
|
|
92728
92871
|
role: "admin"
|
|
92729
92872
|
},
|
|
92730
|
-
"addons.installFromWorkspace": {
|
|
92731
|
-
capName: "addons",
|
|
92732
|
-
capScope: "system",
|
|
92733
|
-
addonId: null,
|
|
92734
|
-
access: "create",
|
|
92735
|
-
role: "admin"
|
|
92736
|
-
},
|
|
92737
92873
|
"addons.installPackage": {
|
|
92738
92874
|
capName: "addons",
|
|
92739
92875
|
capScope: "system",
|
|
@@ -92741,13 +92877,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
92741
92877
|
access: "create",
|
|
92742
92878
|
role: "admin"
|
|
92743
92879
|
},
|
|
92744
|
-
"addons.isWorkspaceAvailable": {
|
|
92745
|
-
capName: "addons",
|
|
92746
|
-
capScope: "system",
|
|
92747
|
-
addonId: null,
|
|
92748
|
-
access: "view",
|
|
92749
|
-
role: "admin"
|
|
92750
|
-
},
|
|
92751
92880
|
"addons.list": {
|
|
92752
92881
|
capName: "addons",
|
|
92753
92882
|
capScope: "system",
|
|
@@ -92797,13 +92926,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
92797
92926
|
access: "view",
|
|
92798
92927
|
role: "admin"
|
|
92799
92928
|
},
|
|
92800
|
-
"addons.listWorkspacePackages": {
|
|
92801
|
-
capName: "addons",
|
|
92802
|
-
capScope: "system",
|
|
92803
|
-
addonId: null,
|
|
92804
|
-
access: "view",
|
|
92805
|
-
role: "admin"
|
|
92806
|
-
},
|
|
92807
92929
|
"addons.onAddonLogs": {
|
|
92808
92930
|
capName: "addons",
|
|
92809
92931
|
capScope: "system",
|
|
@@ -95471,6 +95593,27 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
95471
95593
|
access: "create",
|
|
95472
95594
|
role: "admin"
|
|
95473
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
|
+
},
|
|
95474
95617
|
"deviceState.claimFields": {
|
|
95475
95618
|
capName: "device-state",
|
|
95476
95619
|
capScope: "system",
|
|
@@ -102184,6 +102327,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
102184
102327
|
access: "view",
|
|
102185
102328
|
role: "admin"
|
|
102186
102329
|
},
|
|
102330
|
+
"userManagement.getAdminBootstrapStatus": {
|
|
102331
|
+
capName: "user-management",
|
|
102332
|
+
capScope: "system",
|
|
102333
|
+
addonId: null,
|
|
102334
|
+
access: "view",
|
|
102335
|
+
role: "admin"
|
|
102336
|
+
},
|
|
102187
102337
|
"userManagement.getTotpStatus": {
|
|
102188
102338
|
capName: "user-management",
|
|
102189
102339
|
capScope: "system",
|
|
@@ -103020,6 +103170,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
|
|
|
103020
103170
|
deviceOpsCapability,
|
|
103021
103171
|
deviceProviderCapability,
|
|
103022
103172
|
deviceRemovalHookCapability,
|
|
103173
|
+
deviceRunsCapability,
|
|
103023
103174
|
deviceStateCapability,
|
|
103024
103175
|
deviceStatusCapability,
|
|
103025
103176
|
dishwasherCapability,
|
|
@@ -103963,6 +104114,21 @@ Object.freeze({
|
|
|
103963
104114
|
form: "single",
|
|
103964
104115
|
optional: false
|
|
103965
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
|
+
}],
|
|
103966
104132
|
"deviceState.claimFields": [{
|
|
103967
104133
|
name: "deviceId",
|
|
103968
104134
|
form: "single",
|
|
@@ -107144,6 +107310,10 @@ var STATE_SUMMARY_VARS = [
|
|
|
107144
107310
|
[...RULE_TEXT],
|
|
107145
107311
|
[...RULE_TEXT],
|
|
107146
107312
|
[...RULE_TEXT],
|
|
107313
|
+
[...RULE_TEXT],
|
|
107314
|
+
[...RULE_TEXT],
|
|
107315
|
+
[...RULE_TEXT],
|
|
107316
|
+
[...RULE_TEXT],
|
|
107147
107317
|
[...RULE_BODY_ONLY],
|
|
107148
107318
|
[...RULE_TEXT],
|
|
107149
107319
|
([...RULE_TEXT], [...DEVICE_EVENTS]),
|
|
@@ -107161,6 +107331,7 @@ var STATE_SUMMARY_VARS = [
|
|
|
107161
107331
|
[...RULE_TEXT],
|
|
107162
107332
|
[...RULE_TEXT],
|
|
107163
107333
|
[...RULE_TEXT],
|
|
107334
|
+
[...RULE_TEXT],
|
|
107164
107335
|
([...RULE_TEXT], [...DEVICE_ATTENTION, ...ALERT_EPISODE]),
|
|
107165
107336
|
[...RULE_TEXT],
|
|
107166
107337
|
[...RULE_TEXT],
|
|
@@ -108598,6 +108769,12 @@ Object.defineProperty(exports, "DeviceRole", {
|
|
|
108598
108769
|
return DeviceRole;
|
|
108599
108770
|
}
|
|
108600
108771
|
});
|
|
108772
|
+
Object.defineProperty(exports, "DeviceRunSchema", {
|
|
108773
|
+
enumerable: true,
|
|
108774
|
+
get: function() {
|
|
108775
|
+
return DeviceRunSchema;
|
|
108776
|
+
}
|
|
108777
|
+
});
|
|
108601
108778
|
Object.defineProperty(exports, "DeviceStatusSchema", {
|
|
108602
108779
|
enumerable: true,
|
|
108603
108780
|
get: function() {
|
|
@@ -109600,6 +109777,12 @@ Object.defineProperty(exports, "deviceRemovalHookCapability", {
|
|
|
109600
109777
|
return deviceRemovalHookCapability;
|
|
109601
109778
|
}
|
|
109602
109779
|
});
|
|
109780
|
+
Object.defineProperty(exports, "deviceRunsCapability", {
|
|
109781
|
+
enumerable: true,
|
|
109782
|
+
get: function() {
|
|
109783
|
+
return deviceRunsCapability;
|
|
109784
|
+
}
|
|
109785
|
+
});
|
|
109603
109786
|
Object.defineProperty(exports, "deviceStateCapability", {
|
|
109604
109787
|
enumerable: true,
|
|
109605
109788
|
get: function() {
|