@camstack/server 1.2.731 → 1.2.733
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 +13 -0
- package/dist/api/core/cap-providers.js +1 -0
- package/dist/api/core/logging-settings.js +88 -1
- package/dist/api/trpc/generated-cap-routers.js +49 -0
- package/dist/core/addon/addon-registry.service.js +61 -59
- package/package.json +11 -19
- package/system/dist/addon-runner.js +1 -0
- package/system/dist/addon-runner.mjs +2 -1
- package/system/dist/addon-utils.mjs +1 -1
- package/system/dist/{agent-https-AJPmB73W.mjs → agent-https-D3dptveB.mjs} +1 -1
- package/system/dist/{agent-https-CLJhq0GZ.js → agent-https-v5uyVgpk.js} +1 -1
- 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 +4 -4
- 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 +5 -5
- 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 +5 -5
- package/system/dist/builtins/calendars/calendars.addon.js +1 -1
- package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/system/dist/builtins/camera-grid/index.js +1 -1
- package/system/dist/builtins/camera-grid/index.mjs +1 -1
- package/system/dist/builtins/composer/composer.addon.js +3 -3
- package/system/dist/builtins/composer/composer.addon.mjs +3 -3
- package/system/dist/builtins/console-logging/index.js +1 -1
- package/system/dist/builtins/console-logging/index.mjs +1 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/system/dist/builtins/device-history/device-history.addon.js +2 -2
- package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
- package/system/dist/builtins/device-manager/device-manager.addon.js +220 -16
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +220 -16
- package/system/dist/builtins/device-manager/discovery-proposal-service.d.ts +38 -0
- package/system/dist/builtins/device-manager/discovery-proposal-store.d.ts +28 -0
- package/system/dist/builtins/device-manager/record-kinds.d.ts +2 -1
- package/system/dist/builtins/hub-forwarder/index.js +1 -1
- package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/system/dist/builtins/keychain/index.js +3 -3
- package/system/dist/builtins/keychain/index.mjs +3 -3
- 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 +5 -5
- package/system/dist/builtins/local-network/local-network.addon.d.ts +10 -0
- package/system/dist/builtins/local-network/local-network.addon.js +297 -190
- package/system/dist/builtins/local-network/local-network.addon.mjs +294 -187
- package/system/dist/builtins/local-network/passive/discovery-watcher.d.ts +60 -0
- package/system/dist/builtins/local-network/passive/passive-io-node.d.ts +2 -0
- package/system/dist/builtins/local-network/passive/passive-packets.d.ts +10 -0
- package/system/dist/builtins/local-network/scan/dns-wire.d.ts +6 -2
- package/system/dist/builtins/local-network/scan/scan-engine.d.ts +1 -1
- package/system/dist/builtins/local-network/scan/scan-io.d.ts +6 -0
- 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 +10 -10
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +10 -10
- 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 +20 -20
- 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 +2 -2
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
- 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 +115 -115
- package/system/dist/builtins/winston-logging/index.js +1 -1
- package/system/dist/builtins/winston-logging/index.mjs +1 -1
- package/system/dist/{composition-sources-D-S2hhdw.mjs → composition-sources-Dnyu7-1p.mjs} +1 -1
- package/system/dist/{composition-sources-BNBlJAgu.js → composition-sources-j_bFq7Tx.js} +1 -1
- package/system/dist/{constants-CKwdQTnw.js → constants-C6zJ_38f.js} +1 -1
- package/system/dist/{constants-DmithOex.mjs → constants-GDBin8zB.mjs} +1 -1
- package/system/dist/{coral-accelerators-BW3OcrLD.mjs → coral-accelerators-DBlgWB8k.mjs} +6 -6
- package/system/dist/{custom-action-registry-BIJZBObd.mjs → custom-action-registry-oHl1xltx.mjs} +37 -37
- package/system/dist/{device-ca-D-Cvxobt.mjs → device-ca-Bpqrad00.mjs} +1 -1
- package/system/dist/{device-ca-TbdQfW4d.js → device-ca-CV9QZvoy.js} +1 -1
- package/system/dist/{dist-dQKZfa3-.js → dist-CwYYyGAB.js} +227 -3
- package/system/dist/{dist-yrk6fm65.mjs → dist-DcHvuBfD.mjs} +210 -4
- package/system/dist/dns-wire-CqgMi_uB.js +202 -0
- package/system/dist/dns-wire-DO56tOHL.mjs +173 -0
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-Cae5VWUc.mjs → hub-mdns-ciao-D2sU6sKd.mjs} +2 -2
- package/system/dist/{hub-mdns-ciao-DP3_GNZw.js → hub-mdns-ciao-DNLnbJNG.js} +2 -2
- package/system/dist/index.js +24 -7
- package/system/dist/index.mjs +236 -219
- package/system/dist/{restore-archive-BJ5gxMvf.mjs → restore-archive-BGK6EnYj.mjs} +94 -94
- package/system/dist/{restore-archive-X9c_wEBY.js → restore-archive-xTqhDFkW.js} +1 -1
- package/system/dist/{retention-DBrdAv12.mjs → retention-CXu8PB2L.mjs} +1 -1
- package/system/dist/{retention-DRT2wUyB.js → retention-gQ3GIUA3.js} +1 -1
- package/system/dist/{wal-maintenance-Bi4yImEY.mjs → wal-maintenance-D7XmFaUD.mjs} +0 -0
- package/system/dist/{wal-maintenance-hsgNGrjh.js → wal-maintenance-Hwzm3DCe.js} +0 -0
- package/system/package.json +1 -1
|
@@ -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-CwYYyGAB.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,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ks as errMsg, do as BaseAddon, on as addonWidgetsCapability, qs as EventCategory } from "../../dist-DcHvuBfD.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";
|
|
5
|
-
import * as fs from "node:fs";
|
|
5
|
+
import * as fs$1 from "node:fs";
|
|
6
6
|
//#region src/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.ts
|
|
7
7
|
/**
|
|
8
8
|
* Addon Widgets Aggregator — hub-local builtin that owns the singleton
|
|
@@ -204,9 +204,9 @@ var AddonWidgetsAggregatorAddon = class extends BaseAddon {
|
|
|
204
204
|
if (entryPath === null) return String(Math.floor(Date.now()));
|
|
205
205
|
try {
|
|
206
206
|
const dir = path$1.dirname(entryPath);
|
|
207
|
-
const files = fs.readdirSync(dir).filter((f) => fs.statSync(path$1.join(dir, f)).isFile()).sort();
|
|
207
|
+
const files = fs$1.readdirSync(dir).filter((f) => fs$1.statSync(path$1.join(dir, f)).isFile()).sort();
|
|
208
208
|
const cacheKey = `${dir}#${files.map((f) => {
|
|
209
|
-
const s = fs.statSync(path$1.join(dir, f));
|
|
209
|
+
const s = fs$1.statSync(path$1.join(dir, f));
|
|
210
210
|
return `${f}:${s.size}:${s.mtimeMs}`;
|
|
211
211
|
}).join("|")}`;
|
|
212
212
|
const cached = this.bundleHashCache.get(cacheKey);
|
|
@@ -214,7 +214,7 @@ var AddonWidgetsAggregatorAddon = class extends BaseAddon {
|
|
|
214
214
|
const hash = createHash("sha1");
|
|
215
215
|
for (const f of files) {
|
|
216
216
|
hash.update(f);
|
|
217
|
-
hash.update(fs.readFileSync(path$1.join(dir, f)));
|
|
217
|
+
hash.update(fs$1.readFileSync(path$1.join(dir, f)));
|
|
218
218
|
}
|
|
219
219
|
const digest = hash.digest("hex").slice(0, 12);
|
|
220
220
|
this.bundleHashCache.set(cacheKey, digest);
|
|
@@ -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-CwYYyGAB.js");
|
|
7
7
|
const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
|
|
8
8
|
//#region src/builtins/alerts/alert-episode-policy.ts
|
|
9
9
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ks as errMsg, Or as isAlertEpisodeOpen, cn as alertEpisodePayload, d as AlertSchema, do as BaseAddon, is as defineRecordKinds, kr as isAlertEpisodeSeverity, ln as alertsCapability, qs as EventCategory, sn as alertEpisodeId, ts as createEvent } from "../../dist-DcHvuBfD.mjs";
|
|
2
2
|
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
3
3
|
//#region src/builtins/alerts/alert-episode-policy.ts
|
|
4
4
|
/**
|
|
@@ -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-CwYYyGAB.js");
|
|
7
7
|
//#region src/builtins/autotrack/autotrack-config.ts
|
|
8
8
|
var DEFAULT_AUTOTRACK_LOOP_CONFIG = {
|
|
9
9
|
deadZoneFraction: .5,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ks as errMsg, do as BaseAddon, hs as isEvent, ki as ptzAutotrackCapability, mn as bareAddonId, qs as EventCategory, tt as FIRST_LEVEL_MACRO_CLASSES } from "../../dist-DcHvuBfD.mjs";
|
|
2
2
|
//#region src/builtins/autotrack/autotrack-config.ts
|
|
3
3
|
var DEFAULT_AUTOTRACK_LOOP_CONFIG = {
|
|
4
4
|
deadZoneFraction: .5,
|
|
@@ -3,9 +3,9 @@ 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-CwYYyGAB.js");
|
|
7
7
|
const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
|
|
8
|
-
const require_restore_archive = require("../../restore-archive-
|
|
8
|
+
const require_restore_archive = require("../../restore-archive-xTqhDFkW.js");
|
|
9
9
|
let node_crypto = require("node:crypto");
|
|
10
10
|
let node_fs_promises = require("node:fs/promises");
|
|
11
11
|
node_fs_promises = require_chunk.__toESM(node_fs_promises);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Rs as toNodeId, do as BaseAddon, ei as mayWriteToLocation, fa as storageOccupancyCapability, pn as backupCapability, qs as EventCategory, ws as nodePin } from "../../dist-DcHvuBfD.mjs";
|
|
2
2
|
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
3
|
-
import { _ as backupRecordStoresOf, a as BackupSnapshotRefusedError, d as ENCRYPTED_BACKUP_SUFFIX, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, i as BackupCancelledError, l as BackupKeyFormatError, m as parseBackupSecretKey, n as precheckRestoreKey, o as DEFAULT_BACKUP_DATABASES, p as parseBackupPublicKey, r as prepareRestoreArchive, s as SystemBackupService } from "../../restore-archive-
|
|
3
|
+
import { _ as backupRecordStoresOf, a as BackupSnapshotRefusedError, d as ENCRYPTED_BACKUP_SUFFIX, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, i as BackupCancelledError, l as BackupKeyFormatError, m as parseBackupSecretKey, n as precheckRestoreKey, o as DEFAULT_BACKUP_DATABASES, p as parseBackupPublicKey, r as prepareRestoreArchive, s as SystemBackupService } from "../../restore-archive-BGK6EnYj.mjs";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import * as fsp from "node:fs/promises";
|
|
6
6
|
import * as path$1 from "node:path";
|
|
7
|
-
import * as fs from "node:fs";
|
|
7
|
+
import * as fs$1 from "node:fs";
|
|
8
8
|
//#region src/builtins/backup-orchestrator/backup-databases.ts
|
|
9
9
|
/** Stable id of the seeded weekly schedule. */
|
|
10
10
|
var WEEKLY_SCHEDULE_ID = "weekly-events-history";
|
|
@@ -1018,7 +1018,7 @@ async function downloadArchiveToCache(input) {
|
|
|
1018
1018
|
location: input.locationId,
|
|
1019
1019
|
relativePath: input.filename
|
|
1020
1020
|
});
|
|
1021
|
-
const writeStream = fs.createWriteStream(input.cachePath);
|
|
1021
|
+
const writeStream = fs$1.createWriteStream(input.cachePath);
|
|
1022
1022
|
let offset = 0;
|
|
1023
1023
|
try {
|
|
1024
1024
|
while (offset < sizeBytes) {
|
|
@@ -2502,7 +2502,7 @@ var BackupOrchestratorAddon = class extends BaseAddon {
|
|
|
2502
2502
|
});
|
|
2503
2503
|
try {
|
|
2504
2504
|
let offset = 0;
|
|
2505
|
-
const stream = fs.createReadStream(input.cachePath, { highWaterMark: UPLOAD_CHUNK_BYTES });
|
|
2505
|
+
const stream = fs$1.createReadStream(input.cachePath, { highWaterMark: UPLOAD_CHUNK_BYTES });
|
|
2506
2506
|
for await (const rawChunk of stream) {
|
|
2507
2507
|
if (input.signal?.aborted) {
|
|
2508
2508
|
stream.destroy();
|
|
@@ -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-CwYYyGAB.js");
|
|
7
7
|
const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
|
|
8
8
|
let zod = require("zod");
|
|
9
9
|
//#region src/builtins/calendars/calendar-color.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Sn as calendarsCapability, T as CalendarPreferencesSchema, do as BaseAddon, is as defineRecordKinds } from "../../dist-DcHvuBfD.mjs";
|
|
2
2
|
import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/builtins/calendars/calendar-color.ts
|
|
@@ -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-CwYYyGAB.js");
|
|
7
7
|
let zod = require("zod");
|
|
8
8
|
let _camstack_types_node = require("@camstack/types/node");
|
|
9
9
|
let node_path = require("node:path");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Cn as cameraGridLayoutCapability, Gs as DeviceType, K as DeclaredDevices, Kn as declarationOwnerNodeId, Ks as errMsg, L as DERIVED_CAMERA_SILENCED_CAP_NAMES, St as MOTION_CLOSE_AFTER_MS, Us as DeviceFeature, Va as buildFfmpegArgs, do as BaseAddon, fs as hydrateSchema, m as BaseDevice, ma as streamCatalogCapability, ni as memoizePinnedFfmpeg, qs as EventCategory, sa as snapshotCapability, si as motionCapability, ts as createEvent } from "../../dist-DcHvuBfD.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { FfmpegProcess } from "@camstack/types/node";
|
|
4
4
|
import { join } from "node:path";
|
|
@@ -3,9 +3,9 @@ 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_composition_sources = require("../../composition-sources-
|
|
8
|
-
const require_retention = require("../../retention-
|
|
6
|
+
const require_dist = require("../../dist-CwYYyGAB.js");
|
|
7
|
+
const require_composition_sources = require("../../composition-sources-j_bFq7Tx.js");
|
|
8
|
+
const require_retention = require("../../retention-gQ3GIUA3.js");
|
|
9
9
|
let zod = require("zod");
|
|
10
10
|
//#region src/builtins/composer/actuator-invoke.ts
|
|
11
11
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as parseDeviceStateChanged, n as normalizedNativeOwner, r as isRecord$4 } from "../../composition-sources-
|
|
3
|
-
import { i as DAY_MS$1, m as capSeriesKey, t as DEFAULT_RETENTION } from "../../retention-
|
|
1
|
+
import { Ba as MINUTE_MS, Bn as coverCapability, Ea as valveCapability, Fa as DAY_MS, Ga as compositionFeatureEnabled, Gs as DeviceType, Ha as cloneStatefulExpressionMemory, Ia as DEFAULT_HISTORY_RETENTION, Ja as compositionSourceKey, Jr as lockControlCapability, K as DeclaredDevices, Ka as compositionItemFieldPath, Ks as errMsg, La as HISTORY_FAST_MS, Mn as composerCapability, Nn as compositionFieldKey, Pa as COMPOSER_ADDON_ID, Qa as evaluateStatistic, Ra as HISTORY_SLOW_MS, Si as planComposition, Tr as groupTemplate, Ua as composedDeviceRef, Wa as composedDeviceStableId, Wi as resolveMutate, Xa as disarmRoseMemory, Ya as createStatefulExpressionMemory, Za as evaluateDerivative, _a as switchCapability, _s as isReadingQuantity, ao as openStatistic, b as COMPOSED_ITEM_FIXED_FIELDS, co as statisticCadenceMs, do as BaseAddon, eo as integrateReading, ft as HvacModeSchema, gn as brightnessCapability, gr as fanOutTargets, hr as fanControlCapability, io as openReset, jn as colorCapability, kn as climateControlCapability, lo as toExpressionValue, lr as evaluateCompositionField, m as BaseDevice, n as ACTUATOR_METHODS, na as sharedActuatorMethods, no as isHistoryHelper, o as ALL_CAPABILITY_DEFINITIONS, oo as planResetTier, pr as expressionContainsBuiltinCall, qa as compositionSliceKey, qi as runFanOut, qn as declaredSeriesKind, qs as EventCategory, r as ACTUATOR_TEMPLATE_IDS, ra as sharedColorModes, ri as methodRefusal, ro as nextLocalMidnight, rt as FanDirectionSchema, si as motionCapability, so as planStatisticTier, st as GroupCommandResultSchema, ta as sharedActuatorFeatures, ti as mediaPlayerCapability, to as isForwardInputRef, ts as createEvent, vn as buildCapabilityLookup, vr as featureForwards, wr as groupCommandsCapability, yi as parseColorInput, za as HOUR_MS, zr as kebabToCamel } from "../../dist-DcHvuBfD.mjs";
|
|
2
|
+
import { i as parseDeviceStateChanged, n as normalizedNativeOwner, r as isRecord$4 } from "../../composition-sources-Dnyu7-1p.mjs";
|
|
3
|
+
import { i as DAY_MS$1, m as capSeriesKey, t as DEFAULT_RETENTION } from "../../retention-CXu8PB2L.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/builtins/composer/actuator-invoke.ts
|
|
6
6
|
/**
|
|
@@ -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-CwYYyGAB.js");
|
|
7
7
|
const require_formatter = require("../../formatter-xbxeV4GD.js");
|
|
8
8
|
//#region src/builtins/console-logging/console-destination.ts
|
|
9
9
|
var LEVEL_RANK = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Xr as logDestinationCapability, do as BaseAddon } from "../../dist-DcHvuBfD.mjs";
|
|
2
2
|
import { t as formatLogLine } from "../../formatter-DkYZ4LXp.mjs";
|
|
3
3
|
//#region src/builtins/console-logging/console-destination.ts
|
|
4
4
|
var LEVEL_RANK = {
|
|
@@ -1,8 +1,8 @@
|
|
|
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-CwYYyGAB.js");
|
|
4
4
|
const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
|
|
5
|
-
const require_composition_sources = require("../../composition-sources-
|
|
5
|
+
const require_composition_sources = require("../../composition-sources-j_bFq7Tx.js");
|
|
6
6
|
const require_prefix_range = require("../../prefix-range-D_KueXbQ.js");
|
|
7
7
|
const require_prefix_walk = require("../../prefix-walk-Dv6MLZlM.js");
|
|
8
8
|
let zod = require("zod");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as EMPTY_REMOTE_CONFIG, $a as helperMembers, $o as collectSecretMarkerRefs, Aa as vocabActionIdFor, An as collectWhenMirrorSources, Bi as resolveCoreBlockFiles, Bs as transformSecretWrite, Bt as SchedulerError, C as CORE_BLOCK_ADDON_PREFIX, Ca as validateComposition, Ct as MediaPlayerStatusSchema, D as ConditionMirror, Di as problemsBlockSave, Er as internalActionId, Fi as replacedFieldKeys, Fn as coreBlockAddonId, Fr as isInternalActionId, Ft as RemoteAssumedStateSchema, Gr as localDateOf, Gs as DeviceType, Hn as customKeyOfRole, I as DEFAULT_HOLD_OVERRIDE, Ii as resolveActionVariables, In as coreBlockComposition, Is as secretTreeFromSchema, It as RemoteConfigSchema, Ja as compositionSourceKey, Ji as runSteps, K as DeclaredDevices, Ki as resolveStepArgs, Ks as errMsg, Ln as coreBlockIdFromAddonId, Lt as RunningStateStatusSchema, Na as zoneOnlySite, Ni as remoteCapability, Ns as resolveSecretMarkers, O as ControlStatusSchema, On as checkTemplatePayload, Pi as remoteLayoutComponentsCapability, Pn as compositionSourceRefs, Q as EMPTY_REMOTE_ASSUMED_STATE, Rn as coreBlockSourceKind, S as CORE_BLOCKS_ADDON_ID, Si as planComposition, Ta as validateSchedulerInput, Ti as powerSourceLinkOfComposition, Tn as capUnitResolver, Ua as composedDeviceRef, Un as customRole, Vt as SchedulerSchema, Xi as schedulersCapability, Xt as TemplateKindSchema, Yr as lockDoorLinkOfComposition, Yt as SwitchStatusSchema, Z as EMPTY_AUTOMATION_STATE, Zn as describeComposableCaps, _n as buildActionSteps, _r as fanPresetsCapability, aa as siteFor, ba as timedRunLimitOf, c as ActionStepSchema, ci as nextOccurrence, di as normalizeCoreBlockWrite, do as BaseAddon, en as actionEffect, et as FAN_CAPTURE_FIELDS, f as AutomationStateDocSchema, fi as normalizeStepTargets, fs as hydrateSchema, gi as occurrenceOn, is as defineRecordKinds, it as FanPresetSchema, ja as weekdayOfLocalDate, jt as QuantityUnitError, k as CoreBlockSchema, l as ActionTargetResolver, li as normalizeActionUnits, mt as INTERNAL_ACTION_PREFIX, nn as actionsCapability, nt as FanControlStatusSchema, o as ALL_CAPABILITY_DEFINITIONS, p as BUILTIN_REMOTE_COMPONENTS, pt as IDLE_ACTION_STATUS, qs as EventCategory, rn as addonIdOfActionId, s as ActionError, t as ACTION_TARGET_INVALIDATION_EVENTS, tn as actionSourceCapability, u as ActionVariableSchema, ui as normalizeCapStep, un as appendTrace, ur as evaluateWhenTree, va as templateCapability, vn as buildCapabilityLookup, wi as powerSourceCapability, x as COMPOSER_RUNNER_ID, xa as timedRunSeconds, xs as isSecretRefOwnedBy, ya as timedRunCapability, ys as isSecretMarker, zi as resolveCoreBlockEntry, zn as coreBlocksCapability, zr as kebabToCamel } from "../../dist-DcHvuBfD.mjs";
|
|
2
2
|
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
3
|
-
import { i as parseDeviceStateChanged, t as describeCompositionSources } from "../../composition-sources-
|
|
3
|
+
import { i as parseDeviceStateChanged, t as describeCompositionSources } from "../../composition-sources-Dnyu7-1p.mjs";
|
|
4
4
|
import { t as prefixRange } from "../../prefix-range-Dl0znowN.mjs";
|
|
5
5
|
import { n as unwrapStoredValue, t as loadPrefixed } from "../../prefix-walk-DAOBSyH1.mjs";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
@@ -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_retention = require("../../retention-
|
|
6
|
+
const require_dist = require("../../dist-CwYYyGAB.js");
|
|
7
|
+
const require_retention = require("../../retention-gQ3GIUA3.js");
|
|
8
8
|
let node_crypto = require("node:crypto");
|
|
9
9
|
//#region src/builtins/device-history/capture/point-writer.ts
|
|
10
10
|
var FLUSH_INTERVAL_MS = 1e4;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as subjectIdOf, _ as readUnit, a as FIVE_MINUTES_MS, b as SeriesRegistry, c as bucketEndOf, d as CAP_KEY_PREFIX, f as CaptureEngine, g as readPath, h as catalogMetrics, i as DAY_MS, l as bucketStartOf, m as capSeriesKey, n as RetentionJob, o as HOUR_MS, p as capItemSeriesKey, r as DepartureTracker, s as ROLLUP_GRACE_MS, t as DEFAULT_RETENTION, u as floorTo, v as DeviceDirectory, x as identityOf, y as isRealDeviceType } from "../../retention-
|
|
1
|
+
import { Gs as DeviceType, _s as isReadingQuantity, ct as HISTORY_CATALOG, dn as armRemovalReconcile, do as BaseAddon, ds as historyUnitFor, er as deviceHistoryCapability, is as defineRecordKinds, lt as HISTORY_ITEM_CATALOG, nr as deviceRemovalHookCapability, os as emitReadiness, q as DeviceRunSchema, qs as EventCategory, rr as deviceRunsCapability, uo as wattMillisecondsToKwh, z as DEVICE_HISTORY_ENERGY_KEY } from "../../dist-DcHvuBfD.mjs";
|
|
2
|
+
import { S as subjectIdOf, _ as readUnit, a as FIVE_MINUTES_MS, b as SeriesRegistry, c as bucketEndOf, d as CAP_KEY_PREFIX, f as CaptureEngine, g as readPath, h as catalogMetrics, i as DAY_MS, l as bucketStartOf, m as capSeriesKey, n as RetentionJob, o as HOUR_MS, p as capItemSeriesKey, r as DepartureTracker, s as ROLLUP_GRACE_MS, t as DEFAULT_RETENTION, u as floorTo, v as DeviceDirectory, x as identityOf, y as isRealDeviceType } from "../../retention-CXu8PB2L.mjs";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
//#region src/builtins/device-history/capture/point-writer.ts
|
|
5
5
|
var FLUSH_INTERVAL_MS = 1e4;
|
|
@@ -3,11 +3,12 @@ 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-CwYYyGAB.js");
|
|
7
7
|
const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
|
|
8
8
|
const require_prefix_range = require("../../prefix-range-D_KueXbQ.js");
|
|
9
9
|
const require_prefix_walk = require("../../prefix-walk-Dv6MLZlM.js");
|
|
10
10
|
const require_retired_settings_keys = require("../../retired-settings-keys-C8nOOr5H.js");
|
|
11
|
+
const require_dns_wire = require("../../dns-wire-CqgMi_uB.js");
|
|
11
12
|
let zod = require("zod");
|
|
12
13
|
let node_crypto = require("node:crypto");
|
|
13
14
|
let _camstack_types_node = require("@camstack/types/node");
|
|
@@ -8027,21 +8028,38 @@ var DeviceMetaStore = class {
|
|
|
8027
8028
|
//#region src/builtins/device-manager/record-kinds.ts
|
|
8028
8029
|
var import_read_all_rows = require_read_all_rows$1.require_read_all_rows();
|
|
8029
8030
|
var DeviceTombstoneBodySchema = require_dist.DeviceTombstoneSchema.omit({ deviceId: true });
|
|
8030
|
-
var _deviceManagerRecordKinds = require_dist.defineRecordKinds({
|
|
8031
|
-
|
|
8032
|
-
|
|
8033
|
-
|
|
8034
|
-
|
|
8035
|
-
|
|
8036
|
-
|
|
8037
|
-
|
|
8038
|
-
|
|
8039
|
-
|
|
8040
|
-
|
|
8041
|
-
|
|
8042
|
-
|
|
8043
|
-
|
|
8044
|
-
}
|
|
8031
|
+
var _deviceManagerRecordKinds = require_dist.defineRecordKinds({
|
|
8032
|
+
tombstones: {
|
|
8033
|
+
schema: DeviceTombstoneBodySchema,
|
|
8034
|
+
class: "ledger",
|
|
8035
|
+
writeTrigger: "`removeDevice` records one row per deleted device after the device row is gone; re-record keeps the earlier `deletedAt`",
|
|
8036
|
+
device: "none",
|
|
8037
|
+
at: "required",
|
|
8038
|
+
indexes: [{
|
|
8039
|
+
name: "deleted_at",
|
|
8040
|
+
fields: ["deletedAt"]
|
|
8041
|
+
}],
|
|
8042
|
+
retention: {
|
|
8043
|
+
owner: "device-manager",
|
|
8044
|
+
reason: "90 days (`DEVICE_TOMBSTONE_RETENTION_MS`), pruned whenever a tombstone is written or the list is read"
|
|
8045
|
+
}
|
|
8046
|
+
},
|
|
8047
|
+
"discovery-proposals": {
|
|
8048
|
+
schema: require_dist.DiscoveryProposalBodySchema,
|
|
8049
|
+
class: "config",
|
|
8050
|
+
writeTrigger: "the passive listener and the 30-minute sweep of `local-network` re-see a device (`lastSeenAt` and `at` move); `dismissDiscoveryProposal` sets `dismissed`",
|
|
8051
|
+
device: "none",
|
|
8052
|
+
at: "required",
|
|
8053
|
+
indexes: [{
|
|
8054
|
+
name: "last_seen_at",
|
|
8055
|
+
fields: ["lastSeenAt"]
|
|
8056
|
+
}],
|
|
8057
|
+
retention: {
|
|
8058
|
+
ttlMs: 2160 * 60 * 60 * 1e3,
|
|
8059
|
+
from: "at"
|
|
8060
|
+
}
|
|
8061
|
+
}
|
|
8062
|
+
});
|
|
8045
8063
|
var deviceManagerRecordKinds = _deviceManagerRecordKinds;
|
|
8046
8064
|
_deviceManagerRecordKinds.tombstones;
|
|
8047
8065
|
//#endregion
|
|
@@ -8121,6 +8139,177 @@ var DeviceTombstoneStore = class DeviceTombstoneStore {
|
|
|
8121
8139
|
}
|
|
8122
8140
|
};
|
|
8123
8141
|
//#endregion
|
|
8142
|
+
//#region src/builtins/device-manager/discovery-proposal-service.ts
|
|
8143
|
+
/**
|
|
8144
|
+
* Where the two discovery feeds meet (D994).
|
|
8145
|
+
*
|
|
8146
|
+
* - `runSweep`: the existing provider discovery (`discoverProviders`), run on
|
|
8147
|
+
* the schedule `local-network` keeps; every candidate becomes a proposal.
|
|
8148
|
+
* - `reportObservations`: what the passive listener heard. Each sighting is
|
|
8149
|
+
* matched against the discovery modes the providers DECLARE and handed to the
|
|
8150
|
+
* matching provider's `classifyDiscoveryHits`, exactly like a scan hit.
|
|
8151
|
+
*
|
|
8152
|
+
* Adoption is not here: a proposal is adopted through `adoptDevice` or the
|
|
8153
|
+
* integration setup form, the flows the scan modal already uses.
|
|
8154
|
+
*/
|
|
8155
|
+
/** The hit a declared mode would have produced for this sighting, per matching mode. */
|
|
8156
|
+
function hitsForObservation(modes, observation) {
|
|
8157
|
+
const hits = [];
|
|
8158
|
+
modes.forEach((mode, modeIndex) => {
|
|
8159
|
+
if (observation.kind === "mdns" && mode.kind === "mdns") {
|
|
8160
|
+
if (require_dns_wire.normalizeServiceType(mode.serviceType) !== observation.serviceType) return;
|
|
8161
|
+
if (mode.instancePattern !== void 0 && !instanceMatches(mode.instancePattern, observation.instance)) return;
|
|
8162
|
+
hits.push({
|
|
8163
|
+
modeIndex,
|
|
8164
|
+
host: observation.address ?? observation.host,
|
|
8165
|
+
port: observation.port,
|
|
8166
|
+
mdns: {
|
|
8167
|
+
instance: observation.instance,
|
|
8168
|
+
host: observation.host,
|
|
8169
|
+
port: observation.port,
|
|
8170
|
+
txt: observation.txt
|
|
8171
|
+
}
|
|
8172
|
+
});
|
|
8173
|
+
} else if (observation.kind === "ssdp" && mode.kind === "ssdp") {
|
|
8174
|
+
if (mode.searchTarget.toLowerCase() !== observation.target.toLowerCase()) return;
|
|
8175
|
+
hits.push({
|
|
8176
|
+
modeIndex,
|
|
8177
|
+
host: observation.host,
|
|
8178
|
+
port: observation.port,
|
|
8179
|
+
http: {
|
|
8180
|
+
status: 200,
|
|
8181
|
+
headers: observation.headers,
|
|
8182
|
+
bodyText: ""
|
|
8183
|
+
}
|
|
8184
|
+
});
|
|
8185
|
+
}
|
|
8186
|
+
});
|
|
8187
|
+
return hits;
|
|
8188
|
+
}
|
|
8189
|
+
function instanceMatches(pattern, instance) {
|
|
8190
|
+
try {
|
|
8191
|
+
return new RegExp(pattern, "i").test(instance);
|
|
8192
|
+
} catch {
|
|
8193
|
+
return false;
|
|
8194
|
+
}
|
|
8195
|
+
}
|
|
8196
|
+
var DiscoveryProposalService = class {
|
|
8197
|
+
deps;
|
|
8198
|
+
constructor(deps) {
|
|
8199
|
+
this.deps = deps;
|
|
8200
|
+
}
|
|
8201
|
+
async runSweep() {
|
|
8202
|
+
const addonIds = await this.deps.providerIds();
|
|
8203
|
+
const outcomes = await discoverProviders(this.deps.orchestrator, { addonIds });
|
|
8204
|
+
let proposed = 0;
|
|
8205
|
+
for (const outcome of outcomes) {
|
|
8206
|
+
if (outcome.error !== null) continue;
|
|
8207
|
+
proposed += await this.deps.store.observe(outcome.addonId, outcome.candidates);
|
|
8208
|
+
}
|
|
8209
|
+
this.deps.logger.info("discovery sweep recorded", { meta: {
|
|
8210
|
+
providers: addonIds.length,
|
|
8211
|
+
proposed
|
|
8212
|
+
} });
|
|
8213
|
+
return {
|
|
8214
|
+
providers: addonIds.length,
|
|
8215
|
+
proposed
|
|
8216
|
+
};
|
|
8217
|
+
}
|
|
8218
|
+
async reportObservations(observations) {
|
|
8219
|
+
if (observations.length === 0) return { proposed: 0 };
|
|
8220
|
+
const addonIds = await this.deps.providerIds();
|
|
8221
|
+
let proposed = 0;
|
|
8222
|
+
for (const addonId of addonIds) try {
|
|
8223
|
+
const provider = await this.deps.requireProvider(addonId);
|
|
8224
|
+
const modes = await provider.getDiscoveryModes({});
|
|
8225
|
+
const hits = observations.flatMap((o) => hitsForObservation(modes, o));
|
|
8226
|
+
if (hits.length === 0) continue;
|
|
8227
|
+
const candidates = await provider.classifyDiscoveryHits({ hits });
|
|
8228
|
+
proposed += await this.deps.store.observe(addonId, candidates);
|
|
8229
|
+
} catch (err) {
|
|
8230
|
+
this.deps.logger.warn("passive discovery: provider could not classify", { meta: {
|
|
8231
|
+
addonId,
|
|
8232
|
+
error: require_dist.errMsg(err)
|
|
8233
|
+
} });
|
|
8234
|
+
}
|
|
8235
|
+
return { proposed };
|
|
8236
|
+
}
|
|
8237
|
+
async list() {
|
|
8238
|
+
return this.deps.store.listVisible(await this.deps.ownership());
|
|
8239
|
+
}
|
|
8240
|
+
dismiss(id) {
|
|
8241
|
+
return this.deps.store.dismiss(id);
|
|
8242
|
+
}
|
|
8243
|
+
};
|
|
8244
|
+
//#endregion
|
|
8245
|
+
//#region src/builtins/device-manager/discovery-proposal-store.ts
|
|
8246
|
+
function proposalId(addonId, stableId) {
|
|
8247
|
+
return `${addonId}::${stableId}`;
|
|
8248
|
+
}
|
|
8249
|
+
var DiscoveryProposalStore = class DiscoveryProposalStore {
|
|
8250
|
+
kind;
|
|
8251
|
+
now;
|
|
8252
|
+
constructor(kind, now = () => Date.now()) {
|
|
8253
|
+
this.kind = kind;
|
|
8254
|
+
this.now = now;
|
|
8255
|
+
}
|
|
8256
|
+
static of(records, now) {
|
|
8257
|
+
return new DiscoveryProposalStore(records.kind(deviceManagerRecordKinds["discovery-proposals"]), now);
|
|
8258
|
+
}
|
|
8259
|
+
/** Record what a provider classified. Returns how many proposals are NEW. */
|
|
8260
|
+
async observe(addonId, candidates) {
|
|
8261
|
+
const at = this.now();
|
|
8262
|
+
let created = 0;
|
|
8263
|
+
for (const candidate of candidates) {
|
|
8264
|
+
if (candidate.alreadyOnboarded === true) continue;
|
|
8265
|
+
const id = proposalId(addonId, candidate.stableId);
|
|
8266
|
+
const existing = await this.kind.get(id);
|
|
8267
|
+
if (existing === null) created += 1;
|
|
8268
|
+
await this.kind.put({
|
|
8269
|
+
id,
|
|
8270
|
+
at,
|
|
8271
|
+
data: {
|
|
8272
|
+
addonId,
|
|
8273
|
+
candidate,
|
|
8274
|
+
firstSeenAt: existing?.data.firstSeenAt ?? at,
|
|
8275
|
+
lastSeenAt: at,
|
|
8276
|
+
dismissed: existing?.data.dismissed ?? false
|
|
8277
|
+
}
|
|
8278
|
+
});
|
|
8279
|
+
}
|
|
8280
|
+
return created;
|
|
8281
|
+
}
|
|
8282
|
+
/** Not dismissed, not already a device, not an integration the operator owns. */
|
|
8283
|
+
async listVisible(owned) {
|
|
8284
|
+
const rows = await (0, import_read_all_rows.readAllRows)(this.kind, { order: "at" });
|
|
8285
|
+
const out = [];
|
|
8286
|
+
for (const row of rows) {
|
|
8287
|
+
const { candidate, dismissed } = row.data;
|
|
8288
|
+
if (dismissed) continue;
|
|
8289
|
+
if (owned.deviceStableIds.has(candidate.stableId)) continue;
|
|
8290
|
+
if (owned.integrationOriginIds.has(candidate.stableId)) continue;
|
|
8291
|
+
out.push({
|
|
8292
|
+
id: row.id,
|
|
8293
|
+
...row.data
|
|
8294
|
+
});
|
|
8295
|
+
}
|
|
8296
|
+
return out;
|
|
8297
|
+
}
|
|
8298
|
+
async dismiss(id) {
|
|
8299
|
+
const existing = await this.kind.get(id);
|
|
8300
|
+
if (existing === null) return false;
|
|
8301
|
+
await this.kind.put({
|
|
8302
|
+
id,
|
|
8303
|
+
at: existing.data.lastSeenAt,
|
|
8304
|
+
data: {
|
|
8305
|
+
...existing.data,
|
|
8306
|
+
dismissed: true
|
|
8307
|
+
}
|
|
8308
|
+
});
|
|
8309
|
+
return true;
|
|
8310
|
+
}
|
|
8311
|
+
};
|
|
8312
|
+
//#endregion
|
|
8124
8313
|
//#region src/builtins/device-manager/fleet-read-census.ts
|
|
8125
8314
|
/** How many stack frames identify a call site. One frame is a method; three are
|
|
8126
8315
|
* a cause — `listFleet < listAll < onDeviceRegistered` is the answer, `listAll`
|
|
@@ -11034,6 +11223,17 @@ var DeviceManagerAddon = class extends require_dist.BaseAddon {
|
|
|
11034
11223
|
if (records === void 0) throw new Error("[device-manager] ctx.records is required on the hub");
|
|
11035
11224
|
await records.declare(deviceManagerRecordKinds);
|
|
11036
11225
|
const tombstones = DeviceTombstoneStore.of(records, this.ctx.logger.child("tombstones"));
|
|
11226
|
+
const discoveryProposals = new DiscoveryProposalService({
|
|
11227
|
+
store: DiscoveryProposalStore.of(records),
|
|
11228
|
+
orchestrator: this.discoveryDeps(),
|
|
11229
|
+
providerIds: () => this.listDiscoveryCapableProviderIds(),
|
|
11230
|
+
requireProvider: (addonId) => this.requireDeviceProvider(addonId),
|
|
11231
|
+
ownership: async () => ({
|
|
11232
|
+
deviceStableIds: new Set((await deviceRows.listAll()).map((r) => r.meta.stableId)),
|
|
11233
|
+
integrationOriginIds: await this.discoveryDeps().originStableIds()
|
|
11234
|
+
}),
|
|
11235
|
+
logger: this.ctx.logger.child("discovery-proposals")
|
|
11236
|
+
});
|
|
11037
11237
|
this.staleWrapperActivations.checkOnce(() => readBindingsStore(this.bindingsDeps));
|
|
11038
11238
|
try {
|
|
11039
11239
|
await require_retired_settings_keys.purgeRetiredSettingsRows(deviceRows.retiredRowStore(), this.ctx.logger.child("RetiredRows"));
|
|
@@ -11213,6 +11413,10 @@ var DeviceManagerAddon = class extends require_dist.BaseAddon {
|
|
|
11213
11413
|
if (outcome?.error) throw new Error(outcome.error);
|
|
11214
11414
|
return { candidates: outcome?.candidates ?? [] };
|
|
11215
11415
|
},
|
|
11416
|
+
listDiscoveryProposals: async () => ({ proposals: await discoveryProposals.list() }),
|
|
11417
|
+
dismissDiscoveryProposal: async (input) => ({ dismissed: await discoveryProposals.dismiss(input.id) }),
|
|
11418
|
+
reportDiscoveryObservations: (input) => discoveryProposals.reportObservations(input.observations),
|
|
11419
|
+
runDiscoverySweep: () => discoveryProposals.runSweep(),
|
|
11216
11420
|
providerCreationType: async (input) => {
|
|
11217
11421
|
return (await this.requireDeviceProvider(input.addonId)).getManualCreationType({});
|
|
11218
11422
|
},
|