@camstack/server 1.2.890 → 1.2.892
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 +22 -0
- package/dist/api/trpc/generated-cap-mounts.js +2 -1
- package/dist/api/trpc/generated-cap-routers.js +212 -39
- package/dist/core/addon/addon-registry.service.js +47 -0
- package/dist/core/addon/retire-undeclared-fixed-integrations.js +57 -0
- package/package.json +31 -19
- package/system/dist/addon-runner.js +25 -9
- package/system/dist/addon-runner.mjs +25 -9
- 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/addon.d.ts +65 -41
- package/system/dist/builtins/camera-grid/grid-blocks.d.ts +51 -0
- package/system/dist/builtins/camera-grid/grid-camera-device.d.ts +4 -3
- package/system/dist/builtins/camera-grid/grid-layout-native-provider.d.ts +3 -1
- package/system/dist/builtins/camera-grid/grid-plan.d.ts +3 -3
- package/system/dist/builtins/camera-grid/index.d.ts +2 -6
- package/system/dist/builtins/camera-grid/index.js +431 -727
- package/system/dist/builtins/camera-grid/index.mjs +428 -719
- package/system/dist/builtins/composer/composed-device.d.ts +12 -2
- package/system/dist/builtins/composer/composer.addon.js +28 -10
- package/system/dist/builtins/composer/composer.addon.mjs +28 -10
- package/system/dist/builtins/composer/composition-declarations.d.ts +3 -1
- 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 +283 -51
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +284 -52
- package/system/dist/builtins/core-blocks/hero-layout-service.d.ts +19 -1
- package/system/dist/builtins/core-blocks/power-source-devices.d.ts +9 -0
- package/system/dist/builtins/core-blocks/power-source-service.d.ts +39 -2
- package/system/dist/builtins/core-blocks/tags-service.d.ts +20 -3
- package/system/dist/builtins/core-blocks/tags-wiring.d.ts +15 -2
- package/system/dist/builtins/device-history/device-history.addon.js +2 -2
- package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
- package/system/dist/builtins/device-manager/device-identifiers-action.d.ts +9 -0
- package/system/dist/builtins/device-manager/device-manager.addon.js +172 -5
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +172 -5
- package/system/dist/builtins/device-manager/device-meta-types.d.ts +5 -1
- package/system/dist/builtins/device-manager/device-row-store.d.ts +3 -2
- package/system/dist/builtins/device-manager/device-state-mirror.d.ts +7 -0
- package/system/dist/builtins/device-manager/workload-transition.d.ts +23 -0
- 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 +4 -4
- package/system/dist/builtins/keychain/index.mjs +4 -4
- 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 +2 -2
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
- package/system/dist/builtins/local-network/local-network.addon.js +3 -3
- package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
- 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 +3 -3
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -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/{capture-engine-C1vdBL88.js → capture-engine-DHmlkW_d.js} +1 -1
- package/system/dist/{capture-engine-B1bMuzVX.mjs → capture-engine-sl6e9f9S.mjs} +1 -1
- package/system/dist/{composition-sources-Dj6qn5PP.mjs → composition-sources-CznD85Ri.mjs} +1 -1
- package/system/dist/{composition-sources-BfLlyKRe.js → composition-sources-PqcZfe3j.js} +1 -1
- package/system/dist/{constants-Ba51ywI4.mjs → constants-CHwj_mIM.mjs} +1 -1
- package/system/dist/{constants-DuB_xXYx.js → constants-_2SOk0By.js} +1 -1
- package/system/dist/{device-ca-CkXjf3ms.mjs → device-ca-D2H1EMUY.mjs} +1 -1
- package/system/dist/{device-ca-CVjaotgX.js → device-ca-WIEO5ZcE.js} +1 -1
- package/system/dist/{dist-BKojK6Wf.mjs → dist-DbAhCrHy.mjs} +2468 -454
- package/system/dist/{dist-BjhII4Uq.js → dist-yx2KHo3b.js} +2575 -453
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-identity-C0qf888i.mjs → hub-identity-BcvZqT0L.mjs} +1 -1
- package/system/dist/{hub-identity-C0ehkt78.js → hub-identity-Buegac-w.js} +1 -1
- package/system/dist/{hub-mdns-ciao-BYe34S2Q.mjs → hub-mdns-ciao-B6K_dO2s.mjs} +2 -2
- package/system/dist/{hub-mdns-ciao-DJHjyjvT.js → hub-mdns-ciao-DcNPj7WJ.js} +2 -2
- package/system/dist/index.js +33 -19
- package/system/dist/index.mjs +33 -19
- package/system/dist/kernel/moleculer/child-cap-dispatch.d.ts +3 -6
- package/system/dist/kernel/moleculer/switch-toggle.d.ts +7 -2
- package/system/dist/{legacy-integration-rows-door-G6EceE_J.js → legacy-integration-rows-door-BsZyVNiR.js} +1 -1
- package/system/dist/{legacy-integration-rows-door-BEYgXSXr.mjs → legacy-integration-rows-door-DHOJeDPG.mjs} +1 -1
- package/system/dist/{rename-composition-block-D1mO51F9.js → rename-composition-block-BXMor7MR.js} +1 -1
- package/system/dist/{rename-composition-block-D6bq3Twf.mjs → rename-composition-block-DcVS1LuC.mjs} +1 -1
- package/system/dist/{restore-archive-FXsCWq_f.mjs → restore-archive-BG8VJ8Ar.mjs} +82 -82
- package/system/dist/{restore-archive-CJvMq13C.js → restore-archive-BURufVQd.js} +1 -1
- package/system/dist/{wal-maintenance-Ci9Dl-lB.mjs → wal-maintenance-B4wGD6QR.mjs} +0 -0
- package/system/dist/{wal-maintenance-COJ_JxrD.js → wal-maintenance-CeaJyKNT.js} +0 -0
- package/system/package.json +2 -5
- package/system/dist/builtins/camera-grid/grid-camera-declarations.d.ts +0 -59
- package/system/dist/builtins/camera-grid/grid-instances.d.ts +0 -40
- package/system/dist/builtins/camera-grid/grid-record-kinds.d.ts +0 -31
- package/system/dist/builtins/camera-grid/migrations/__fixtures__/seed.d.ts +0 -13
- package/system/dist/builtins/camera-grid/migrations/camera-grids-to-records.d.ts +0 -26
- package/system/dist/builtins/camera-grid/migrations/index.d.ts +0 -6
|
@@ -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-Hwx_JSCU.mjs
|
|
4
4
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
5
5
|
EventCategory["SystemBoot"] = "system.boot";
|
|
6
6
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -522,6 +522,14 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
522
522
|
EventCategory["RunningStarted"] = "running.started";
|
|
523
523
|
/** Mirrors `runningStateCapability.events.onFinished`. */
|
|
524
524
|
EventCategory["RunningFinished"] = "running.finished";
|
|
525
|
+
/** Mirrors `workloadCapability.events.onStarted` — a workload reached running (#585). */
|
|
526
|
+
EventCategory["WorkloadStarted"] = "workload.started";
|
|
527
|
+
/** Mirrors `workloadCapability.events.onStopped` — a running workload stopped cleanly. */
|
|
528
|
+
EventCategory["WorkloadStopped"] = "workload.stopped";
|
|
529
|
+
/** Mirrors `workloadCapability.events.onCrashed` — a workload stopped without a request. */
|
|
530
|
+
EventCategory["WorkloadCrashed"] = "workload.crashed";
|
|
531
|
+
/** Mirrors `workloadCapability.events.onRecovered` — a crashed workload runs again. */
|
|
532
|
+
EventCategory["WorkloadRecovered"] = "workload.recovered";
|
|
525
533
|
/** Mirrors `deviceRunsCapability.events.onRunOpened` - a durable run record opened. */
|
|
526
534
|
EventCategory["DeviceRunOpened"] = "device-run.opened";
|
|
527
535
|
/** Mirrors `deviceRunsCapability.events.onRunClosed` - a durable run record closed. */
|
|
@@ -824,7 +832,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
824
832
|
return EventCategory;
|
|
825
833
|
}({});
|
|
826
834
|
//#endregion
|
|
827
|
-
//#region ../types/dist/composed-stable-id-
|
|
835
|
+
//#region ../types/dist/composed-stable-id-BBL71oUQ.mjs
|
|
828
836
|
/**
|
|
829
837
|
import { errMsg } from '@camstack/types'
|
|
830
838
|
* Extract a human-readable message from an unknown error value.
|
|
@@ -956,6 +964,10 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
956
964
|
* and the storage as branches of one bus. One read-only `energy-system` cap carries
|
|
957
965
|
* every value; the storage is a field of it, never the `battery` cap (#513, #522). */
|
|
958
966
|
DeviceType["EnergySystem"] = "energy-system";
|
|
967
|
+
/** Something that RUNS on a machine, or the machine itself (#585): a VM, an app
|
|
968
|
+
* container, an LXC, an app, or a host. The kind is the ROLE (D1033, D1056), never
|
|
969
|
+
* a field; one `workload` cap carries the state, the controls and the resources. */
|
|
970
|
+
DeviceType["Workload"] = "workload";
|
|
959
971
|
return DeviceType;
|
|
960
972
|
}({});
|
|
961
973
|
var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
|
|
@@ -1185,6 +1197,11 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
1185
1197
|
* `light` type: the provider owns the type, and a light implies brightness
|
|
1186
1198
|
* or colour this relay lacks. */
|
|
1187
1199
|
DeviceRole["SwitchLight"] = "switch-light";
|
|
1200
|
+
/** One port of a network switch that powers the device behind it (PoE): on /
|
|
1201
|
+
* off feeds or cuts that power. Its link is `network-link`, its draw
|
|
1202
|
+
* `power-meter`. Restarting the powered device through the port is that
|
|
1203
|
+
* device's `power-source` cap, never a reboot of the port. */
|
|
1204
|
+
DeviceRole["PoePort"] = "poe-port";
|
|
1188
1205
|
/** Air conditioner / split unit: cooling, fan speed, louvres. */
|
|
1189
1206
|
DeviceRole["ClimateAc"] = "climate-ac";
|
|
1190
1207
|
/** Room thermostat: a setpoint and a room temperature. The default. */
|
|
@@ -1265,6 +1282,17 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
1265
1282
|
/** Emits a pulse train (infrared or RF) on request — the `ir-transmitter`
|
|
1266
1283
|
* cap. A `DeviceType.Generic` device. */
|
|
1267
1284
|
DeviceRole["IrTransmitter"] = "ir-transmitter";
|
|
1285
|
+
/** A virtual machine on a hypervisor. */
|
|
1286
|
+
DeviceRole["Vm"] = "vm";
|
|
1287
|
+
/** An application container (Docker, Podman). */
|
|
1288
|
+
DeviceRole["AppContainer"] = "app-container";
|
|
1289
|
+
/** A system container (LXC). */
|
|
1290
|
+
DeviceRole["Lxc"] = "lxc";
|
|
1291
|
+
/** An application or service running on a host. */
|
|
1292
|
+
DeviceRole["App"] = "app";
|
|
1293
|
+
/** A machine that runs workloads or is an appliance with its own OS: a
|
|
1294
|
+
* server, a hypervisor, a gateway console, a CCU. */
|
|
1295
|
+
DeviceRole["Host"] = "host";
|
|
1268
1296
|
return DeviceRole;
|
|
1269
1297
|
}({});
|
|
1270
1298
|
/**
|
|
@@ -1274,7 +1302,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
1274
1302
|
*/
|
|
1275
1303
|
var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
|
|
1276
1304
|
//#endregion
|
|
1277
|
-
//#region ../types/dist/sleep-
|
|
1305
|
+
//#region ../types/dist/sleep-D6Pih0Qt.mjs
|
|
1278
1306
|
/**
|
|
1279
1307
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
1280
1308
|
* window to float samples (D455).
|
|
@@ -6807,6 +6835,10 @@ var CAP_VOCABULARY_BY_NAME = {
|
|
|
6807
6835
|
effect: {
|
|
6808
6836
|
field: "on",
|
|
6809
6837
|
value: true
|
|
6838
|
+
},
|
|
6839
|
+
offeredWhen: {
|
|
6840
|
+
method: "getOptions",
|
|
6841
|
+
field: "supportsSetState"
|
|
6810
6842
|
}
|
|
6811
6843
|
},
|
|
6812
6844
|
{
|
|
@@ -6825,6 +6857,10 @@ var CAP_VOCABULARY_BY_NAME = {
|
|
|
6825
6857
|
effect: {
|
|
6826
6858
|
field: "on",
|
|
6827
6859
|
value: false
|
|
6860
|
+
},
|
|
6861
|
+
offeredWhen: {
|
|
6862
|
+
method: "getOptions",
|
|
6863
|
+
field: "supportsSetState"
|
|
6828
6864
|
}
|
|
6829
6865
|
},
|
|
6830
6866
|
{
|
|
@@ -6838,9 +6874,14 @@ var CAP_VOCABULARY_BY_NAME = {
|
|
|
6838
6874
|
en: "Toggle {device}",
|
|
6839
6875
|
it: "Commuta {device}"
|
|
6840
6876
|
},
|
|
6841
|
-
icon: "toggle-right"
|
|
6877
|
+
icon: "toggle-right",
|
|
6878
|
+
offeredWhen: {
|
|
6879
|
+
method: "getOptions",
|
|
6880
|
+
field: "supportsSetState"
|
|
6881
|
+
}
|
|
6842
6882
|
}
|
|
6843
6883
|
],
|
|
6884
|
+
notOperatorFacing: { powerCycle: "a power cycle is the forced restart of the device the switch powers (power-source), never a step of its own" },
|
|
6844
6885
|
state: [{
|
|
6845
6886
|
kind: "boolean",
|
|
6846
6887
|
field: "on",
|
|
@@ -7099,6 +7140,47 @@ var CAP_VOCABULARY_BY_NAME = {
|
|
|
7099
7140
|
"switch.off": { icon: "plug" }
|
|
7100
7141
|
},
|
|
7101
7142
|
state: { on: { icon: "plug-zap" } }
|
|
7143
|
+
},
|
|
7144
|
+
[DeviceRole.PoePort]: {
|
|
7145
|
+
actions: {
|
|
7146
|
+
"switch.on": {
|
|
7147
|
+
label: {
|
|
7148
|
+
en: "Power on",
|
|
7149
|
+
it: "Alimenta"
|
|
7150
|
+
},
|
|
7151
|
+
phrase: {
|
|
7152
|
+
en: "Power on {device}",
|
|
7153
|
+
it: "Alimenta {device}"
|
|
7154
|
+
},
|
|
7155
|
+
icon: "plug-zap"
|
|
7156
|
+
},
|
|
7157
|
+
"switch.off": {
|
|
7158
|
+
label: {
|
|
7159
|
+
en: "Power off",
|
|
7160
|
+
it: "Togli alimentazione"
|
|
7161
|
+
},
|
|
7162
|
+
phrase: {
|
|
7163
|
+
en: "Power off {device}",
|
|
7164
|
+
it: "Togli alimentazione a {device}"
|
|
7165
|
+
},
|
|
7166
|
+
icon: "unplug"
|
|
7167
|
+
}
|
|
7168
|
+
},
|
|
7169
|
+
state: { on: {
|
|
7170
|
+
label: {
|
|
7171
|
+
en: "Powered",
|
|
7172
|
+
it: "Alimentata"
|
|
7173
|
+
},
|
|
7174
|
+
whenTrue: {
|
|
7175
|
+
en: "When {device} is powered",
|
|
7176
|
+
it: "Quando {device} viene alimentata"
|
|
7177
|
+
},
|
|
7178
|
+
whenFalse: {
|
|
7179
|
+
en: "When {device} loses power",
|
|
7180
|
+
it: "Quando {device} perde l’alimentazione"
|
|
7181
|
+
},
|
|
7182
|
+
icon: "plug-zap"
|
|
7183
|
+
} }
|
|
7102
7184
|
}
|
|
7103
7185
|
}
|
|
7104
7186
|
}
|
|
@@ -7818,7 +7900,11 @@ var CAP_VOCABULARY_BY_NAME = {
|
|
|
7818
7900
|
en: "Power on {device}",
|
|
7819
7901
|
it: "Dai corrente a {device}"
|
|
7820
7902
|
},
|
|
7821
|
-
icon: "power"
|
|
7903
|
+
icon: "power",
|
|
7904
|
+
offeredWhen: {
|
|
7905
|
+
method: "getStatus",
|
|
7906
|
+
field: "switchSettable"
|
|
7907
|
+
}
|
|
7822
7908
|
},
|
|
7823
7909
|
{
|
|
7824
7910
|
id: "powerSource.off",
|
|
@@ -7831,7 +7917,11 @@ var CAP_VOCABULARY_BY_NAME = {
|
|
|
7831
7917
|
en: "Cut the power of {device}",
|
|
7832
7918
|
it: "Togli la corrente a {device}"
|
|
7833
7919
|
},
|
|
7834
|
-
icon: "power-off"
|
|
7920
|
+
icon: "power-off",
|
|
7921
|
+
offeredWhen: {
|
|
7922
|
+
method: "getStatus",
|
|
7923
|
+
field: "switchSettable"
|
|
7924
|
+
}
|
|
7835
7925
|
},
|
|
7836
7926
|
{
|
|
7837
7927
|
id: "powerSource.forceRestart",
|
|
@@ -9601,37 +9691,66 @@ var CAP_VOCABULARY_BY_NAME = {
|
|
|
9601
9691
|
en: "Siren",
|
|
9602
9692
|
it: "Sirena"
|
|
9603
9693
|
},
|
|
9604
|
-
actions: [
|
|
9605
|
-
|
|
9606
|
-
|
|
9607
|
-
|
|
9608
|
-
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
|
|
9612
|
-
|
|
9613
|
-
|
|
9614
|
-
|
|
9615
|
-
|
|
9616
|
-
|
|
9617
|
-
|
|
9618
|
-
id: "siren.stop",
|
|
9619
|
-
method: "stop",
|
|
9620
|
-
label: {
|
|
9621
|
-
en: "Silence the siren",
|
|
9622
|
-
it: "Zittisci la sirena"
|
|
9694
|
+
actions: [
|
|
9695
|
+
{
|
|
9696
|
+
id: "siren.trigger",
|
|
9697
|
+
method: "trigger",
|
|
9698
|
+
label: {
|
|
9699
|
+
en: "Sound the siren",
|
|
9700
|
+
it: "Fai suonare la sirena"
|
|
9701
|
+
},
|
|
9702
|
+
phrase: {
|
|
9703
|
+
en: "Sound {device}",
|
|
9704
|
+
it: "Fai suonare {device}"
|
|
9705
|
+
},
|
|
9706
|
+
icon: "siren",
|
|
9707
|
+
args: {}
|
|
9623
9708
|
},
|
|
9624
|
-
|
|
9625
|
-
|
|
9626
|
-
|
|
9709
|
+
{
|
|
9710
|
+
id: "siren.triggerPlays",
|
|
9711
|
+
method: "trigger",
|
|
9712
|
+
label: {
|
|
9713
|
+
en: "Sound the siren N times",
|
|
9714
|
+
it: "Fai suonare la sirena N volte"
|
|
9715
|
+
},
|
|
9716
|
+
phrase: {
|
|
9717
|
+
en: "Sound {device} {plays} times",
|
|
9718
|
+
it: "Fai suonare {device} {plays} volte"
|
|
9719
|
+
},
|
|
9720
|
+
icon: "siren",
|
|
9721
|
+
openArgs: [{
|
|
9722
|
+
key: "plays",
|
|
9723
|
+
label: {
|
|
9724
|
+
en: "Plays",
|
|
9725
|
+
it: "Riproduzioni"
|
|
9726
|
+
},
|
|
9727
|
+
offer: {
|
|
9728
|
+
kind: "dynamic",
|
|
9729
|
+
from: "method",
|
|
9730
|
+
method: "getPlayChoices",
|
|
9731
|
+
valueKind: "number"
|
|
9732
|
+
}
|
|
9733
|
+
}]
|
|
9627
9734
|
},
|
|
9628
|
-
|
|
9629
|
-
|
|
9630
|
-
|
|
9631
|
-
|
|
9632
|
-
|
|
9735
|
+
{
|
|
9736
|
+
id: "siren.stop",
|
|
9737
|
+
method: "stop",
|
|
9738
|
+
label: {
|
|
9739
|
+
en: "Silence the siren",
|
|
9740
|
+
it: "Zittisci la sirena"
|
|
9741
|
+
},
|
|
9742
|
+
phrase: {
|
|
9743
|
+
en: "Silence {device}",
|
|
9744
|
+
it: "Zittisci {device}"
|
|
9745
|
+
},
|
|
9746
|
+
icon: "siren",
|
|
9747
|
+
args: {},
|
|
9748
|
+
effect: {
|
|
9749
|
+
field: "active",
|
|
9750
|
+
value: false
|
|
9751
|
+
}
|
|
9633
9752
|
}
|
|
9634
|
-
|
|
9753
|
+
],
|
|
9635
9754
|
state: [{
|
|
9636
9755
|
kind: "boolean",
|
|
9637
9756
|
field: "active",
|
|
@@ -12226,6 +12345,374 @@ var CAP_VOCABULARY_BY_NAME = {
|
|
|
12226
12345
|
icon: "loader"
|
|
12227
12346
|
}]
|
|
12228
12347
|
},
|
|
12348
|
+
"workload": {
|
|
12349
|
+
scope: "device",
|
|
12350
|
+
noun: {
|
|
12351
|
+
en: "Workload",
|
|
12352
|
+
it: "Carico di lavoro"
|
|
12353
|
+
},
|
|
12354
|
+
actions: [
|
|
12355
|
+
{
|
|
12356
|
+
id: "workload.start",
|
|
12357
|
+
method: "start",
|
|
12358
|
+
label: {
|
|
12359
|
+
en: "Start",
|
|
12360
|
+
it: "Avvia"
|
|
12361
|
+
},
|
|
12362
|
+
phrase: {
|
|
12363
|
+
en: "Start {device}",
|
|
12364
|
+
it: "Avvia {device}"
|
|
12365
|
+
},
|
|
12366
|
+
icon: "play",
|
|
12367
|
+
effect: {
|
|
12368
|
+
field: "state",
|
|
12369
|
+
value: "running"
|
|
12370
|
+
}
|
|
12371
|
+
},
|
|
12372
|
+
{
|
|
12373
|
+
id: "workload.stop",
|
|
12374
|
+
method: "stop",
|
|
12375
|
+
label: {
|
|
12376
|
+
en: "Stop",
|
|
12377
|
+
it: "Arresta"
|
|
12378
|
+
},
|
|
12379
|
+
phrase: {
|
|
12380
|
+
en: "Stop {device}",
|
|
12381
|
+
it: "Arresta {device}"
|
|
12382
|
+
},
|
|
12383
|
+
icon: "square",
|
|
12384
|
+
effect: {
|
|
12385
|
+
field: "state",
|
|
12386
|
+
value: "stopped"
|
|
12387
|
+
}
|
|
12388
|
+
},
|
|
12389
|
+
{
|
|
12390
|
+
id: "workload.restart",
|
|
12391
|
+
method: "restart",
|
|
12392
|
+
label: {
|
|
12393
|
+
en: "Restart",
|
|
12394
|
+
it: "Riavvia"
|
|
12395
|
+
},
|
|
12396
|
+
phrase: {
|
|
12397
|
+
en: "Restart {device}",
|
|
12398
|
+
it: "Riavvia {device}"
|
|
12399
|
+
},
|
|
12400
|
+
icon: "rotate-ccw"
|
|
12401
|
+
},
|
|
12402
|
+
{
|
|
12403
|
+
id: "workload.pause",
|
|
12404
|
+
method: "pause",
|
|
12405
|
+
label: {
|
|
12406
|
+
en: "Pause",
|
|
12407
|
+
it: "Metti in pausa"
|
|
12408
|
+
},
|
|
12409
|
+
phrase: {
|
|
12410
|
+
en: "Pause {device}",
|
|
12411
|
+
it: "Metti in pausa {device}"
|
|
12412
|
+
},
|
|
12413
|
+
icon: "pause",
|
|
12414
|
+
effect: {
|
|
12415
|
+
field: "state",
|
|
12416
|
+
value: "paused"
|
|
12417
|
+
}
|
|
12418
|
+
},
|
|
12419
|
+
{
|
|
12420
|
+
id: "workload.resume",
|
|
12421
|
+
method: "resume",
|
|
12422
|
+
label: {
|
|
12423
|
+
en: "Resume",
|
|
12424
|
+
it: "Riprendi"
|
|
12425
|
+
},
|
|
12426
|
+
phrase: {
|
|
12427
|
+
en: "Resume {device}",
|
|
12428
|
+
it: "Riprendi {device}"
|
|
12429
|
+
},
|
|
12430
|
+
icon: "circle-play",
|
|
12431
|
+
effect: {
|
|
12432
|
+
field: "state",
|
|
12433
|
+
value: "running"
|
|
12434
|
+
}
|
|
12435
|
+
},
|
|
12436
|
+
{
|
|
12437
|
+
id: "workload.forceStop",
|
|
12438
|
+
method: "forceStop",
|
|
12439
|
+
label: {
|
|
12440
|
+
en: "Force stop",
|
|
12441
|
+
it: "Arresto forzato"
|
|
12442
|
+
},
|
|
12443
|
+
phrase: {
|
|
12444
|
+
en: "Force {device} to stop",
|
|
12445
|
+
it: "Forza l’arresto di {device}"
|
|
12446
|
+
},
|
|
12447
|
+
icon: "octagon-x",
|
|
12448
|
+
effect: {
|
|
12449
|
+
field: "state",
|
|
12450
|
+
value: "stopped"
|
|
12451
|
+
}
|
|
12452
|
+
}
|
|
12453
|
+
],
|
|
12454
|
+
state: [
|
|
12455
|
+
{
|
|
12456
|
+
kind: "enum",
|
|
12457
|
+
field: "state",
|
|
12458
|
+
label: {
|
|
12459
|
+
en: "State",
|
|
12460
|
+
it: "Stato"
|
|
12461
|
+
},
|
|
12462
|
+
values: [
|
|
12463
|
+
{
|
|
12464
|
+
value: "running",
|
|
12465
|
+
label: {
|
|
12466
|
+
en: "Running",
|
|
12467
|
+
it: "In esecuzione"
|
|
12468
|
+
},
|
|
12469
|
+
phrase: {
|
|
12470
|
+
en: "When {device} is running",
|
|
12471
|
+
it: "Quando {device} è in esecuzione"
|
|
12472
|
+
}
|
|
12473
|
+
},
|
|
12474
|
+
{
|
|
12475
|
+
value: "paused",
|
|
12476
|
+
label: {
|
|
12477
|
+
en: "Paused",
|
|
12478
|
+
it: "In pausa"
|
|
12479
|
+
}
|
|
12480
|
+
},
|
|
12481
|
+
{
|
|
12482
|
+
value: "stopped",
|
|
12483
|
+
label: {
|
|
12484
|
+
en: "Stopped",
|
|
12485
|
+
it: "Arrestato"
|
|
12486
|
+
},
|
|
12487
|
+
phrase: {
|
|
12488
|
+
en: "When {device} is stopped",
|
|
12489
|
+
it: "Quando {device} è arrestato"
|
|
12490
|
+
}
|
|
12491
|
+
},
|
|
12492
|
+
{
|
|
12493
|
+
value: "starting",
|
|
12494
|
+
label: {
|
|
12495
|
+
en: "Starting",
|
|
12496
|
+
it: "In avvio"
|
|
12497
|
+
}
|
|
12498
|
+
},
|
|
12499
|
+
{
|
|
12500
|
+
value: "stopping",
|
|
12501
|
+
label: {
|
|
12502
|
+
en: "Stopping",
|
|
12503
|
+
it: "In arresto"
|
|
12504
|
+
}
|
|
12505
|
+
},
|
|
12506
|
+
{
|
|
12507
|
+
value: "crashed",
|
|
12508
|
+
label: {
|
|
12509
|
+
en: "Crashed",
|
|
12510
|
+
it: "Arrestato in modo anomalo"
|
|
12511
|
+
},
|
|
12512
|
+
phrase: {
|
|
12513
|
+
en: "When {device} has crashed",
|
|
12514
|
+
it: "Quando {device} è arrestato in modo anomalo"
|
|
12515
|
+
}
|
|
12516
|
+
}
|
|
12517
|
+
],
|
|
12518
|
+
icon: "activity"
|
|
12519
|
+
},
|
|
12520
|
+
{
|
|
12521
|
+
kind: "numeric",
|
|
12522
|
+
field: "resources.cpuPercent",
|
|
12523
|
+
quantity: {
|
|
12524
|
+
en: "the CPU use",
|
|
12525
|
+
it: "l'uso della CPU"
|
|
12526
|
+
},
|
|
12527
|
+
label: {
|
|
12528
|
+
en: "CPU",
|
|
12529
|
+
it: "CPU"
|
|
12530
|
+
},
|
|
12531
|
+
unit: "%",
|
|
12532
|
+
icon: "cpu"
|
|
12533
|
+
},
|
|
12534
|
+
{
|
|
12535
|
+
kind: "numeric",
|
|
12536
|
+
field: "resources.memoryPercent",
|
|
12537
|
+
quantity: {
|
|
12538
|
+
en: "the memory use",
|
|
12539
|
+
it: "l'uso della memoria"
|
|
12540
|
+
},
|
|
12541
|
+
label: {
|
|
12542
|
+
en: "Memory",
|
|
12543
|
+
it: "Memoria"
|
|
12544
|
+
},
|
|
12545
|
+
unit: "%",
|
|
12546
|
+
icon: "memory-stick"
|
|
12547
|
+
},
|
|
12548
|
+
{
|
|
12549
|
+
kind: "numeric",
|
|
12550
|
+
field: "resources.temperature",
|
|
12551
|
+
quantity: {
|
|
12552
|
+
en: "the temperature",
|
|
12553
|
+
it: "la temperatura"
|
|
12554
|
+
},
|
|
12555
|
+
label: {
|
|
12556
|
+
en: "Temperature",
|
|
12557
|
+
it: "Temperatura"
|
|
12558
|
+
},
|
|
12559
|
+
unit: "°C",
|
|
12560
|
+
icon: "thermometer"
|
|
12561
|
+
}
|
|
12562
|
+
],
|
|
12563
|
+
events: {
|
|
12564
|
+
onStarted: {
|
|
12565
|
+
category: EventCategory.WorkloadStarted,
|
|
12566
|
+
label: {
|
|
12567
|
+
en: "Started",
|
|
12568
|
+
it: "Avviato"
|
|
12569
|
+
},
|
|
12570
|
+
phrase: {
|
|
12571
|
+
en: "When {device} starts",
|
|
12572
|
+
it: "Quando {device} si avvia"
|
|
12573
|
+
},
|
|
12574
|
+
icon: "play"
|
|
12575
|
+
},
|
|
12576
|
+
onStopped: {
|
|
12577
|
+
category: EventCategory.WorkloadStopped,
|
|
12578
|
+
label: {
|
|
12579
|
+
en: "Stopped",
|
|
12580
|
+
it: "Arrestato"
|
|
12581
|
+
},
|
|
12582
|
+
phrase: {
|
|
12583
|
+
en: "When {device} stops",
|
|
12584
|
+
it: "Quando {device} si arresta"
|
|
12585
|
+
},
|
|
12586
|
+
icon: "square"
|
|
12587
|
+
},
|
|
12588
|
+
onCrashed: {
|
|
12589
|
+
category: EventCategory.WorkloadCrashed,
|
|
12590
|
+
label: {
|
|
12591
|
+
en: "Crashed",
|
|
12592
|
+
it: "Arrestato in modo anomalo"
|
|
12593
|
+
},
|
|
12594
|
+
phrase: {
|
|
12595
|
+
en: "When {device} stops without being asked",
|
|
12596
|
+
it: "Quando {device} si arresta senza che sia stato richiesto"
|
|
12597
|
+
},
|
|
12598
|
+
icon: "triangle-alert"
|
|
12599
|
+
},
|
|
12600
|
+
onRecovered: {
|
|
12601
|
+
category: EventCategory.WorkloadRecovered,
|
|
12602
|
+
label: {
|
|
12603
|
+
en: "Recovered",
|
|
12604
|
+
it: "Ripristinato"
|
|
12605
|
+
},
|
|
12606
|
+
phrase: {
|
|
12607
|
+
en: "When {device} runs again after a crash",
|
|
12608
|
+
it: "Quando {device} riparte dopo un arresto anomalo"
|
|
12609
|
+
},
|
|
12610
|
+
icon: "heart-pulse"
|
|
12611
|
+
}
|
|
12612
|
+
},
|
|
12613
|
+
overrides: { byRole: {
|
|
12614
|
+
[DeviceRole.Vm]: {
|
|
12615
|
+
actions: { "workload.start": { icon: "monitor" } },
|
|
12616
|
+
state: { state: { icon: "monitor" } }
|
|
12617
|
+
},
|
|
12618
|
+
[DeviceRole.AppContainer]: {
|
|
12619
|
+
actions: { "workload.start": { icon: "container" } },
|
|
12620
|
+
state: { state: { icon: "container" } }
|
|
12621
|
+
},
|
|
12622
|
+
[DeviceRole.Lxc]: {
|
|
12623
|
+
actions: { "workload.start": { icon: "box" } },
|
|
12624
|
+
state: { state: { icon: "box" } }
|
|
12625
|
+
},
|
|
12626
|
+
[DeviceRole.App]: {
|
|
12627
|
+
actions: { "workload.start": { icon: "app-window" } },
|
|
12628
|
+
state: { state: { icon: "app-window" } }
|
|
12629
|
+
},
|
|
12630
|
+
[DeviceRole.Host]: {
|
|
12631
|
+
actions: {
|
|
12632
|
+
"workload.start": {
|
|
12633
|
+
label: {
|
|
12634
|
+
en: "Power on",
|
|
12635
|
+
it: "Accendi"
|
|
12636
|
+
},
|
|
12637
|
+
phrase: {
|
|
12638
|
+
en: "Power on {device}",
|
|
12639
|
+
it: "Accendi {device}"
|
|
12640
|
+
},
|
|
12641
|
+
icon: "power"
|
|
12642
|
+
},
|
|
12643
|
+
"workload.stop": {
|
|
12644
|
+
label: {
|
|
12645
|
+
en: "Shut down",
|
|
12646
|
+
it: "Spegni"
|
|
12647
|
+
},
|
|
12648
|
+
phrase: {
|
|
12649
|
+
en: "Shut down {device}",
|
|
12650
|
+
it: "Spegni {device}"
|
|
12651
|
+
},
|
|
12652
|
+
icon: "power-off"
|
|
12653
|
+
},
|
|
12654
|
+
"workload.restart": {
|
|
12655
|
+
label: {
|
|
12656
|
+
en: "Reboot",
|
|
12657
|
+
it: "Riavvia"
|
|
12658
|
+
},
|
|
12659
|
+
phrase: {
|
|
12660
|
+
en: "Reboot {device}",
|
|
12661
|
+
it: "Riavvia {device}"
|
|
12662
|
+
},
|
|
12663
|
+
icon: "refresh-cw"
|
|
12664
|
+
}
|
|
12665
|
+
},
|
|
12666
|
+
state: { state: { icon: "server" } },
|
|
12667
|
+
events: {
|
|
12668
|
+
onStarted: {
|
|
12669
|
+
label: {
|
|
12670
|
+
en: "Came online",
|
|
12671
|
+
it: "Tornato in linea"
|
|
12672
|
+
},
|
|
12673
|
+
phrase: {
|
|
12674
|
+
en: "When {device} comes online",
|
|
12675
|
+
it: "Quando {device} torna in linea"
|
|
12676
|
+
},
|
|
12677
|
+
icon: "server"
|
|
12678
|
+
},
|
|
12679
|
+
onStopped: {
|
|
12680
|
+
label: {
|
|
12681
|
+
en: "Shut down",
|
|
12682
|
+
it: "Spento"
|
|
12683
|
+
},
|
|
12684
|
+
phrase: {
|
|
12685
|
+
en: "When {device} shuts down",
|
|
12686
|
+
it: "Quando {device} si spegne"
|
|
12687
|
+
},
|
|
12688
|
+
icon: "server-off"
|
|
12689
|
+
},
|
|
12690
|
+
onCrashed: {
|
|
12691
|
+
label: {
|
|
12692
|
+
en: "Went down",
|
|
12693
|
+
it: "Caduto"
|
|
12694
|
+
},
|
|
12695
|
+
phrase: {
|
|
12696
|
+
en: "When {device} goes down unexpectedly",
|
|
12697
|
+
it: "Quando {device} cade inaspettatamente"
|
|
12698
|
+
},
|
|
12699
|
+
icon: "server-crash"
|
|
12700
|
+
},
|
|
12701
|
+
onRecovered: {
|
|
12702
|
+
label: {
|
|
12703
|
+
en: "Came online",
|
|
12704
|
+
it: "Tornato in linea"
|
|
12705
|
+
},
|
|
12706
|
+
phrase: {
|
|
12707
|
+
en: "When {device} comes back online after going down",
|
|
12708
|
+
it: "Quando {device} torna in linea dopo essere caduto"
|
|
12709
|
+
},
|
|
12710
|
+
icon: "server"
|
|
12711
|
+
}
|
|
12712
|
+
}
|
|
12713
|
+
}
|
|
12714
|
+
} }
|
|
12715
|
+
},
|
|
12229
12716
|
"accessories": {
|
|
12230
12717
|
scope: "device",
|
|
12231
12718
|
noun: {
|
|
@@ -16062,6 +16549,15 @@ var PipelineStepInputSchema = zod.z.lazy(() => zod.z.object({
|
|
|
16062
16549
|
}));
|
|
16063
16550
|
/** Typed bridge to the recursive `FrameResult` graph; validation is structural. */
|
|
16064
16551
|
var PipelineRunResultBridge = zod.z.custom();
|
|
16552
|
+
/**
|
|
16553
|
+
* Whether a switch can be set (D1058), schema-free so the addon runner can import it from
|
|
16554
|
+
* `@camstack/types/addon` without loading the capability schema graph (D28).
|
|
16555
|
+
*/
|
|
16556
|
+
/** The read that decides whether a switch is offered on/off (`offeredWhen` of its actions). */
|
|
16557
|
+
var SWITCH_SETTABLE_GATE = {
|
|
16558
|
+
method: "getOptions",
|
|
16559
|
+
field: "supportsSetState"
|
|
16560
|
+
};
|
|
16065
16561
|
var StaticDirOutputSchema = zod.z.object({ staticDir: zod.z.string() });
|
|
16066
16562
|
var VersionOutputSchema = zod.z.object({ version: zod.z.string() });
|
|
16067
16563
|
/**
|
|
@@ -16431,6 +16927,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
16431
16927
|
"weather",
|
|
16432
16928
|
"weather-station",
|
|
16433
16929
|
"webrtc-session",
|
|
16930
|
+
"workload",
|
|
16434
16931
|
"zone-analytics",
|
|
16435
16932
|
"zone-rules",
|
|
16436
16933
|
"zones"
|
|
@@ -17733,6 +18230,14 @@ Object.freeze({
|
|
|
17733
18230
|
"path": "ssid",
|
|
17734
18231
|
"valueType": "string"
|
|
17735
18232
|
},
|
|
18233
|
+
{
|
|
18234
|
+
"path": "speedKbps",
|
|
18235
|
+
"valueType": "number"
|
|
18236
|
+
},
|
|
18237
|
+
{
|
|
18238
|
+
"path": "linkUp",
|
|
18239
|
+
"valueType": "boolean"
|
|
18240
|
+
},
|
|
17736
18241
|
{
|
|
17737
18242
|
"path": "lastUpdated",
|
|
17738
18243
|
"valueType": "number"
|
|
@@ -18129,6 +18634,14 @@ Object.freeze({
|
|
|
18129
18634
|
"path": "durationSeconds",
|
|
18130
18635
|
"valueType": "number"
|
|
18131
18636
|
},
|
|
18637
|
+
{
|
|
18638
|
+
"path": "plays",
|
|
18639
|
+
"valueType": "number"
|
|
18640
|
+
},
|
|
18641
|
+
{
|
|
18642
|
+
"path": "activeUntilEstimated",
|
|
18643
|
+
"valueType": "boolean"
|
|
18644
|
+
},
|
|
18132
18645
|
{
|
|
18133
18646
|
"path": "lastTriggeredAt",
|
|
18134
18647
|
"valueType": "number"
|
|
@@ -18531,6 +19044,92 @@ Object.freeze({
|
|
|
18531
19044
|
"valueType": "number"
|
|
18532
19045
|
}
|
|
18533
19046
|
],
|
|
19047
|
+
"workload": [
|
|
19048
|
+
{
|
|
19049
|
+
"path": "state",
|
|
19050
|
+
"valueType": "enum",
|
|
19051
|
+
"enumValues": [
|
|
19052
|
+
"running",
|
|
19053
|
+
"paused",
|
|
19054
|
+
"stopped",
|
|
19055
|
+
"starting",
|
|
19056
|
+
"stopping",
|
|
19057
|
+
"crashed"
|
|
19058
|
+
]
|
|
19059
|
+
},
|
|
19060
|
+
{
|
|
19061
|
+
"path": "since",
|
|
19062
|
+
"valueType": "number"
|
|
19063
|
+
},
|
|
19064
|
+
{
|
|
19065
|
+
"path": "hostDeviceId",
|
|
19066
|
+
"valueType": "number"
|
|
19067
|
+
},
|
|
19068
|
+
{
|
|
19069
|
+
"path": "image",
|
|
19070
|
+
"valueType": "string"
|
|
19071
|
+
},
|
|
19072
|
+
{
|
|
19073
|
+
"path": "os",
|
|
19074
|
+
"valueType": "string"
|
|
19075
|
+
},
|
|
19076
|
+
{
|
|
19077
|
+
"path": "version",
|
|
19078
|
+
"valueType": "string"
|
|
19079
|
+
},
|
|
19080
|
+
{
|
|
19081
|
+
"path": "autostart",
|
|
19082
|
+
"valueType": "boolean"
|
|
19083
|
+
},
|
|
19084
|
+
{
|
|
19085
|
+
"path": "resources.cpuPercent",
|
|
19086
|
+
"valueType": "number"
|
|
19087
|
+
},
|
|
19088
|
+
{
|
|
19089
|
+
"path": "resources.memoryUsedBytes",
|
|
19090
|
+
"valueType": "number"
|
|
19091
|
+
},
|
|
19092
|
+
{
|
|
19093
|
+
"path": "resources.memoryPercent",
|
|
19094
|
+
"valueType": "number"
|
|
19095
|
+
},
|
|
19096
|
+
{
|
|
19097
|
+
"path": "resources.memoryLimitBytes",
|
|
19098
|
+
"valueType": "number"
|
|
19099
|
+
},
|
|
19100
|
+
{
|
|
19101
|
+
"path": "resources.vcpus",
|
|
19102
|
+
"valueType": "number"
|
|
19103
|
+
},
|
|
19104
|
+
{
|
|
19105
|
+
"path": "resources.diskUsedBytes",
|
|
19106
|
+
"valueType": "number"
|
|
19107
|
+
},
|
|
19108
|
+
{
|
|
19109
|
+
"path": "resources.diskTotalBytes",
|
|
19110
|
+
"valueType": "number"
|
|
19111
|
+
},
|
|
19112
|
+
{
|
|
19113
|
+
"path": "resources.netRxKbps",
|
|
19114
|
+
"valueType": "number"
|
|
19115
|
+
},
|
|
19116
|
+
{
|
|
19117
|
+
"path": "resources.netTxKbps",
|
|
19118
|
+
"valueType": "number"
|
|
19119
|
+
},
|
|
19120
|
+
{
|
|
19121
|
+
"path": "resources.load1",
|
|
19122
|
+
"valueType": "number"
|
|
19123
|
+
},
|
|
19124
|
+
{
|
|
19125
|
+
"path": "resources.temperature",
|
|
19126
|
+
"valueType": "number"
|
|
19127
|
+
},
|
|
19128
|
+
{
|
|
19129
|
+
"path": "updateAvailable",
|
|
19130
|
+
"valueType": "boolean"
|
|
19131
|
+
}
|
|
19132
|
+
],
|
|
18534
19133
|
"zone-analytics": [
|
|
18535
19134
|
{
|
|
18536
19135
|
"path": "ts",
|
|
@@ -18762,7 +19361,7 @@ function sleep(ms) {
|
|
|
18762
19361
|
return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
|
|
18763
19362
|
}
|
|
18764
19363
|
//#endregion
|
|
18765
|
-
//#region ../types/dist/implemented-methods-
|
|
19364
|
+
//#region ../types/dist/implemented-methods-u7ddjc-_.mjs
|
|
18766
19365
|
var AUDIO_ENCODER_BY_CODEC = {
|
|
18767
19366
|
opus: "libopus",
|
|
18768
19367
|
aac: "aac",
|
|
@@ -21186,7 +21785,37 @@ var derivativeHelperObject = zod.z.object({
|
|
|
21186
21785
|
]),
|
|
21187
21786
|
source: HelperMemberSchema
|
|
21188
21787
|
});
|
|
21788
|
+
/** The stream profiles a camera grid can publish. */
|
|
21789
|
+
var GRID_PROFILES = [
|
|
21790
|
+
"high",
|
|
21791
|
+
"mid",
|
|
21792
|
+
"low"
|
|
21793
|
+
];
|
|
21794
|
+
/** A rectangle in normalized [0,1] coordinates of whatever contains it. */
|
|
21795
|
+
var GridRectSchema = zod.z.object({
|
|
21796
|
+
x: zod.z.number().min(0).max(1),
|
|
21797
|
+
y: zod.z.number().min(0).max(1),
|
|
21798
|
+
width: zod.z.number().gt(0).max(1),
|
|
21799
|
+
height: zod.z.number().gt(0).max(1)
|
|
21800
|
+
});
|
|
21801
|
+
var GridCellSpecSchema = zod.z.object({
|
|
21802
|
+
source: CompositionSourceRefSchema,
|
|
21803
|
+
region: GridRectSchema,
|
|
21804
|
+
cell: GridRectSchema
|
|
21805
|
+
});
|
|
21806
|
+
var gridHelperObject = zod.z.object({
|
|
21807
|
+
kind: zod.z.literal("grid"),
|
|
21808
|
+
fps: zod.z.number().int().min(1).max(60),
|
|
21809
|
+
publishedProfiles: zod.z.array(zod.z.enum(GRID_PROFILES)).max(3),
|
|
21810
|
+
cells: zod.z.array(GridCellSpecSchema).max(16)
|
|
21811
|
+
});
|
|
21812
|
+
var terminalHelperObject = zod.z.object({
|
|
21813
|
+
kind: zod.z.literal("terminal"),
|
|
21814
|
+
terminalId: zod.z.string().uuid()
|
|
21815
|
+
});
|
|
21189
21816
|
var HelperSpecSchema = zod.z.discriminatedUnion("kind", [
|
|
21817
|
+
gridHelperObject,
|
|
21818
|
+
terminalHelperObject,
|
|
21190
21819
|
GroupHelperSpecSchema,
|
|
21191
21820
|
statisticHelperObject,
|
|
21192
21821
|
integralHelperObject,
|
|
@@ -21208,8 +21837,13 @@ function helperMembers(spec) {
|
|
|
21208
21837
|
case "derivative": return [spec.source];
|
|
21209
21838
|
case "arithmetic": return spec.inputs;
|
|
21210
21839
|
case "expression": return spec.inputs.map((input) => input.member);
|
|
21840
|
+
case "grid":
|
|
21841
|
+
case "terminal": return [];
|
|
21211
21842
|
}
|
|
21212
21843
|
}
|
|
21844
|
+
function isEngineHostedHelper(spec) {
|
|
21845
|
+
return spec.kind === "grid" || spec.kind === "terminal";
|
|
21846
|
+
}
|
|
21213
21847
|
/**
|
|
21214
21848
|
* A COMPOSITION: a device assembled from other devices' state (D659).
|
|
21215
21849
|
*
|
|
@@ -58940,9 +59574,10 @@ var GridProfileOfferSchema = zod.z.object({
|
|
|
58940
59574
|
published: zod.z.boolean()
|
|
58941
59575
|
});
|
|
58942
59576
|
var GridLayoutViewSchema = zod.z.object({
|
|
58943
|
-
/** The
|
|
58944
|
-
|
|
59577
|
+
/** The grid block (planning#580) whose camera this is. */
|
|
59578
|
+
blockId: zod.z.string(),
|
|
58945
59579
|
deviceId: zod.z.number().int().nonnegative(),
|
|
59580
|
+
/** The device row's name — the only name a grid has; it is renamed on the block or the device. */
|
|
58946
59581
|
name: zod.z.string(),
|
|
58947
59582
|
/**
|
|
58948
59583
|
* NO canvas size. A grid's resolution is not authored: each profile derives
|
|
@@ -58958,7 +59593,6 @@ var GridLayoutViewSchema = zod.z.object({
|
|
|
58958
59593
|
});
|
|
58959
59594
|
var GridLayoutPatchSchema = zod.z.object({
|
|
58960
59595
|
deviceId: zod.z.number().int().nonnegative(),
|
|
58961
|
-
name: zod.z.string().min(1).max(160).optional(),
|
|
58962
59596
|
fps: zod.z.number().int().min(1).max(60).optional(),
|
|
58963
59597
|
/** Which profiles to publish. See `GridProfileOffer.published`. */
|
|
58964
59598
|
publishedProfiles: zod.z.array(zod.z.enum([
|
|
@@ -63411,7 +64045,8 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
63411
64045
|
DeviceType.Dryer,
|
|
63412
64046
|
DeviceType.Gateway,
|
|
63413
64047
|
DeviceType.HeatPump,
|
|
63414
|
-
DeviceType.EnergySystem
|
|
64048
|
+
DeviceType.EnergySystem,
|
|
64049
|
+
DeviceType.Workload
|
|
63415
64050
|
],
|
|
63416
64051
|
apply: "add",
|
|
63417
64052
|
vocabularyCap: "consumables",
|
|
@@ -65783,7 +66418,7 @@ function groupTemplate(id) {
|
|
|
65783
66418
|
}
|
|
65784
66419
|
/**
|
|
65785
66420
|
* Cap history catalog, projected from every `*.cap.ts` `history` block.
|
|
65786
|
-
*
|
|
66421
|
+
* 47 caps with series (130 series), 39 caps answered `'none'`.
|
|
65787
66422
|
* Field keys are `runtimeState` paths (`a.b` into fixed objects only).
|
|
65788
66423
|
*/
|
|
65789
66424
|
var HISTORY_CATALOG = {
|
|
@@ -66416,6 +67051,48 @@ var HISTORY_CATALOG = {
|
|
|
66416
67051
|
unit: "mm",
|
|
66417
67052
|
deadband: .1
|
|
66418
67053
|
}
|
|
67054
|
+
},
|
|
67055
|
+
"workload": {
|
|
67056
|
+
"state": {
|
|
67057
|
+
kind: "enum",
|
|
67058
|
+
values: [
|
|
67059
|
+
"running",
|
|
67060
|
+
"paused",
|
|
67061
|
+
"stopped",
|
|
67062
|
+
"starting",
|
|
67063
|
+
"stopping",
|
|
67064
|
+
"crashed"
|
|
67065
|
+
]
|
|
67066
|
+
},
|
|
67067
|
+
"resources.cpuPercent": {
|
|
67068
|
+
kind: "gauge",
|
|
67069
|
+
unit: "%",
|
|
67070
|
+
deadband: 2,
|
|
67071
|
+
displayName: "CPU"
|
|
67072
|
+
},
|
|
67073
|
+
"resources.memoryUsedBytes": {
|
|
67074
|
+
kind: "gauge",
|
|
67075
|
+
unit: "bytes",
|
|
67076
|
+
displayName: "Memory used"
|
|
67077
|
+
},
|
|
67078
|
+
"resources.memoryPercent": {
|
|
67079
|
+
kind: "gauge",
|
|
67080
|
+
unit: "%",
|
|
67081
|
+
deadband: 2,
|
|
67082
|
+
displayName: "Memory"
|
|
67083
|
+
},
|
|
67084
|
+
"resources.netRxKbps": {
|
|
67085
|
+
group: "network",
|
|
67086
|
+
kind: "gauge",
|
|
67087
|
+
unit: "kbps",
|
|
67088
|
+
displayName: "Network received"
|
|
67089
|
+
},
|
|
67090
|
+
"resources.netTxKbps": {
|
|
67091
|
+
group: "network",
|
|
67092
|
+
kind: "gauge",
|
|
67093
|
+
unit: "kbps",
|
|
67094
|
+
displayName: "Network sent"
|
|
67095
|
+
}
|
|
66419
67096
|
}
|
|
66420
67097
|
};
|
|
66421
67098
|
/**
|
|
@@ -66479,7 +67156,7 @@ var HISTORY_ITEM_CATALOG = {
|
|
|
66479
67156
|
};
|
|
66480
67157
|
/**
|
|
66481
67158
|
* The series a device card trends, per cap (`history.primary` + `history.priority`):
|
|
66482
|
-
*
|
|
67159
|
+
* 7 caps. The card shows the primary of the enabled cap with the highest priority.
|
|
66483
67160
|
*/
|
|
66484
67161
|
var HISTORY_PRIMARY = {
|
|
66485
67162
|
"climate-control": {
|
|
@@ -66505,6 +67182,10 @@ var HISTORY_PRIMARY = {
|
|
|
66505
67182
|
"weather-station": {
|
|
66506
67183
|
field: "temperature",
|
|
66507
67184
|
priority: 60
|
|
67185
|
+
},
|
|
67186
|
+
"workload": {
|
|
67187
|
+
field: "resources.cpuPercent",
|
|
67188
|
+
priority: 40
|
|
66508
67189
|
}
|
|
66509
67190
|
};
|
|
66510
67191
|
/** The series specs of `capName`; empty for a `'none'` cap or an unknown one. */
|
|
@@ -66899,6 +67580,10 @@ function expressionDraft(spec) {
|
|
|
66899
67580
|
draft: spec.output === "boolean" ? binarySensor(spec, source) : numericSensor(spec, source)
|
|
66900
67581
|
};
|
|
66901
67582
|
}
|
|
67583
|
+
/**
|
|
67584
|
+
* Project a helper spec onto the composition the composer already runs (D944).
|
|
67585
|
+
* Pure: it stores nothing. A group does not compile to `avg(...)` / `any(...)`.
|
|
67586
|
+
*/
|
|
66902
67587
|
function sameSource(a, b) {
|
|
66903
67588
|
return a.addonId === b.addonId && a.stableId === b.stableId;
|
|
66904
67589
|
}
|
|
@@ -67021,8 +67706,25 @@ function compileHelper(spec, retention = DEFAULT_HISTORY_RETENTION) {
|
|
|
67021
67706
|
case "threshold": return compileMath(thresholdDraft(spec));
|
|
67022
67707
|
case "arithmetic": return compileMath(arithmeticDraft(spec));
|
|
67023
67708
|
case "expression": return compileMath(expressionDraft(spec));
|
|
67709
|
+
case "grid":
|
|
67710
|
+
case "terminal": return parseDraft(engineHostedDraft(spec));
|
|
67024
67711
|
}
|
|
67025
67712
|
}
|
|
67713
|
+
/**
|
|
67714
|
+
* A grid or a Terminal camera (planning#580): a bare `new` Camera. The composer
|
|
67715
|
+
* declares the row; the engine serves every cap on it, so there is nothing to
|
|
67716
|
+
* compose.
|
|
67717
|
+
*/
|
|
67718
|
+
function engineHostedDraft(spec) {
|
|
67719
|
+
return {
|
|
67720
|
+
target: {
|
|
67721
|
+
kind: "new",
|
|
67722
|
+
type: DeviceType.Camera
|
|
67723
|
+
},
|
|
67724
|
+
helper: spec,
|
|
67725
|
+
features: []
|
|
67726
|
+
};
|
|
67727
|
+
}
|
|
67026
67728
|
function compileMath(built) {
|
|
67027
67729
|
if (built.problems.length > 0) return {
|
|
67028
67730
|
ok: false,
|
|
@@ -67276,6 +67978,8 @@ var PowerSourceRefusalReasonSchema = zod.z.enum([
|
|
|
67276
67978
|
"switch-unknown",
|
|
67277
67979
|
"restart-in-progress",
|
|
67278
67980
|
"switch-call-failed",
|
|
67981
|
+
"switch-options-unreadable",
|
|
67982
|
+
"not-settable",
|
|
67279
67983
|
"switch-is-actuator"
|
|
67280
67984
|
]);
|
|
67281
67985
|
var PowerSourceActionResultSchema = zod.z.discriminatedUnion("accepted", [zod.z.object({ accepted: zod.z.literal(true) }), zod.z.object({
|
|
@@ -67292,6 +67996,14 @@ var PowerSourceInfoSchema = zod.z.object({
|
|
|
67292
67996
|
/** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
|
|
67293
67997
|
switchOn: zod.z.boolean().nullable(),
|
|
67294
67998
|
switchOnline: zod.z.boolean().nullable(),
|
|
67999
|
+
/**
|
|
68000
|
+
* Whether the linked switch can be set (`switch.getOptions().supportsSetState`; a provider
|
|
68001
|
+
* without the method is a plain switch, `true`). `null` = not known: no link, the switch is
|
|
68002
|
+
* missing, or the read FAILED. Absent = a provider that predates the field. Only `false`
|
|
68003
|
+
* withdraws power on / off (`offeredWhen` of `powerSource.on` / `.off`, the device hero) —
|
|
68004
|
+
* unknown keeps them (D315, D1058).
|
|
68005
|
+
*/
|
|
68006
|
+
switchSettable: zod.z.boolean().nullable().optional(),
|
|
67295
68007
|
restartInProgress: zod.z.boolean(),
|
|
67296
68008
|
offSeconds: zod.z.number().int()
|
|
67297
68009
|
});
|
|
@@ -67349,6 +68061,11 @@ var powerSourceCustomize = {
|
|
|
67349
68061
|
}]
|
|
67350
68062
|
};
|
|
67351
68063
|
var deviceInput$2 = zod.z.object({ deviceId: zod.z.number().int().nonnegative() });
|
|
68064
|
+
/** The read that decides whether power on / off are offered (`offeredWhen`, D1058). */
|
|
68065
|
+
var POWER_SOURCE_SETTABLE_GATE = {
|
|
68066
|
+
method: "getStatus",
|
|
68067
|
+
field: "switchSettable"
|
|
68068
|
+
};
|
|
67352
68069
|
var powerSourceCapability = {
|
|
67353
68070
|
name: "power-source",
|
|
67354
68071
|
scope: "device",
|
|
@@ -67363,7 +68080,8 @@ var powerSourceCapability = {
|
|
|
67363
68080
|
id: "powerSource.on",
|
|
67364
68081
|
label: t("Power on", "Dai corrente"),
|
|
67365
68082
|
phrase: t("Power on {device}", "Dai corrente a {device}"),
|
|
67366
|
-
icon: "power"
|
|
68083
|
+
icon: "power",
|
|
68084
|
+
offeredWhen: POWER_SOURCE_SETTABLE_GATE
|
|
67367
68085
|
}]
|
|
67368
68086
|
}),
|
|
67369
68087
|
powerOff: systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
|
|
@@ -67373,7 +68091,8 @@ var powerSourceCapability = {
|
|
|
67373
68091
|
id: "powerSource.off",
|
|
67374
68092
|
label: t("Power off", "Togli corrente"),
|
|
67375
68093
|
phrase: t("Cut the power of {device}", "Togli la corrente a {device}"),
|
|
67376
|
-
icon: "power-off"
|
|
68094
|
+
icon: "power-off",
|
|
68095
|
+
offeredWhen: POWER_SOURCE_SETTABLE_GATE
|
|
67377
68096
|
}]
|
|
67378
68097
|
}),
|
|
67379
68098
|
forceRestart: systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
|
|
@@ -70354,6 +71073,260 @@ var SiteZoneSchema = zod.z.object({
|
|
|
70354
71073
|
function siteZoneKey(label) {
|
|
70355
71074
|
return label.trim().toLowerCase();
|
|
70356
71075
|
}
|
|
71076
|
+
/**
|
|
71077
|
+
* Provider-declared device identifiers (D1059, planning#590).
|
|
71078
|
+
*
|
|
71079
|
+
* What a device IS, as its owning provider read it from the hardware: the keys a
|
|
71080
|
+
* later step matches across integrations to tell that two devices are the same
|
|
71081
|
+
* physical object. Separate from `DeviceMetadata` on purpose — metadata is a
|
|
71082
|
+
* free-form blob the operator can edit, identifiers are typed, normalised and
|
|
71083
|
+
* written ONLY by the provider that owns the device (`device-manager.
|
|
71084
|
+
* setIdentifiers`, owner-checked on the transport's caller stamp).
|
|
71085
|
+
*
|
|
71086
|
+
* | Key | Stored form | Strength |
|
|
71087
|
+
* | -------------- | ----------------------------------- | -------- |
|
|
71088
|
+
* | `mac` | `aa:bb:cc:dd:ee:ff`, several | strong |
|
|
71089
|
+
* | `serial` | `<manufacturer>:<serial>` | strong |
|
|
71090
|
+
* | `machine-uuid` | SMBIOS / VM / container uuid | strong |
|
|
71091
|
+
* | `vendor-uid` | `<vendor>:<id>` | strong |
|
|
71092
|
+
* | `hostname` | lower-case, no domain | weak |
|
|
71093
|
+
* | `ip` | IPv4 / IPv6 | weak |
|
|
71094
|
+
*
|
|
71095
|
+
* Strength is a property of the KEY, derived by {@link identifierStrength} —
|
|
71096
|
+
* never stored, so it cannot drift from the table above. A weak key never links
|
|
71097
|
+
* two devices on its own.
|
|
71098
|
+
*
|
|
71099
|
+
* The schema refuses a value that is not in its stored form, so whatever is
|
|
71100
|
+
* persisted is already normalised. Build a declaration with
|
|
71101
|
+
* {@link normaliseIdentifiers}, which turns the raw values a driver read into
|
|
71102
|
+
* that form and names every value it refused.
|
|
71103
|
+
*/
|
|
71104
|
+
var DEVICE_IDENTIFIER_KEYS = [
|
|
71105
|
+
"mac",
|
|
71106
|
+
"serial",
|
|
71107
|
+
"machine-uuid",
|
|
71108
|
+
"vendor-uid",
|
|
71109
|
+
"hostname",
|
|
71110
|
+
"ip"
|
|
71111
|
+
];
|
|
71112
|
+
var DeviceIdentifierKeySchema = zod.z.enum(DEVICE_IDENTIFIER_KEYS);
|
|
71113
|
+
/** `read` — the provider read it from the device; `derived` — computed from something else it read. */
|
|
71114
|
+
var DeviceIdentifierOriginSchema = zod.z.enum(["read", "derived"]);
|
|
71115
|
+
var MAC_PATTERN = /^[0-9a-f]{2}(?::[0-9a-f]{2}){5}$/;
|
|
71116
|
+
/** `<prefix>:<value>` — prefix a lower-case slug, value lower-case and non-blank. */
|
|
71117
|
+
var PREFIXED_PATTERN = /^[a-z0-9][a-z0-9._-]*:[^\sA-Z]+$/;
|
|
71118
|
+
var MACHINE_UUID_PATTERN = /^[0-9a-f][0-9a-f-]{7,}$/;
|
|
71119
|
+
var HOSTNAME_PATTERN = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
|
|
71120
|
+
function entrySchema(value) {
|
|
71121
|
+
return zod.z.object({
|
|
71122
|
+
value,
|
|
71123
|
+
origin: DeviceIdentifierOriginSchema,
|
|
71124
|
+
/** Epoch ms of the FIRST read that produced this value (and origin). A later
|
|
71125
|
+
* read of the same value does not move it — see {@link mergeIdentifiers}. */
|
|
71126
|
+
readAt: zod.z.number().int().nonnegative()
|
|
71127
|
+
}).strict();
|
|
71128
|
+
}
|
|
71129
|
+
var MacEntrySchema = entrySchema(zod.z.string().regex(MAC_PATTERN));
|
|
71130
|
+
var SerialEntrySchema = entrySchema(zod.z.string().regex(PREFIXED_PATTERN));
|
|
71131
|
+
var MachineUuidEntrySchema = entrySchema(zod.z.string().regex(MACHINE_UUID_PATTERN));
|
|
71132
|
+
var VendorUidEntrySchema = entrySchema(zod.z.string().regex(PREFIXED_PATTERN));
|
|
71133
|
+
var HostnameEntrySchema = entrySchema(zod.z.string().regex(HOSTNAME_PATTERN));
|
|
71134
|
+
var IpEntrySchema = entrySchema(zod.z.union([zod.z.ipv4(), zod.z.ipv6()]));
|
|
71135
|
+
zod.z.object({
|
|
71136
|
+
value: zod.z.string().min(1),
|
|
71137
|
+
origin: DeviceIdentifierOriginSchema,
|
|
71138
|
+
readAt: zod.z.number().int().nonnegative()
|
|
71139
|
+
}).strict();
|
|
71140
|
+
/** The typed declaration. Every key optional; `mac` the only one that holds several. */
|
|
71141
|
+
var DeviceIdentifiersSchema = zod.z.object({
|
|
71142
|
+
mac: zod.z.array(MacEntrySchema).min(1).readonly().optional(),
|
|
71143
|
+
serial: SerialEntrySchema.optional(),
|
|
71144
|
+
"machine-uuid": MachineUuidEntrySchema.optional(),
|
|
71145
|
+
"vendor-uid": VendorUidEntrySchema.optional(),
|
|
71146
|
+
hostname: HostnameEntrySchema.optional(),
|
|
71147
|
+
ip: IpEntrySchema.optional()
|
|
71148
|
+
}).strict();
|
|
71149
|
+
/** True when the declaration carries no key at all. */
|
|
71150
|
+
function isEmptyIdentifiers(identifiers) {
|
|
71151
|
+
return DEVICE_IDENTIFIER_KEYS.every((key) => identifiers[key] === void 0);
|
|
71152
|
+
}
|
|
71153
|
+
/** Values devices report when they do not know: never an identity. */
|
|
71154
|
+
var PLACEHOLDER_PATTERN = /^(?:unknown|none|n\/?a|null|undefined|default|0+|-+)$/i;
|
|
71155
|
+
var NULL_MACS = new Set(["00:00:00:00:00:00", "ff:ff:ff:ff:ff:ff"]);
|
|
71156
|
+
function rejected(reason) {
|
|
71157
|
+
return {
|
|
71158
|
+
ok: false,
|
|
71159
|
+
reason
|
|
71160
|
+
};
|
|
71161
|
+
}
|
|
71162
|
+
/** `AA-BB-CC-DD-EE-FF`, `aabb.ccdd.eeff`, `AABBCCDDEEFF` → `aa:bb:cc:dd:ee:ff`. */
|
|
71163
|
+
function normaliseMac(raw) {
|
|
71164
|
+
const hex = raw.trim().toLowerCase().replace(/[\s:.-]/g, "");
|
|
71165
|
+
if (!/^[0-9a-f]{12}$/.test(hex)) return rejected("not a 48-bit MAC");
|
|
71166
|
+
const mac = (hex.match(/../g) ?? []).join(":");
|
|
71167
|
+
if (NULL_MACS.has(mac)) return rejected("placeholder MAC");
|
|
71168
|
+
return {
|
|
71169
|
+
ok: true,
|
|
71170
|
+
value: mac
|
|
71171
|
+
};
|
|
71172
|
+
}
|
|
71173
|
+
function slug$2(raw) {
|
|
71174
|
+
return raw.trim().toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^[-._]+|[-._]+$/g, "");
|
|
71175
|
+
}
|
|
71176
|
+
function normalisePrefixed(prefixRaw, valueRaw, what) {
|
|
71177
|
+
const prefix = slug$2(prefixRaw);
|
|
71178
|
+
if (prefix.length === 0) return rejected(`no ${what}`);
|
|
71179
|
+
const value = valueRaw.trim().toLowerCase().replace(/\s+/g, "");
|
|
71180
|
+
if (value.length === 0) return rejected("blank value");
|
|
71181
|
+
if (PLACEHOLDER_PATTERN.test(value)) return rejected("placeholder value");
|
|
71182
|
+
return {
|
|
71183
|
+
ok: true,
|
|
71184
|
+
value: `${prefix}:${value}`
|
|
71185
|
+
};
|
|
71186
|
+
}
|
|
71187
|
+
function normaliseMachineUuid(raw) {
|
|
71188
|
+
const value = raw.trim().toLowerCase().replace(/^\{|\}$/g, "");
|
|
71189
|
+
if (!MACHINE_UUID_PATTERN.test(value)) return rejected("not a uuid");
|
|
71190
|
+
if (/^[0-]+$/.test(value) || /^[f-]+$/.test(value)) return rejected("placeholder uuid");
|
|
71191
|
+
return {
|
|
71192
|
+
ok: true,
|
|
71193
|
+
value
|
|
71194
|
+
};
|
|
71195
|
+
}
|
|
71196
|
+
function isIp(value) {
|
|
71197
|
+
return zod.z.union([zod.z.ipv4(), zod.z.ipv6()]).safeParse(value).success;
|
|
71198
|
+
}
|
|
71199
|
+
function normaliseHostname(raw) {
|
|
71200
|
+
const full = raw.trim().toLowerCase().replace(/\.$/, "");
|
|
71201
|
+
if (full.length === 0) return rejected("blank hostname");
|
|
71202
|
+
if (isIp(full)) return rejected("an address, not a hostname");
|
|
71203
|
+
const label = full.split(".")[0] ?? "";
|
|
71204
|
+
if (!HOSTNAME_PATTERN.test(label)) return rejected("not a hostname");
|
|
71205
|
+
if (label === "localhost") return rejected("placeholder hostname");
|
|
71206
|
+
return {
|
|
71207
|
+
ok: true,
|
|
71208
|
+
value: label
|
|
71209
|
+
};
|
|
71210
|
+
}
|
|
71211
|
+
function normaliseIp(raw) {
|
|
71212
|
+
const value = raw.trim().toLowerCase().replace(/^\[|\]$/g, "");
|
|
71213
|
+
if (!isIp(value)) return rejected("not an IP address");
|
|
71214
|
+
if (value === "0.0.0.0" || value === "::" || value === "::1" || value.startsWith("127.")) return rejected("loopback or unspecified address");
|
|
71215
|
+
return {
|
|
71216
|
+
ok: true,
|
|
71217
|
+
value
|
|
71218
|
+
};
|
|
71219
|
+
}
|
|
71220
|
+
function isBlank(value) {
|
|
71221
|
+
return value === null || value === void 0 || value.trim().length === 0;
|
|
71222
|
+
}
|
|
71223
|
+
/**
|
|
71224
|
+
* Turn what a driver read into a valid {@link DeviceIdentifiers}: MACs lower-case
|
|
71225
|
+
* with colons and de-duplicated, a hostname without its domain, an IP validated,
|
|
71226
|
+
* a serial prefixed by its manufacturer, a vendor uid by its vendor. A value that
|
|
71227
|
+
* cannot be normalised is left out and listed in `rejected` — the caller logs it
|
|
71228
|
+
* (with `tags: { deviceId }`), it is never dropped in silence.
|
|
71229
|
+
*/
|
|
71230
|
+
function normaliseIdentifiers(raw, options = {}) {
|
|
71231
|
+
const readAt = options.readAt ?? Date.now();
|
|
71232
|
+
const originOf = (key) => options.originByKey?.[key] ?? options.origin ?? "read";
|
|
71233
|
+
const entry = (key, value) => ({
|
|
71234
|
+
value,
|
|
71235
|
+
origin: originOf(key),
|
|
71236
|
+
readAt
|
|
71237
|
+
});
|
|
71238
|
+
const refused = [];
|
|
71239
|
+
const take = (key, input, result) => {
|
|
71240
|
+
if (result.ok) return entry(key, result.value);
|
|
71241
|
+
refused.push({
|
|
71242
|
+
key,
|
|
71243
|
+
value: input,
|
|
71244
|
+
reason: result.reason
|
|
71245
|
+
});
|
|
71246
|
+
};
|
|
71247
|
+
const macInputs = raw.mac === null || raw.mac === void 0 ? [] : [raw.mac].flat();
|
|
71248
|
+
const macs = [];
|
|
71249
|
+
for (const input of macInputs) {
|
|
71250
|
+
if (isBlank(input)) continue;
|
|
71251
|
+
const taken = take("mac", input, normaliseMac(input));
|
|
71252
|
+
if (taken !== void 0 && !macs.some((m) => m.value === taken.value)) macs.push(taken);
|
|
71253
|
+
}
|
|
71254
|
+
const serial = raw.serial === null || raw.serial === void 0 || isBlank(raw.serial.serial) ? void 0 : take("serial", `${raw.serial.manufacturer}:${raw.serial.serial}`, normalisePrefixed(raw.serial.manufacturer, raw.serial.serial, "manufacturer"));
|
|
71255
|
+
const vendorUid = raw.vendorUid === null || raw.vendorUid === void 0 || isBlank(raw.vendorUid.id) ? void 0 : take("vendor-uid", `${raw.vendorUid.vendor}:${raw.vendorUid.id}`, normalisePrefixed(raw.vendorUid.vendor, raw.vendorUid.id, "vendor"));
|
|
71256
|
+
const machineUuid = isBlank(raw.machineUuid) ? void 0 : take("machine-uuid", raw.machineUuid, normaliseMachineUuid(raw.machineUuid));
|
|
71257
|
+
const host = isBlank(raw.host) ? null : raw.host.trim();
|
|
71258
|
+
const hostIsIp = host !== null && isIp(host.toLowerCase().replace(/^\[|\]$/g, ""));
|
|
71259
|
+
const hostnameInput = isBlank(raw.hostname) ? hostIsIp ? null : host : raw.hostname;
|
|
71260
|
+
const ipInput = isBlank(raw.ip) ? hostIsIp ? host : null : raw.ip;
|
|
71261
|
+
const hostname = hostnameInput === null ? void 0 : take("hostname", hostnameInput, normaliseHostname(hostnameInput));
|
|
71262
|
+
const ip = ipInput === null ? void 0 : take("ip", ipInput, normaliseIp(ipInput));
|
|
71263
|
+
return {
|
|
71264
|
+
identifiers: {
|
|
71265
|
+
...macs.length > 0 ? { mac: macs } : {},
|
|
71266
|
+
...serial !== void 0 ? { serial } : {},
|
|
71267
|
+
...machineUuid !== void 0 ? { "machine-uuid": machineUuid } : {},
|
|
71268
|
+
...vendorUid !== void 0 ? { "vendor-uid": vendorUid } : {},
|
|
71269
|
+
...hostname !== void 0 ? { hostname } : {},
|
|
71270
|
+
...ip !== void 0 ? { ip } : {}
|
|
71271
|
+
},
|
|
71272
|
+
rejected: refused
|
|
71273
|
+
};
|
|
71274
|
+
}
|
|
71275
|
+
function sameEntry(a, b) {
|
|
71276
|
+
return a.value === b.value && a.origin === b.origin;
|
|
71277
|
+
}
|
|
71278
|
+
/** `next`, but with the stored entry wherever value and origin are unchanged. */
|
|
71279
|
+
function keepStoredEntry(next, stored) {
|
|
71280
|
+
return stored !== void 0 && sameEntry(next, stored) ? stored : next;
|
|
71281
|
+
}
|
|
71282
|
+
/**
|
|
71283
|
+
* The declaration to store when the owning provider declares `next` over
|
|
71284
|
+
* `stored` (D1059).
|
|
71285
|
+
*
|
|
71286
|
+
* - A kind in `unread` — the provider TRIED to read it and the read failed —
|
|
71287
|
+
* keeps its stored entry: a failed read changes nothing (D49).
|
|
71288
|
+
* - Every other kind is what `next` says: a kind absent from `next` was read and
|
|
71289
|
+
* found absent, so it is removed.
|
|
71290
|
+
* - An entry whose value and origin are unchanged keeps its stored `readAt`:
|
|
71291
|
+
* `readAt` is when that value was FIRST read, so a provider re-declaring on every
|
|
71292
|
+
* boot writes nothing and emits nothing.
|
|
71293
|
+
*
|
|
71294
|
+
* Returns `null` when nothing is left.
|
|
71295
|
+
*/
|
|
71296
|
+
function mergeIdentifiers(stored, next, unread = []) {
|
|
71297
|
+
const before = stored ?? {};
|
|
71298
|
+
const after = next ?? {};
|
|
71299
|
+
const failed = new Set(unread);
|
|
71300
|
+
const macs = failed.has("mac") ? before.mac : after.mac?.map((m) => keepStoredEntry(m, before.mac?.find((s) => sameEntry(s, m))));
|
|
71301
|
+
const single = (key) => {
|
|
71302
|
+
if (failed.has(key)) return before[key];
|
|
71303
|
+
const entry = after[key];
|
|
71304
|
+
return entry === void 0 ? void 0 : keepStoredEntry(entry, before[key]);
|
|
71305
|
+
};
|
|
71306
|
+
const serial = single("serial");
|
|
71307
|
+
const machineUuid = single("machine-uuid");
|
|
71308
|
+
const vendorUid = single("vendor-uid");
|
|
71309
|
+
const hostname = single("hostname");
|
|
71310
|
+
const ip = single("ip");
|
|
71311
|
+
const merged = {
|
|
71312
|
+
...macs !== void 0 && macs.length > 0 ? { mac: macs } : {},
|
|
71313
|
+
...serial !== void 0 ? { serial } : {},
|
|
71314
|
+
...machineUuid !== void 0 ? { "machine-uuid": machineUuid } : {},
|
|
71315
|
+
...vendorUid !== void 0 ? { "vendor-uid": vendorUid } : {},
|
|
71316
|
+
...hostname !== void 0 ? { hostname } : {},
|
|
71317
|
+
...ip !== void 0 ? { ip } : {}
|
|
71318
|
+
};
|
|
71319
|
+
return isEmptyIdentifiers(merged) ? null : merged;
|
|
71320
|
+
}
|
|
71321
|
+
/** True when two declarations hold the same entries, `readAt` included (key order ignored). */
|
|
71322
|
+
function sameIdentifiers(a, b) {
|
|
71323
|
+
const canonical = (v) => v === null || v === void 0 || isEmptyIdentifiers(v) ? "" : JSON.stringify(DEVICE_IDENTIFIER_KEYS.map((key) => [key, v[key] ?? null]).map(([key, e]) => [key, e === null ? null : [e].flat().map((x) => [
|
|
71324
|
+
x.value,
|
|
71325
|
+
x.origin,
|
|
71326
|
+
x.readAt
|
|
71327
|
+
])]));
|
|
71328
|
+
return canonical(a) === canonical(b);
|
|
71329
|
+
}
|
|
70357
71330
|
var DeviceSearchRequiresSchema = zod.z.object({
|
|
70358
71331
|
/** Capability names the field wants a value of. Absent when the field wants actions only. */
|
|
70359
71332
|
caps: zod.z.array(zod.z.string()).readonly().optional(),
|
|
@@ -70916,6 +71889,10 @@ var DeviceInfoSchema = zod.z.object({
|
|
|
70916
71889
|
/** Hardware + identity blob (manufacturer / model / firmware / sn /
|
|
70917
71890
|
* uid / mac / …). Populated by drivers; editable via setMetadata. */
|
|
70918
71891
|
metadata: zod.z.record(zod.z.string(), zod.z.unknown()).nullable().optional(),
|
|
71892
|
+
/** Provider-declared identifiers (D1059): typed, normalised, written only by
|
|
71893
|
+
* the owning provider via `setIdentifiers`; read-only for the operator.
|
|
71894
|
+
* Absent ⇒ the provider declared none. */
|
|
71895
|
+
identifiers: DeviceIdentifiersSchema.optional(),
|
|
70919
71896
|
/** Optional upstream-system identity + rendering envelope. See
|
|
70920
71897
|
* `SourceInfo` in `packages/types/src/device/source-info.ts`. */
|
|
70921
71898
|
sourceInfo: SourceInfoSchema.optional(),
|
|
@@ -71082,6 +72059,8 @@ var DeviceMetaSchema = zod.z.object({
|
|
|
71082
72059
|
disabled: zod.z.boolean(),
|
|
71083
72060
|
parentDeviceId: zod.z.number().nullable(),
|
|
71084
72061
|
metadata: zod.z.record(zod.z.string(), zod.z.unknown()).nullable().optional(),
|
|
72062
|
+
/** Provider-declared identifiers (D1059). See `DeviceMeta.identifiers`. */
|
|
72063
|
+
identifiers: DeviceIdentifiersSchema.optional(),
|
|
71085
72064
|
/** Optional upstream-system identity + rendering envelope. See
|
|
71086
72065
|
* `SourceInfo`. Present when the device has been persisted with a
|
|
71087
72066
|
* non-synthetic source identifier (HA entities, vendor MAC, …);
|
|
@@ -71563,6 +72542,26 @@ var deviceManagerCapability = {
|
|
|
71563
72542
|
kind: "mutation",
|
|
71564
72543
|
auth: "admin"
|
|
71565
72544
|
}),
|
|
72545
|
+
/** Declare the device's identifiers (D1059) — the typed, normalised keys
|
|
72546
|
+
* (`mac`, `serial`, `machine-uuid`, `vendor-uid`, `hostname`, `ip`) a later
|
|
72547
|
+
* step matches across integrations. Each kind is REPLACED by what this call
|
|
72548
|
+
* says (absent = read and found absent, removed) EXCEPT the kinds listed in
|
|
72549
|
+
* `unread` — the reads that FAILED this time — which keep their stored value.
|
|
72550
|
+
* An unchanged value keeps its first `readAt`; a call that changes nothing
|
|
72551
|
+
* writes and emits nothing. `null` clears every read kind. Accepted only from the provider that OWNS the device: the
|
|
72552
|
+
* caller stamp the transport sets (`callerAddonId`) must equal the row's
|
|
72553
|
+
* `addonId`, so an operator session — which carries no stamp — is refused.
|
|
72554
|
+
* Build the value with `normaliseIdentifiers` (`@camstack/types`); a device
|
|
72555
|
+
* calls it through `BaseDevice.declareIdentifiers`. */
|
|
72556
|
+
setIdentifiers: method(zod.z.object({
|
|
72557
|
+
deviceId: zod.z.number(),
|
|
72558
|
+
identifiers: DeviceIdentifiersSchema.nullable(),
|
|
72559
|
+
/** Kinds the provider tried to read and could not: their stored value is kept. */
|
|
72560
|
+
unread: zod.z.array(DeviceIdentifierKeySchema).optional()
|
|
72561
|
+
}), zod.z.void(), {
|
|
72562
|
+
kind: "mutation",
|
|
72563
|
+
auth: "admin"
|
|
72564
|
+
}),
|
|
71566
72565
|
/** Operator-curated location registry. Returns the union of:
|
|
71567
72566
|
* (1) labels persisted in the registry via `addLocation`, and
|
|
71568
72567
|
* (2) labels currently in use on at least one device's
|
|
@@ -77895,6 +78894,7 @@ var HERO_SCENE_BY_TYPE = {
|
|
|
77895
78894
|
[DeviceType.WaterHeater]: "heater",
|
|
77896
78895
|
[DeviceType.HeatPump]: "heat-pump",
|
|
77897
78896
|
[DeviceType.EnergySystem]: "generic",
|
|
78897
|
+
[DeviceType.Workload]: "generic",
|
|
77898
78898
|
[DeviceType.Fan]: "fan",
|
|
77899
78899
|
[DeviceType.MediaPlayer]: "tv",
|
|
77900
78900
|
[DeviceType.AlarmPanel]: "alarm",
|
|
@@ -77937,6 +78937,7 @@ var HERO_SCENE_BY_ROLE = {
|
|
|
77937
78937
|
[DeviceRole.SwitchHeater]: "heater",
|
|
77938
78938
|
[DeviceRole.SwitchFan]: "fan",
|
|
77939
78939
|
[DeviceRole.SwitchLight]: "light",
|
|
78940
|
+
[DeviceRole.PoePort]: "plug",
|
|
77940
78941
|
[DeviceRole.ClimateAc]: "ac",
|
|
77941
78942
|
[DeviceRole.ClimateThermostat]: "inherit",
|
|
77942
78943
|
[DeviceRole.ClimateFloor]: "inherit",
|
|
@@ -77981,7 +78982,12 @@ var HERO_SCENE_BY_ROLE = {
|
|
|
77981
78982
|
[DeviceRole.MessagingNotifier]: "inherit",
|
|
77982
78983
|
[DeviceRole.EmailNotifier]: "inherit",
|
|
77983
78984
|
[DeviceRole.GenericNotifier]: "inherit",
|
|
77984
|
-
[DeviceRole.IrTransmitter]: "inherit"
|
|
78985
|
+
[DeviceRole.IrTransmitter]: "inherit",
|
|
78986
|
+
[DeviceRole.Vm]: "inherit",
|
|
78987
|
+
[DeviceRole.AppContainer]: "inherit",
|
|
78988
|
+
[DeviceRole.Lxc]: "inherit",
|
|
78989
|
+
[DeviceRole.App]: "inherit",
|
|
78990
|
+
[DeviceRole.Host]: "inherit"
|
|
77985
78991
|
};
|
|
77986
78992
|
function isDeviceType$3(type) {
|
|
77987
78993
|
return Object.values(DeviceType).includes(type);
|
|
@@ -78239,8 +79245,12 @@ var HeroPowerSupplySlotSchema = zod.z.object({
|
|
|
78239
79245
|
/** Off asks for a confirmation while the device runs. */
|
|
78240
79246
|
confirmOffWhileRunning: zod.z.boolean(),
|
|
78241
79247
|
running: zod.z.boolean().nullable(),
|
|
78242
|
-
|
|
78243
|
-
|
|
79248
|
+
/**
|
|
79249
|
+
* `null` when the linked switch ANSWERED it only reports (a PoE port seen through an
|
|
79250
|
+
* API key): power on / off would always be refused. The restart stays (D1058).
|
|
79251
|
+
*/
|
|
79252
|
+
powerOn: HeroActionSchema.nullable(),
|
|
79253
|
+
powerOff: HeroActionSchema.nullable(),
|
|
78244
79254
|
restart: HeroActionSchema
|
|
78245
79255
|
});
|
|
78246
79256
|
var HeroStateBackdropSchema = zod.z.object({
|
|
@@ -91741,6 +92751,19 @@ var NetworkLinkStatusSchema = zod.z.object({
|
|
|
91741
92751
|
rssi: zod.z.number().optional().meta(readingMeta("signal-level")),
|
|
91742
92752
|
/** Network name of a wireless link, when the firmware reports it. */
|
|
91743
92753
|
ssid: zod.z.string().optional(),
|
|
92754
|
+
/**
|
|
92755
|
+
* Negotiated link speed of a wired port, the `bitrate` quantity in its base
|
|
92756
|
+
* unit, kbit/s (a gigabit port is 1 000 000); the display picks the unit.
|
|
92757
|
+
* `null` = the port is down or the speed is not known; absent = the provider
|
|
92758
|
+
* never reports one.
|
|
92759
|
+
*/
|
|
92760
|
+
speedKbps: zod.z.number().nonnegative().nullable().optional().meta(readingMeta("bitrate")),
|
|
92761
|
+
/**
|
|
92762
|
+
* Whether the link is up. `type` names the medium, not its state, so a wired
|
|
92763
|
+
* port that lost its link is `ethernet` + `linkUp: false`. `null` = not known;
|
|
92764
|
+
* absent = the provider never reports it.
|
|
92765
|
+
*/
|
|
92766
|
+
linkUp: zod.z.boolean().nullable().optional(),
|
|
91744
92767
|
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
91745
92768
|
lastUpdated: zod.z.number().meta(readingMeta("none"))
|
|
91746
92769
|
});
|
|
@@ -94039,7 +95062,32 @@ var NcRuleInputSchema = zod.z.object({
|
|
|
94039
95062
|
* authored before this field meant. An editor turns it off by writing
|
|
94040
95063
|
* `false`, so it needs no `clear` key.
|
|
94041
95064
|
*/
|
|
94042
|
-
askVerdict: zod.z.boolean().optional()
|
|
95065
|
+
askVerdict: zod.z.boolean().optional(),
|
|
95066
|
+
/**
|
|
95067
|
+
* Operator tags (D1054), kept on the rule like a core block's. Absent = no
|
|
95068
|
+
* tags. `.optional()`, never `.default()`: a partial `updateRule` patch that
|
|
95069
|
+
* does not name `tags` keeps the stored ones (the store merges), and an
|
|
95070
|
+
* editor empties them by sending `[]` (the store drops an empty list).
|
|
95071
|
+
* Renamed or removed fleet-wide only through the `tags` cap, which writes
|
|
95072
|
+
* here with `setRuleTags`.
|
|
95073
|
+
*/
|
|
95074
|
+
tags: TagsFieldSchema.optional()
|
|
95075
|
+
});
|
|
95076
|
+
/**
|
|
95077
|
+
* The rule kinds that carry tags (D1054) — each one its own store. Every kind
|
|
95078
|
+
* labels its rules the same way; this names which store a tag write goes to.
|
|
95079
|
+
*/
|
|
95080
|
+
var NcTaggedRuleKindSchema = zod.z.enum([
|
|
95081
|
+
"event",
|
|
95082
|
+
"summary",
|
|
95083
|
+
"timelapse",
|
|
95084
|
+
"calendar-events"
|
|
95085
|
+
]);
|
|
95086
|
+
/** One rule's tags, as the `tags` cap reads them across every kind. */
|
|
95087
|
+
var NcRuleTagsEntrySchema = zod.z.object({
|
|
95088
|
+
kind: NcTaggedRuleKindSchema,
|
|
95089
|
+
ruleId: zod.z.string(),
|
|
95090
|
+
tags: zod.z.array(zod.z.string())
|
|
94043
95091
|
});
|
|
94044
95092
|
/**
|
|
94045
95093
|
* Partial patch for `updateRule` — any subset of the input fields, plus the
|
|
@@ -95089,6 +96137,29 @@ var notificationRulesCapability = {
|
|
|
95089
96137
|
auth: "admin"
|
|
95090
96138
|
}),
|
|
95091
96139
|
/**
|
|
96140
|
+
* Every rule of every kind with its tags (D1054) — event rules, summaries,
|
|
96141
|
+
* timelapses and calendar-events rules. The `tags` cap counts and rewrites
|
|
96142
|
+
* from this one read; a rule without tags is listed with `[]`.
|
|
96143
|
+
*/
|
|
96144
|
+
listRuleTags: method(zod.z.object({}), zod.z.object({ rules: zod.z.array(NcRuleTagsEntrySchema) }), {
|
|
96145
|
+
kind: "query",
|
|
96146
|
+
auth: "admin"
|
|
96147
|
+
}),
|
|
96148
|
+
/**
|
|
96149
|
+
* Replace ONE rule's tags (D1054) and nothing else — the `tags` cap's rename
|
|
96150
|
+
* and remove write through this. `kind` names the store the rule lives in.
|
|
96151
|
+
* Normalised on write (trimmed, deduplicated case-insensitively); `[]`
|
|
96152
|
+
* clears them.
|
|
96153
|
+
*/
|
|
96154
|
+
setRuleTags: method(zod.z.object({
|
|
96155
|
+
kind: NcTaggedRuleKindSchema,
|
|
96156
|
+
ruleId: zod.z.string(),
|
|
96157
|
+
tags: TagsFieldSchema
|
|
96158
|
+
}), zod.z.object({ success: zod.z.literal(true) }), {
|
|
96159
|
+
kind: "mutation",
|
|
96160
|
+
auth: "admin"
|
|
96161
|
+
}),
|
|
96162
|
+
/**
|
|
95092
96163
|
* WHAT THE RULES ACTUALLY ASK the stream broker to retain, per camera.
|
|
95093
96164
|
*
|
|
95094
96165
|
* The notification centre owns the rules, so it is the only thing that can
|
|
@@ -102025,7 +103096,18 @@ var videoclipsCapability = {
|
|
|
102025
103096
|
* older than this field keeps working unchanged (D382 — an unstated
|
|
102026
103097
|
* ask is zero).
|
|
102027
103098
|
*/
|
|
102028
|
-
audio: ClipStreamAudioSchema.optional()
|
|
103099
|
+
audio: ClipStreamAudioSchema.optional(),
|
|
103100
|
+
/**
|
|
103101
|
+
* The operator's authorisation to wake a sleeping camera for this
|
|
103102
|
+
* dial — the same {@link ClipWakeSchema} the byte reads carry. Absent
|
|
103103
|
+
* — the default — means a sleeping standalone battery camera is
|
|
103104
|
+
* REFUSED by name before any URL is minted. A caller sets it only
|
|
103105
|
+
* when a viewer itself asked for the clip (the broker's `playClip`);
|
|
103106
|
+
* a prefetch, a reconcile or a retry never does. With it, the
|
|
103107
|
+
* provider wakes the camera and waits under a bound; a camera that
|
|
103108
|
+
* does not come up is refused `wake-timeout`, naming the wait.
|
|
103109
|
+
*/
|
|
103110
|
+
wake: ClipWakeSchema.optional()
|
|
102029
103111
|
}), ClipStreamDialSchema, {
|
|
102030
103112
|
kind: "query",
|
|
102031
103113
|
auth: "protected"
|
|
@@ -102315,7 +103397,8 @@ zod.z.enum([
|
|
|
102315
103397
|
"camera-refused",
|
|
102316
103398
|
"fetch-failed",
|
|
102317
103399
|
"too-large-to-transfer",
|
|
102318
|
-
"wake-expired"
|
|
103400
|
+
"wake-expired",
|
|
103401
|
+
"wake-timeout"
|
|
102319
103402
|
]);
|
|
102320
103403
|
/** Candidate download URLs (LAN first, then operator extra hosts). */
|
|
102321
103404
|
var ExportDownloadSchema = zod.z.object({
|
|
@@ -104951,6 +106034,16 @@ var SirenOptionsSchema = zod.z.object({
|
|
|
104951
106034
|
rangeSeconds: SirenDurationRangeSchema.nullable(),
|
|
104952
106035
|
/** The camera's default duration, seconds. */
|
|
104953
106036
|
defaultSeconds: zod.z.number().positive(),
|
|
106037
|
+
/**
|
|
106038
|
+
* Discrete play counts the operator may pick; `null` when the camera gives a
|
|
106039
|
+
* range or does not count plays. Defaults to `null` so a provider that
|
|
106040
|
+
* predates plays (#589) reads as declaring none.
|
|
106041
|
+
*/
|
|
106042
|
+
allowedPlays: zod.z.array(zod.z.number().int().positive()).nullable().default(null),
|
|
106043
|
+
/** Continuous range of play counts; `null` when listed or not counted. */
|
|
106044
|
+
rangePlays: SirenDurationRangeSchema.nullable().default(null),
|
|
106045
|
+
/** The camera's default play count; `null` when the camera does not count plays. */
|
|
106046
|
+
defaultPlays: zod.z.number().int().positive().nullable().default(null),
|
|
104954
106047
|
/** What the camera counts natively. */
|
|
104955
106048
|
unit: zod.z.enum([SirenDurationUnit.Seconds, SirenDurationUnit.Plays]),
|
|
104956
106049
|
/** Seconds one play lasts, when `unit` is `plays`; `null` for a seconds camera. */
|
|
@@ -104967,9 +106060,28 @@ var SirenStatusSchema = zod.z.object({
|
|
|
104967
106060
|
activeUntil: zod.z.number().nullable(),
|
|
104968
106061
|
/** Duration of the current / last activation, seconds; `null` when none yet. */
|
|
104969
106062
|
durationSeconds: zod.z.number().nullable(),
|
|
106063
|
+
/**
|
|
106064
|
+
* The play count of the current / last activation when it was asked in plays;
|
|
106065
|
+
* `null` when it was asked in seconds (or none yet). The unit that was asked.
|
|
106066
|
+
*/
|
|
106067
|
+
plays: zod.z.number().int().positive().nullable().default(null),
|
|
106068
|
+
/**
|
|
106069
|
+
* True when `activeUntil` comes from a seconds-per-play factor the camera did
|
|
106070
|
+
* not report — the siren may fall silent somewhat earlier or later.
|
|
106071
|
+
*/
|
|
106072
|
+
activeUntilEstimated: zod.z.boolean().default(false),
|
|
104970
106073
|
/** Ms epoch of the last trigger (0 = never). */
|
|
104971
106074
|
lastTriggeredAt: zod.z.number()
|
|
104972
106075
|
});
|
|
106076
|
+
/** A trigger asks seconds OR plays (#589); neither means the camera default. */
|
|
106077
|
+
var SirenTriggerInputSchema = zod.z.object({
|
|
106078
|
+
deviceId: zod.z.number().int().nonnegative(),
|
|
106079
|
+
durationSeconds: zod.z.number().positive().optional(),
|
|
106080
|
+
plays: zod.z.number().int().positive().optional()
|
|
106081
|
+
}).refine((input) => input.durationSeconds === void 0 || input.plays === void 0, {
|
|
106082
|
+
message: "a siren trigger takes durationSeconds or plays, not both",
|
|
106083
|
+
path: ["plays"]
|
|
106084
|
+
});
|
|
104973
106085
|
var SirenRuntimeStateSchema = SirenStatusSchema.extend({
|
|
104974
106086
|
/** Ms epoch of the last successful camera read of the options (0 = never). */
|
|
104975
106087
|
lastFetchedAt: zod.z.number() });
|
|
@@ -104986,13 +106098,20 @@ var sirenCapability = {
|
|
|
104986
106098
|
auth: "protected"
|
|
104987
106099
|
}),
|
|
104988
106100
|
/**
|
|
104989
|
-
*
|
|
104990
|
-
*
|
|
106101
|
+
* The play counts a rule may pick: what `getOptions` declares as a list, or
|
|
106102
|
+
* its range spelled out. Empty for a siren that counts seconds.
|
|
104991
106103
|
*/
|
|
104992
|
-
|
|
104993
|
-
|
|
104994
|
-
|
|
104995
|
-
}),
|
|
106104
|
+
getPlayChoices: method(zod.z.object({ deviceId: zod.z.number().int().nonnegative() }), zod.z.array(zod.z.number().int().positive()), {
|
|
106105
|
+
kind: "query",
|
|
106106
|
+
auth: "protected"
|
|
106107
|
+
}),
|
|
106108
|
+
/**
|
|
106109
|
+
* Sound the siren for `durationSeconds` OR `plays` — never both. With
|
|
106110
|
+
* neither the camera default applies. A count on a siren that declares no
|
|
106111
|
+
* plays is refused. Answers the state at the moment of the trigger
|
|
106112
|
+
* (`activeUntil` included).
|
|
106113
|
+
*/
|
|
106114
|
+
trigger: method(SirenTriggerInputSchema, SirenStatusSchema, {
|
|
104996
106115
|
kind: "mutation",
|
|
104997
106116
|
auth: "protected",
|
|
104998
106117
|
actions: [{
|
|
@@ -105001,6 +106120,21 @@ var sirenCapability = {
|
|
|
105001
106120
|
phrase: t("Sound {device}", "Fai suonare {device}"),
|
|
105002
106121
|
icon: "siren",
|
|
105003
106122
|
args: {}
|
|
106123
|
+
}, {
|
|
106124
|
+
id: "siren.triggerPlays",
|
|
106125
|
+
label: t("Sound the siren N times", "Fai suonare la sirena N volte"),
|
|
106126
|
+
phrase: t("Sound {device} {plays} times", "Fai suonare {device} {plays} volte"),
|
|
106127
|
+
icon: "siren",
|
|
106128
|
+
openArgs: [{
|
|
106129
|
+
key: "plays",
|
|
106130
|
+
label: t("Plays", "Riproduzioni"),
|
|
106131
|
+
offer: {
|
|
106132
|
+
kind: "dynamic",
|
|
106133
|
+
from: "method",
|
|
106134
|
+
method: "getPlayChoices",
|
|
106135
|
+
valueKind: "number"
|
|
106136
|
+
}
|
|
106137
|
+
}]
|
|
105004
106138
|
}]
|
|
105005
106139
|
}),
|
|
105006
106140
|
/** Silence the siren now. */
|
|
@@ -106590,6 +107724,27 @@ var SwitchStatusSchema = zod.z.object({
|
|
|
106590
107724
|
/** Ms epoch of the last state change. Useful for UI "X minutes ago". */
|
|
106591
107725
|
lastChangedAt: zod.z.number()
|
|
106592
107726
|
});
|
|
107727
|
+
/**
|
|
107728
|
+
* What a switch can do, from its provider (`getOptions`). A provider that writes no
|
|
107729
|
+
* `getOptions` is a plain on/off switch: the defaults are the old contract.
|
|
107730
|
+
*
|
|
107731
|
+
* - `supportsSetState: false` — the switch reports its state but cannot be set (a PoE port seen only
|
|
107732
|
+
* through an API key). Its provider refuses `setState`; these surfaces withdraw on/off once the
|
|
107733
|
+
* device ANSWERED this (`switchRefusesSetState`): the device hero, the automation action picker
|
|
107734
|
+
* (`offeredWhen` on `switch.on` / `switch.off` / `switch.toggle`), the default `toggle`, the
|
|
107735
|
+
* HomeKit, Alexa and Google exporters, and `power-source` on a device the switch powers
|
|
107736
|
+
* (`getStatus().switchSettable`, `offeredWhen` on `powerSource.on` / `.off`, `not-settable`). A
|
|
107737
|
+
* read that failed or is pending changes nothing (D315).
|
|
107738
|
+
* - `supportsPowerCycle: true` — the device behind the switch can cut and restore its own output in
|
|
107739
|
+
* one native call (a PoE port's power cycle). It has no control of its own: a linked
|
|
107740
|
+
* `power-source.forceRestart` uses it instead of off / wait / on.
|
|
107741
|
+
*/
|
|
107742
|
+
var SwitchOptionsSchema = zod.z.object({
|
|
107743
|
+
supportsSetState: zod.z.boolean().default(true),
|
|
107744
|
+
supportsPowerCycle: zod.z.boolean().default(false)
|
|
107745
|
+
});
|
|
107746
|
+
/** The options of a provider that did not answer `getOptions`: a plain on/off switch. */
|
|
107747
|
+
var SWITCH_DEFAULT_OPTIONS = SwitchOptionsSchema.parse({});
|
|
106593
107748
|
var switchCapability = {
|
|
106594
107749
|
name: "switch",
|
|
106595
107750
|
scope: "device",
|
|
@@ -106617,7 +107772,8 @@ var switchCapability = {
|
|
|
106617
107772
|
field: "on",
|
|
106618
107773
|
value: true
|
|
106619
107774
|
},
|
|
106620
|
-
args: { on: true }
|
|
107775
|
+
args: { on: true },
|
|
107776
|
+
offeredWhen: SWITCH_SETTABLE_GATE
|
|
106621
107777
|
}, {
|
|
106622
107778
|
id: "switch.off",
|
|
106623
107779
|
label: t("Turn off", "Spegni"),
|
|
@@ -106627,9 +107783,16 @@ var switchCapability = {
|
|
|
106627
107783
|
field: "on",
|
|
106628
107784
|
value: false
|
|
106629
107785
|
},
|
|
106630
|
-
args: { on: false }
|
|
107786
|
+
args: { on: false },
|
|
107787
|
+
offeredWhen: SWITCH_SETTABLE_GATE
|
|
106631
107788
|
}]
|
|
106632
107789
|
}),
|
|
107790
|
+
getOptions: optionalMethod(zod.z.object({ deviceId: zod.z.number() }), SwitchOptionsSchema, { auth: "protected" }),
|
|
107791
|
+
powerCycle: optionalMethod(zod.z.object({ deviceId: zod.z.number() }), zod.z.void(), {
|
|
107792
|
+
kind: "mutation",
|
|
107793
|
+
auth: "protected",
|
|
107794
|
+
notOperatorFacing: "a power cycle is the forced restart of the device the switch powers (power-source), never a step of its own"
|
|
107795
|
+
}),
|
|
106633
107796
|
toggle: optionalMethod(zod.z.object({ deviceId: zod.z.number() }), zod.z.void(), {
|
|
106634
107797
|
kind: "mutation",
|
|
106635
107798
|
auth: "protected",
|
|
@@ -106637,7 +107800,8 @@ var switchCapability = {
|
|
|
106637
107800
|
id: "switch.toggle",
|
|
106638
107801
|
label: t("Toggle", "Commuta"),
|
|
106639
107802
|
phrase: t("Toggle {device}", "Commuta {device}"),
|
|
106640
|
-
icon: "toggle-right"
|
|
107803
|
+
icon: "toggle-right",
|
|
107804
|
+
offeredWhen: SWITCH_SETTABLE_GATE
|
|
106641
107805
|
}]
|
|
106642
107806
|
})
|
|
106643
107807
|
},
|
|
@@ -106659,6 +107823,16 @@ var switchCapability = {
|
|
|
106659
107823
|
* not need to re-query the provider after a setState mutation.
|
|
106660
107824
|
*/
|
|
106661
107825
|
runtimeState: SwitchStatusSchema,
|
|
107826
|
+
composedMethods: {
|
|
107827
|
+
getOptions: {
|
|
107828
|
+
kind: "answer",
|
|
107829
|
+
value: SWITCH_DEFAULT_OPTIONS
|
|
107830
|
+
},
|
|
107831
|
+
powerCycle: {
|
|
107832
|
+
kind: "refuse",
|
|
107833
|
+
reason: "a composed switch has no native power cycle"
|
|
107834
|
+
}
|
|
107835
|
+
},
|
|
106662
107836
|
/**
|
|
106663
107837
|
* Runtime-state durability: **restored** — device state an operator reads as authoritative; 55 devices, transition-driven.
|
|
106664
107838
|
*
|
|
@@ -106832,6 +108006,26 @@ var switchCapability = {
|
|
|
106832
108006
|
"switch.off": { icon: "plug" }
|
|
106833
108007
|
},
|
|
106834
108008
|
state: { on: { icon: "plug-zap" } }
|
|
108009
|
+
},
|
|
108010
|
+
[DeviceRole.PoePort]: {
|
|
108011
|
+
actions: {
|
|
108012
|
+
"switch.on": {
|
|
108013
|
+
label: t("Power on", "Alimenta"),
|
|
108014
|
+
phrase: t("Power on {device}", "Alimenta {device}"),
|
|
108015
|
+
icon: "plug-zap"
|
|
108016
|
+
},
|
|
108017
|
+
"switch.off": {
|
|
108018
|
+
label: t("Power off", "Togli alimentazione"),
|
|
108019
|
+
phrase: t("Power off {device}", "Togli alimentazione a {device}"),
|
|
108020
|
+
icon: "unplug"
|
|
108021
|
+
}
|
|
108022
|
+
},
|
|
108023
|
+
state: { on: {
|
|
108024
|
+
label: t("Powered", "Alimentata"),
|
|
108025
|
+
whenTrue: t("When {device} is powered", "Quando {device} viene alimentata"),
|
|
108026
|
+
whenFalse: t("When {device} loses power", "Quando {device} perde l’alimentazione"),
|
|
108027
|
+
icon: "plug-zap"
|
|
108028
|
+
} }
|
|
106835
108029
|
}
|
|
106836
108030
|
}
|
|
106837
108031
|
}
|
|
@@ -107554,10 +108748,11 @@ var systemCapability = {
|
|
|
107554
108748
|
/**
|
|
107555
108749
|
* tags — the registry of tag STYLES and the one place that renames or removes a
|
|
107556
108750
|
* tag everywhere (D1054). A tag itself lives in the `tags` array of the record it
|
|
107557
|
-
* labels (a core block, a scheduler, a template, an action, a device
|
|
108751
|
+
* labels (a core block, a scheduler, a template, an action, a device, a
|
|
108752
|
+
* notification rule); only its
|
|
107558
108753
|
* colour token and icon are registered here. Provided by the core-blocks builtin,
|
|
107559
|
-
* the one place that knows every owner kind; devices
|
|
107560
|
-
* `deviceManager` over `ctx.api`.
|
|
108754
|
+
* the one place that knows every owner kind; devices and notification rules
|
|
108755
|
+
* are reached through `deviceManager` / `notificationRules` over `ctx.api`.
|
|
107561
108756
|
*
|
|
107562
108757
|
* Tags compare trimmed and case-insensitively. `list` is the union of styled tags
|
|
107563
108758
|
* and tags in use; a tag with no style answers a colour derived from its name and
|
|
@@ -107568,7 +108763,21 @@ var TagUsageCountsSchema = zod.z.object({
|
|
|
107568
108763
|
schedulers: zod.z.number().int().nonnegative(),
|
|
107569
108764
|
templates: zod.z.number().int().nonnegative(),
|
|
107570
108765
|
actions: zod.z.number().int().nonnegative(),
|
|
107571
|
-
devices: zod.z.number().int().nonnegative()
|
|
108766
|
+
devices: zod.z.number().int().nonnegative(),
|
|
108767
|
+
notificationRules: zod.z.number().int().nonnegative()
|
|
108768
|
+
});
|
|
108769
|
+
/**
|
|
108770
|
+
* The counts `list` answers. An owner that could not be read (a forked addon
|
|
108771
|
+
* that is down, redeploying or not installed) is `null` — unknown, never `0`
|
|
108772
|
+
* (D393) — and `list` still answers with the other owners' tags.
|
|
108773
|
+
*/
|
|
108774
|
+
var TagListCountsSchema = zod.z.object({
|
|
108775
|
+
coreBlocks: zod.z.number().int().nonnegative().nullable(),
|
|
108776
|
+
schedulers: zod.z.number().int().nonnegative().nullable(),
|
|
108777
|
+
templates: zod.z.number().int().nonnegative().nullable(),
|
|
108778
|
+
actions: zod.z.number().int().nonnegative().nullable(),
|
|
108779
|
+
devices: zod.z.number().int().nonnegative().nullable(),
|
|
108780
|
+
notificationRules: zod.z.number().int().nonnegative().nullable()
|
|
107572
108781
|
});
|
|
107573
108782
|
var TagEntrySchema = zod.z.object({
|
|
107574
108783
|
name: TagNameSchema,
|
|
@@ -107576,14 +108785,19 @@ var TagEntrySchema = zod.z.object({
|
|
|
107576
108785
|
icon: IconKeySchema,
|
|
107577
108786
|
/** `false` when the operator never chose a style: colour and icon are the derived defaults. */
|
|
107578
108787
|
styled: zod.z.boolean(),
|
|
107579
|
-
|
|
108788
|
+
/** Per owner kind; `null` = that owner could not be read on this call. */
|
|
108789
|
+
counts: TagListCountsSchema
|
|
107580
108790
|
});
|
|
107581
108791
|
var tagsCapability = {
|
|
107582
108792
|
name: "tags",
|
|
107583
108793
|
scope: "system",
|
|
107584
108794
|
mode: "singleton",
|
|
107585
108795
|
methods: {
|
|
107586
|
-
/**
|
|
108796
|
+
/**
|
|
108797
|
+
* Every tag: styled or in use, with how many records of each kind carry it.
|
|
108798
|
+
* An unreachable owner degrades that kind's count to `null`; the call still
|
|
108799
|
+
* answers.
|
|
108800
|
+
*/
|
|
107587
108801
|
list: method(zod.z.object({}), zod.z.array(TagEntrySchema), { auth: "protected" }),
|
|
107588
108802
|
/** Choose the colour and icon of a tag. The tag need not be in use. */
|
|
107589
108803
|
setStyle: method(zod.z.object({
|
|
@@ -107597,7 +108811,9 @@ var tagsCapability = {
|
|
|
107597
108811
|
/**
|
|
107598
108812
|
* Rename a tag on EVERY owner in one call. When `to` already exists the two
|
|
107599
108813
|
* merge and the TARGET's style wins (like `renameLocation`). An empty `to`
|
|
107600
|
-
* is refused before anything is written
|
|
108814
|
+
* is refused before anything is written, and so is any call while an owner
|
|
108815
|
+
* cannot be read (the error names the owner): a rename applied to
|
|
108816
|
+
* only some owners would split the fleet across two spellings.
|
|
107601
108817
|
*/
|
|
107602
108818
|
rename: method(zod.z.object({
|
|
107603
108819
|
from: zod.z.string(),
|
|
@@ -107606,7 +108822,7 @@ var tagsCapability = {
|
|
|
107606
108822
|
kind: "mutation",
|
|
107607
108823
|
auth: "admin"
|
|
107608
108824
|
}),
|
|
107609
|
-
/** Drop a tag from every owner and delete its style. */
|
|
108825
|
+
/** Drop a tag from every owner and delete its style. Refused like `rename` while an owner cannot be read. */
|
|
107610
108826
|
remove: method(zod.z.object({ name: zod.z.string() }), zod.z.object({ updated: TagUsageCountsSchema }), {
|
|
107611
108827
|
kind: "mutation",
|
|
107612
108828
|
auth: "admin"
|
|
@@ -108562,7 +109778,6 @@ var templateCapability = {
|
|
|
108562
109778
|
};
|
|
108563
109779
|
/** Profile-exported FormBuilder schema. Shape is ConfigUISchema at the UI. */
|
|
108564
109780
|
var ProfileSettingsSchemaBridge = zod.z.unknown().nullable();
|
|
108565
|
-
var ProfileSettingsBagSchema = zod.z.record(zod.z.string(), zod.z.unknown());
|
|
108566
109781
|
/**
|
|
108567
109782
|
* A live terminal session hosted by the provider addon. Output and input do
|
|
108568
109783
|
* NOT flow through the capability — they use the addon data plane
|
|
@@ -108581,7 +109796,11 @@ var TerminalSessionInfoSchema = zod.z.object({
|
|
|
108581
109796
|
cols: zod.z.number().int().positive(),
|
|
108582
109797
|
rows: zod.z.number().int().positive(),
|
|
108583
109798
|
/** ms-epoch the session's pty was spawned. */
|
|
108584
|
-
startedAt: zod.z.number()
|
|
109799
|
+
startedAt: zod.z.number(),
|
|
109800
|
+
/** User id of the admin who opened it; `unattributed` when the caller was not passed. */
|
|
109801
|
+
openedBy: zod.z.string().optional(),
|
|
109802
|
+
/** ms-epoch of the last pty input or output — what the idle timeout measures. */
|
|
109803
|
+
lastActivityAt: zod.z.number().optional()
|
|
108585
109804
|
});
|
|
108586
109805
|
/**
|
|
108587
109806
|
* A profile the operator may open — a pre-declared, allowlisted program
|
|
@@ -108601,39 +109820,6 @@ var TerminalProfileInfoSchema = zod.z.object({
|
|
|
108601
109820
|
/** ConfigUISchema for instance knobs, or null when the profile has none. */
|
|
108602
109821
|
settingsSchema: ProfileSettingsSchemaBridge.optional()
|
|
108603
109822
|
});
|
|
108604
|
-
/**
|
|
108605
|
-
* A durable operator-created Terminal instance. Profiles are templates; only
|
|
108606
|
-
* an instance declares a camera.
|
|
108607
|
-
*/
|
|
108608
|
-
var TerminalInstanceInfoSchema = zod.z.object({
|
|
108609
|
-
instanceId: zod.z.string(),
|
|
108610
|
-
cameraStableId: zod.z.string(),
|
|
108611
|
-
nodeId: zod.z.string(),
|
|
108612
|
-
/**
|
|
108613
|
-
* False while the node the instance is bound to is not in the cluster
|
|
108614
|
-
* topology (forgotten, renamed, re-paired). The instance is kept; the
|
|
108615
|
-
* operator re-points it on the Terminal page.
|
|
108616
|
-
*/
|
|
108617
|
-
nodeInCluster: zod.z.boolean(),
|
|
108618
|
-
profileId: zod.z.string(),
|
|
108619
|
-
profileLabel: zod.z.string(),
|
|
108620
|
-
name: zod.z.string(),
|
|
108621
|
-
enabled: zod.z.boolean(),
|
|
108622
|
-
executable: zod.z.string(),
|
|
108623
|
-
args: zod.z.array(zod.z.string()).readonly(),
|
|
108624
|
-
cwd: zod.z.string(),
|
|
108625
|
-
environment: zod.z.array(zod.z.string()).readonly(),
|
|
108626
|
-
profileSettings: ProfileSettingsBagSchema
|
|
108627
|
-
});
|
|
108628
|
-
var TerminalLegacyCameraSchema = zod.z.object({
|
|
108629
|
-
stableId: zod.z.string(),
|
|
108630
|
-
nodeId: zod.z.string(),
|
|
108631
|
-
profileId: zod.z.string(),
|
|
108632
|
-
profileLabel: zod.z.string(),
|
|
108633
|
-
name: zod.z.string(),
|
|
108634
|
-
/** Only legacy monitor cameras can retain their historic stable identity. */
|
|
108635
|
-
adoptable: zod.z.boolean()
|
|
108636
|
-
});
|
|
108637
109823
|
var TerminalOutputEventSchema = zod.z.discriminatedUnion("kind", [zod.z.object({
|
|
108638
109824
|
seq: zod.z.number().int().positive(),
|
|
108639
109825
|
kind: zod.z.literal("data"),
|
|
@@ -108665,8 +109851,8 @@ var TerminalOutputBatchSchema = zod.z.object({
|
|
|
108665
109851
|
* terminal-session — singleton system capability for interactive TTY sessions.
|
|
108666
109852
|
*
|
|
108667
109853
|
* Owns both live PTY lifecycle and durable Terminal instance management.
|
|
108668
|
-
* Profiles are allowlisted templates;
|
|
108669
|
-
*
|
|
109854
|
+
* Profiles are allowlisted templates; a Terminal camera is a core block naming
|
|
109855
|
+
* one Terminal (planning#580).
|
|
108670
109856
|
*/
|
|
108671
109857
|
var terminalSessionCapability = {
|
|
108672
109858
|
name: "terminal-session",
|
|
@@ -108675,16 +109861,6 @@ var terminalSessionCapability = {
|
|
|
108675
109861
|
methods: {
|
|
108676
109862
|
/** Pre-declared profiles the operator may open. */
|
|
108677
109863
|
listProfiles: method(zod.z.void(), zod.z.array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
|
|
108678
|
-
/** Existing automatic cameras are shown for explicit migration only. */
|
|
108679
|
-
listLegacyCameras: method(zod.z.void(), zod.z.array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }),
|
|
108680
|
-
/** Explicitly adopt one legacy monitor camera, retaining its stable id. */
|
|
108681
|
-
adoptLegacyMonitor: method(zod.z.object({
|
|
108682
|
-
stableId: zod.z.string().min(1),
|
|
108683
|
-
name: zod.z.string().trim().min(1).max(160).optional()
|
|
108684
|
-
}), TerminalInstanceInfoSchema, {
|
|
108685
|
-
kind: "mutation",
|
|
108686
|
-
auth: "admin"
|
|
108687
|
-
}),
|
|
108688
109864
|
/** Live sessions currently hosted by the provider. */
|
|
108689
109865
|
listSessions: method(zod.z.void(), zod.z.array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }),
|
|
108690
109866
|
/**
|
|
@@ -111833,6 +113009,454 @@ var webrtcSessionCapability = {
|
|
|
111833
113009
|
order: 3340
|
|
111834
113010
|
}
|
|
111835
113011
|
};
|
|
113012
|
+
var WorkloadStateSchema = zod.z.enum([
|
|
113013
|
+
"running",
|
|
113014
|
+
"paused",
|
|
113015
|
+
"stopped",
|
|
113016
|
+
"starting",
|
|
113017
|
+
"stopping",
|
|
113018
|
+
"crashed"
|
|
113019
|
+
]);
|
|
113020
|
+
/** The five kinds of workload, as roles of the `workload` device type (D1033). */
|
|
113021
|
+
var WORKLOAD_ROLES = [
|
|
113022
|
+
DeviceRole.Vm,
|
|
113023
|
+
DeviceRole.AppContainer,
|
|
113024
|
+
DeviceRole.Lxc,
|
|
113025
|
+
DeviceRole.App,
|
|
113026
|
+
DeviceRole.Host
|
|
113027
|
+
];
|
|
113028
|
+
/**
|
|
113029
|
+
* What the workload uses. Every value is `null` when not reported (D393). A host
|
|
113030
|
+
* fills `load1` and `temperature`; its uptime is `since` while it runs.
|
|
113031
|
+
*/
|
|
113032
|
+
var WorkloadResourcesSchema = zod.z.object({
|
|
113033
|
+
/** CPU use, percent of the CPUs it may use (0–100). */
|
|
113034
|
+
cpuPercent: zod.z.number().nullable().meta(readingMeta("percentage", { precision: 1 })),
|
|
113035
|
+
memoryUsedBytes: zod.z.number().nullable().meta(readingMeta("information")),
|
|
113036
|
+
/**
|
|
113037
|
+
* Memory use, percent of `memoryLimitBytes`, for a source that reports a share
|
|
113038
|
+
* and not bytes (a Docker container's stats). Absent or `null` = not reported.
|
|
113039
|
+
*/
|
|
113040
|
+
memoryPercent: zod.z.number().nullable().optional().meta(readingMeta("percentage", { precision: 1 })),
|
|
113041
|
+
/** The memory it may use: the limit of a container, the RAM of a VM or host. */
|
|
113042
|
+
memoryLimitBytes: zod.z.number().nullable().meta(readingMeta("information")),
|
|
113043
|
+
vcpus: zod.z.number().nullable().meta(readingMeta("count")),
|
|
113044
|
+
diskUsedBytes: zod.z.number().nullable().meta(readingMeta("information")),
|
|
113045
|
+
diskTotalBytes: zod.z.number().nullable().meta(readingMeta("information")),
|
|
113046
|
+
/** Network received, kbit/s. */
|
|
113047
|
+
netRxKbps: zod.z.number().nullable().meta(readingMeta("bitrate")),
|
|
113048
|
+
/** Network sent, kbit/s. */
|
|
113049
|
+
netTxKbps: zod.z.number().nullable().meta(readingMeta("bitrate")),
|
|
113050
|
+
/** One-minute load average (a host). */
|
|
113051
|
+
load1: zod.z.number().nullable().meta(readingMeta("index", { precision: 2 })),
|
|
113052
|
+
/** CPU / board temperature (a host). */
|
|
113053
|
+
temperature: zod.z.number().nullable().meta(readingMeta("temperature", { precision: 1 }))
|
|
113054
|
+
});
|
|
113055
|
+
var WorkloadPortProtocolSchema = zod.z.enum(["tcp", "udp"]);
|
|
113056
|
+
/** One published port: the workload's own port and where the host exposes it. */
|
|
113057
|
+
var WorkloadPortSchema = zod.z.object({
|
|
113058
|
+
port: zod.z.number().int().meta(readingMeta("none")),
|
|
113059
|
+
/** The host port it is published on; null = not published. */
|
|
113060
|
+
hostPort: zod.z.number().int().nullable().meta(readingMeta("none")),
|
|
113061
|
+
/** The host address it is bound to; null = every address. */
|
|
113062
|
+
hostIp: zod.z.string().nullable(),
|
|
113063
|
+
protocol: WorkloadPortProtocolSchema
|
|
113064
|
+
});
|
|
113065
|
+
var WorkloadStatusSchema = zod.z.object({
|
|
113066
|
+
/** null = unknown, never stopped (D393). */
|
|
113067
|
+
state: WorkloadStateSchema.nullable().meta({ label: "State" }),
|
|
113068
|
+
/** Epoch ms the current state began (uptime while running); null when unknown. */
|
|
113069
|
+
since: zod.z.number().nullable().meta(readingMeta("none")),
|
|
113070
|
+
/** The `host` device this runs on, when the provider has adopted it. */
|
|
113071
|
+
hostDeviceId: zod.z.number().int().nullable().meta(readingMeta("device")),
|
|
113072
|
+
/** The image a container runs (`nginx:1.27`). */
|
|
113073
|
+
image: zod.z.string().nullable(),
|
|
113074
|
+
/** The operating system (a VM, an LXC, a host). */
|
|
113075
|
+
os: zod.z.string().nullable(),
|
|
113076
|
+
/** The version or firmware it runs. */
|
|
113077
|
+
version: zod.z.string().nullable(),
|
|
113078
|
+
/** Starts with its host; null when the platform does not say. */
|
|
113079
|
+
autostart: zod.z.boolean().nullable(),
|
|
113080
|
+
resources: WorkloadResourcesSchema,
|
|
113081
|
+
ports: zod.z.array(WorkloadPortSchema),
|
|
113082
|
+
/** The addresses it is reachable on (IPs or host names). */
|
|
113083
|
+
addresses: zod.z.array(zod.z.string()),
|
|
113084
|
+
/** A newer image / version exists. Installing it stays the `update` cap. */
|
|
113085
|
+
updateAvailable: zod.z.boolean().nullable(),
|
|
113086
|
+
lastFetchedAt: zod.z.number()
|
|
113087
|
+
});
|
|
113088
|
+
/**
|
|
113089
|
+
* What this device can do, probed by its provider (D14 honesty): a flag is
|
|
113090
|
+
* `true` only when the platform really serves it for THIS device.
|
|
113091
|
+
*/
|
|
113092
|
+
var WorkloadOptionsSchema = zod.z.object({
|
|
113093
|
+
supportsStart: zod.z.boolean(),
|
|
113094
|
+
supportsStop: zod.z.boolean(),
|
|
113095
|
+
supportsRestart: zod.z.boolean(),
|
|
113096
|
+
/** Pause AND resume. */
|
|
113097
|
+
supportsPause: zod.z.boolean(),
|
|
113098
|
+
supportsForceStop: zod.z.boolean(),
|
|
113099
|
+
hasResources: zod.z.boolean(),
|
|
113100
|
+
hasPorts: zod.z.boolean(),
|
|
113101
|
+
hasAddresses: zod.z.boolean(),
|
|
113102
|
+
hasAutostart: zod.z.boolean(),
|
|
113103
|
+
hasUpdateCheck: zod.z.boolean()
|
|
113104
|
+
});
|
|
113105
|
+
var WorkloadDeviceInputSchema = zod.z.object({ deviceId: zod.z.number().int().nonnegative() });
|
|
113106
|
+
var WorkloadTransitionEventDataSchema = zod.z.object({
|
|
113107
|
+
deviceId: zod.z.number(),
|
|
113108
|
+
state: WorkloadStateSchema,
|
|
113109
|
+
previous: WorkloadStateSchema,
|
|
113110
|
+
since: zod.z.number().nullable()
|
|
113111
|
+
});
|
|
113112
|
+
function isWorkloadSettled(state) {
|
|
113113
|
+
return state !== "starting" && state !== "stopping";
|
|
113114
|
+
}
|
|
113115
|
+
/**
|
|
113116
|
+
* The event a move from the last SETTLED state to `next` raises, or null.
|
|
113117
|
+
* A first sight (`previous` undefined) raises nothing: it is not a change.
|
|
113118
|
+
* Unknown (`next` null) raises nothing and is not remembered.
|
|
113119
|
+
*/
|
|
113120
|
+
function workloadTransition(previous, next) {
|
|
113121
|
+
if (previous === void 0 || next === null || next === previous) return null;
|
|
113122
|
+
switch (next) {
|
|
113123
|
+
case "running":
|
|
113124
|
+
if (previous === "crashed") return "recovered";
|
|
113125
|
+
return previous === "stopped" ? "started" : null;
|
|
113126
|
+
case "stopped": return previous === "running" || previous === "paused" ? "stopped" : null;
|
|
113127
|
+
case "crashed": return "crashed";
|
|
113128
|
+
case "paused":
|
|
113129
|
+
case "starting":
|
|
113130
|
+
case "stopping": return null;
|
|
113131
|
+
}
|
|
113132
|
+
}
|
|
113133
|
+
/** The bus category of each transition. */
|
|
113134
|
+
var WORKLOAD_TRANSITION_CATEGORY = {
|
|
113135
|
+
started: EventCategory.WorkloadStarted,
|
|
113136
|
+
stopped: EventCategory.WorkloadStopped,
|
|
113137
|
+
crashed: EventCategory.WorkloadCrashed,
|
|
113138
|
+
recovered: EventCategory.WorkloadRecovered
|
|
113139
|
+
};
|
|
113140
|
+
var workloadCapability = {
|
|
113141
|
+
name: "workload",
|
|
113142
|
+
scope: "device",
|
|
113143
|
+
deviceNative: true,
|
|
113144
|
+
mode: "singleton",
|
|
113145
|
+
deviceTypes: [DeviceType.Workload],
|
|
113146
|
+
deviceRoles: { [DeviceType.Workload]: WORKLOAD_ROLES },
|
|
113147
|
+
/**
|
|
113148
|
+
* On / off is the state (#462): stopped or crashed is off, anything else on.
|
|
113149
|
+
* The owner registers `switch` through `registerPowerSwitch`; there is no
|
|
113150
|
+
* second on/off state. A device whose provider serves no start / stop gets no
|
|
113151
|
+
* switch.
|
|
113152
|
+
*/
|
|
113153
|
+
power: {
|
|
113154
|
+
kind: "methods",
|
|
113155
|
+
field: "state",
|
|
113156
|
+
offValues: ["stopped", "crashed"],
|
|
113157
|
+
on: "start",
|
|
113158
|
+
off: "stop"
|
|
113159
|
+
},
|
|
113160
|
+
methods: {
|
|
113161
|
+
start: optionalMethod(WorkloadDeviceInputSchema, zod.z.void(), {
|
|
113162
|
+
kind: "mutation",
|
|
113163
|
+
auth: "protected",
|
|
113164
|
+
actions: [{
|
|
113165
|
+
id: "workload.start",
|
|
113166
|
+
label: t("Start", "Avvia"),
|
|
113167
|
+
phrase: t("Start {device}", "Avvia {device}"),
|
|
113168
|
+
icon: "play",
|
|
113169
|
+
effect: {
|
|
113170
|
+
field: "state",
|
|
113171
|
+
value: "running"
|
|
113172
|
+
}
|
|
113173
|
+
}]
|
|
113174
|
+
}),
|
|
113175
|
+
stop: optionalMethod(WorkloadDeviceInputSchema, zod.z.void(), {
|
|
113176
|
+
kind: "mutation",
|
|
113177
|
+
auth: "protected",
|
|
113178
|
+
actions: [{
|
|
113179
|
+
id: "workload.stop",
|
|
113180
|
+
label: t("Stop", "Arresta"),
|
|
113181
|
+
phrase: t("Stop {device}", "Arresta {device}"),
|
|
113182
|
+
icon: "square",
|
|
113183
|
+
effect: {
|
|
113184
|
+
field: "state",
|
|
113185
|
+
value: "stopped"
|
|
113186
|
+
}
|
|
113187
|
+
}]
|
|
113188
|
+
}),
|
|
113189
|
+
restart: optionalMethod(WorkloadDeviceInputSchema, zod.z.void(), {
|
|
113190
|
+
kind: "mutation",
|
|
113191
|
+
auth: "protected",
|
|
113192
|
+
actions: [{
|
|
113193
|
+
id: "workload.restart",
|
|
113194
|
+
label: t("Restart", "Riavvia"),
|
|
113195
|
+
phrase: t("Restart {device}", "Riavvia {device}"),
|
|
113196
|
+
icon: "rotate-ccw"
|
|
113197
|
+
}]
|
|
113198
|
+
}),
|
|
113199
|
+
pause: optionalMethod(WorkloadDeviceInputSchema, zod.z.void(), {
|
|
113200
|
+
kind: "mutation",
|
|
113201
|
+
auth: "protected",
|
|
113202
|
+
actions: [{
|
|
113203
|
+
id: "workload.pause",
|
|
113204
|
+
label: t("Pause", "Metti in pausa"),
|
|
113205
|
+
phrase: t("Pause {device}", "Metti in pausa {device}"),
|
|
113206
|
+
icon: "pause",
|
|
113207
|
+
effect: {
|
|
113208
|
+
field: "state",
|
|
113209
|
+
value: "paused"
|
|
113210
|
+
}
|
|
113211
|
+
}]
|
|
113212
|
+
}),
|
|
113213
|
+
resume: optionalMethod(WorkloadDeviceInputSchema, zod.z.void(), {
|
|
113214
|
+
kind: "mutation",
|
|
113215
|
+
auth: "protected",
|
|
113216
|
+
actions: [{
|
|
113217
|
+
id: "workload.resume",
|
|
113218
|
+
label: t("Resume", "Riprendi"),
|
|
113219
|
+
phrase: t("Resume {device}", "Riprendi {device}"),
|
|
113220
|
+
icon: "circle-play",
|
|
113221
|
+
effect: {
|
|
113222
|
+
field: "state",
|
|
113223
|
+
value: "running"
|
|
113224
|
+
}
|
|
113225
|
+
}]
|
|
113226
|
+
}),
|
|
113227
|
+
forceStop: optionalMethod(WorkloadDeviceInputSchema, zod.z.void(), {
|
|
113228
|
+
kind: "mutation",
|
|
113229
|
+
auth: "admin",
|
|
113230
|
+
actions: [{
|
|
113231
|
+
id: "workload.forceStop",
|
|
113232
|
+
label: t("Force stop", "Arresto forzato"),
|
|
113233
|
+
phrase: t("Force {device} to stop", "Forza l’arresto di {device}"),
|
|
113234
|
+
icon: "octagon-x",
|
|
113235
|
+
effect: {
|
|
113236
|
+
field: "state",
|
|
113237
|
+
value: "stopped"
|
|
113238
|
+
}
|
|
113239
|
+
}]
|
|
113240
|
+
}),
|
|
113241
|
+
/** What THIS device can do, probed — the UI is derived from it. */
|
|
113242
|
+
getOptions: method(WorkloadDeviceInputSchema, WorkloadOptionsSchema, { auth: "protected" })
|
|
113243
|
+
},
|
|
113244
|
+
events: {
|
|
113245
|
+
onStarted: {
|
|
113246
|
+
data: WorkloadTransitionEventDataSchema,
|
|
113247
|
+
trigger: {
|
|
113248
|
+
category: EventCategory.WorkloadStarted,
|
|
113249
|
+
label: t("Started", "Avviato"),
|
|
113250
|
+
phrase: t("When {device} starts", "Quando {device} si avvia"),
|
|
113251
|
+
icon: "play"
|
|
113252
|
+
}
|
|
113253
|
+
},
|
|
113254
|
+
onStopped: {
|
|
113255
|
+
data: WorkloadTransitionEventDataSchema,
|
|
113256
|
+
trigger: {
|
|
113257
|
+
category: EventCategory.WorkloadStopped,
|
|
113258
|
+
label: t("Stopped", "Arrestato"),
|
|
113259
|
+
phrase: t("When {device} stops", "Quando {device} si arresta"),
|
|
113260
|
+
icon: "square"
|
|
113261
|
+
}
|
|
113262
|
+
},
|
|
113263
|
+
onCrashed: {
|
|
113264
|
+
data: WorkloadTransitionEventDataSchema,
|
|
113265
|
+
trigger: {
|
|
113266
|
+
category: EventCategory.WorkloadCrashed,
|
|
113267
|
+
label: t("Crashed", "Arrestato in modo anomalo"),
|
|
113268
|
+
phrase: t("When {device} stops without being asked", "Quando {device} si arresta senza che sia stato richiesto"),
|
|
113269
|
+
icon: "triangle-alert"
|
|
113270
|
+
}
|
|
113271
|
+
},
|
|
113272
|
+
onRecovered: {
|
|
113273
|
+
data: WorkloadTransitionEventDataSchema,
|
|
113274
|
+
trigger: {
|
|
113275
|
+
category: EventCategory.WorkloadRecovered,
|
|
113276
|
+
label: t("Recovered", "Ripristinato"),
|
|
113277
|
+
phrase: t("When {device} runs again after a crash", "Quando {device} riparte dopo un arresto anomalo"),
|
|
113278
|
+
icon: "heart-pulse"
|
|
113279
|
+
}
|
|
113280
|
+
}
|
|
113281
|
+
},
|
|
113282
|
+
status: {
|
|
113283
|
+
schema: WorkloadStatusSchema,
|
|
113284
|
+
kind: "poll"
|
|
113285
|
+
},
|
|
113286
|
+
runtimeState: WorkloadStatusSchema,
|
|
113287
|
+
/**
|
|
113288
|
+
* Runtime-state durability: **session** — the provider answers on its next
|
|
113289
|
+
* poll; the series are recorded, so a restart that clears the slice loses
|
|
113290
|
+
* nothing a reader needs. The events are judged from the first state seen.
|
|
113291
|
+
*/
|
|
113292
|
+
durability: "session",
|
|
113293
|
+
/**
|
|
113294
|
+
* History (D850): the state as an enum, CPU / memory / network as gauges, so
|
|
113295
|
+
* the charts need no per-metric child device.
|
|
113296
|
+
*/
|
|
113297
|
+
history: {
|
|
113298
|
+
primary: "resources.cpuPercent",
|
|
113299
|
+
priority: 40,
|
|
113300
|
+
fields: {
|
|
113301
|
+
state: { kind: "enum" },
|
|
113302
|
+
"resources.cpuPercent": {
|
|
113303
|
+
kind: "gauge",
|
|
113304
|
+
unit: "%",
|
|
113305
|
+
deadband: 2,
|
|
113306
|
+
displayName: "CPU"
|
|
113307
|
+
},
|
|
113308
|
+
"resources.memoryUsedBytes": {
|
|
113309
|
+
kind: "gauge",
|
|
113310
|
+
unit: "bytes",
|
|
113311
|
+
displayName: "Memory used"
|
|
113312
|
+
},
|
|
113313
|
+
"resources.memoryPercent": {
|
|
113314
|
+
kind: "gauge",
|
|
113315
|
+
unit: "%",
|
|
113316
|
+
deadband: 2,
|
|
113317
|
+
displayName: "Memory"
|
|
113318
|
+
},
|
|
113319
|
+
"resources.netRxKbps": {
|
|
113320
|
+
group: "network",
|
|
113321
|
+
kind: "gauge",
|
|
113322
|
+
unit: "kbps",
|
|
113323
|
+
displayName: "Network received"
|
|
113324
|
+
},
|
|
113325
|
+
"resources.netTxKbps": {
|
|
113326
|
+
group: "network",
|
|
113327
|
+
kind: "gauge",
|
|
113328
|
+
unit: "kbps",
|
|
113329
|
+
displayName: "Network sent"
|
|
113330
|
+
}
|
|
113331
|
+
}
|
|
113332
|
+
},
|
|
113333
|
+
volatileStateFields: ["lastFetchedAt"],
|
|
113334
|
+
vocabulary: {
|
|
113335
|
+
noun: t("Workload", "Carico di lavoro"),
|
|
113336
|
+
order: 2400,
|
|
113337
|
+
state: [
|
|
113338
|
+
{
|
|
113339
|
+
kind: "enum",
|
|
113340
|
+
field: "state",
|
|
113341
|
+
label: t("State", "Stato"),
|
|
113342
|
+
values: [
|
|
113343
|
+
{
|
|
113344
|
+
value: "running",
|
|
113345
|
+
label: t("Running", "In esecuzione"),
|
|
113346
|
+
phrase: t("When {device} is running", "Quando {device} è in esecuzione")
|
|
113347
|
+
},
|
|
113348
|
+
{
|
|
113349
|
+
value: "paused",
|
|
113350
|
+
label: t("Paused", "In pausa")
|
|
113351
|
+
},
|
|
113352
|
+
{
|
|
113353
|
+
value: "stopped",
|
|
113354
|
+
label: t("Stopped", "Arrestato"),
|
|
113355
|
+
phrase: t("When {device} is stopped", "Quando {device} è arrestato")
|
|
113356
|
+
},
|
|
113357
|
+
{
|
|
113358
|
+
value: "starting",
|
|
113359
|
+
label: t("Starting", "In avvio")
|
|
113360
|
+
},
|
|
113361
|
+
{
|
|
113362
|
+
value: "stopping",
|
|
113363
|
+
label: t("Stopping", "In arresto")
|
|
113364
|
+
},
|
|
113365
|
+
{
|
|
113366
|
+
value: "crashed",
|
|
113367
|
+
label: t("Crashed", "Arrestato in modo anomalo"),
|
|
113368
|
+
phrase: t("When {device} has crashed", "Quando {device} è arrestato in modo anomalo")
|
|
113369
|
+
}
|
|
113370
|
+
],
|
|
113371
|
+
icon: "activity"
|
|
113372
|
+
},
|
|
113373
|
+
{
|
|
113374
|
+
kind: "numeric",
|
|
113375
|
+
field: "resources.cpuPercent",
|
|
113376
|
+
quantity: t("the CPU use", "l'uso della CPU"),
|
|
113377
|
+
label: t("CPU", "CPU"),
|
|
113378
|
+
unit: "%",
|
|
113379
|
+
icon: "cpu"
|
|
113380
|
+
},
|
|
113381
|
+
{
|
|
113382
|
+
kind: "numeric",
|
|
113383
|
+
field: "resources.memoryPercent",
|
|
113384
|
+
quantity: t("the memory use", "l'uso della memoria"),
|
|
113385
|
+
label: t("Memory", "Memoria"),
|
|
113386
|
+
unit: "%",
|
|
113387
|
+
icon: "memory-stick"
|
|
113388
|
+
},
|
|
113389
|
+
{
|
|
113390
|
+
kind: "numeric",
|
|
113391
|
+
field: "resources.temperature",
|
|
113392
|
+
quantity: t("the temperature", "la temperatura"),
|
|
113393
|
+
label: t("Temperature", "Temperatura"),
|
|
113394
|
+
unit: "°C",
|
|
113395
|
+
icon: "thermometer"
|
|
113396
|
+
}
|
|
113397
|
+
],
|
|
113398
|
+
overrides: { byRole: {
|
|
113399
|
+
[DeviceRole.Vm]: {
|
|
113400
|
+
actions: { "workload.start": { icon: "monitor" } },
|
|
113401
|
+
state: { state: { icon: "monitor" } }
|
|
113402
|
+
},
|
|
113403
|
+
[DeviceRole.AppContainer]: {
|
|
113404
|
+
actions: { "workload.start": { icon: "container" } },
|
|
113405
|
+
state: { state: { icon: "container" } }
|
|
113406
|
+
},
|
|
113407
|
+
[DeviceRole.Lxc]: {
|
|
113408
|
+
actions: { "workload.start": { icon: "box" } },
|
|
113409
|
+
state: { state: { icon: "box" } }
|
|
113410
|
+
},
|
|
113411
|
+
[DeviceRole.App]: {
|
|
113412
|
+
actions: { "workload.start": { icon: "app-window" } },
|
|
113413
|
+
state: { state: { icon: "app-window" } }
|
|
113414
|
+
},
|
|
113415
|
+
[DeviceRole.Host]: {
|
|
113416
|
+
actions: {
|
|
113417
|
+
"workload.start": {
|
|
113418
|
+
label: t("Power on", "Accendi"),
|
|
113419
|
+
phrase: t("Power on {device}", "Accendi {device}"),
|
|
113420
|
+
icon: "power"
|
|
113421
|
+
},
|
|
113422
|
+
"workload.stop": {
|
|
113423
|
+
label: t("Shut down", "Spegni"),
|
|
113424
|
+
phrase: t("Shut down {device}", "Spegni {device}"),
|
|
113425
|
+
icon: "power-off"
|
|
113426
|
+
},
|
|
113427
|
+
"workload.restart": {
|
|
113428
|
+
label: t("Reboot", "Riavvia"),
|
|
113429
|
+
phrase: t("Reboot {device}", "Riavvia {device}"),
|
|
113430
|
+
icon: "refresh-cw"
|
|
113431
|
+
}
|
|
113432
|
+
},
|
|
113433
|
+
state: { state: { icon: "server" } },
|
|
113434
|
+
events: {
|
|
113435
|
+
onStarted: {
|
|
113436
|
+
label: t("Came online", "Tornato in linea"),
|
|
113437
|
+
phrase: t("When {device} comes online", "Quando {device} torna in linea"),
|
|
113438
|
+
icon: "server"
|
|
113439
|
+
},
|
|
113440
|
+
onStopped: {
|
|
113441
|
+
label: t("Shut down", "Spento"),
|
|
113442
|
+
phrase: t("When {device} shuts down", "Quando {device} si spegne"),
|
|
113443
|
+
icon: "server-off"
|
|
113444
|
+
},
|
|
113445
|
+
onCrashed: {
|
|
113446
|
+
label: t("Went down", "Caduto"),
|
|
113447
|
+
phrase: t("When {device} goes down unexpectedly", "Quando {device} cade inaspettatamente"),
|
|
113448
|
+
icon: "server-crash"
|
|
113449
|
+
},
|
|
113450
|
+
onRecovered: {
|
|
113451
|
+
label: t("Came online", "Tornato in linea"),
|
|
113452
|
+
phrase: t("When {device} comes back online after going down", "Quando {device} torna in linea dopo essere caduto"),
|
|
113453
|
+
icon: "server"
|
|
113454
|
+
}
|
|
113455
|
+
}
|
|
113456
|
+
}
|
|
113457
|
+
} }
|
|
113458
|
+
}
|
|
113459
|
+
};
|
|
111836
113460
|
/**
|
|
111837
113461
|
* Per-zone occupancy aggregation produced by the analytics frame
|
|
111838
113462
|
* processor on every inference result. Covers the full combinatorial
|
|
@@ -112498,6 +114122,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
|
|
|
112498
114122
|
weatherCapability,
|
|
112499
114123
|
weatherStationCapability,
|
|
112500
114124
|
webrtcSessionCapability,
|
|
114125
|
+
workloadCapability,
|
|
112501
114126
|
zoneAnalyticsCapability,
|
|
112502
114127
|
zoneRulesCapability,
|
|
112503
114128
|
zonesCapability
|
|
@@ -114557,6 +116182,438 @@ function withDefaultRunning(composition, blockId) {
|
|
|
114557
116182
|
features: [...composition.features, feature]
|
|
114558
116183
|
};
|
|
114559
116184
|
}
|
|
116185
|
+
/** Marker written to a declared integration's `info`. */
|
|
116186
|
+
var DECLARED_INTEGRATION_FIXED_KEY = "fixed";
|
|
116187
|
+
/**
|
|
116188
|
+
* Give a declared integration its instance record, ONCE. The record is read first and left
|
|
116189
|
+
* exactly as it is when it exists (an operator's rename, a field the addon later adds): a seed
|
|
116190
|
+
* never overwrites. A read that fails throws and writes nothing (D49) — the next pass retries.
|
|
116191
|
+
* True when the record was written by this call.
|
|
116192
|
+
*/
|
|
116193
|
+
async function seedInstanceOnce(instances, seed) {
|
|
116194
|
+
const existing = await instances.getInstance({ id: seed.id });
|
|
116195
|
+
if (existing !== null && existing !== void 0) return false;
|
|
116196
|
+
await instances.createInstance({
|
|
116197
|
+
id: seed.id,
|
|
116198
|
+
name: seed.name
|
|
116199
|
+
});
|
|
116200
|
+
return true;
|
|
116201
|
+
}
|
|
116202
|
+
/**
|
|
116203
|
+
* Strip the `<node>/<addon>` suffix a forked child carries.
|
|
116204
|
+
*
|
|
116205
|
+
* Comparing `ctx.kernel.localNodeId` raw skipped EVERY node — including the one
|
|
116206
|
+
* that was supposed to act — because on the hub it reads `hub/<addon>`.
|
|
116207
|
+
*/
|
|
116208
|
+
function declarationOwnerNodeId(localNodeId) {
|
|
116209
|
+
const raw = localNodeId ?? "hub";
|
|
116210
|
+
if (!raw.includes("/")) return raw;
|
|
116211
|
+
return raw.split("/")[0] ?? "hub";
|
|
116212
|
+
}
|
|
116213
|
+
/**
|
|
116214
|
+
* The one way an addon owns a device it declares.
|
|
116215
|
+
*
|
|
116216
|
+
* Construct once with the addon's ports, then call {@link reconcile} on boot and
|
|
116217
|
+
* on every convergence tick. There is no second get-or-create helper — a guard
|
|
116218
|
+
* in `scripts/` enforces that.
|
|
116219
|
+
*/
|
|
116220
|
+
var DeclaredDevices = class {
|
|
116221
|
+
ports;
|
|
116222
|
+
constructor(ports) {
|
|
116223
|
+
const addonId = ports.addonId;
|
|
116224
|
+
if (typeof addonId !== "string" || addonId.length === 0) throw new Error(`DeclaredDevices: addonId must be the declaring addon's id, got ${JSON.stringify(addonId)}. On an addon context it is \`ctx.id\` — there is no \`ctx.addonId\`.`);
|
|
116225
|
+
this.ports = ports;
|
|
116226
|
+
}
|
|
116227
|
+
/**
|
|
116228
|
+
* Converge the declared set. Idempotent, and safe to call repeatedly.
|
|
116229
|
+
*
|
|
116230
|
+
* Throws only what the ports throw on the FIRST index read; every other
|
|
116231
|
+
* failure is per-device and logged, so one bad declaration never takes the
|
|
116232
|
+
* others down.
|
|
116233
|
+
*/
|
|
116234
|
+
async reconcile(spec) {
|
|
116235
|
+
if ((spec.placement ?? "hub") === "hub") {
|
|
116236
|
+
const nodeId = declarationOwnerNodeId(this.ports.localNodeId);
|
|
116237
|
+
if (nodeId !== "hub") {
|
|
116238
|
+
this.ports.logger.info("declared devices are hub-owned — skipping on this node", { meta: {
|
|
116239
|
+
nodeId,
|
|
116240
|
+
rawNodeId: this.ports.localNodeId ?? null
|
|
116241
|
+
} });
|
|
116242
|
+
return {
|
|
116243
|
+
integrationId: null,
|
|
116244
|
+
devices: [],
|
|
116245
|
+
removed: [],
|
|
116246
|
+
owned: false
|
|
116247
|
+
};
|
|
116248
|
+
}
|
|
116249
|
+
}
|
|
116250
|
+
let integrationId;
|
|
116251
|
+
if (spec.integrationId !== void 0) integrationId = spec.integrationId;
|
|
116252
|
+
else {
|
|
116253
|
+
const own = await this.ensureIntegration(spec.integrationName);
|
|
116254
|
+
integrationId = own.id;
|
|
116255
|
+
await this.seedInstance(own);
|
|
116256
|
+
}
|
|
116257
|
+
const index = await this.readIndex();
|
|
116258
|
+
const live = await this.readLiveByStableId();
|
|
116259
|
+
const outcomes = [];
|
|
116260
|
+
for (const declaration of spec.devices) {
|
|
116261
|
+
const outcome = await this.applyDeclaration(declaration, integrationId, index, live);
|
|
116262
|
+
if (outcome !== null) outcomes.push(outcome);
|
|
116263
|
+
}
|
|
116264
|
+
const removed = await this.sweepWithdrawn(spec.devices, integrationId, index);
|
|
116265
|
+
return {
|
|
116266
|
+
integrationId,
|
|
116267
|
+
devices: outcomes,
|
|
116268
|
+
removed,
|
|
116269
|
+
owned: true
|
|
116270
|
+
};
|
|
116271
|
+
}
|
|
116272
|
+
/**
|
|
116273
|
+
* Get-or-create the FIXED integration, and RE-ASSERT the flag every pass.
|
|
116274
|
+
*
|
|
116275
|
+
* The re-assertion is the fix for the defect the hand-rolled version shipped
|
|
116276
|
+
* with: writing `info.fixed` only on the create path left every pre-existing
|
|
116277
|
+
* install without it, and the kernel kept offering to delete an integration
|
|
116278
|
+
* the addon owns.
|
|
116279
|
+
*/
|
|
116280
|
+
async ensureIntegration(integrationName) {
|
|
116281
|
+
const existing = await this.ports.getIntegration(this.ports.addonId);
|
|
116282
|
+
if (existing === null) {
|
|
116283
|
+
const created = await this.ports.createIntegration({
|
|
116284
|
+
addonId: this.ports.addonId,
|
|
116285
|
+
name: integrationName,
|
|
116286
|
+
info: { [DECLARED_INTEGRATION_FIXED_KEY]: true }
|
|
116287
|
+
});
|
|
116288
|
+
this.ports.logger.info("declared a fixed integration", { meta: {
|
|
116289
|
+
integrationId: created.id,
|
|
116290
|
+
name: integrationName
|
|
116291
|
+
} });
|
|
116292
|
+
return {
|
|
116293
|
+
id: created.id,
|
|
116294
|
+
name: integrationName
|
|
116295
|
+
};
|
|
116296
|
+
}
|
|
116297
|
+
if (existing.info?.["fixed"] !== true) {
|
|
116298
|
+
await this.ports.updateIntegration({
|
|
116299
|
+
id: existing.id,
|
|
116300
|
+
info: { [DECLARED_INTEGRATION_FIXED_KEY]: true }
|
|
116301
|
+
});
|
|
116302
|
+
this.ports.logger.info("re-asserted `fixed` on a declared integration", { meta: { integrationId: existing.id } });
|
|
116303
|
+
}
|
|
116304
|
+
return {
|
|
116305
|
+
id: existing.id,
|
|
116306
|
+
name: existing.name ?? integrationName
|
|
116307
|
+
};
|
|
116308
|
+
}
|
|
116309
|
+
/** Seed the instance record of an integration this declarer owns; best-effort, retried next pass. */
|
|
116310
|
+
async seedInstance(integration) {
|
|
116311
|
+
const { seedInstance } = this.ports;
|
|
116312
|
+
if (seedInstance === void 0) return;
|
|
116313
|
+
try {
|
|
116314
|
+
await seedInstance({
|
|
116315
|
+
id: integration.id,
|
|
116316
|
+
name: integration.name
|
|
116317
|
+
});
|
|
116318
|
+
} catch (err) {
|
|
116319
|
+
this.ports.logger.warn("could not seed the instance record of a declared integration", {
|
|
116320
|
+
tags: { integrationId: integration.id },
|
|
116321
|
+
meta: { error: errMsg(err) }
|
|
116322
|
+
});
|
|
116323
|
+
}
|
|
116324
|
+
}
|
|
116325
|
+
async readIndex() {
|
|
116326
|
+
const rows = await this.ports.listOwnDevices();
|
|
116327
|
+
return new Map(rows.map((row) => [row.stableId, row]));
|
|
116328
|
+
}
|
|
116329
|
+
/**
|
|
116330
|
+
* Devices this kernel already has CONSTRUCTED, by stableId.
|
|
116331
|
+
*
|
|
116332
|
+
* Distinct from {@link readIndex}, and the distinction is the bug: the index
|
|
116333
|
+
* is persisted rows, this is live objects. A row without an object must be
|
|
116334
|
+
* adopted; an object must be left exactly as it is.
|
|
116335
|
+
*
|
|
116336
|
+
* Failure is non-fatal and deliberately so — an empty map degrades to the
|
|
116337
|
+
* previous behaviour (attempt the adopt) rather than skipping a device that
|
|
116338
|
+
* genuinely needs bringing up.
|
|
116339
|
+
*/
|
|
116340
|
+
async readLiveByStableId() {
|
|
116341
|
+
try {
|
|
116342
|
+
const devices = await this.ports.devices.getAll();
|
|
116343
|
+
return new Map(devices.map((device) => [device.stableId, device]));
|
|
116344
|
+
} catch (err) {
|
|
116345
|
+
this.ports.logger.warn("could not read live devices — falling back to adopt-by-row", { meta: { error: err instanceof Error ? err.message : String(err) } });
|
|
116346
|
+
return /* @__PURE__ */ new Map();
|
|
116347
|
+
}
|
|
116348
|
+
}
|
|
116349
|
+
/**
|
|
116350
|
+
* One declaration: adopt what exists, create what does not.
|
|
116351
|
+
*
|
|
116352
|
+
* The create branch is the destructive one — it seeds `initialMeta`, and
|
|
116353
|
+
* `initialMeta.name` lands as an unconditional `setName`. A transiently empty
|
|
116354
|
+
* index therefore looks exactly like a first boot and would silently re-stamp
|
|
116355
|
+
* the declared name over the operator's rename. D49: that branch needs a
|
|
116356
|
+
* second read to agree.
|
|
116357
|
+
*/
|
|
116358
|
+
async applyDeclaration(declaration, integrationId, index, live) {
|
|
116359
|
+
try {
|
|
116360
|
+
const alreadyLive = live.get(declaration.stableId);
|
|
116361
|
+
if (alreadyLive !== void 0) return {
|
|
116362
|
+
stableId: declaration.stableId,
|
|
116363
|
+
deviceId: alreadyLive.id,
|
|
116364
|
+
device: alreadyLive,
|
|
116365
|
+
created: false
|
|
116366
|
+
};
|
|
116367
|
+
let existing = index.get(declaration.stableId);
|
|
116368
|
+
if (existing === void 0) {
|
|
116369
|
+
existing = (await this.readIndex()).get(declaration.stableId);
|
|
116370
|
+
if (existing !== void 0) this.ports.logger.warn("device index disagreed with itself — adopting instead of re-creating", {
|
|
116371
|
+
tags: { deviceId: existing.id },
|
|
116372
|
+
meta: {
|
|
116373
|
+
stableId: declaration.stableId,
|
|
116374
|
+
addonId: this.ports.addonId
|
|
116375
|
+
}
|
|
116376
|
+
});
|
|
116377
|
+
}
|
|
116378
|
+
if (existing !== void 0) {
|
|
116379
|
+
const device = await this.ports.devices.create(declaration.stableId, declaration.DeviceClass, {}, null, void 0);
|
|
116380
|
+
this.ports.logger.info("declared device adopted", {
|
|
116381
|
+
tags: { deviceId: device.id },
|
|
116382
|
+
meta: {
|
|
116383
|
+
stableId: declaration.stableId,
|
|
116384
|
+
integrationId
|
|
116385
|
+
}
|
|
116386
|
+
});
|
|
116387
|
+
return {
|
|
116388
|
+
stableId: declaration.stableId,
|
|
116389
|
+
deviceId: device.id,
|
|
116390
|
+
device,
|
|
116391
|
+
created: false
|
|
116392
|
+
};
|
|
116393
|
+
}
|
|
116394
|
+
const device = await this.ports.devices.create(declaration.stableId, declaration.DeviceClass, declaration.config ?? {}, null, {
|
|
116395
|
+
type: declaration.type,
|
|
116396
|
+
name: declaration.name,
|
|
116397
|
+
integrationId,
|
|
116398
|
+
...declaration.role === void 0 ? {} : { role: declaration.role }
|
|
116399
|
+
});
|
|
116400
|
+
this.ports.logger.info("declared device created", {
|
|
116401
|
+
tags: { deviceId: device.id },
|
|
116402
|
+
meta: {
|
|
116403
|
+
stableId: declaration.stableId,
|
|
116404
|
+
integrationId
|
|
116405
|
+
}
|
|
116406
|
+
});
|
|
116407
|
+
return {
|
|
116408
|
+
stableId: declaration.stableId,
|
|
116409
|
+
deviceId: device.id,
|
|
116410
|
+
device,
|
|
116411
|
+
created: true
|
|
116412
|
+
};
|
|
116413
|
+
} catch (err) {
|
|
116414
|
+
this.ports.logger.warn("a declared device could not be brought up", { meta: {
|
|
116415
|
+
stableId: declaration.stableId,
|
|
116416
|
+
error: err instanceof Error ? err.message : String(err)
|
|
116417
|
+
} });
|
|
116418
|
+
return null;
|
|
116419
|
+
}
|
|
116420
|
+
}
|
|
116421
|
+
/**
|
|
116422
|
+
* Remove rows under the addon's FIXED integration whose declaration is gone.
|
|
116423
|
+
*
|
|
116424
|
+
* Bounded to that integration: a declared integration has no operator
|
|
116425
|
+
* add-flow, so every row under it got there by declaration. Devices this
|
|
116426
|
+
* addon owns OUTSIDE it (a provider's adopted devices) are never candidates.
|
|
116427
|
+
*
|
|
116428
|
+
* Bounded in count, and every deletion is logged with its `deviceId` — a
|
|
116429
|
+
* withdrawal that removes an operator-visible row silently is the failure
|
|
116430
|
+
* mode, not the removal itself.
|
|
116431
|
+
*/
|
|
116432
|
+
async sweepWithdrawn(declarations, integrationId, index) {
|
|
116433
|
+
const declared = new Set(declarations.map((d) => d.stableId));
|
|
116434
|
+
const candidates = [...index.values()].filter((row) => row.integrationId === integrationId && !declared.has(row.stableId));
|
|
116435
|
+
if (candidates.length === 0) return [];
|
|
116436
|
+
if (candidates.length > 32) {
|
|
116437
|
+
this.ports.logger.warn("withdrawal sweep exceeded its bound — removing nothing", { meta: {
|
|
116438
|
+
integrationId,
|
|
116439
|
+
candidates: candidates.length,
|
|
116440
|
+
bound: 32
|
|
116441
|
+
} });
|
|
116442
|
+
return [];
|
|
116443
|
+
}
|
|
116444
|
+
const removed = [];
|
|
116445
|
+
for (const row of candidates) try {
|
|
116446
|
+
await this.ports.devices.remove(row.id);
|
|
116447
|
+
removed.push(row.id);
|
|
116448
|
+
this.ports.logger.info("declared device removed — its declaration was withdrawn", {
|
|
116449
|
+
tags: { deviceId: row.id },
|
|
116450
|
+
meta: {
|
|
116451
|
+
stableId: row.stableId,
|
|
116452
|
+
integrationId
|
|
116453
|
+
}
|
|
116454
|
+
});
|
|
116455
|
+
} catch (err) {
|
|
116456
|
+
this.ports.logger.warn("a withdrawn declared device could not be removed", {
|
|
116457
|
+
tags: { deviceId: row.id },
|
|
116458
|
+
meta: {
|
|
116459
|
+
stableId: row.stableId,
|
|
116460
|
+
error: err instanceof Error ? err.message : String(err)
|
|
116461
|
+
}
|
|
116462
|
+
});
|
|
116463
|
+
}
|
|
116464
|
+
return removed;
|
|
116465
|
+
}
|
|
116466
|
+
};
|
|
116467
|
+
function isSpecOfKind(spec, kind) {
|
|
116468
|
+
return spec !== void 0 && spec.kind === kind;
|
|
116469
|
+
}
|
|
116470
|
+
/**
|
|
116471
|
+
* The blocks of `kind` whose composer row exists. A block whose row the
|
|
116472
|
+
* composer has not declared yet is left out: nothing can be hosted on it until
|
|
116473
|
+
* its next apply, and the next pass picks it up.
|
|
116474
|
+
*/
|
|
116475
|
+
function selectEngineHostedBlocks(kind, compositions, composerRows) {
|
|
116476
|
+
if (compositions.state === "not-loaded") return {
|
|
116477
|
+
kind: "untrusted",
|
|
116478
|
+
reason: compositions.reason
|
|
116479
|
+
};
|
|
116480
|
+
const rowByStableId = new Map(composerRows.map((row) => [row.stableId, row]));
|
|
116481
|
+
const blocks = [];
|
|
116482
|
+
for (const view of compositions.views) {
|
|
116483
|
+
const block = view.block;
|
|
116484
|
+
const composition = block.source?.kind === "composition" ? block.source.composition : null;
|
|
116485
|
+
if (composition === null) continue;
|
|
116486
|
+
const spec = composition.helper;
|
|
116487
|
+
if (!isSpecOfKind(spec, kind)) continue;
|
|
116488
|
+
const stableId = `${COMPOSED_DEVICE_STABLE_ID_PREFIX}${block.id}`;
|
|
116489
|
+
const row = rowByStableId.get(stableId);
|
|
116490
|
+
if (row === void 0) continue;
|
|
116491
|
+
blocks.push({
|
|
116492
|
+
blockId: block.id,
|
|
116493
|
+
deviceId: row.id,
|
|
116494
|
+
stableId,
|
|
116495
|
+
name: block.name,
|
|
116496
|
+
enabled: block.enabled,
|
|
116497
|
+
updatedAt: block.updatedAt,
|
|
116498
|
+
composition,
|
|
116499
|
+
spec
|
|
116500
|
+
});
|
|
116501
|
+
}
|
|
116502
|
+
return {
|
|
116503
|
+
kind: "trusted",
|
|
116504
|
+
blocks
|
|
116505
|
+
};
|
|
116506
|
+
}
|
|
116507
|
+
var WITHDRAWAL_CONFIRMATIONS = 2;
|
|
116508
|
+
/**
|
|
116509
|
+
* D49 for an engine's hosted set: a block missing from ONE trusted read is
|
|
116510
|
+
* kept; a second consecutive trusted read that agrees withdraws it. An
|
|
116511
|
+
* untrusted read is never fed here, so it neither counts nor resets.
|
|
116512
|
+
*/
|
|
116513
|
+
var HostedWithdrawalGate = class {
|
|
116514
|
+
misses = /* @__PURE__ */ new Map();
|
|
116515
|
+
/**
|
|
116516
|
+
* `hosted`: what the engine serves now; `present`: what this trusted read
|
|
116517
|
+
* names. Returns the ids to withdraw now, and the ids kept on a first miss.
|
|
116518
|
+
*/
|
|
116519
|
+
judge(hosted, present) {
|
|
116520
|
+
const withdraw = [];
|
|
116521
|
+
const held = [];
|
|
116522
|
+
const misses = /* @__PURE__ */ new Map();
|
|
116523
|
+
for (const id of hosted) {
|
|
116524
|
+
if (present.has(id)) continue;
|
|
116525
|
+
const count = (this.misses.get(id) ?? 0) + 1;
|
|
116526
|
+
if (count < WITHDRAWAL_CONFIRMATIONS) {
|
|
116527
|
+
held.push(id);
|
|
116528
|
+
misses.set(id, count);
|
|
116529
|
+
} else withdraw.push(id);
|
|
116530
|
+
}
|
|
116531
|
+
this.misses = misses;
|
|
116532
|
+
return {
|
|
116533
|
+
withdraw,
|
|
116534
|
+
held
|
|
116535
|
+
};
|
|
116536
|
+
}
|
|
116537
|
+
};
|
|
116538
|
+
/**
|
|
116539
|
+
* Build `DeviceClass` on the composer's row `(stableId, id)`. The context is
|
|
116540
|
+
* `loadContext` (D677: a caller that BUILDS a device hydrates its stored
|
|
116541
|
+
* runtime state first); a kernel without it is refused by name rather than
|
|
116542
|
+
* building on an empty state. The device is never `register`ed and its config
|
|
116543
|
+
* never persisted: the row, its name and its lifetime are the composer's.
|
|
116544
|
+
*/
|
|
116545
|
+
async function hostEngineDevice(devices, row, config, DeviceClass) {
|
|
116546
|
+
if (devices.loadContext === void 0) throw new Error(`this kernel cannot build a device on a row it does not own (no loadContext) — device ${String(row.id)} is not hosted`);
|
|
116547
|
+
const base = await devices.loadContext(row.stableId, row.id, null, config);
|
|
116548
|
+
const registered = [];
|
|
116549
|
+
const device = new DeviceClass({
|
|
116550
|
+
...base,
|
|
116551
|
+
registerNativeCap: (cap, provider) => {
|
|
116552
|
+
base.registerNativeCap(cap, provider);
|
|
116553
|
+
registered.push(cap.name);
|
|
116554
|
+
}
|
|
116555
|
+
});
|
|
116556
|
+
return {
|
|
116557
|
+
device,
|
|
116558
|
+
withdraw: async () => {
|
|
116559
|
+
await device.removeDevice();
|
|
116560
|
+
for (const capName of registered) base.unregisterNativeCap?.(capName);
|
|
116561
|
+
}
|
|
116562
|
+
};
|
|
116563
|
+
}
|
|
116564
|
+
/**
|
|
116565
|
+
* Whether an engine may stop sweeping: only once a pass found no old row left.
|
|
116566
|
+
* `none` is not done — a registry that has not answered the integration yet
|
|
116567
|
+
* reads as null too, and the sweep is one indexed read per pass.
|
|
116568
|
+
*/
|
|
116569
|
+
function legacySweepDone(sweep) {
|
|
116570
|
+
return sweep.kind === "swept" && sweep.drained;
|
|
116571
|
+
}
|
|
116572
|
+
/**
|
|
116573
|
+
* The legacy rows, one bounded batch at a time: only the rows under the old
|
|
116574
|
+
* integration, ordered by id, at most `DECLARED_DEVICE_SWEEP_LIMIT` — a large
|
|
116575
|
+
* leftover set drains over passes instead of being refused whole by the
|
|
116576
|
+
* sweep's own bound.
|
|
116577
|
+
*/
|
|
116578
|
+
function legacyEngineRowsIndex(rows, integrationId) {
|
|
116579
|
+
return rows.filter((row) => row.integrationId === integrationId).toSorted((left, right) => left.id - right.id).slice(0, 32);
|
|
116580
|
+
}
|
|
116581
|
+
/**
|
|
116582
|
+
* Remove every camera row an engine declared itself before its cameras were
|
|
116583
|
+
* blocks, unconditionally, through the declared sweep (`removeDevice` →
|
|
116584
|
+
* tombstone, D865). No integration means nothing was ever declared, and
|
|
116585
|
+
* nothing is minted to find out. A failed read throws: the caller retries.
|
|
116586
|
+
*/
|
|
116587
|
+
async function sweepLegacyEngineRows(ports, integrationName) {
|
|
116588
|
+
const integration = await ports.getIntegration(ports.addonId);
|
|
116589
|
+
if (integration === null) return { kind: "none" };
|
|
116590
|
+
let found = 0;
|
|
116591
|
+
return {
|
|
116592
|
+
kind: "swept",
|
|
116593
|
+
removed: (await new DeclaredDevices({
|
|
116594
|
+
logger: ports.logger,
|
|
116595
|
+
addonId: ports.addonId,
|
|
116596
|
+
devices: ports.devices,
|
|
116597
|
+
localNodeId: ports.localNodeId,
|
|
116598
|
+
getIntegration: async () => integration,
|
|
116599
|
+
createIntegration: async () => {
|
|
116600
|
+
throw new Error(`${ports.addonId}: the legacy sweep never mints an integration`);
|
|
116601
|
+
},
|
|
116602
|
+
updateIntegration: async () => void 0,
|
|
116603
|
+
listOwnDevices: async () => {
|
|
116604
|
+
const index = legacyEngineRowsIndex(await ports.listAddonRows(ports.addonId), integration.id);
|
|
116605
|
+
found = index.length;
|
|
116606
|
+
return index;
|
|
116607
|
+
}
|
|
116608
|
+
}).reconcile({
|
|
116609
|
+
integrationName,
|
|
116610
|
+
integrationId: integration.id,
|
|
116611
|
+
placement: "hub",
|
|
116612
|
+
devices: []
|
|
116613
|
+
})).removed,
|
|
116614
|
+
drained: found === 0
|
|
116615
|
+
};
|
|
116616
|
+
}
|
|
114560
116617
|
/**
|
|
114561
116618
|
* One composed field, evaluated from what its sources say NOW (D659).
|
|
114562
116619
|
*
|
|
@@ -115160,11 +117217,65 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
115160
117217
|
waterHeater: waterHeaterCapability,
|
|
115161
117218
|
weather: weatherCapability,
|
|
115162
117219
|
weatherStation: weatherStationCapability,
|
|
117220
|
+
workload: workloadCapability,
|
|
115163
117221
|
zoneAnalytics: zoneAnalyticsCapability,
|
|
115164
117222
|
zoneRules: zoneRulesCapability,
|
|
115165
117223
|
zones: zonesCapability
|
|
115166
117224
|
};
|
|
115167
117225
|
/**
|
|
117226
|
+
* Normalise `raw` and declare it: every kind it carries replaces the stored one,
|
|
117227
|
+
* every kind it lacks is removed, except the kinds in `options.unread` (a failed
|
|
117228
|
+
* read keeps what was stored) — pass everything the provider read in one call.
|
|
117229
|
+
*/
|
|
117230
|
+
async function declareDeviceIdentifiers(deps, raw, options = {}) {
|
|
117231
|
+
const { deviceId, logger, writer } = deps;
|
|
117232
|
+
const { unread, ...normaliseOptions } = options;
|
|
117233
|
+
const { identifiers, rejected } = normaliseIdentifiers(raw, normaliseOptions);
|
|
117234
|
+
for (const r of rejected) logger.warn("identifier refused — not declared", {
|
|
117235
|
+
tags: { deviceId },
|
|
117236
|
+
meta: {
|
|
117237
|
+
key: r.key,
|
|
117238
|
+
value: r.value,
|
|
117239
|
+
reason: r.reason
|
|
117240
|
+
}
|
|
117241
|
+
});
|
|
117242
|
+
const unreadKinds = new Set(unread ?? []);
|
|
117243
|
+
if (isEmptyIdentifiers(identifiers) && DEVICE_IDENTIFIER_KEYS.every((key) => unreadKinds.has(key))) {
|
|
117244
|
+
logger.debug("no identifier read — nothing declared", { tags: { deviceId } });
|
|
117245
|
+
return {
|
|
117246
|
+
outcome: "nothing-to-declare",
|
|
117247
|
+
identifiers
|
|
117248
|
+
};
|
|
117249
|
+
}
|
|
117250
|
+
if (writer === void 0) {
|
|
117251
|
+
logger.warn("identifiers not declared — device-manager unreachable", { tags: { deviceId } });
|
|
117252
|
+
return {
|
|
117253
|
+
outcome: "unavailable",
|
|
117254
|
+
identifiers
|
|
117255
|
+
};
|
|
117256
|
+
}
|
|
117257
|
+
try {
|
|
117258
|
+
await writer.mutate({
|
|
117259
|
+
deviceId,
|
|
117260
|
+
identifiers,
|
|
117261
|
+
...unread !== void 0 && unread.length > 0 ? { unread } : {}
|
|
117262
|
+
});
|
|
117263
|
+
return {
|
|
117264
|
+
outcome: "declared",
|
|
117265
|
+
identifiers
|
|
117266
|
+
};
|
|
117267
|
+
} catch (err) {
|
|
117268
|
+
logger.warn("identifiers not declared — setIdentifiers failed", {
|
|
117269
|
+
tags: { deviceId },
|
|
117270
|
+
meta: { error: errMsg(err) }
|
|
117271
|
+
});
|
|
117272
|
+
return {
|
|
117273
|
+
outcome: "failed",
|
|
117274
|
+
identifiers
|
|
117275
|
+
};
|
|
117276
|
+
}
|
|
117277
|
+
}
|
|
117278
|
+
/**
|
|
115168
117279
|
* The edge between two readings, or `null` for no edge.
|
|
115169
117280
|
*
|
|
115170
117281
|
* - `null`/cold → `true` is a START (a fault already open at boot is one);
|
|
@@ -115216,6 +117327,8 @@ var BaseDevice = class {
|
|
|
115216
117327
|
id;
|
|
115217
117328
|
stableId;
|
|
115218
117329
|
type;
|
|
117330
|
+
/** True when another process owns the base slices (`options.deviceStatus: 'external'`). */
|
|
117331
|
+
statusIsExternal;
|
|
115219
117332
|
name;
|
|
115220
117333
|
parentDeviceId;
|
|
115221
117334
|
role;
|
|
@@ -115364,21 +117477,26 @@ var BaseDevice = class {
|
|
|
115364
117477
|
};
|
|
115365
117478
|
this.runtimeState = DeviceRuntimeState.fromInitial(initial, writer, onWriteFailed);
|
|
115366
117479
|
ctx.bindRuntimeState?.(this.runtimeState);
|
|
115367
|
-
|
|
115368
|
-
|
|
115369
|
-
|
|
115370
|
-
|
|
115371
|
-
|
|
115372
|
-
|
|
115373
|
-
|
|
115374
|
-
|
|
115375
|
-
|
|
115376
|
-
|
|
115377
|
-
|
|
115378
|
-
|
|
115379
|
-
|
|
115380
|
-
|
|
115381
|
-
|
|
117480
|
+
this.statusIsExternal = options.deviceStatus === "external";
|
|
117481
|
+
if (!this.statusIsExternal) ctx.registerNativeCap?.(deviceStatusCapability, {});
|
|
117482
|
+
if (!this.statusIsExternal) {
|
|
117483
|
+
const seed = {
|
|
117484
|
+
online: true,
|
|
117485
|
+
lastChangedAt: Date.now()
|
|
117486
|
+
};
|
|
117487
|
+
this.runtimeState.setCapState("device-status", seed);
|
|
117488
|
+
}
|
|
117489
|
+
if (!this.statusIsExternal) {
|
|
117490
|
+
ctx.registerNativeCap?.(featureProbeCapability, {});
|
|
117491
|
+
this.runtimeState.setCapState("feature-probe", {
|
|
117492
|
+
flags: {},
|
|
117493
|
+
deviceType: null,
|
|
117494
|
+
model: null,
|
|
117495
|
+
channelCount: null,
|
|
117496
|
+
lastProbedAt: 0,
|
|
117497
|
+
lastFetchedAt: 0
|
|
117498
|
+
});
|
|
117499
|
+
}
|
|
115382
117500
|
}
|
|
115383
117501
|
deviceActions = /* @__PURE__ */ new Map();
|
|
115384
117502
|
/** Declare a device custom action + its typed handler. Idempotent per name. */
|
|
@@ -115406,7 +117524,7 @@ var BaseDevice = class {
|
|
|
115406
117524
|
* override to gate side effects on the transition.
|
|
115407
117525
|
*/
|
|
115408
117526
|
markOnline(online) {
|
|
115409
|
-
if (this.online === online) return;
|
|
117527
|
+
if (this.statusIsExternal || this.online === online) return;
|
|
115410
117528
|
const next = {
|
|
115411
117529
|
online,
|
|
115412
117530
|
lastChangedAt: Date.now()
|
|
@@ -115476,6 +117594,24 @@ var BaseDevice = class {
|
|
|
115476
117594
|
}));
|
|
115477
117595
|
}
|
|
115478
117596
|
/**
|
|
117597
|
+
* Declare this device's identifiers (D1059): MAC(s), serial, vendor uid,
|
|
117598
|
+
* machine uuid, hostname, IP — what a later step matches across integrations.
|
|
117599
|
+
* Normalises `raw` (`normaliseIdentifiers`), logs every refused value, and
|
|
117600
|
+
* writes the result through `device-manager.setIdentifiers`, which accepts it
|
|
117601
|
+
* only from the provider that owns this device. Each kind it carries replaces
|
|
117602
|
+
* the stored one and each kind it lacks is removed — except the kinds listed in
|
|
117603
|
+
* `options.unread` (reads that FAILED), which keep their stored value. Pass
|
|
117604
|
+
* everything read in one call; a call where every kind is unread writes
|
|
117605
|
+
* nothing. Best-effort: never throws.
|
|
117606
|
+
*/
|
|
117607
|
+
async declareIdentifiers(raw, options) {
|
|
117608
|
+
return declareDeviceIdentifiers({
|
|
117609
|
+
deviceId: this.id,
|
|
117610
|
+
logger: this.ctx.logger,
|
|
117611
|
+
writer: this.ctx.api.deviceManager?.setIdentifiers
|
|
117612
|
+
}, raw, options);
|
|
117613
|
+
}
|
|
117614
|
+
/**
|
|
115479
117615
|
* Re-publish the device's current `features` array to the persisted
|
|
115480
117616
|
* meta blob. Drivers call this after a probe finishes when the live
|
|
115481
117617
|
* `features` getter has gained new flags (e.g. `hasIntercom` flips
|
|
@@ -115680,6 +117816,7 @@ var BaseDevice = class {
|
|
|
115680
117816
|
* `lastProbedAt`) once their probe actually succeeds.
|
|
115681
117817
|
*/
|
|
115682
117818
|
async onProbe() {
|
|
117819
|
+
if (this.statusIsExternal) return;
|
|
115683
117820
|
const base = this.runtimeState.getCapState("feature-probe") ?? {
|
|
115684
117821
|
flags: {},
|
|
115685
117822
|
deviceType: null,
|
|
@@ -116096,289 +118233,7 @@ function legacyAutoLinkIds(params) {
|
|
|
116096
118233
|
ids.delete(selfId);
|
|
116097
118234
|
return [...ids];
|
|
116098
118235
|
}
|
|
116099
|
-
|
|
116100
|
-
var DECLARED_INTEGRATION_FIXED_KEY = "fixed";
|
|
116101
|
-
/**
|
|
116102
|
-
* Give a declared integration its instance record, ONCE. The record is read first and left
|
|
116103
|
-
* exactly as it is when it exists (an operator's rename, a field the addon later adds): a seed
|
|
116104
|
-
* never overwrites. A read that fails throws and writes nothing (D49) — the next pass retries.
|
|
116105
|
-
* True when the record was written by this call.
|
|
116106
|
-
*/
|
|
116107
|
-
async function seedInstanceOnce(instances, seed) {
|
|
116108
|
-
const existing = await instances.getInstance({ id: seed.id });
|
|
116109
|
-
if (existing !== null && existing !== void 0) return false;
|
|
116110
|
-
await instances.createInstance({
|
|
116111
|
-
id: seed.id,
|
|
116112
|
-
name: seed.name
|
|
116113
|
-
});
|
|
116114
|
-
return true;
|
|
116115
|
-
}
|
|
116116
|
-
/**
|
|
116117
|
-
* Strip the `<node>/<addon>` suffix a forked child carries.
|
|
116118
|
-
*
|
|
116119
|
-
* Comparing `ctx.kernel.localNodeId` raw skipped EVERY node — including the one
|
|
116120
|
-
* that was supposed to act — because on the hub it reads `hub/<addon>`.
|
|
116121
|
-
*/
|
|
116122
|
-
function declarationOwnerNodeId(localNodeId) {
|
|
116123
|
-
const raw = localNodeId ?? "hub";
|
|
116124
|
-
if (!raw.includes("/")) return raw;
|
|
116125
|
-
return raw.split("/")[0] ?? "hub";
|
|
116126
|
-
}
|
|
116127
|
-
/**
|
|
116128
|
-
* The one way an addon owns a device it declares.
|
|
116129
|
-
*
|
|
116130
|
-
* Construct once with the addon's ports, then call {@link reconcile} on boot and
|
|
116131
|
-
* on every convergence tick. There is no second get-or-create helper — a guard
|
|
116132
|
-
* in `scripts/` enforces that.
|
|
116133
|
-
*/
|
|
116134
|
-
var DeclaredDevices = class {
|
|
116135
|
-
ports;
|
|
116136
|
-
constructor(ports) {
|
|
116137
|
-
const addonId = ports.addonId;
|
|
116138
|
-
if (typeof addonId !== "string" || addonId.length === 0) throw new Error(`DeclaredDevices: addonId must be the declaring addon's id, got ${JSON.stringify(addonId)}. On an addon context it is \`ctx.id\` — there is no \`ctx.addonId\`.`);
|
|
116139
|
-
this.ports = ports;
|
|
116140
|
-
}
|
|
116141
|
-
/**
|
|
116142
|
-
* Converge the declared set. Idempotent, and safe to call repeatedly.
|
|
116143
|
-
*
|
|
116144
|
-
* Throws only what the ports throw on the FIRST index read; every other
|
|
116145
|
-
* failure is per-device and logged, so one bad declaration never takes the
|
|
116146
|
-
* others down.
|
|
116147
|
-
*/
|
|
116148
|
-
async reconcile(spec) {
|
|
116149
|
-
if ((spec.placement ?? "hub") === "hub") {
|
|
116150
|
-
const nodeId = declarationOwnerNodeId(this.ports.localNodeId);
|
|
116151
|
-
if (nodeId !== "hub") {
|
|
116152
|
-
this.ports.logger.info("declared devices are hub-owned — skipping on this node", { meta: {
|
|
116153
|
-
nodeId,
|
|
116154
|
-
rawNodeId: this.ports.localNodeId ?? null
|
|
116155
|
-
} });
|
|
116156
|
-
return {
|
|
116157
|
-
integrationId: null,
|
|
116158
|
-
devices: [],
|
|
116159
|
-
removed: [],
|
|
116160
|
-
owned: false
|
|
116161
|
-
};
|
|
116162
|
-
}
|
|
116163
|
-
}
|
|
116164
|
-
let integrationId;
|
|
116165
|
-
if (spec.integrationId !== void 0) integrationId = spec.integrationId;
|
|
116166
|
-
else {
|
|
116167
|
-
const own = await this.ensureIntegration(spec.integrationName);
|
|
116168
|
-
integrationId = own.id;
|
|
116169
|
-
await this.seedInstance(own);
|
|
116170
|
-
}
|
|
116171
|
-
const index = await this.readIndex();
|
|
116172
|
-
const live = await this.readLiveByStableId();
|
|
116173
|
-
const outcomes = [];
|
|
116174
|
-
for (const declaration of spec.devices) {
|
|
116175
|
-
const outcome = await this.applyDeclaration(declaration, integrationId, index, live);
|
|
116176
|
-
if (outcome !== null) outcomes.push(outcome);
|
|
116177
|
-
}
|
|
116178
|
-
const removed = await this.sweepWithdrawn(spec.devices, integrationId, index);
|
|
116179
|
-
return {
|
|
116180
|
-
integrationId,
|
|
116181
|
-
devices: outcomes,
|
|
116182
|
-
removed,
|
|
116183
|
-
owned: true
|
|
116184
|
-
};
|
|
116185
|
-
}
|
|
116186
|
-
/**
|
|
116187
|
-
* Get-or-create the FIXED integration, and RE-ASSERT the flag every pass.
|
|
116188
|
-
*
|
|
116189
|
-
* The re-assertion is the fix for the defect the hand-rolled version shipped
|
|
116190
|
-
* with: writing `info.fixed` only on the create path left every pre-existing
|
|
116191
|
-
* install without it, and the kernel kept offering to delete an integration
|
|
116192
|
-
* the addon owns.
|
|
116193
|
-
*/
|
|
116194
|
-
async ensureIntegration(integrationName) {
|
|
116195
|
-
const existing = await this.ports.getIntegration(this.ports.addonId);
|
|
116196
|
-
if (existing === null) {
|
|
116197
|
-
const created = await this.ports.createIntegration({
|
|
116198
|
-
addonId: this.ports.addonId,
|
|
116199
|
-
name: integrationName,
|
|
116200
|
-
info: { [DECLARED_INTEGRATION_FIXED_KEY]: true }
|
|
116201
|
-
});
|
|
116202
|
-
this.ports.logger.info("declared a fixed integration", { meta: {
|
|
116203
|
-
integrationId: created.id,
|
|
116204
|
-
name: integrationName
|
|
116205
|
-
} });
|
|
116206
|
-
return {
|
|
116207
|
-
id: created.id,
|
|
116208
|
-
name: integrationName
|
|
116209
|
-
};
|
|
116210
|
-
}
|
|
116211
|
-
if (existing.info?.["fixed"] !== true) {
|
|
116212
|
-
await this.ports.updateIntegration({
|
|
116213
|
-
id: existing.id,
|
|
116214
|
-
info: { [DECLARED_INTEGRATION_FIXED_KEY]: true }
|
|
116215
|
-
});
|
|
116216
|
-
this.ports.logger.info("re-asserted `fixed` on a declared integration", { meta: { integrationId: existing.id } });
|
|
116217
|
-
}
|
|
116218
|
-
return {
|
|
116219
|
-
id: existing.id,
|
|
116220
|
-
name: existing.name ?? integrationName
|
|
116221
|
-
};
|
|
116222
|
-
}
|
|
116223
|
-
/** Seed the instance record of an integration this declarer owns; best-effort, retried next pass. */
|
|
116224
|
-
async seedInstance(integration) {
|
|
116225
|
-
const { seedInstance } = this.ports;
|
|
116226
|
-
if (seedInstance === void 0) return;
|
|
116227
|
-
try {
|
|
116228
|
-
await seedInstance({
|
|
116229
|
-
id: integration.id,
|
|
116230
|
-
name: integration.name
|
|
116231
|
-
});
|
|
116232
|
-
} catch (err) {
|
|
116233
|
-
this.ports.logger.warn("could not seed the instance record of a declared integration", {
|
|
116234
|
-
tags: { integrationId: integration.id },
|
|
116235
|
-
meta: { error: errMsg(err) }
|
|
116236
|
-
});
|
|
116237
|
-
}
|
|
116238
|
-
}
|
|
116239
|
-
async readIndex() {
|
|
116240
|
-
const rows = await this.ports.listOwnDevices();
|
|
116241
|
-
return new Map(rows.map((row) => [row.stableId, row]));
|
|
116242
|
-
}
|
|
116243
|
-
/**
|
|
116244
|
-
* Devices this kernel already has CONSTRUCTED, by stableId.
|
|
116245
|
-
*
|
|
116246
|
-
* Distinct from {@link readIndex}, and the distinction is the bug: the index
|
|
116247
|
-
* is persisted rows, this is live objects. A row without an object must be
|
|
116248
|
-
* adopted; an object must be left exactly as it is.
|
|
116249
|
-
*
|
|
116250
|
-
* Failure is non-fatal and deliberately so — an empty map degrades to the
|
|
116251
|
-
* previous behaviour (attempt the adopt) rather than skipping a device that
|
|
116252
|
-
* genuinely needs bringing up.
|
|
116253
|
-
*/
|
|
116254
|
-
async readLiveByStableId() {
|
|
116255
|
-
try {
|
|
116256
|
-
const devices = await this.ports.devices.getAll();
|
|
116257
|
-
return new Map(devices.map((device) => [device.stableId, device]));
|
|
116258
|
-
} catch (err) {
|
|
116259
|
-
this.ports.logger.warn("could not read live devices — falling back to adopt-by-row", { meta: { error: err instanceof Error ? err.message : String(err) } });
|
|
116260
|
-
return /* @__PURE__ */ new Map();
|
|
116261
|
-
}
|
|
116262
|
-
}
|
|
116263
|
-
/**
|
|
116264
|
-
* One declaration: adopt what exists, create what does not.
|
|
116265
|
-
*
|
|
116266
|
-
* The create branch is the destructive one — it seeds `initialMeta`, and
|
|
116267
|
-
* `initialMeta.name` lands as an unconditional `setName`. A transiently empty
|
|
116268
|
-
* index therefore looks exactly like a first boot and would silently re-stamp
|
|
116269
|
-
* the declared name over the operator's rename. D49: that branch needs a
|
|
116270
|
-
* second read to agree.
|
|
116271
|
-
*/
|
|
116272
|
-
async applyDeclaration(declaration, integrationId, index, live) {
|
|
116273
|
-
try {
|
|
116274
|
-
const alreadyLive = live.get(declaration.stableId);
|
|
116275
|
-
if (alreadyLive !== void 0) return {
|
|
116276
|
-
stableId: declaration.stableId,
|
|
116277
|
-
deviceId: alreadyLive.id,
|
|
116278
|
-
device: alreadyLive,
|
|
116279
|
-
created: false
|
|
116280
|
-
};
|
|
116281
|
-
let existing = index.get(declaration.stableId);
|
|
116282
|
-
if (existing === void 0) {
|
|
116283
|
-
existing = (await this.readIndex()).get(declaration.stableId);
|
|
116284
|
-
if (existing !== void 0) this.ports.logger.warn("device index disagreed with itself — adopting instead of re-creating", {
|
|
116285
|
-
tags: { deviceId: existing.id },
|
|
116286
|
-
meta: {
|
|
116287
|
-
stableId: declaration.stableId,
|
|
116288
|
-
addonId: this.ports.addonId
|
|
116289
|
-
}
|
|
116290
|
-
});
|
|
116291
|
-
}
|
|
116292
|
-
if (existing !== void 0) {
|
|
116293
|
-
const device = await this.ports.devices.create(declaration.stableId, declaration.DeviceClass, {}, null, void 0);
|
|
116294
|
-
this.ports.logger.info("declared device adopted", {
|
|
116295
|
-
tags: { deviceId: device.id },
|
|
116296
|
-
meta: {
|
|
116297
|
-
stableId: declaration.stableId,
|
|
116298
|
-
integrationId
|
|
116299
|
-
}
|
|
116300
|
-
});
|
|
116301
|
-
return {
|
|
116302
|
-
stableId: declaration.stableId,
|
|
116303
|
-
deviceId: device.id,
|
|
116304
|
-
device,
|
|
116305
|
-
created: false
|
|
116306
|
-
};
|
|
116307
|
-
}
|
|
116308
|
-
const device = await this.ports.devices.create(declaration.stableId, declaration.DeviceClass, declaration.config ?? {}, null, {
|
|
116309
|
-
type: declaration.type,
|
|
116310
|
-
name: declaration.name,
|
|
116311
|
-
integrationId,
|
|
116312
|
-
...declaration.role === void 0 ? {} : { role: declaration.role }
|
|
116313
|
-
});
|
|
116314
|
-
this.ports.logger.info("declared device created", {
|
|
116315
|
-
tags: { deviceId: device.id },
|
|
116316
|
-
meta: {
|
|
116317
|
-
stableId: declaration.stableId,
|
|
116318
|
-
integrationId
|
|
116319
|
-
}
|
|
116320
|
-
});
|
|
116321
|
-
return {
|
|
116322
|
-
stableId: declaration.stableId,
|
|
116323
|
-
deviceId: device.id,
|
|
116324
|
-
device,
|
|
116325
|
-
created: true
|
|
116326
|
-
};
|
|
116327
|
-
} catch (err) {
|
|
116328
|
-
this.ports.logger.warn("a declared device could not be brought up", { meta: {
|
|
116329
|
-
stableId: declaration.stableId,
|
|
116330
|
-
error: err instanceof Error ? err.message : String(err)
|
|
116331
|
-
} });
|
|
116332
|
-
return null;
|
|
116333
|
-
}
|
|
116334
|
-
}
|
|
116335
|
-
/**
|
|
116336
|
-
* Remove rows under the addon's FIXED integration whose declaration is gone.
|
|
116337
|
-
*
|
|
116338
|
-
* Bounded to that integration: a declared integration has no operator
|
|
116339
|
-
* add-flow, so every row under it got there by declaration. Devices this
|
|
116340
|
-
* addon owns OUTSIDE it (a provider's adopted devices) are never candidates.
|
|
116341
|
-
*
|
|
116342
|
-
* Bounded in count, and every deletion is logged with its `deviceId` — a
|
|
116343
|
-
* withdrawal that removes an operator-visible row silently is the failure
|
|
116344
|
-
* mode, not the removal itself.
|
|
116345
|
-
*/
|
|
116346
|
-
async sweepWithdrawn(declarations, integrationId, index) {
|
|
116347
|
-
const declared = new Set(declarations.map((d) => d.stableId));
|
|
116348
|
-
const candidates = [...index.values()].filter((row) => row.integrationId === integrationId && !declared.has(row.stableId));
|
|
116349
|
-
if (candidates.length === 0) return [];
|
|
116350
|
-
if (candidates.length > 32) {
|
|
116351
|
-
this.ports.logger.warn("withdrawal sweep exceeded its bound — removing nothing", { meta: {
|
|
116352
|
-
integrationId,
|
|
116353
|
-
candidates: candidates.length,
|
|
116354
|
-
bound: 32
|
|
116355
|
-
} });
|
|
116356
|
-
return [];
|
|
116357
|
-
}
|
|
116358
|
-
const removed = [];
|
|
116359
|
-
for (const row of candidates) try {
|
|
116360
|
-
await this.ports.devices.remove(row.id);
|
|
116361
|
-
removed.push(row.id);
|
|
116362
|
-
this.ports.logger.info("declared device removed — its declaration was withdrawn", {
|
|
116363
|
-
tags: { deviceId: row.id },
|
|
116364
|
-
meta: {
|
|
116365
|
-
stableId: row.stableId,
|
|
116366
|
-
integrationId
|
|
116367
|
-
}
|
|
116368
|
-
});
|
|
116369
|
-
} catch (err) {
|
|
116370
|
-
this.ports.logger.warn("a withdrawn declared device could not be removed", {
|
|
116371
|
-
tags: { deviceId: row.id },
|
|
116372
|
-
meta: {
|
|
116373
|
-
stableId: row.stableId,
|
|
116374
|
-
error: err instanceof Error ? err.message : String(err)
|
|
116375
|
-
}
|
|
116376
|
-
});
|
|
116377
|
-
}
|
|
116378
|
-
return removed;
|
|
116379
|
-
}
|
|
116380
|
-
};
|
|
116381
|
-
DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Camera, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
|
|
118236
|
+
DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Workload, DeviceType.Camera, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
|
|
116382
118237
|
new Set(Object.values(DeviceType));
|
|
116383
118238
|
/** True when a value is a navigable node: a plain object OR a tRPC v11 client
|
|
116384
118239
|
* proxy node (a callable `Proxy(noop)` → `typeof === 'function'`, NOT an
|
|
@@ -118640,10 +120495,12 @@ function durationText(seconds) {
|
|
|
118640
120495
|
const text = `${Math.floor(m / 60)} h ${String(m % 60).padStart(2, "0")}`;
|
|
118641
120496
|
return t(text, text);
|
|
118642
120497
|
}
|
|
118643
|
-
var switchContribution = contribution("switch", SwitchStatusSchema, (slice) => {
|
|
120498
|
+
var switchContribution = contribution("switch", SwitchStatusSchema, (slice, ctx) => {
|
|
118644
120499
|
const on = slice?.on ?? null;
|
|
120500
|
+
const state = reading("switch", on === null ? "unknown" : on ? "on" : "off");
|
|
120501
|
+
if (ctx.switchOptions?.supportsSetState === false) return { reading: state };
|
|
118645
120502
|
return {
|
|
118646
|
-
reading:
|
|
120503
|
+
reading: state,
|
|
118647
120504
|
ownPower: {
|
|
118648
120505
|
source: "switch",
|
|
118649
120506
|
on,
|
|
@@ -118853,14 +120710,17 @@ var timedRunContribution = contribution("timed-run", TimedRunStatusSchema, (slic
|
|
|
118853
120710
|
tiles: armed
|
|
118854
120711
|
};
|
|
118855
120712
|
});
|
|
118856
|
-
var powerSourceContribution = contribution("power-source", PowerSourceStateSchema, (slice, ctx) =>
|
|
118857
|
-
|
|
118858
|
-
|
|
118859
|
-
|
|
118860
|
-
|
|
118861
|
-
|
|
118862
|
-
|
|
118863
|
-
}
|
|
120713
|
+
var powerSourceContribution = contribution("power-source", PowerSourceStateSchema, (slice, ctx) => {
|
|
120714
|
+
const settable = ctx.powerSupplySettable !== false;
|
|
120715
|
+
return { powerSupply: {
|
|
120716
|
+
on: slice?.switchOn ?? null,
|
|
120717
|
+
confirmOffWhileRunning: ctx.running === true,
|
|
120718
|
+
running: ctx.running ?? null,
|
|
120719
|
+
powerOn: settable ? action("power-supply.on", t("Power on", "Alimenta"), "plug", "power-source", "powerOn") : null,
|
|
120720
|
+
powerOff: settable ? action("power-supply.off", t("Power off", "Togli alimentazione"), "plug-zap", "power-source", "powerOff", {}, "normal", "off-while-running") : null,
|
|
120721
|
+
restart: action("power-supply.restart", t("Restart", "Riavvia"), "rotate-cw", "power-source", "forceRestart")
|
|
120722
|
+
} };
|
|
120723
|
+
});
|
|
118864
120724
|
/** The remote cap has no status: the model's input carries how many commands it holds. */
|
|
118865
120725
|
var remoteContribution = {
|
|
118866
120726
|
cap: "remote",
|
|
@@ -119277,6 +121137,7 @@ var HERO_LAYOUT_BY_TYPE = {
|
|
|
119277
121137
|
[DeviceType.WaterHeater]: CLIMATE_LAYOUT,
|
|
119278
121138
|
[DeviceType.HeatPump]: HEAT_PUMP_LAYOUT,
|
|
119279
121139
|
[DeviceType.EnergySystem]: HERO_LAYOUT_DEFAULT,
|
|
121140
|
+
[DeviceType.Workload]: HERO_LAYOUT_DEFAULT,
|
|
119280
121141
|
[DeviceType.Fan]: FAN_LAYOUT,
|
|
119281
121142
|
[DeviceType.MediaPlayer]: MEDIA_PLAYER_LAYOUT,
|
|
119282
121143
|
[DeviceType.AlarmPanel]: ALARM_LAYOUT,
|
|
@@ -120001,6 +121862,7 @@ var HERO_LOOK_BY_TYPE = {
|
|
|
120001
121862
|
[DeviceType.WaterHeater]: WATER_HEATER_LOOK,
|
|
120002
121863
|
[DeviceType.HeatPump]: HEAT_PUMP_LOOK,
|
|
120003
121864
|
[DeviceType.EnergySystem]: HERO_LOOK_DEFAULT,
|
|
121865
|
+
[DeviceType.Workload]: HERO_LOOK_DEFAULT,
|
|
120004
121866
|
[DeviceType.Fan]: FAN_LOOK,
|
|
120005
121867
|
[DeviceType.MediaPlayer]: MEDIA_PLAYER_LOOK,
|
|
120006
121868
|
[DeviceType.AlarmPanel]: ALARM_LOOK,
|
|
@@ -120043,6 +121905,7 @@ var HERO_LOOK_BY_ROLE = {
|
|
|
120043
121905
|
[DeviceRole.SwitchHeater]: HEATER_LOOK,
|
|
120044
121906
|
[DeviceRole.SwitchFan]: FAN_LOOK,
|
|
120045
121907
|
[DeviceRole.SwitchLight]: LIGHT_LOOK,
|
|
121908
|
+
[DeviceRole.PoePort]: "inherit",
|
|
120046
121909
|
[DeviceRole.ClimateAc]: "inherit",
|
|
120047
121910
|
[DeviceRole.ClimateThermostat]: "inherit",
|
|
120048
121911
|
[DeviceRole.ClimateFloor]: "inherit",
|
|
@@ -120087,7 +121950,12 @@ var HERO_LOOK_BY_ROLE = {
|
|
|
120087
121950
|
[DeviceRole.MessagingNotifier]: "inherit",
|
|
120088
121951
|
[DeviceRole.EmailNotifier]: "inherit",
|
|
120089
121952
|
[DeviceRole.GenericNotifier]: "inherit",
|
|
120090
|
-
[DeviceRole.IrTransmitter]: "inherit"
|
|
121953
|
+
[DeviceRole.IrTransmitter]: "inherit",
|
|
121954
|
+
[DeviceRole.Vm]: "inherit",
|
|
121955
|
+
[DeviceRole.AppContainer]: "inherit",
|
|
121956
|
+
[DeviceRole.Lxc]: "inherit",
|
|
121957
|
+
[DeviceRole.App]: "inherit",
|
|
121958
|
+
[DeviceRole.Host]: "inherit"
|
|
120091
121959
|
};
|
|
120092
121960
|
function isDeviceType$1(type) {
|
|
120093
121961
|
return Object.values(DeviceType).includes(type);
|
|
@@ -120122,16 +121990,6 @@ function resolveOwnPower(offers) {
|
|
|
120122
121990
|
}
|
|
120123
121991
|
return null;
|
|
120124
121992
|
}
|
|
120125
|
-
/**
|
|
120126
|
-
* `buildHeroModel` — the ONE pure function behind every device hero (D1023).
|
|
120127
|
-
* The admin device page, the admin quick-detail dialog and the viewer's device
|
|
120128
|
-
* screen all draw what it returns; none of them decides anything.
|
|
120129
|
-
*
|
|
120130
|
-
* Inputs are the device, the caps it is bound to (`getBindings`, per device —
|
|
120131
|
-
* never the global cap list, D12), its features and one raw slice per cap. A
|
|
120132
|
-
* slice that is missing or does not parse is "not answered": unknown is never
|
|
120133
|
-
* off (D315/D393), a heater whose switch has not reported renders `unknown`.
|
|
120134
|
-
*/
|
|
120135
121993
|
/** The first source with a known answer wins. */
|
|
120136
121994
|
var STATE_SOURCE_ORDER = [
|
|
120137
121995
|
"media-player",
|
|
@@ -120297,7 +122155,9 @@ function buildHeroModel(input) {
|
|
|
120297
122155
|
running: runningOf(input),
|
|
120298
122156
|
remoteCommands: input.remoteCommands,
|
|
120299
122157
|
caps: input.caps,
|
|
120300
|
-
quantity: device.quantity ?? null
|
|
122158
|
+
quantity: device.quantity ?? null,
|
|
122159
|
+
...input.switchOptions !== void 0 ? { switchOptions: input.switchOptions } : {},
|
|
122160
|
+
...input.powerSupplySettable !== void 0 ? { powerSupplySettable: input.powerSupplySettable } : {}
|
|
120301
122161
|
};
|
|
120302
122162
|
const contributed = HERO_CAP_CONTRIBUTIONS.filter((c) => input.caps.includes(c.cap)).map((c) => ({
|
|
120303
122163
|
cap: c.cap,
|
|
@@ -123046,6 +124906,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
123046
124906
|
access: "create",
|
|
123047
124907
|
role: "admin"
|
|
123048
124908
|
},
|
|
124909
|
+
"deviceManager.setIdentifiers": {
|
|
124910
|
+
capName: "device-manager",
|
|
124911
|
+
capScope: "system",
|
|
124912
|
+
addonId: null,
|
|
124913
|
+
access: "create",
|
|
124914
|
+
role: "admin"
|
|
124915
|
+
},
|
|
123049
124916
|
"deviceManager.setIntegrationId": {
|
|
123050
124917
|
capName: "device-manager",
|
|
123051
124918
|
capScope: "system",
|
|
@@ -125930,6 +127797,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
125930
127797
|
access: "view",
|
|
125931
127798
|
role: "admin"
|
|
125932
127799
|
},
|
|
127800
|
+
"notificationRules.listRuleTags": {
|
|
127801
|
+
capName: "notification-rules",
|
|
127802
|
+
capScope: "system",
|
|
127803
|
+
addonId: null,
|
|
127804
|
+
access: "view",
|
|
127805
|
+
role: "admin"
|
|
127806
|
+
},
|
|
125933
127807
|
"notificationRules.listSnoozes": {
|
|
125934
127808
|
capName: "notification-rules",
|
|
125935
127809
|
capScope: "system",
|
|
@@ -125986,6 +127860,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
125986
127860
|
access: "create",
|
|
125987
127861
|
role: "admin"
|
|
125988
127862
|
},
|
|
127863
|
+
"notificationRules.setRuleTags": {
|
|
127864
|
+
capName: "notification-rules",
|
|
127865
|
+
capScope: "system",
|
|
127866
|
+
addonId: null,
|
|
127867
|
+
access: "create",
|
|
127868
|
+
role: "admin"
|
|
127869
|
+
},
|
|
125989
127870
|
"notificationRules.testRule": {
|
|
125990
127871
|
capName: "notification-rules",
|
|
125991
127872
|
capScope: "system",
|
|
@@ -128954,6 +130835,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
128954
130835
|
access: "view",
|
|
128955
130836
|
role: "viewer"
|
|
128956
130837
|
},
|
|
130838
|
+
"siren.getPlayChoices": {
|
|
130839
|
+
capName: "siren",
|
|
130840
|
+
capScope: "device",
|
|
130841
|
+
addonId: null,
|
|
130842
|
+
access: "view",
|
|
130843
|
+
role: "viewer"
|
|
130844
|
+
},
|
|
128957
130845
|
"siren.getStatus": {
|
|
128958
130846
|
capName: "siren",
|
|
128959
130847
|
capScope: "device",
|
|
@@ -129766,6 +131654,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
129766
131654
|
access: "view",
|
|
129767
131655
|
role: "viewer"
|
|
129768
131656
|
},
|
|
131657
|
+
"switch.getOptions": {
|
|
131658
|
+
capName: "switch",
|
|
131659
|
+
capScope: "device",
|
|
131660
|
+
addonId: null,
|
|
131661
|
+
access: "view",
|
|
131662
|
+
role: "viewer"
|
|
131663
|
+
},
|
|
129769
131664
|
"switch.getStatus": {
|
|
129770
131665
|
capName: "switch",
|
|
129771
131666
|
capScope: "device",
|
|
@@ -129773,6 +131668,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
129773
131668
|
access: "view",
|
|
129774
131669
|
role: "viewer"
|
|
129775
131670
|
},
|
|
131671
|
+
"switch.powerCycle": {
|
|
131672
|
+
capName: "switch",
|
|
131673
|
+
capScope: "device",
|
|
131674
|
+
addonId: null,
|
|
131675
|
+
access: "create",
|
|
131676
|
+
role: "viewer"
|
|
131677
|
+
},
|
|
129776
131678
|
"switch.setState": {
|
|
129777
131679
|
capName: "switch",
|
|
129778
131680
|
capScope: "device",
|
|
@@ -129976,13 +131878,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
129976
131878
|
access: "create",
|
|
129977
131879
|
role: "admin"
|
|
129978
131880
|
},
|
|
129979
|
-
"terminalSession.adoptLegacyMonitor": {
|
|
129980
|
-
capName: "terminal-session",
|
|
129981
|
-
capScope: "system",
|
|
129982
|
-
addonId: null,
|
|
129983
|
-
access: "create",
|
|
129984
|
-
role: "admin"
|
|
129985
|
-
},
|
|
129986
131881
|
"terminalSession.close": {
|
|
129987
131882
|
capName: "terminal-session",
|
|
129988
131883
|
capScope: "system",
|
|
@@ -129990,13 +131885,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
129990
131885
|
access: "create",
|
|
129991
131886
|
role: "admin"
|
|
129992
131887
|
},
|
|
129993
|
-
"terminalSession.listLegacyCameras": {
|
|
129994
|
-
capName: "terminal-session",
|
|
129995
|
-
capScope: "system",
|
|
129996
|
-
addonId: null,
|
|
129997
|
-
access: "view",
|
|
129998
|
-
role: "admin"
|
|
129999
|
-
},
|
|
130000
131888
|
"terminalSession.listProfiles": {
|
|
130001
131889
|
capName: "terminal-session",
|
|
130002
131890
|
capScope: "system",
|
|
@@ -130858,6 +132746,62 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
130858
132746
|
access: "view",
|
|
130859
132747
|
role: "viewer"
|
|
130860
132748
|
},
|
|
132749
|
+
"workload.forceStop": {
|
|
132750
|
+
capName: "workload",
|
|
132751
|
+
capScope: "device",
|
|
132752
|
+
addonId: null,
|
|
132753
|
+
access: "create",
|
|
132754
|
+
role: "admin"
|
|
132755
|
+
},
|
|
132756
|
+
"workload.getOptions": {
|
|
132757
|
+
capName: "workload",
|
|
132758
|
+
capScope: "device",
|
|
132759
|
+
addonId: null,
|
|
132760
|
+
access: "view",
|
|
132761
|
+
role: "viewer"
|
|
132762
|
+
},
|
|
132763
|
+
"workload.getStatus": {
|
|
132764
|
+
capName: "workload",
|
|
132765
|
+
capScope: "device",
|
|
132766
|
+
addonId: null,
|
|
132767
|
+
access: "view",
|
|
132768
|
+
role: "viewer"
|
|
132769
|
+
},
|
|
132770
|
+
"workload.pause": {
|
|
132771
|
+
capName: "workload",
|
|
132772
|
+
capScope: "device",
|
|
132773
|
+
addonId: null,
|
|
132774
|
+
access: "create",
|
|
132775
|
+
role: "viewer"
|
|
132776
|
+
},
|
|
132777
|
+
"workload.restart": {
|
|
132778
|
+
capName: "workload",
|
|
132779
|
+
capScope: "device",
|
|
132780
|
+
addonId: null,
|
|
132781
|
+
access: "create",
|
|
132782
|
+
role: "viewer"
|
|
132783
|
+
},
|
|
132784
|
+
"workload.resume": {
|
|
132785
|
+
capName: "workload",
|
|
132786
|
+
capScope: "device",
|
|
132787
|
+
addonId: null,
|
|
132788
|
+
access: "create",
|
|
132789
|
+
role: "viewer"
|
|
132790
|
+
},
|
|
132791
|
+
"workload.start": {
|
|
132792
|
+
capName: "workload",
|
|
132793
|
+
capScope: "device",
|
|
132794
|
+
addonId: null,
|
|
132795
|
+
access: "create",
|
|
132796
|
+
role: "viewer"
|
|
132797
|
+
},
|
|
132798
|
+
"workload.stop": {
|
|
132799
|
+
capName: "workload",
|
|
132800
|
+
capScope: "device",
|
|
132801
|
+
addonId: null,
|
|
132802
|
+
access: "create",
|
|
132803
|
+
role: "viewer"
|
|
132804
|
+
},
|
|
130861
132805
|
"zoneAnalytics.getCameraHistory": {
|
|
130862
132806
|
capName: "zone-analytics",
|
|
130863
132807
|
capScope: "device",
|
|
@@ -130984,7 +132928,8 @@ function resolveAction(cap, action, wordings) {
|
|
|
130984
132928
|
icon: w.icon ?? action.icon,
|
|
130985
132929
|
args: action.args ?? {},
|
|
130986
132930
|
openArgs: action.openArgs ?? [],
|
|
130987
|
-
access
|
|
132931
|
+
access,
|
|
132932
|
+
offeredWhen: action.offeredWhen ?? null
|
|
130988
132933
|
};
|
|
130989
132934
|
}
|
|
130990
132935
|
/**
|
|
@@ -131227,8 +133172,8 @@ function offered(received) {
|
|
|
131227
133172
|
};
|
|
131228
133173
|
}
|
|
131229
133174
|
offered(HA_AS), withheld(HOMEKIT_REASON), withheld(ALEXA_REASON), withheld(GOOGLE_REASON), withheld(MATTER_REASON);
|
|
131230
|
-
DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
|
|
131231
|
-
DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
|
|
133175
|
+
DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Workload, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
|
|
133176
|
+
DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.PoePort, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter, DeviceRole.Vm, DeviceRole.AppContainer, DeviceRole.Lxc, DeviceRole.App, DeviceRole.Host;
|
|
131232
133177
|
new Set(Object.values(DeviceType));
|
|
131233
133178
|
new Set(Object.values(DeviceRole));
|
|
131234
133179
|
/**
|
|
@@ -131323,7 +133268,8 @@ var CAP_NAMES_WITH_STATUS = [
|
|
|
131323
133268
|
"vibration",
|
|
131324
133269
|
"water-heater",
|
|
131325
133270
|
"weather",
|
|
131326
|
-
"weather-station"
|
|
133271
|
+
"weather-station",
|
|
133272
|
+
"workload"
|
|
131327
133273
|
];
|
|
131328
133274
|
Object.freeze({
|
|
131329
133275
|
"accessories.getStatus": [{
|
|
@@ -132024,6 +133970,11 @@ Object.freeze({
|
|
|
132024
133970
|
form: "single",
|
|
132025
133971
|
optional: false
|
|
132026
133972
|
}],
|
|
133973
|
+
"deviceManager.setIdentifiers": [{
|
|
133974
|
+
name: "deviceId",
|
|
133975
|
+
form: "single",
|
|
133976
|
+
optional: false
|
|
133977
|
+
}],
|
|
132027
133978
|
"deviceManager.setIntegrationId": [{
|
|
132028
133979
|
name: "deviceId",
|
|
132029
133980
|
form: "single",
|
|
@@ -134018,6 +135969,11 @@ Object.freeze({
|
|
|
134018
135969
|
form: "single",
|
|
134019
135970
|
optional: false
|
|
134020
135971
|
}],
|
|
135972
|
+
"siren.getPlayChoices": [{
|
|
135973
|
+
name: "deviceId",
|
|
135974
|
+
form: "single",
|
|
135975
|
+
optional: false
|
|
135976
|
+
}],
|
|
134021
135977
|
"siren.getStatus": [{
|
|
134022
135978
|
name: "deviceId",
|
|
134023
135979
|
form: "single",
|
|
@@ -134200,11 +136156,21 @@ Object.freeze({
|
|
|
134200
136156
|
form: "single",
|
|
134201
136157
|
optional: false
|
|
134202
136158
|
}],
|
|
136159
|
+
"switch.getOptions": [{
|
|
136160
|
+
name: "deviceId",
|
|
136161
|
+
form: "single",
|
|
136162
|
+
optional: false
|
|
136163
|
+
}],
|
|
134203
136164
|
"switch.getStatus": [{
|
|
134204
136165
|
name: "deviceId",
|
|
134205
136166
|
form: "single",
|
|
134206
136167
|
optional: false
|
|
134207
136168
|
}],
|
|
136169
|
+
"switch.powerCycle": [{
|
|
136170
|
+
name: "deviceId",
|
|
136171
|
+
form: "single",
|
|
136172
|
+
optional: false
|
|
136173
|
+
}],
|
|
134208
136174
|
"switch.setState": [{
|
|
134209
136175
|
name: "deviceId",
|
|
134210
136176
|
form: "single",
|
|
@@ -134445,6 +136411,46 @@ Object.freeze({
|
|
|
134445
136411
|
form: "single",
|
|
134446
136412
|
optional: false
|
|
134447
136413
|
}],
|
|
136414
|
+
"workload.forceStop": [{
|
|
136415
|
+
name: "deviceId",
|
|
136416
|
+
form: "single",
|
|
136417
|
+
optional: false
|
|
136418
|
+
}],
|
|
136419
|
+
"workload.getOptions": [{
|
|
136420
|
+
name: "deviceId",
|
|
136421
|
+
form: "single",
|
|
136422
|
+
optional: false
|
|
136423
|
+
}],
|
|
136424
|
+
"workload.getStatus": [{
|
|
136425
|
+
name: "deviceId",
|
|
136426
|
+
form: "single",
|
|
136427
|
+
optional: false
|
|
136428
|
+
}],
|
|
136429
|
+
"workload.pause": [{
|
|
136430
|
+
name: "deviceId",
|
|
136431
|
+
form: "single",
|
|
136432
|
+
optional: false
|
|
136433
|
+
}],
|
|
136434
|
+
"workload.restart": [{
|
|
136435
|
+
name: "deviceId",
|
|
136436
|
+
form: "single",
|
|
136437
|
+
optional: false
|
|
136438
|
+
}],
|
|
136439
|
+
"workload.resume": [{
|
|
136440
|
+
name: "deviceId",
|
|
136441
|
+
form: "single",
|
|
136442
|
+
optional: false
|
|
136443
|
+
}],
|
|
136444
|
+
"workload.start": [{
|
|
136445
|
+
name: "deviceId",
|
|
136446
|
+
form: "single",
|
|
136447
|
+
optional: false
|
|
136448
|
+
}],
|
|
136449
|
+
"workload.stop": [{
|
|
136450
|
+
name: "deviceId",
|
|
136451
|
+
form: "single",
|
|
136452
|
+
optional: false
|
|
136453
|
+
}],
|
|
134448
136454
|
"zoneAnalytics.getCameraHistory": [{
|
|
134449
136455
|
name: "deviceId",
|
|
134450
136456
|
form: "single",
|
|
@@ -134513,7 +136519,7 @@ Object.freeze({
|
|
|
134513
136519
|
});
|
|
134514
136520
|
/**
|
|
134515
136521
|
* Per-cap runtime-state policy, projected from every `*.cap.ts` that declares
|
|
134516
|
-
* `runtimeState`.
|
|
136522
|
+
* `runtimeState`. 87 caps: 43 `restored`, 44 `session`.
|
|
134517
136523
|
*
|
|
134518
136524
|
* A cap absent from this map has no runtime-state slice at all. A cap PRESENT
|
|
134519
136525
|
* with `durability: 'session'` has one and has decided not to keep it.
|
|
@@ -134853,6 +136859,10 @@ var RUNTIME_STATE_POLICY = {
|
|
|
134853
136859
|
durability: "session",
|
|
134854
136860
|
volatileFields: ["lastFetchedAt"]
|
|
134855
136861
|
},
|
|
136862
|
+
"workload": {
|
|
136863
|
+
durability: "session",
|
|
136864
|
+
volatileFields: ["lastFetchedAt"]
|
|
136865
|
+
},
|
|
134856
136866
|
"zone-analytics": {
|
|
134857
136867
|
durability: "session",
|
|
134858
136868
|
volatileFields: []
|
|
@@ -136097,6 +138107,8 @@ var TimelapseRuleInputSchema = zod.z.object({
|
|
|
136097
138107
|
/** Canonical notification priority ordinal (1..5); per-target overridable. */
|
|
136098
138108
|
priority: PriorityField.default(3),
|
|
136099
138109
|
/** Per-target settings keyed by target id (D1032) — absent = every target follows the rule. */
|
|
138110
|
+
/** Operator labels (D1054) — optional and NEVER defaulted: an absent key leaves the stored tags alone; `[]` clears them. Admin-only. */
|
|
138111
|
+
tags: TagsFieldSchema.optional(),
|
|
136100
138112
|
targetOverrides: NcTargetOverridesSchema.optional()
|
|
136101
138113
|
});
|
|
136102
138114
|
zod.z.object({
|
|
@@ -136115,6 +138127,8 @@ zod.z.object({
|
|
|
136115
138127
|
reportClasses: ReportClassesField.optional(),
|
|
136116
138128
|
priority: PriorityField.optional(),
|
|
136117
138129
|
/** Per-target settings keyed by target id (D1032) — absent = every target follows the rule. */
|
|
138130
|
+
/** Absent = keep the stored tags; `[]` clears them (D1054). Never defaulted. */
|
|
138131
|
+
tags: TagsFieldSchema.optional(),
|
|
136118
138132
|
targetOverrides: NcTargetOverridesSchema.optional()
|
|
136119
138133
|
});
|
|
136120
138134
|
TimelapseRuleInputSchema.extend({
|
|
@@ -137316,6 +139330,12 @@ Object.defineProperty(exports, "DeviceFeature", {
|
|
|
137316
139330
|
return DeviceFeature;
|
|
137317
139331
|
}
|
|
137318
139332
|
});
|
|
139333
|
+
Object.defineProperty(exports, "DeviceIdentifiersSchema", {
|
|
139334
|
+
enumerable: true,
|
|
139335
|
+
get: function() {
|
|
139336
|
+
return DeviceIdentifiersSchema;
|
|
139337
|
+
}
|
|
139338
|
+
});
|
|
137319
139339
|
Object.defineProperty(exports, "DeviceRole", {
|
|
137320
139340
|
enumerable: true,
|
|
137321
139341
|
get: function() {
|
|
@@ -137514,6 +139534,12 @@ Object.defineProperty(exports, "HelperMemberSchema", {
|
|
|
137514
139534
|
return HelperMemberSchema;
|
|
137515
139535
|
}
|
|
137516
139536
|
});
|
|
139537
|
+
Object.defineProperty(exports, "HostedWithdrawalGate", {
|
|
139538
|
+
enumerable: true,
|
|
139539
|
+
get: function() {
|
|
139540
|
+
return HostedWithdrawalGate;
|
|
139541
|
+
}
|
|
139542
|
+
});
|
|
137517
139543
|
Object.defineProperty(exports, "HvacModeSchema", {
|
|
137518
139544
|
enumerable: true,
|
|
137519
139545
|
get: function() {
|
|
@@ -137610,6 +139636,12 @@ Object.defineProperty(exports, "MigrationMetaSchema", {
|
|
|
137610
139636
|
return MigrationMetaSchema;
|
|
137611
139637
|
}
|
|
137612
139638
|
});
|
|
139639
|
+
Object.defineProperty(exports, "NcTaggedRuleKindSchema", {
|
|
139640
|
+
enumerable: true,
|
|
139641
|
+
get: function() {
|
|
139642
|
+
return NcTaggedRuleKindSchema;
|
|
139643
|
+
}
|
|
139644
|
+
});
|
|
137613
139645
|
Object.defineProperty(exports, "NetworkTunnelStartedDataSchema", {
|
|
137614
139646
|
enumerable: true,
|
|
137615
139647
|
get: function() {
|
|
@@ -137850,6 +139882,12 @@ Object.defineProperty(exports, "STREAM_PROFILE_META", {
|
|
|
137850
139882
|
return STREAM_PROFILE_META;
|
|
137851
139883
|
}
|
|
137852
139884
|
});
|
|
139885
|
+
Object.defineProperty(exports, "SWITCH_DEFAULT_OPTIONS", {
|
|
139886
|
+
enumerable: true,
|
|
139887
|
+
get: function() {
|
|
139888
|
+
return SWITCH_DEFAULT_OPTIONS;
|
|
139889
|
+
}
|
|
139890
|
+
});
|
|
137853
139891
|
Object.defineProperty(exports, "SchedulerError", {
|
|
137854
139892
|
enumerable: true,
|
|
137855
139893
|
get: function() {
|
|
@@ -137988,6 +140026,18 @@ Object.defineProperty(exports, "WELL_KNOWN_TAB_MAP", {
|
|
|
137988
140026
|
return WELL_KNOWN_TAB_MAP;
|
|
137989
140027
|
}
|
|
137990
140028
|
});
|
|
140029
|
+
Object.defineProperty(exports, "WORKLOAD_TRANSITION_CATEGORY", {
|
|
140030
|
+
enumerable: true,
|
|
140031
|
+
get: function() {
|
|
140032
|
+
return WORKLOAD_TRANSITION_CATEGORY;
|
|
140033
|
+
}
|
|
140034
|
+
});
|
|
140035
|
+
Object.defineProperty(exports, "WorkloadStateSchema", {
|
|
140036
|
+
enumerable: true,
|
|
140037
|
+
get: function() {
|
|
140038
|
+
return WorkloadStateSchema;
|
|
140039
|
+
}
|
|
140040
|
+
});
|
|
137991
140041
|
Object.defineProperty(exports, "actionEffect", {
|
|
137992
140042
|
enumerable: true,
|
|
137993
140043
|
get: function() {
|
|
@@ -138336,6 +140386,12 @@ Object.defineProperty(exports, "compareVersions", {
|
|
|
138336
140386
|
return compareVersions;
|
|
138337
140387
|
}
|
|
138338
140388
|
});
|
|
140389
|
+
Object.defineProperty(exports, "compileHelper", {
|
|
140390
|
+
enumerable: true,
|
|
140391
|
+
get: function() {
|
|
140392
|
+
return compileHelper;
|
|
140393
|
+
}
|
|
140394
|
+
});
|
|
138339
140395
|
Object.defineProperty(exports, "compileScalarOverride", {
|
|
138340
140396
|
enumerable: true,
|
|
138341
140397
|
get: function() {
|
|
@@ -138876,6 +140932,12 @@ Object.defineProperty(exports, "historyUnitFor", {
|
|
|
138876
140932
|
return historyUnitFor;
|
|
138877
140933
|
}
|
|
138878
140934
|
});
|
|
140935
|
+
Object.defineProperty(exports, "hostEngineDevice", {
|
|
140936
|
+
enumerable: true,
|
|
140937
|
+
get: function() {
|
|
140938
|
+
return hostEngineDevice;
|
|
140939
|
+
}
|
|
140940
|
+
});
|
|
138879
140941
|
Object.defineProperty(exports, "hydrateSchema", {
|
|
138880
140942
|
enumerable: true,
|
|
138881
140943
|
get: function() {
|
|
@@ -138990,6 +141052,18 @@ Object.defineProperty(exports, "isDeviceConfigCap", {
|
|
|
138990
141052
|
return isDeviceConfigCap;
|
|
138991
141053
|
}
|
|
138992
141054
|
});
|
|
141055
|
+
Object.defineProperty(exports, "isEmptyIdentifiers", {
|
|
141056
|
+
enumerable: true,
|
|
141057
|
+
get: function() {
|
|
141058
|
+
return isEmptyIdentifiers;
|
|
141059
|
+
}
|
|
141060
|
+
});
|
|
141061
|
+
Object.defineProperty(exports, "isEngineHostedHelper", {
|
|
141062
|
+
enumerable: true,
|
|
141063
|
+
get: function() {
|
|
141064
|
+
return isEngineHostedHelper;
|
|
141065
|
+
}
|
|
141066
|
+
});
|
|
138993
141067
|
Object.defineProperty(exports, "isEvent", {
|
|
138994
141068
|
enumerable: true,
|
|
138995
141069
|
get: function() {
|
|
@@ -139092,6 +141166,12 @@ Object.defineProperty(exports, "isVoidInput", {
|
|
|
139092
141166
|
return isVoidInput;
|
|
139093
141167
|
}
|
|
139094
141168
|
});
|
|
141169
|
+
Object.defineProperty(exports, "isWorkloadSettled", {
|
|
141170
|
+
enumerable: true,
|
|
141171
|
+
get: function() {
|
|
141172
|
+
return isWorkloadSettled;
|
|
141173
|
+
}
|
|
141174
|
+
});
|
|
139095
141175
|
Object.defineProperty(exports, "kebabToCamel", {
|
|
139096
141176
|
enumerable: true,
|
|
139097
141177
|
get: function() {
|
|
@@ -139122,6 +141202,12 @@ Object.defineProperty(exports, "legacyModeOf", {
|
|
|
139122
141202
|
return legacyModeOf;
|
|
139123
141203
|
}
|
|
139124
141204
|
});
|
|
141205
|
+
Object.defineProperty(exports, "legacySweepDone", {
|
|
141206
|
+
enumerable: true,
|
|
141207
|
+
get: function() {
|
|
141208
|
+
return legacySweepDone;
|
|
141209
|
+
}
|
|
141210
|
+
});
|
|
139125
141211
|
Object.defineProperty(exports, "lifecycleJobSchema", {
|
|
139126
141212
|
enumerable: true,
|
|
139127
141213
|
get: function() {
|
|
@@ -139218,6 +141304,12 @@ Object.defineProperty(exports, "memoizePinnedFfmpeg", {
|
|
|
139218
141304
|
return memoizePinnedFfmpeg;
|
|
139219
141305
|
}
|
|
139220
141306
|
});
|
|
141307
|
+
Object.defineProperty(exports, "mergeIdentifiers", {
|
|
141308
|
+
enumerable: true,
|
|
141309
|
+
get: function() {
|
|
141310
|
+
return mergeIdentifiers;
|
|
141311
|
+
}
|
|
141312
|
+
});
|
|
139221
141313
|
Object.defineProperty(exports, "methodRefusal", {
|
|
139222
141314
|
enumerable: true,
|
|
139223
141315
|
get: function() {
|
|
@@ -139728,6 +141820,12 @@ Object.defineProperty(exports, "runtimeStatePolicyFor", {
|
|
|
139728
141820
|
return runtimeStatePolicyFor;
|
|
139729
141821
|
}
|
|
139730
141822
|
});
|
|
141823
|
+
Object.defineProperty(exports, "sameIdentifiers", {
|
|
141824
|
+
enumerable: true,
|
|
141825
|
+
get: function() {
|
|
141826
|
+
return sameIdentifiers;
|
|
141827
|
+
}
|
|
141828
|
+
});
|
|
139731
141829
|
Object.defineProperty(exports, "schedulersCapability", {
|
|
139732
141830
|
enumerable: true,
|
|
139733
141831
|
get: function() {
|
|
@@ -139788,6 +141886,12 @@ Object.defineProperty(exports, "seedInstanceOnce", {
|
|
|
139788
141886
|
return seedInstanceOnce;
|
|
139789
141887
|
}
|
|
139790
141888
|
});
|
|
141889
|
+
Object.defineProperty(exports, "selectEngineHostedBlocks", {
|
|
141890
|
+
enumerable: true,
|
|
141891
|
+
get: function() {
|
|
141892
|
+
return selectEngineHostedBlocks;
|
|
141893
|
+
}
|
|
141894
|
+
});
|
|
139791
141895
|
Object.defineProperty(exports, "settingsStoreCapability", {
|
|
139792
141896
|
enumerable: true,
|
|
139793
141897
|
get: function() {
|
|
@@ -139914,6 +142018,12 @@ Object.defineProperty(exports, "supportedRuntimes", {
|
|
|
139914
142018
|
return supportedRuntimes;
|
|
139915
142019
|
}
|
|
139916
142020
|
});
|
|
142021
|
+
Object.defineProperty(exports, "sweepLegacyEngineRows", {
|
|
142022
|
+
enumerable: true,
|
|
142023
|
+
get: function() {
|
|
142024
|
+
return sweepLegacyEngineRows;
|
|
142025
|
+
}
|
|
142026
|
+
});
|
|
139917
142027
|
Object.defineProperty(exports, "switchCapability", {
|
|
139918
142028
|
enumerable: true,
|
|
139919
142029
|
get: function() {
|
|
@@ -140106,6 +142216,18 @@ Object.defineProperty(exports, "withoutCallerStamp", {
|
|
|
140106
142216
|
return withoutCallerStamp;
|
|
140107
142217
|
}
|
|
140108
142218
|
});
|
|
142219
|
+
Object.defineProperty(exports, "workloadCapability", {
|
|
142220
|
+
enumerable: true,
|
|
142221
|
+
get: function() {
|
|
142222
|
+
return workloadCapability;
|
|
142223
|
+
}
|
|
142224
|
+
});
|
|
142225
|
+
Object.defineProperty(exports, "workloadTransition", {
|
|
142226
|
+
enumerable: true,
|
|
142227
|
+
get: function() {
|
|
142228
|
+
return workloadTransition;
|
|
142229
|
+
}
|
|
142230
|
+
});
|
|
140109
142231
|
Object.defineProperty(exports, "zoneOnlySite", {
|
|
140110
142232
|
enumerable: true,
|
|
140111
142233
|
get: function() {
|