@camstack/system 1.2.181 → 1.2.183
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/dist/addon-runner.js +1 -1
- package/dist/addon-runner.mjs +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
- package/dist/builtins/device-manager/device-linked-devices.d.ts +9 -0
- package/dist/builtins/device-manager/device-manager.addon.js +20 -5
- package/dist/builtins/device-manager/device-manager.addon.mjs +20 -5
- package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
- package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +1 -1
- package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
- package/dist/builtins/local-network/local-network.addon.js +1 -1
- package/dist/builtins/local-network/local-network.addon.mjs +1 -1
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.js +1 -1
- package/dist/builtins/system-config/system-config.addon.mjs +1 -1
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{dist-DbnNk4Lw.mjs → dist-BUbcDk8K.mjs} +56 -3
- package/dist/{dist-whe0b4_3.js → dist-DGrXE5nL.js} +56 -3
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{manifest-system-deps-DOcMuUWK.mjs → manifest-system-deps-D2qye9OM.mjs} +1 -1
- package/dist/{manifest-system-deps-y5vZBO6q.js → manifest-system-deps-ezj0SKDM.js} +1 -1
- package/dist/{retired-settings-keys-BdvmiaK7.js → retired-settings-keys-BxUjEt2b.js} +1 -1
- package/dist/{retired-settings-keys-CyQG8b-A.mjs → retired-settings-keys-CQzLYNqb.mjs} +1 -1
- package/package.json +1 -1
package/dist/addon-runner.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
2
|
-
const require_manifest_system_deps = require("./manifest-system-deps-
|
|
2
|
+
const require_manifest_system_deps = require("./manifest-system-deps-ezj0SKDM.js");
|
|
3
3
|
const require_custom_action_registry = require("./custom-action-registry-jY0NOZK8.js");
|
|
4
4
|
let node_path = require("node:path");
|
|
5
5
|
node_path = require_chunk.__toESM(node_path);
|
package/dist/addon-runner.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as createUdsLoggerWithControl, Ft as RUNNER_RSS_BUDGET_ENV, Jt as startRunnerHeapWatch, Qt as emitHeapDiagnosticReport, a as createUdsAddonContext, bt as resolveAddonClass, it as setWorkerNativeCapsChangeListener, j as LocalChildClient, n as installManifestPythonDeps, nt as getWorkerNativeCapSnapshot, ot as validateProviderRegistrations, t as installManifestSystemDeps, tt as getWorkerNativeCapProvider, yt as installManifestNativeDeps } from "./manifest-system-deps-
|
|
1
|
+
import { A as createUdsLoggerWithControl, Ft as RUNNER_RSS_BUDGET_ENV, Jt as startRunnerHeapWatch, Qt as emitHeapDiagnosticReport, a as createUdsAddonContext, bt as resolveAddonClass, it as setWorkerNativeCapsChangeListener, j as LocalChildClient, n as installManifestPythonDeps, nt as getWorkerNativeCapSnapshot, ot as validateProviderRegistrations, t as installManifestSystemDeps, tt as getWorkerNativeCapProvider, yt as installManifestNativeDeps } from "./manifest-system-deps-D2qye9OM.mjs";
|
|
2
2
|
import { t as CustomActionRegistry } from "./custom-action-registry-F__gp_VX.mjs";
|
|
3
3
|
import { register } from "node:module";
|
|
4
4
|
import * as path$1 from "node:path";
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-DGrXE5nL.js");
|
|
7
7
|
const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
|
|
8
8
|
let node_crypto = require("node:crypto");
|
|
9
9
|
let node_path = require("node:path");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as addonPagesCapability, Ft as BaseAddon, Pt as errMsg, sn as EventCategory } from "../../dist-
|
|
1
|
+
import { E as addonPagesCapability, Ft as BaseAddon, Pt as errMsg, sn as EventCategory } from "../../dist-BUbcDk8K.mjs";
|
|
2
2
|
import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
4
|
import * as path$1 from "node:path";
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-DGrXE5nL.js");
|
|
7
7
|
const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
|
|
8
8
|
let node_crypto = require("node:crypto");
|
|
9
9
|
let node_path = require("node:path");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ft as BaseAddon, O as addonWidgetsCapability, Pt as errMsg, sn as EventCategory } from "../../dist-
|
|
1
|
+
import { Ft as BaseAddon, O as addonWidgetsCapability, Pt as errMsg, sn as EventCategory } from "../../dist-BUbcDk8K.mjs";
|
|
2
2
|
import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
4
|
import * as path$1 from "node:path";
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-DGrXE5nL.js");
|
|
7
7
|
//#region src/builtins/alerts/prune-policy.ts
|
|
8
8
|
/**
|
|
9
9
|
* Ids older than `cutoffMs`, oldest first.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ft as BaseAddon, Jt as createEvent, Pt as errMsg, k as alertsCapability, n as AlertSchema, sn as EventCategory } from "../../dist-
|
|
1
|
+
import { Ft as BaseAddon, Jt as createEvent, Pt as errMsg, k as alertsCapability, n as AlertSchema, sn as EventCategory } from "../../dist-BUbcDk8K.mjs";
|
|
2
2
|
//#region src/builtins/alerts/prune-policy.ts
|
|
3
3
|
/**
|
|
4
4
|
* Ids older than `cutoffMs`, oldest first.
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-DGrXE5nL.js");
|
|
7
7
|
let node_crypto = require("node:crypto");
|
|
8
8
|
let buffer = require("buffer");
|
|
9
9
|
let node_fs_promises = require("node:fs/promises");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ft as BaseAddon, j as backupCapability, sn as EventCategory } from "../../dist-
|
|
1
|
+
import { Ft as BaseAddon, j as backupCapability, sn as EventCategory } from "../../dist-BUbcDk8K.mjs";
|
|
2
2
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
3
3
|
import { Buffer as Buffer$1 } from "buffer";
|
|
4
4
|
import * as fsp from "node:fs/promises";
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-DGrXE5nL.js");
|
|
7
7
|
const require_formatter = require("../../formatter-DqAKDlvN.js");
|
|
8
8
|
//#region src/builtins/console-logging/console-destination.ts
|
|
9
9
|
var LEVEL_RANK = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ft as BaseAddon, ct as logDestinationCapability } from "../../dist-
|
|
1
|
+
import { Ft as BaseAddon, ct as logDestinationCapability } from "../../dist-BUbcDk8K.mjs";
|
|
2
2
|
import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
|
|
3
3
|
//#region src/builtins/console-logging/console-destination.ts
|
|
4
4
|
var LEVEL_RANK = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
3
|
-
const require_dist = require("../../dist-
|
|
3
|
+
const require_dist = require("../../dist-DGrXE5nL.js");
|
|
4
4
|
let node_crypto = require("node:crypto");
|
|
5
5
|
let node_fs_promises = require("node:fs/promises");
|
|
6
6
|
node_fs_promises = require_chunk.__toESM(node_fs_promises);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ft as BaseAddon, I as coreBlockAddonId, L as coreBlockIdFromAddonId, Pt as errMsg, R as coreBlocksCapability, c as CORE_BLOCK_ADDON_PREFIX, d as DeclaredDevices, l as CoreBlockSchema, s as CORE_BLOCKS_ADDON_ID } from "../../dist-
|
|
1
|
+
import { Ft as BaseAddon, I as coreBlockAddonId, L as coreBlockIdFromAddonId, Pt as errMsg, R as coreBlocksCapability, c as CORE_BLOCK_ADDON_PREFIX, d as DeclaredDevices, l as CoreBlockSchema, s as CORE_BLOCKS_ADDON_ID } from "../../dist-BUbcDk8K.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import * as fs from "node:fs/promises";
|
|
4
4
|
import * as path$1 from "node:path";
|
|
@@ -30,6 +30,15 @@ export interface LinkCandidate {
|
|
|
30
30
|
readonly stableId: string;
|
|
31
31
|
/** The container's own operator pick, when one was made. */
|
|
32
32
|
readonly primaryChildEntityId?: string | null;
|
|
33
|
+
/**
|
|
34
|
+
* The child's `DeviceRole`. Ranked ABOVE `type` when a container picks the
|
|
35
|
+
* child it stands for, because `DeviceType` cannot tell a door contact from a
|
|
36
|
+
* battery reading — Home Assistant maps both to `Sensor`. A first-class meta
|
|
37
|
+
* column, so `slim` carries it.
|
|
38
|
+
*/
|
|
39
|
+
readonly role?: string | null | undefined;
|
|
40
|
+
/** Operator-facing name — used for the namesake tiebreak. Also a column. */
|
|
41
|
+
readonly name?: string;
|
|
33
42
|
}
|
|
34
43
|
/**
|
|
35
44
|
* Pure resolution core: children ∪ (auto → same-location | manual → list),
|
|
@@ -3,8 +3,8 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
7
|
-
const require_retired_settings_keys = require("../../retired-settings-keys-
|
|
6
|
+
const require_dist = require("../../dist-DGrXE5nL.js");
|
|
7
|
+
const require_retired_settings_keys = require("../../retired-settings-keys-BxUjEt2b.js");
|
|
8
8
|
let node_crypto = require("node:crypto");
|
|
9
9
|
let _camstack_types_node = require("@camstack/types/node");
|
|
10
10
|
//#region src/builtins/device-manager/adoption-job-engine.ts
|
|
@@ -1896,7 +1896,10 @@ async function discoverDevices(pctx, input) {
|
|
|
1896
1896
|
stableId: d.stableId,
|
|
1897
1897
|
type: d.type,
|
|
1898
1898
|
suggestedName: d.suggestedName,
|
|
1899
|
-
prefilledConfig: d.prefilledConfig
|
|
1899
|
+
prefilledConfig: d.prefilledConfig,
|
|
1900
|
+
...d.alreadyOnboarded === true ? { alreadyOnboarded: true } : {},
|
|
1901
|
+
...d.onboardedDeviceId !== void 0 ? { onboardedDeviceId: d.onboardedDeviceId } : {},
|
|
1902
|
+
...d.onboardedName !== void 0 ? { onboardedName: d.onboardedName } : {}
|
|
1900
1903
|
}));
|
|
1901
1904
|
}
|
|
1902
1905
|
async function adoptDevice(pctx, input) {
|
|
@@ -2089,8 +2092,10 @@ function expandContainer(id, byId, byParent, visited, out) {
|
|
|
2089
2092
|
const primary = require_dist.resolveContainerPrimaryChild((byParent.get(id) ?? []).map((c) => ({
|
|
2090
2093
|
id: c.id,
|
|
2091
2094
|
stableId: c.stableId,
|
|
2092
|
-
type: c.type
|
|
2093
|
-
|
|
2095
|
+
type: c.type,
|
|
2096
|
+
...c.role !== void 0 && c.role !== null ? { role: c.role } : {},
|
|
2097
|
+
...c.name !== void 0 ? { name: c.name } : {}
|
|
2098
|
+
})), byId.get(id)?.primaryChildEntityId, byId.get(id)?.name);
|
|
2094
2099
|
if (primary !== null) expandContainer(primary.id, byId, byParent, nextVisited, out);
|
|
2095
2100
|
}
|
|
2096
2101
|
/**
|
|
@@ -4158,6 +4163,16 @@ async function setPrimaryChildEntityId(pctx, input) {
|
|
|
4158
4163
|
const { deviceId, primaryChildEntityId } = input;
|
|
4159
4164
|
await pctx.metaStore.withMetaWriteLock(async () => {
|
|
4160
4165
|
if (!await pctx.metaStore.resolvePersistedById(deviceId)) throw new Error(`[device-manager] setPrimaryChildEntityId: unknown device id=${deviceId}`);
|
|
4166
|
+
if (primaryChildEntityId !== null) {
|
|
4167
|
+
const children = await pctx.metaStore.rows.listByParent(deviceId);
|
|
4168
|
+
if (!children.some((child) => child.meta.stableId === primaryChildEntityId)) pctx.host.ctx.logger.warn("setPrimaryChildEntityId: pick matches no child — the container will keep its priority default", {
|
|
4169
|
+
tags: { deviceId },
|
|
4170
|
+
meta: {
|
|
4171
|
+
primaryChildEntityId,
|
|
4172
|
+
childStableIds: children.map((child) => child.meta.stableId).slice(0, 12)
|
|
4173
|
+
}
|
|
4174
|
+
});
|
|
4175
|
+
}
|
|
4161
4176
|
await pctx.metaStore.rows.patch(deviceId, { primaryChildEntityId });
|
|
4162
4177
|
});
|
|
4163
4178
|
pctx.host.ctx.eventBus.emit({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $t as isDeviceConfigCap, Bt as DeviceRole, Ft as BaseAddon, H as deviceManagerCapability, J as enumerateSchemaFields, P as buildStreamParamsConfigSchema, Pt as errMsg, U as deviceStateCapability, Vt as DeviceType, W as deviceStatusCapability, Wt as WELL_KNOWN_TAB_MAP, a as CAMERA_SWITCH_ORDER, b as STREAM_PROFILE_META, f as DeviceStatusSchema, ft as normalizeUnit, mt as parseStreamParamsFormPatch, o as CAP_NAMES_WITH_STATUS, on as sleep, q as enumerateItemArrayFields, sn as EventCategory, t as ALL_CAPABILITY_DEFINITIONS, xt as runtimeStatePolicyFor, yt as resolveContainerPrimaryChild, zt as DeviceFeature } from "../../dist-
|
|
2
|
-
import { n as purgeRetiredSettingsRows } from "../../retired-settings-keys-
|
|
1
|
+
import { $t as isDeviceConfigCap, Bt as DeviceRole, Ft as BaseAddon, H as deviceManagerCapability, J as enumerateSchemaFields, P as buildStreamParamsConfigSchema, Pt as errMsg, U as deviceStateCapability, Vt as DeviceType, W as deviceStatusCapability, Wt as WELL_KNOWN_TAB_MAP, a as CAMERA_SWITCH_ORDER, b as STREAM_PROFILE_META, f as DeviceStatusSchema, ft as normalizeUnit, mt as parseStreamParamsFormPatch, o as CAP_NAMES_WITH_STATUS, on as sleep, q as enumerateItemArrayFields, sn as EventCategory, t as ALL_CAPABILITY_DEFINITIONS, xt as runtimeStatePolicyFor, yt as resolveContainerPrimaryChild, zt as DeviceFeature } from "../../dist-BUbcDk8K.mjs";
|
|
2
|
+
import { n as purgeRetiredSettingsRows } from "../../retired-settings-keys-CQzLYNqb.mjs";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
import { canonicalDeviceFingerprint } from "@camstack/types/node";
|
|
5
5
|
//#region src/builtins/device-manager/adoption-job-engine.ts
|
|
@@ -1891,7 +1891,10 @@ async function discoverDevices(pctx, input) {
|
|
|
1891
1891
|
stableId: d.stableId,
|
|
1892
1892
|
type: d.type,
|
|
1893
1893
|
suggestedName: d.suggestedName,
|
|
1894
|
-
prefilledConfig: d.prefilledConfig
|
|
1894
|
+
prefilledConfig: d.prefilledConfig,
|
|
1895
|
+
...d.alreadyOnboarded === true ? { alreadyOnboarded: true } : {},
|
|
1896
|
+
...d.onboardedDeviceId !== void 0 ? { onboardedDeviceId: d.onboardedDeviceId } : {},
|
|
1897
|
+
...d.onboardedName !== void 0 ? { onboardedName: d.onboardedName } : {}
|
|
1895
1898
|
}));
|
|
1896
1899
|
}
|
|
1897
1900
|
async function adoptDevice(pctx, input) {
|
|
@@ -2084,8 +2087,10 @@ function expandContainer(id, byId, byParent, visited, out) {
|
|
|
2084
2087
|
const primary = resolveContainerPrimaryChild((byParent.get(id) ?? []).map((c) => ({
|
|
2085
2088
|
id: c.id,
|
|
2086
2089
|
stableId: c.stableId,
|
|
2087
|
-
type: c.type
|
|
2088
|
-
|
|
2090
|
+
type: c.type,
|
|
2091
|
+
...c.role !== void 0 && c.role !== null ? { role: c.role } : {},
|
|
2092
|
+
...c.name !== void 0 ? { name: c.name } : {}
|
|
2093
|
+
})), byId.get(id)?.primaryChildEntityId, byId.get(id)?.name);
|
|
2089
2094
|
if (primary !== null) expandContainer(primary.id, byId, byParent, nextVisited, out);
|
|
2090
2095
|
}
|
|
2091
2096
|
/**
|
|
@@ -4153,6 +4158,16 @@ async function setPrimaryChildEntityId(pctx, input) {
|
|
|
4153
4158
|
const { deviceId, primaryChildEntityId } = input;
|
|
4154
4159
|
await pctx.metaStore.withMetaWriteLock(async () => {
|
|
4155
4160
|
if (!await pctx.metaStore.resolvePersistedById(deviceId)) throw new Error(`[device-manager] setPrimaryChildEntityId: unknown device id=${deviceId}`);
|
|
4161
|
+
if (primaryChildEntityId !== null) {
|
|
4162
|
+
const children = await pctx.metaStore.rows.listByParent(deviceId);
|
|
4163
|
+
if (!children.some((child) => child.meta.stableId === primaryChildEntityId)) pctx.host.ctx.logger.warn("setPrimaryChildEntityId: pick matches no child — the container will keep its priority default", {
|
|
4164
|
+
tags: { deviceId },
|
|
4165
|
+
meta: {
|
|
4166
|
+
primaryChildEntityId,
|
|
4167
|
+
childStableIds: children.map((child) => child.meta.stableId).slice(0, 12)
|
|
4168
|
+
}
|
|
4169
|
+
});
|
|
4170
|
+
}
|
|
4156
4171
|
await pctx.metaStore.rows.patch(deviceId, { primaryChildEntityId });
|
|
4157
4172
|
});
|
|
4158
4173
|
pctx.host.ctx.eventBus.emit({
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-DGrXE5nL.js");
|
|
7
7
|
//#region src/builtins/doorbell/trigger-engine.ts
|
|
8
8
|
/**
|
|
9
9
|
* Pure trigger logic for the virtual-doorbell builtin — edge detection over
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ft as BaseAddon, G as doorbellCapability, Jt as createEvent, M as bareAddonId, Pt as errMsg, Vt as DeviceType, Y as evaluateSensorEdge, _ as SOURCE_CAPS, nt as isSameAddonId, rt as isSourceCap, sn as EventCategory, v as SOURCE_DEVICE_TYPES } from "../../dist-
|
|
1
|
+
import { Ft as BaseAddon, G as doorbellCapability, Jt as createEvent, M as bareAddonId, Pt as errMsg, Vt as DeviceType, Y as evaluateSensorEdge, _ as SOURCE_CAPS, nt as isSameAddonId, rt as isSourceCap, sn as EventCategory, v as SOURCE_DEVICE_TYPES } from "../../dist-BUbcDk8K.mjs";
|
|
2
2
|
//#region src/builtins/doorbell/trigger-engine.ts
|
|
3
3
|
/**
|
|
4
4
|
* Pure trigger logic for the virtual-doorbell builtin — edge detection over
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-DGrXE5nL.js");
|
|
7
7
|
const require_formatter = require("../../formatter-DqAKDlvN.js");
|
|
8
8
|
//#region src/builtins/hub-forwarder/hub-forwarder-destination.ts
|
|
9
9
|
var DEFAULT_OUTBOUND_BUFFER_SIZE = 500;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ft as BaseAddon, ct as logDestinationCapability } from "../../dist-
|
|
1
|
+
import { Ft as BaseAddon, ct as logDestinationCapability } from "../../dist-BUbcDk8K.mjs";
|
|
2
2
|
import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
|
|
3
3
|
//#region src/builtins/hub-forwarder/hub-forwarder-destination.ts
|
|
4
4
|
var DEFAULT_OUTBOUND_BUFFER_SIZE = 500;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../../chunk-Cek0wNdY.js");
|
|
3
|
-
const require_dist = require("../../dist-
|
|
3
|
+
const require_dist = require("../../dist-DGrXE5nL.js");
|
|
4
4
|
//#region src/builtins/liveness-monitor/liveness-checks.ts
|
|
5
5
|
var NO_DEVICES = "liveness:no-devices";
|
|
6
6
|
var ALL_OFFLINE = "liveness:all-devices-offline";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ft as BaseAddon, Jt as createEvent, Pt as errMsg, sn as EventCategory } from "../../dist-
|
|
1
|
+
import { Ft as BaseAddon, Jt as createEvent, Pt as errMsg, sn as EventCategory } from "../../dist-BUbcDk8K.mjs";
|
|
2
2
|
//#region src/builtins/liveness-monitor/liveness-checks.ts
|
|
3
3
|
var NO_DEVICES = "liveness:no-devices";
|
|
4
4
|
var ALL_OFFLINE = "liveness:all-devices-offline";
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-DGrXE5nL.js");
|
|
7
7
|
let node_crypto = require("node:crypto");
|
|
8
8
|
node_crypto = require_chunk.__toESM(node_crypto);
|
|
9
9
|
let crypto$1 = require("crypto");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as __require, o as __toESM, t as __commonJSMin } from "../../chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import { A as authProviderCapability, Ft as BaseAddon, T as UserRecordSchema, jt as userManagementCapability, r as ApiKeyRecordSchema, x as ScopedTokenSchema } from "../../dist-
|
|
2
|
+
import { A as authProviderCapability, Ft as BaseAddon, T as UserRecordSchema, jt as userManagementCapability, r as ApiKeyRecordSchema, x as ScopedTokenSchema } from "../../dist-BUbcDk8K.mjs";
|
|
3
3
|
import * as crypto$2 from "node:crypto";
|
|
4
4
|
import { createHash, randomUUID, timingSafeEqual } from "node:crypto";
|
|
5
5
|
import nodeCrypto from "crypto";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
3
|
-
const require_dist = require("../../dist-
|
|
3
|
+
const require_dist = require("../../dist-DGrXE5nL.js");
|
|
4
4
|
const require_tls = require("../../tls-BxQlomxd.js");
|
|
5
5
|
let node_fs_promises = require("node:fs/promises");
|
|
6
6
|
let node_path = require("node:path");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ft as BaseAddon, sn as EventCategory, st as localNetworkCapability } from "../../dist-
|
|
1
|
+
import { Ft as BaseAddon, sn as EventCategory, st as localNetworkCapability } from "../../dist-BUbcDk8K.mjs";
|
|
2
2
|
import { S as readLanHttpState, _ as DEFAULT_LAN_HTTP_PORT, a as writeTlsMode, i as writeExtraSans, l as reissueTlsLeaf, n as readTlsAccessStatus, o as validateUploadedTls, r as readTlsMode, s as ensureTlsCert, t as readExtraSans, y as applyLanHttp } from "../../tls-DOTmtLCW.mjs";
|
|
3
3
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
4
4
|
import { join } from "node:path";
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-DGrXE5nL.js");
|
|
7
7
|
//#region src/builtins/loki-logging/loki-payload.ts
|
|
8
8
|
/**
|
|
9
9
|
* Loki rejects a label name that is not a valid Prometheus label
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ft as BaseAddon, ct as logDestinationCapability } from "../../dist-
|
|
1
|
+
import { Ft as BaseAddon, ct as logDestinationCapability } from "../../dist-BUbcDk8K.mjs";
|
|
2
2
|
//#region src/builtins/loki-logging/loki-payload.ts
|
|
3
3
|
/**
|
|
4
4
|
* Loki rejects a label name that is not a valid Prometheus label
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-DGrXE5nL.js");
|
|
7
7
|
let node_fs_promises = require("node:fs/promises");
|
|
8
8
|
let node_child_process = require("node:child_process");
|
|
9
9
|
let node_util = require("node:util");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ft as BaseAddon, Jt as createEvent, Pt as errMsg, Q as foldSnapshotByFunction, _t as reducePoints, dt as metricsProviderCapability, sn as EventCategory, vt as resolveBucketMs } from "../../dist-
|
|
1
|
+
import { Ft as BaseAddon, Jt as createEvent, Pt as errMsg, Q as foldSnapshotByFunction, _t as reducePoints, dt as metricsProviderCapability, sn as EventCategory, vt as resolveBucketMs } from "../../dist-BUbcDk8K.mjs";
|
|
2
2
|
import { readFile, readdir } from "node:fs/promises";
|
|
3
3
|
import { execFile, execFileSync } from "node:child_process";
|
|
4
4
|
import { promisify } from "node:util";
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-DGrXE5nL.js");
|
|
7
7
|
let node_child_process = require("node:child_process");
|
|
8
8
|
let node_util = require("node:util");
|
|
9
9
|
let node_fs = require("node:fs");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as __toESM } from "../../chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import { Ft as BaseAddon, K as enumerateInferenceDevices, Pt as errMsg, Xt as emitReadiness, ht as platformProbeCapability, sn as EventCategory, wt as scoreRuntimes } from "../../dist-
|
|
2
|
+
import { Ft as BaseAddon, K as enumerateInferenceDevices, Pt as errMsg, Xt as emitReadiness, ht as platformProbeCapability, sn as EventCategory, wt as scoreRuntimes } from "../../dist-BUbcDk8K.mjs";
|
|
3
3
|
import { execFile } from "node:child_process";
|
|
4
4
|
import { promisify } from "node:util";
|
|
5
5
|
import * as fs from "node:fs";
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-DGrXE5nL.js");
|
|
7
7
|
//#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
|
|
8
8
|
/**
|
|
9
9
|
* Reconcile the durable `enabledProviders` set against authoritative
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ft as BaseAddon, sn as EventCategory } from "../../dist-
|
|
1
|
+
import { Ft as BaseAddon, sn as EventCategory } from "../../dist-BUbcDk8K.mjs";
|
|
2
2
|
//#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
|
|
3
3
|
/**
|
|
4
4
|
* Reconcile the durable `enabledProviders` set against authoritative
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-DGrXE5nL.js");
|
|
7
7
|
let zod = require("zod");
|
|
8
8
|
let node_crypto = require("node:crypto");
|
|
9
9
|
let _camstack_types_node = require("@camstack/types/node");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { At as streamQualityLabel, Et as snapshotCapability, Ft as BaseAddon, M as bareAddonId, N as batteryCapability, Pt as errMsg, V as deriveBatteryPresence, Vt as DeviceType, en as nodePin, i as BatteryStatusSchema, sn as EventCategory, zt as DeviceFeature } from "../../dist-
|
|
1
|
+
import { At as streamQualityLabel, Et as snapshotCapability, Ft as BaseAddon, M as bareAddonId, N as batteryCapability, Pt as errMsg, V as deriveBatteryPresence, Vt as DeviceType, en as nodePin, i as BatteryStatusSchema, sn as EventCategory, zt as DeviceFeature } from "../../dist-BUbcDk8K.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
import { signExpiringUrl, verifyExpiringUrl } from "@camstack/types/node";
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-DGrXE5nL.js");
|
|
7
7
|
let node_crypto = require("node:crypto");
|
|
8
8
|
let node_fs_promises = require("node:fs/promises");
|
|
9
9
|
let node_path = require("node:path");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ft as BaseAddon, Z as filesystemBrowseCapability, kt as storageProviderCapability } from "../../dist-
|
|
1
|
+
import { Ft as BaseAddon, Z as filesystemBrowseCapability, kt as storageProviderCapability } from "../../dist-BUbcDk8K.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import { mkdir, readdir, realpath, statfs } from "node:fs/promises";
|
|
4
4
|
import * as path$1 from "node:path";
|
|
Binary file
|
|
Binary file
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-DGrXE5nL.js");
|
|
7
7
|
const require_hub_cap_forward = require("../../hub-cap-forward-DmHNjbB0.js");
|
|
8
8
|
let zod = require("zod");
|
|
9
9
|
let node_crypto = require("node:crypto");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as StorageLocationTypeSchema, Dt as storageCapability, F as collectSecretConfigKeys, Ft as BaseAddon, Ot as storageMigrationCapability, S as StorageCleanupJobSchema, Tt as settingsStoreCapability, h as REDACTED_SECRET, tn as parseJsonObject, w as StorageMigrationJobSchema } from "../../dist-
|
|
1
|
+
import { C as StorageLocationTypeSchema, Dt as storageCapability, F as collectSecretConfigKeys, Ft as BaseAddon, Ot as storageMigrationCapability, S as StorageCleanupJobSchema, Tt as settingsStoreCapability, h as REDACTED_SECRET, tn as parseJsonObject, w as StorageMigrationJobSchema } from "../../dist-BUbcDk8K.mjs";
|
|
2
2
|
import { t as HUB_CAP_FWD_ACTION } from "../../hub-cap-forward-BdT320dq.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-DGrXE5nL.js");
|
|
7
7
|
//#region src/builtins/system-config/system-config.addon.ts
|
|
8
8
|
/**
|
|
9
9
|
* Built-in `system-config` addon — Phase 4 of the settings redesign.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ft as BaseAddon, Pt as errMsg, Qt as hydrateSchema } from "../../dist-
|
|
1
|
+
import { Ft as BaseAddon, Pt as errMsg, Qt as hydrateSchema } from "../../dist-BUbcDk8K.mjs";
|
|
2
2
|
//#region src/builtins/system-config/system-config.addon.ts
|
|
3
3
|
/**
|
|
4
4
|
* Built-in `system-config` addon — Phase 4 of the settings redesign.
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-DGrXE5nL.js");
|
|
7
7
|
const require_formatter = require("../../formatter-DqAKDlvN.js");
|
|
8
8
|
let node_path = require("node:path");
|
|
9
9
|
node_path = require_chunk.__toESM(node_path);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ft as BaseAddon, ct as logDestinationCapability } from "../../dist-
|
|
1
|
+
import { Ft as BaseAddon, ct as logDestinationCapability } from "../../dist-BUbcDk8K.mjs";
|
|
2
2
|
import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
|
|
3
3
|
import * as path$1 from "node:path";
|
|
4
4
|
import path from "node:path";
|
|
@@ -10423,7 +10423,26 @@ var DiscoveryCandidateSchema = z.object({
|
|
|
10423
10423
|
* identity ahead of adoption. Rendering metadata (unit, precision)
|
|
10424
10424
|
* flows live through the cap STATUS SLICE after adoption.
|
|
10425
10425
|
*/
|
|
10426
|
-
sourceInfo: SourceInfoSchema.optional()
|
|
10426
|
+
sourceInfo: SourceInfoSchema.optional(),
|
|
10427
|
+
/**
|
|
10428
|
+
* Set when this candidate is a device the provider ALREADY owns.
|
|
10429
|
+
*
|
|
10430
|
+
* A scan cannot generally produce the identity a device was onboarded under
|
|
10431
|
+
* (Reolink keys on `mac-<mac>`, learned at adopt time), so a stableId
|
|
10432
|
+
* comparison never matches and an owned device looks addable. Re-adopting one
|
|
10433
|
+
* overwrites its config with scan-derived values — that is how a Home Hub's
|
|
10434
|
+
* Baichuan port was overwritten with its ONVIF port, taking the hub and its
|
|
10435
|
+
* three child cameras offline for four hours.
|
|
10436
|
+
*
|
|
10437
|
+
* A provider that can recognise its own devices says so here. Absent means
|
|
10438
|
+
* "not recognised", which is not the same as "known to be new" — a provider
|
|
10439
|
+
* that cannot tell simply never sets it.
|
|
10440
|
+
*/
|
|
10441
|
+
alreadyOnboarded: z.boolean().optional(),
|
|
10442
|
+
/** Numeric id of the device this candidate was matched to. Set with `alreadyOnboarded`. */
|
|
10443
|
+
onboardedDeviceId: z.number().optional(),
|
|
10444
|
+
/** Operator-facing name of the matched device, so the UI can say WHICH one it is. */
|
|
10445
|
+
onboardedName: z.string().optional()
|
|
10427
10446
|
});
|
|
10428
10447
|
/**
|
|
10429
10448
|
* Flat device summary returned by `createDevice` / `adoptDiscoveredDevice`.
|
|
@@ -34007,6 +34026,39 @@ var CONTAINER_CHILD_PRIORITY = [
|
|
|
34007
34026
|
"image",
|
|
34008
34027
|
"sensor"
|
|
34009
34028
|
];
|
|
34029
|
+
/**
|
|
34030
|
+
* Roles that say what a container IS, most→least defining. Consulted BEFORE
|
|
34031
|
+
* type priority, because `DeviceType` cannot tell them apart: Home Assistant
|
|
34032
|
+
* maps a door contact, a battery level, a temperature reading and a "last seen"
|
|
34033
|
+
* timestamp all to `DeviceType.Sensor`. Measured on container 4127 — children
|
|
34034
|
+
* `battery-sensor`, `temperature-sensor`, `datetime-sensor`, `contact-sensor`
|
|
34035
|
+
* and a role-less `button` — the type list ranked `button` above `sensor` and
|
|
34036
|
+
* the container stood for its "Identifica" button instead of the door contact
|
|
34037
|
+
* it is named after.
|
|
34038
|
+
*
|
|
34039
|
+
* Only STATE-DEFINING roles belong here. A diagnostic reading (battery,
|
|
34040
|
+
* temperature, humidity, signal, last-seen) is never what a container is, so
|
|
34041
|
+
* they are deliberately absent and fall through to type priority.
|
|
34042
|
+
*/
|
|
34043
|
+
var CONTAINER_CHILD_ROLE_PRIORITY = [
|
|
34044
|
+
"contact-sensor",
|
|
34045
|
+
"motion-sensor",
|
|
34046
|
+
"occupancy-sensor",
|
|
34047
|
+
"smoke-sensor",
|
|
34048
|
+
"co-sensor",
|
|
34049
|
+
"gas-sensor",
|
|
34050
|
+
"leak-sensor",
|
|
34051
|
+
"vibration-sensor",
|
|
34052
|
+
"tamper-sensor",
|
|
34053
|
+
"sound-sensor",
|
|
34054
|
+
"binary-sensor",
|
|
34055
|
+
"binary-helper"
|
|
34056
|
+
];
|
|
34057
|
+
function roleRank(role) {
|
|
34058
|
+
if (role === void 0) return CONTAINER_CHILD_ROLE_PRIORITY.length;
|
|
34059
|
+
const i = CONTAINER_CHILD_ROLE_PRIORITY.indexOf(role);
|
|
34060
|
+
return i === -1 ? CONTAINER_CHILD_ROLE_PRIORITY.length : i;
|
|
34061
|
+
}
|
|
34010
34062
|
function rank(type) {
|
|
34011
34063
|
const i = CONTAINER_CHILD_PRIORITY.indexOf(type);
|
|
34012
34064
|
return i === -1 ? CONTAINER_CHILD_PRIORITY.length : i;
|
|
@@ -34017,12 +34069,13 @@ function rank(type) {
|
|
|
34017
34069
|
* must decide what an empty container means for it, rather than being handed a
|
|
34018
34070
|
* child that is not there.
|
|
34019
34071
|
*/
|
|
34020
|
-
function resolveContainerPrimaryChild(children, overrideEntityId) {
|
|
34072
|
+
function resolveContainerPrimaryChild(children, overrideEntityId, containerName) {
|
|
34021
34073
|
if (overrideEntityId !== void 0 && overrideEntityId !== null) {
|
|
34022
34074
|
const picked = children.find((c) => c.stableId === overrideEntityId) ?? children.find((c) => c.entityId !== void 0 && c.entityId === overrideEntityId);
|
|
34023
34075
|
if (picked !== void 0) return picked;
|
|
34024
34076
|
}
|
|
34025
|
-
|
|
34077
|
+
const namesake = (c) => containerName !== void 0 && containerName.length > 0 && c.name !== void 0 && c.name.toLowerCase() === containerName.toLowerCase() ? 0 : 1;
|
|
34078
|
+
return [...children].toSorted((a, b) => roleRank(a.role) - roleRank(b.role) || namesake(a) - namesake(b) || rank(a.type) - rank(b.type))[0] ?? null;
|
|
34026
34079
|
}
|
|
34027
34080
|
/**
|
|
34028
34081
|
* Accessory device helpers — shared across drivers.
|
|
@@ -10423,7 +10423,26 @@ var DiscoveryCandidateSchema = zod.z.object({
|
|
|
10423
10423
|
* identity ahead of adoption. Rendering metadata (unit, precision)
|
|
10424
10424
|
* flows live through the cap STATUS SLICE after adoption.
|
|
10425
10425
|
*/
|
|
10426
|
-
sourceInfo: SourceInfoSchema.optional()
|
|
10426
|
+
sourceInfo: SourceInfoSchema.optional(),
|
|
10427
|
+
/**
|
|
10428
|
+
* Set when this candidate is a device the provider ALREADY owns.
|
|
10429
|
+
*
|
|
10430
|
+
* A scan cannot generally produce the identity a device was onboarded under
|
|
10431
|
+
* (Reolink keys on `mac-<mac>`, learned at adopt time), so a stableId
|
|
10432
|
+
* comparison never matches and an owned device looks addable. Re-adopting one
|
|
10433
|
+
* overwrites its config with scan-derived values — that is how a Home Hub's
|
|
10434
|
+
* Baichuan port was overwritten with its ONVIF port, taking the hub and its
|
|
10435
|
+
* three child cameras offline for four hours.
|
|
10436
|
+
*
|
|
10437
|
+
* A provider that can recognise its own devices says so here. Absent means
|
|
10438
|
+
* "not recognised", which is not the same as "known to be new" — a provider
|
|
10439
|
+
* that cannot tell simply never sets it.
|
|
10440
|
+
*/
|
|
10441
|
+
alreadyOnboarded: zod.z.boolean().optional(),
|
|
10442
|
+
/** Numeric id of the device this candidate was matched to. Set with `alreadyOnboarded`. */
|
|
10443
|
+
onboardedDeviceId: zod.z.number().optional(),
|
|
10444
|
+
/** Operator-facing name of the matched device, so the UI can say WHICH one it is. */
|
|
10445
|
+
onboardedName: zod.z.string().optional()
|
|
10427
10446
|
});
|
|
10428
10447
|
/**
|
|
10429
10448
|
* Flat device summary returned by `createDevice` / `adoptDiscoveredDevice`.
|
|
@@ -34007,6 +34026,39 @@ var CONTAINER_CHILD_PRIORITY = [
|
|
|
34007
34026
|
"image",
|
|
34008
34027
|
"sensor"
|
|
34009
34028
|
];
|
|
34029
|
+
/**
|
|
34030
|
+
* Roles that say what a container IS, most→least defining. Consulted BEFORE
|
|
34031
|
+
* type priority, because `DeviceType` cannot tell them apart: Home Assistant
|
|
34032
|
+
* maps a door contact, a battery level, a temperature reading and a "last seen"
|
|
34033
|
+
* timestamp all to `DeviceType.Sensor`. Measured on container 4127 — children
|
|
34034
|
+
* `battery-sensor`, `temperature-sensor`, `datetime-sensor`, `contact-sensor`
|
|
34035
|
+
* and a role-less `button` — the type list ranked `button` above `sensor` and
|
|
34036
|
+
* the container stood for its "Identifica" button instead of the door contact
|
|
34037
|
+
* it is named after.
|
|
34038
|
+
*
|
|
34039
|
+
* Only STATE-DEFINING roles belong here. A diagnostic reading (battery,
|
|
34040
|
+
* temperature, humidity, signal, last-seen) is never what a container is, so
|
|
34041
|
+
* they are deliberately absent and fall through to type priority.
|
|
34042
|
+
*/
|
|
34043
|
+
var CONTAINER_CHILD_ROLE_PRIORITY = [
|
|
34044
|
+
"contact-sensor",
|
|
34045
|
+
"motion-sensor",
|
|
34046
|
+
"occupancy-sensor",
|
|
34047
|
+
"smoke-sensor",
|
|
34048
|
+
"co-sensor",
|
|
34049
|
+
"gas-sensor",
|
|
34050
|
+
"leak-sensor",
|
|
34051
|
+
"vibration-sensor",
|
|
34052
|
+
"tamper-sensor",
|
|
34053
|
+
"sound-sensor",
|
|
34054
|
+
"binary-sensor",
|
|
34055
|
+
"binary-helper"
|
|
34056
|
+
];
|
|
34057
|
+
function roleRank(role) {
|
|
34058
|
+
if (role === void 0) return CONTAINER_CHILD_ROLE_PRIORITY.length;
|
|
34059
|
+
const i = CONTAINER_CHILD_ROLE_PRIORITY.indexOf(role);
|
|
34060
|
+
return i === -1 ? CONTAINER_CHILD_ROLE_PRIORITY.length : i;
|
|
34061
|
+
}
|
|
34010
34062
|
function rank(type) {
|
|
34011
34063
|
const i = CONTAINER_CHILD_PRIORITY.indexOf(type);
|
|
34012
34064
|
return i === -1 ? CONTAINER_CHILD_PRIORITY.length : i;
|
|
@@ -34017,12 +34069,13 @@ function rank(type) {
|
|
|
34017
34069
|
* must decide what an empty container means for it, rather than being handed a
|
|
34018
34070
|
* child that is not there.
|
|
34019
34071
|
*/
|
|
34020
|
-
function resolveContainerPrimaryChild(children, overrideEntityId) {
|
|
34072
|
+
function resolveContainerPrimaryChild(children, overrideEntityId, containerName) {
|
|
34021
34073
|
if (overrideEntityId !== void 0 && overrideEntityId !== null) {
|
|
34022
34074
|
const picked = children.find((c) => c.stableId === overrideEntityId) ?? children.find((c) => c.entityId !== void 0 && c.entityId === overrideEntityId);
|
|
34023
34075
|
if (picked !== void 0) return picked;
|
|
34024
34076
|
}
|
|
34025
|
-
|
|
34077
|
+
const namesake = (c) => containerName !== void 0 && containerName.length > 0 && c.name !== void 0 && c.name.toLowerCase() === containerName.toLowerCase() ? 0 : 1;
|
|
34078
|
+
return [...children].toSorted((a, b) => roleRank(a.role) - roleRank(b.role) || namesake(a) - namesake(b) || rank(a.type) - rank(b.type))[0] ?? null;
|
|
34026
34079
|
}
|
|
34027
34080
|
/**
|
|
34028
34081
|
* Accessory device helpers — shared across drivers.
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
3
|
-
const require_dist = require("./dist-
|
|
3
|
+
const require_dist = require("./dist-DGrXE5nL.js");
|
|
4
4
|
const require_builtins_alerts_alerts_addon = require("./builtins/alerts/alerts.addon.js");
|
|
5
5
|
require("./builtins/alerts/index.js");
|
|
6
6
|
const require_formatter = require("./formatter-DqAKDlvN.js");
|
|
@@ -27,7 +27,7 @@ require("./builtins/system-config/index.js");
|
|
|
27
27
|
const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
|
|
28
28
|
const require_file_data_plane = require("./file-data-plane-DO8KbxCe.js");
|
|
29
29
|
const require_tls$1 = require("./tls-BxQlomxd.js");
|
|
30
|
-
const require_manifest_system_deps = require("./manifest-system-deps-
|
|
30
|
+
const require_manifest_system_deps = require("./manifest-system-deps-ezj0SKDM.js");
|
|
31
31
|
const require_resource_monitor = require("./resource-monitor-CdnzxBLP.js");
|
|
32
32
|
const require_custom_action_registry = require("./custom-action-registry-jY0NOZK8.js");
|
|
33
33
|
let zod = require("zod");
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM$1, r as __exportAll, t as __commonJSMin$1 } from "./chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import { $ as isArrayOutputSchema, Ct as scopesAllowDeviceCap, D as addonSettingsCapability, Gt as asJsonObject$1, Ht as ReadinessRegistry, It as DATAPLANE_SECRET_HEADER$1, Jt as createEvent, Kt as asNumber, Lt as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Pt as errMsg$1, Rt as DEVICE_STATUS_METHOD, St as scopesAllowAddon, Ut as ReadinessTimeoutError, X as extractNestedAddonId, Yt as emitDownForOwnedCaps, Zt as expandCapMethods, an as scopeKey, at as kebabToCamel, bt as resolveMethodAuth, et as isCollectionArrayMethod, g as RUNTIME_DEFAULTS, gt as procedureAuthKey, in as resolveCapMount, it as isVoidInput, lt as logLevelAtMost, m as METHOD_ACCESS_MAP, nn as parseJsonUnknown, ot as lifecycleJobSchema, p as LOG_LEVEL_RANK, pt as objectInputDeclaresAddonId, qt as asString$1, rn as readinessKey, sn as EventCategory$1, t as ALL_CAPABILITY_DEFINITIONS, tn as parseJsonObject, tt as isObjectInput, ut as looseSchema } from "./dist-
|
|
2
|
+
import { $ as isArrayOutputSchema, Ct as scopesAllowDeviceCap, D as addonSettingsCapability, Gt as asJsonObject$1, Ht as ReadinessRegistry, It as DATAPLANE_SECRET_HEADER$1, Jt as createEvent, Kt as asNumber, Lt as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Pt as errMsg$1, Rt as DEVICE_STATUS_METHOD, St as scopesAllowAddon, Ut as ReadinessTimeoutError, X as extractNestedAddonId, Yt as emitDownForOwnedCaps, Zt as expandCapMethods, an as scopeKey, at as kebabToCamel, bt as resolveMethodAuth, et as isCollectionArrayMethod, g as RUNTIME_DEFAULTS, gt as procedureAuthKey, in as resolveCapMount, it as isVoidInput, lt as logLevelAtMost, m as METHOD_ACCESS_MAP, nn as parseJsonUnknown, ot as lifecycleJobSchema, p as LOG_LEVEL_RANK, pt as objectInputDeclaresAddonId, qt as asString$1, rn as readinessKey, sn as EventCategory$1, t as ALL_CAPABILITY_DEFINITIONS, tn as parseJsonObject, tt as isObjectInput, ut as looseSchema } from "./dist-BUbcDk8K.mjs";
|
|
3
3
|
import { AlertCenterAddon } from "./builtins/alerts/alerts.addon.mjs";
|
|
4
4
|
import "./builtins/alerts/index.mjs";
|
|
5
5
|
import { t as formatLogLine } from "./formatter-B7qW8bPJ.mjs";
|
|
@@ -26,7 +26,7 @@ import "./builtins/system-config/index.mjs";
|
|
|
26
26
|
import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
|
|
27
27
|
import { a as parseTokenizedUrl, c as collectModelFiles, d as downloadModel, f as ensureModel, h as isModelDownloaded, i as parseRangeHeader, l as deleteModelFromDisk, m as getModelFilePath, n as contentTypeFor, o as resolveFilePath, p as fetchJson, r as createAuthenticatedFileServer, s as ModelDownloadService, t as createFileDataPlaneHandler, u as downloadFile } from "./file-data-plane-BhKdxJgf.mjs";
|
|
28
28
|
import { C as registerLanHttpHandler, S as readLanHttpState, _ as DEFAULT_LAN_HTTP_PORT, a as writeTlsMode, b as bindPendingLanHttp, c as loadTlsCert, d as collectCertIdentity, f as CA_VALIDITY_DAYS, g as evaluateExistingCert, h as SERVER_AUTH_OID, i as writeExtraSans, l as reissueTlsLeaf, m as MAX_LEAF_VALIDITY_DAYS, n as readTlsAccessStatus, o as validateUploadedTls, p as LEAF_RENEWAL_WINDOW_DAYS, r as readTlsMode, s as ensureTlsCert, t as readExtraSans, u as CA_COMMON_NAME, v as allFamiliesListenHost, x as closeLanHttp, y as applyLanHttp } from "./tls-DOTmtLCW.mjs";
|
|
29
|
-
import { $ as buildUdsNativeCapProxy, $t as formatHeapSpaces, A as createUdsLoggerWithControl, At as HUB_MAIN_RSS_BUDGET_MB, B as readMoleculerFanoutMode, Bt as createV8Reclaimer, C as ipcParentLink, Ct as createAddonDataPlaneFacility, D as createUdsEventBus, Dt as HEAP_WATCH_INTERVAL_MS, E as createUdsEventBridge, Et as HEAP_RECLAIM_TRIGGER_MB, F as AGENT_CAP_FWD_SERVICE, Ft as RUNNER_RSS_BUDGET_ENV, G as createLocalTransport, Gt as reclaimIntervalMs, H as PARENT_ROUTED_PROVIDER_ADDON_ID, Ht as hubMainRssBudget, I as CapRouteResolver, It as ZERO_LOOP_DELAY, J as SocketChannel, Jt as startRunnerHeapWatch, K as UdsLocalTransportClient, Kt as shouldReclaim, L as CapRouteError, Lt as buildHeapSample, M as LocalChildRegistry, Mt as RSS_BUDGET_REANNOUNCE_MIN_MS, N as UDS_NO_ROUTE_PREFIX, Nt as RSS_BUDGET_RELEASE_RATIO, O as udsChildLogToWorkerEntry, Ot as HEAP_WATCH_WARN_RATIO, P as AGENT_CAP_FWD_ACTION, Pt as RUNNER_HEAP_WATCH_INTERVAL_MS, Q as buildNativeCapProxy, Qt as emitHeapDiagnosticReport, R as classifyCapRoute, Rt as createDeferredHeapWatchSink, S as buildLinkChain, St as runNpm, T as createParentUnownedCallHandler, Tt as HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, U as __resetCapUsageRegistryForTests, Ut as nextRssBudgetState, V as CapUsageRegistry, Vt as describeRss, W as getCapUsageRegistry, Wt as parseRssBudgetMb, X as FrameDecoder, Xt as DECISIVE_HEAP_SPACES, Y as localEndpointPath, Yt as strandedMb, Z as encodeFrame, Zt as HEAP_SPACE_REPORT_MIN_MB, _ as AddonDepsManager, _n as createEventPlaneReader, _t as CapabilityUnavailableError, a as createUdsAddonContext, an as createSocketPlaneMeter, at as createAddonService, b as brokerCallForCap, bt as resolveAddonClass, c as getOrInitReadinessRegistryForClient, cn as formatSocketPlane, ct as capActionName, d as clusterEventTopic, dn as recordSocketFrame, dt as capServiceName, en as heapSpaceField, et as createBrokerDeviceManagerApi, f as getBrokerEventBus, fn as sampleSocketDirection, ft as parseCapAction, g as subscribePassthrough, gn as createEventPlaneMeter, gt as CapabilityHandle, h as setNodeEventInterest, hn as EVENT_PLANE_TOP_N, ht as DeviceRegistry, i as createAddonContext, in as SOCKET_PLANE_TOP_N, j as LocalChildClient, jt as HUB_RSS_BUDGET_ENV, k as createUdsLogger, kt as HUB_MAIN_HEAP_WATCH_LABEL, l as setHubConnected, ln as EMPTY_SOCKET_DIRECTION, lt as capActionSuffix, m as registerEventBusService, mn as socketDirectionMessages, mt as serializeTypedArrays, n as installManifestPythonDeps, nn as selectReportedSpaces, o as getWorkerDeviceRegistry, on as createSocketPlaneReader, ot as validateProviderRegistrations, p as getMoleculerEventStats, pn as socketDirectionBytes, pt as deserializeTypedArrays, q as UdsLocalTransportServer, qt as startHeapWatch, r as adaptBrokerToCluster, rn as EMPTY_SOCKET_PLANE_BASELINE, rt as mountNativeCapService, s as getOrInitReadinessRegistry, sn as diffSocketPlane, st as NATIVE_PROVIDER_SERVICE_INFIX, t as installManifestSystemDeps, tn as readHeapSpaces, u as EVENT_TOPIC_PREFIX, un as createSocketDirectionCounters, ut as capBareAction, v as createKernelHwAccel, vn as diffEventPlane, vt as copyBundledNativeModules, w as localProviderLink, wt as HEAP_RECLAIM_MIN_INTERVAL_MS, x as brokerTransportLink, xt as resolveNpmInvocation, y as resolveHwAccel, yn as formatEventPlane, yt as installManifestNativeDeps, z as callWithServiceDiscovery, zt as createLoopDelayMeter } from "./manifest-system-deps-
|
|
29
|
+
import { $ as buildUdsNativeCapProxy, $t as formatHeapSpaces, A as createUdsLoggerWithControl, At as HUB_MAIN_RSS_BUDGET_MB, B as readMoleculerFanoutMode, Bt as createV8Reclaimer, C as ipcParentLink, Ct as createAddonDataPlaneFacility, D as createUdsEventBus, Dt as HEAP_WATCH_INTERVAL_MS, E as createUdsEventBridge, Et as HEAP_RECLAIM_TRIGGER_MB, F as AGENT_CAP_FWD_SERVICE, Ft as RUNNER_RSS_BUDGET_ENV, G as createLocalTransport, Gt as reclaimIntervalMs, H as PARENT_ROUTED_PROVIDER_ADDON_ID, Ht as hubMainRssBudget, I as CapRouteResolver, It as ZERO_LOOP_DELAY, J as SocketChannel, Jt as startRunnerHeapWatch, K as UdsLocalTransportClient, Kt as shouldReclaim, L as CapRouteError, Lt as buildHeapSample, M as LocalChildRegistry, Mt as RSS_BUDGET_REANNOUNCE_MIN_MS, N as UDS_NO_ROUTE_PREFIX, Nt as RSS_BUDGET_RELEASE_RATIO, O as udsChildLogToWorkerEntry, Ot as HEAP_WATCH_WARN_RATIO, P as AGENT_CAP_FWD_ACTION, Pt as RUNNER_HEAP_WATCH_INTERVAL_MS, Q as buildNativeCapProxy, Qt as emitHeapDiagnosticReport, R as classifyCapRoute, Rt as createDeferredHeapWatchSink, S as buildLinkChain, St as runNpm, T as createParentUnownedCallHandler, Tt as HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, U as __resetCapUsageRegistryForTests, Ut as nextRssBudgetState, V as CapUsageRegistry, Vt as describeRss, W as getCapUsageRegistry, Wt as parseRssBudgetMb, X as FrameDecoder, Xt as DECISIVE_HEAP_SPACES, Y as localEndpointPath, Yt as strandedMb, Z as encodeFrame, Zt as HEAP_SPACE_REPORT_MIN_MB, _ as AddonDepsManager, _n as createEventPlaneReader, _t as CapabilityUnavailableError, a as createUdsAddonContext, an as createSocketPlaneMeter, at as createAddonService, b as brokerCallForCap, bt as resolveAddonClass, c as getOrInitReadinessRegistryForClient, cn as formatSocketPlane, ct as capActionName, d as clusterEventTopic, dn as recordSocketFrame, dt as capServiceName, en as heapSpaceField, et as createBrokerDeviceManagerApi, f as getBrokerEventBus, fn as sampleSocketDirection, ft as parseCapAction, g as subscribePassthrough, gn as createEventPlaneMeter, gt as CapabilityHandle, h as setNodeEventInterest, hn as EVENT_PLANE_TOP_N, ht as DeviceRegistry, i as createAddonContext, in as SOCKET_PLANE_TOP_N, j as LocalChildClient, jt as HUB_RSS_BUDGET_ENV, k as createUdsLogger, kt as HUB_MAIN_HEAP_WATCH_LABEL, l as setHubConnected, ln as EMPTY_SOCKET_DIRECTION, lt as capActionSuffix, m as registerEventBusService, mn as socketDirectionMessages, mt as serializeTypedArrays, n as installManifestPythonDeps, nn as selectReportedSpaces, o as getWorkerDeviceRegistry, on as createSocketPlaneReader, ot as validateProviderRegistrations, p as getMoleculerEventStats, pn as socketDirectionBytes, pt as deserializeTypedArrays, q as UdsLocalTransportServer, qt as startHeapWatch, r as adaptBrokerToCluster, rn as EMPTY_SOCKET_PLANE_BASELINE, rt as mountNativeCapService, s as getOrInitReadinessRegistry, sn as diffSocketPlane, st as NATIVE_PROVIDER_SERVICE_INFIX, t as installManifestSystemDeps, tn as readHeapSpaces, u as EVENT_TOPIC_PREFIX, un as createSocketDirectionCounters, ut as capBareAction, v as createKernelHwAccel, vn as diffEventPlane, vt as copyBundledNativeModules, w as localProviderLink, wt as HEAP_RECLAIM_MIN_INTERVAL_MS, x as brokerTransportLink, xt as resolveNpmInvocation, y as resolveHwAccel, yn as formatEventPlane, yt as installManifestNativeDeps, z as callWithServiceDiscovery, zt as createLoopDelayMeter } from "./manifest-system-deps-D2qye9OM.mjs";
|
|
30
30
|
import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-BWmQ5i-o.mjs";
|
|
31
31
|
import { t as CustomActionRegistry } from "./custom-action-registry-F__gp_VX.mjs";
|
|
32
32
|
import { z } from "zod";
|