@camstack/system 1.2.68 → 1.2.70
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 +6 -6
- package/dist/addon-runner.mjs +3 -3
- package/dist/addon-utils.js +11 -11
- package/dist/addon-utils.mjs +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +3 -3
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +2 -2
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +3 -3
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +2 -2
- 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 +8 -8
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +6 -6
- 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 +3 -3
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/dist/builtins/device-manager/adoption-job-engine.d.ts +89 -0
- package/dist/builtins/device-manager/device-manager.addon.d.ts +8 -0
- package/dist/builtins/device-manager/device-manager.addon.js +330 -3
- package/dist/builtins/device-manager/device-manager.addon.mjs +330 -3
- package/dist/builtins/device-manager/device-provider-context.d.ts +3 -0
- package/dist/builtins/device-manager/device-queries.d.ts +3 -0
- 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/index.d.ts +0 -1
- package/dist/builtins/local-auth/index.js +0 -1
- package/dist/builtins/local-auth/index.mjs +2 -2
- package/dist/builtins/local-auth/local-auth.addon.js +129 -173
- package/dist/builtins/local-auth/local-auth.addon.mjs +130 -173
- 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 +5 -5
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +4 -4
- package/dist/builtins/platform-probe/index.js +4 -4
- package/dist/builtins/platform-probe/index.mjs +3 -3
- 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 +2 -2
- package/dist/builtins/snapshot/index.mjs +2 -2
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +4 -4
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +3 -3
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +3 -3
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +2 -2
- 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-D2J8RJ7m.mjs → dist-CnQXXnK1.mjs} +296 -2
- package/dist/{dist-Dhpte164.js → dist-DCLoJf2T.js} +295 -7
- package/dist/{model-download-service-CTBHzORJ.mjs → file-data-plane-CuE_hBli.mjs} +848 -848
- package/dist/index.d.ts +73 -81
- package/dist/index.js +1379 -1346
- package/dist/index.mjs +1362 -1328
- package/dist/kernel/capability-registry.d.ts +26 -0
- package/dist/kernel/config-schema.d.ts +1 -1
- package/dist/{manifest-python-deps-Dz1ryHIN.mjs → manifest-python-deps-DKrHcUZj.mjs} +47 -47
- package/package.json +1 -4
- package/dist/builtins/local-auth/homeassistant-integration.d.ts +0 -7
- package/dist/{model-download-service-Caj1kaSi.js → file-data-plane-DUHPHa-Y.js} +847 -847
- package/dist/{manifest-python-deps-BE6l8Y4W.js → manifest-python-deps-DafB-1hp.js} +47 -47
- package/dist/{resource-monitor-BkP504Vq.mjs → resource-monitor-BWmQ5i-o.mjs} +1 -1
- package/dist/{resource-monitor-DNNomR-i.js → resource-monitor-CdnzxBLP.js} +1 -1
|
@@ -3,13 +3,13 @@ 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-
|
|
7
|
-
let node_fs = require("node:fs");
|
|
8
|
-
node_fs = require_chunk.__toESM(node_fs);
|
|
9
|
-
let node_util = require("node:util");
|
|
6
|
+
const require_dist = require("../../dist-DCLoJf2T.js");
|
|
10
7
|
let node_child_process = require("node:child_process");
|
|
8
|
+
let node_util = require("node:util");
|
|
11
9
|
let node_os = require("node:os");
|
|
12
10
|
node_os = require_chunk.__toESM(node_os);
|
|
11
|
+
let node_fs = require("node:fs");
|
|
12
|
+
node_fs = require_chunk.__toESM(node_fs);
|
|
13
13
|
//#region src/builtins/native-metrics/native-metrics-provider.ts
|
|
14
14
|
var IS_DARWIN = node_os.platform() === "darwin";
|
|
15
15
|
var IS_LINUX = node_os.platform() === "linux";
|
|
@@ -123,7 +123,7 @@ var NativeMetricsProvider = class {
|
|
|
123
123
|
return getCpuTemperatureInternal();
|
|
124
124
|
}
|
|
125
125
|
async getProcessStats(input) {
|
|
126
|
-
const { getPidStats } = await Promise.resolve().then(() => require("../../resource-monitor-
|
|
126
|
+
const { getPidStats } = await Promise.resolve().then(() => require("../../resource-monitor-CdnzxBLP.js")).then((n) => n.resource_monitor_exports);
|
|
127
127
|
const raw = await getPidStats(input.pids);
|
|
128
128
|
const result = [];
|
|
129
129
|
for (const [pid, s] of raw) result.push({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as fs from "node:fs";
|
|
3
|
-
import { promisify } from "node:util";
|
|
1
|
+
import { Rt as EventCategory, Tt as createEvent, X as metricsProviderCapability, ft as BaseAddon } from "../../dist-CnQXXnK1.mjs";
|
|
4
2
|
import { execFile, execFileSync } from "node:child_process";
|
|
3
|
+
import { promisify } from "node:util";
|
|
5
4
|
import * as os from "node:os";
|
|
5
|
+
import * as fs from "node:fs";
|
|
6
6
|
//#region src/builtins/native-metrics/native-metrics-provider.ts
|
|
7
7
|
var IS_DARWIN = os.platform() === "darwin";
|
|
8
8
|
var IS_LINUX = os.platform() === "linux";
|
|
@@ -116,7 +116,7 @@ var NativeMetricsProvider = class {
|
|
|
116
116
|
return getCpuTemperatureInternal();
|
|
117
117
|
}
|
|
118
118
|
async getProcessStats(input) {
|
|
119
|
-
const { getPidStats } = await import("../../resource-monitor-
|
|
119
|
+
const { getPidStats } = await import("../../resource-monitor-BWmQ5i-o.mjs").then((n) => n.r);
|
|
120
120
|
const raw = await getPidStats(input.pids);
|
|
121
121
|
const result = [];
|
|
122
122
|
for (const [pid, s] of raw) result.push({
|
|
@@ -3,13 +3,13 @@ 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-
|
|
7
|
-
let node_fs = require("node:fs");
|
|
8
|
-
node_fs = require_chunk.__toESM(node_fs);
|
|
9
|
-
let node_util = require("node:util");
|
|
6
|
+
const require_dist = require("../../dist-DCLoJf2T.js");
|
|
10
7
|
let node_child_process = require("node:child_process");
|
|
8
|
+
let node_util = require("node:util");
|
|
11
9
|
let node_os = require("node:os");
|
|
12
10
|
node_os = require_chunk.__toESM(node_os);
|
|
11
|
+
let node_fs = require("node:fs");
|
|
12
|
+
node_fs = require_chunk.__toESM(node_fs);
|
|
13
13
|
//#region src/builtins/platform-probe/coral-accelerators.ts
|
|
14
14
|
/**
|
|
15
15
|
* Coral USB Edge TPU USB identifiers.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { o as __toESM } from "../../chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import * as fs from "node:fs";
|
|
4
|
-
import { promisify } from "node:util";
|
|
2
|
+
import { Dt as emitReadiness, P as enumerateInferenceDevices, Rt as EventCategory, dt as errMsg, et as platformProbeCapability, ft as BaseAddon, nt as scoreRuntimes } from "../../dist-CnQXXnK1.mjs";
|
|
5
3
|
import { execFile } from "node:child_process";
|
|
4
|
+
import { promisify } from "node:util";
|
|
6
5
|
import * as os from "node:os";
|
|
6
|
+
import * as fs from "node:fs";
|
|
7
7
|
//#region src/builtins/platform-probe/coral-accelerators.ts
|
|
8
8
|
/**
|
|
9
9
|
* Coral USB Edge TPU USB identifiers.
|
|
@@ -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-DCLoJf2T.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 {
|
|
1
|
+
import { Rt as EventCategory, ft as BaseAddon } from "../../dist-CnQXXnK1.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,10 +3,10 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
7
|
-
let _camstack_types_node = require("@camstack/types/node");
|
|
6
|
+
const require_dist = require("../../dist-DCLoJf2T.js");
|
|
8
7
|
let zod = require("zod");
|
|
9
8
|
let node_crypto = require("node:crypto");
|
|
9
|
+
let _camstack_types_node = require("@camstack/types/node");
|
|
10
10
|
let node_child_process = require("node:child_process");
|
|
11
11
|
//#region src/builtins/snapshot/snapshot-coalescing.ts
|
|
12
12
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as bareAddonId,
|
|
2
|
-
import { signExpiringUrl, verifyExpiringUrl } from "@camstack/types/node";
|
|
1
|
+
import { C as bareAddonId, dt as errMsg, ft as BaseAddon, gt as DeviceFeature, i as BatteryStatusSchema, it as snapshotCapability, jt as nodePin, st as streamQualityLabel, vt as DeviceType } from "../../dist-CnQXXnK1.mjs";
|
|
3
2
|
import { z } from "zod";
|
|
4
3
|
import { randomUUID } from "node:crypto";
|
|
4
|
+
import { signExpiringUrl, verifyExpiringUrl } from "@camstack/types/node";
|
|
5
5
|
import { execFile, spawn } from "node:child_process";
|
|
6
6
|
//#region src/builtins/snapshot/snapshot-coalescing.ts
|
|
7
7
|
/**
|
|
@@ -3,14 +3,14 @@ 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-DCLoJf2T.js");
|
|
7
7
|
let node_crypto = require("node:crypto");
|
|
8
|
-
let
|
|
9
|
-
node_fs = require_chunk.__toESM(node_fs);
|
|
8
|
+
let node_fs_promises = require("node:fs/promises");
|
|
10
9
|
let node_path = require("node:path");
|
|
11
10
|
node_path = require_chunk.__toESM(node_path);
|
|
12
11
|
let node_os = require("node:os");
|
|
13
|
-
let
|
|
12
|
+
let node_fs = require("node:fs");
|
|
13
|
+
node_fs = require_chunk.__toESM(node_fs);
|
|
14
14
|
//#region src/builtins/sqlite-storage/path-guard.ts
|
|
15
15
|
/**
|
|
16
16
|
* Allowed-root containment guard for the filesystem-browse cap. Pure +
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { R as filesystemBrowseCapability,
|
|
1
|
+
import { R as filesystemBrowseCapability, ft as BaseAddon, ot as storageProviderCapability } from "../../dist-CnQXXnK1.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
|
-
import
|
|
3
|
+
import { mkdir, readdir, realpath, statfs } from "node:fs/promises";
|
|
4
4
|
import * as path$1 from "node:path";
|
|
5
5
|
import { basename, dirname, join, resolve, sep } from "node:path";
|
|
6
6
|
import { homedir } from "node:os";
|
|
7
|
-
import
|
|
7
|
+
import * as fs from "node:fs";
|
|
8
8
|
//#region src/builtins/sqlite-storage/path-guard.ts
|
|
9
9
|
/**
|
|
10
10
|
* Allowed-root containment guard for the filesystem-browse cap. Pure +
|
|
@@ -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-DCLoJf2T.js");
|
|
7
7
|
let node_crypto = require("node:crypto");
|
|
8
8
|
let node_fs = require("node:fs");
|
|
9
9
|
let node_module = require("node:module");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as bareAddonId,
|
|
1
|
+
import { C as bareAddonId, Nt as parseJsonUnknown, O as dataStoreProviderCapability, St as asJsonObject, dt as errMsg, f as RUNTIME_DEFAULTS, ft as BaseAddon, k as decodeVectorBase64, lt as vectorDimFromBase64, ut as vectorStoreCapability } from "../../dist-CnQXXnK1.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
import { statSync } from "node:fs";
|
|
@@ -3,11 +3,11 @@ 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-
|
|
7
|
-
let node_path = require("node:path");
|
|
8
|
-
node_path = require_chunk.__toESM(node_path);
|
|
6
|
+
const require_dist = require("../../dist-DCLoJf2T.js");
|
|
9
7
|
let node_fs_promises = require("node:fs/promises");
|
|
10
8
|
node_fs_promises = require_chunk.__toESM(node_fs_promises);
|
|
9
|
+
let node_path = require("node:path");
|
|
10
|
+
node_path = require_chunk.__toESM(node_path);
|
|
11
11
|
let _camstack_system = require("@camstack/system");
|
|
12
12
|
//#region src/builtins/storage-orchestrator/storage-orchestrator.service.ts
|
|
13
13
|
var SESSION_VOCABULARY = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as path$1 from "node:path";
|
|
1
|
+
import { Mt as parseJsonObject, at as storageCapability, ft as BaseAddon, h as StorageLocationTypeSchema, rt as settingsStoreCapability } from "../../dist-CnQXXnK1.mjs";
|
|
3
2
|
import * as fs from "node:fs/promises";
|
|
3
|
+
import * as path$1 from "node:path";
|
|
4
4
|
import { buildStorageLocationRegistry } from "@camstack/system";
|
|
5
5
|
//#region src/builtins/storage-orchestrator/storage-orchestrator.service.ts
|
|
6
6
|
var SESSION_VOCABULARY = {
|
|
@@ -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-DCLoJf2T.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 {
|
|
1
|
+
import { dt as errMsg, ft as BaseAddon, kt as hydrateSchema } from "../../dist-CnQXXnK1.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-DCLoJf2T.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 {
|
|
1
|
+
import { ft as BaseAddon, q as logDestinationCapability } from "../../dist-CnQXXnK1.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";
|
|
@@ -3200,6 +3200,104 @@ z.object({
|
|
|
3200
3200
|
})
|
|
3201
3201
|
});
|
|
3202
3202
|
/**
|
|
3203
|
+
* Adoption job — the background form of `device-adoption.adopt`.
|
|
3204
|
+
*
|
|
3205
|
+
* ## Why this exists
|
|
3206
|
+
*
|
|
3207
|
+
* `adopt({childNativeIds: [...]})` materialises one CamStack device per
|
|
3208
|
+
* candidate PLUS every accessory child, and the whole array shares ONE UDS
|
|
3209
|
+
* request deadline (60s). Measured on the live hub against Home Assistant:
|
|
3210
|
+
* each device the kernel creates costs ~450 ms — `devices.create` pre-seeds
|
|
3211
|
+
* meta with up to eleven SEQUENTIAL round trips (`setName`, `setType`,
|
|
3212
|
+
* `setRole`, … `persistConfig`) before the class is constructed — and an
|
|
3213
|
+
* accessory child costs the same as its parent. So the real unit of work is
|
|
3214
|
+
* the CHILD, not the candidate:
|
|
3215
|
+
*
|
|
3216
|
+
* - 25 candidates averaging 6 children → ~150 devices → **>60s, times out**
|
|
3217
|
+
* - ONE candidate with 217 children → ~217 devices → **>60s, times out**
|
|
3218
|
+
*
|
|
3219
|
+
* That second line is why this is a job and not a smaller batch. No chunking,
|
|
3220
|
+
* no bounded concurrency over candidates and no per-call tuning can fix a
|
|
3221
|
+
* shape where **N=1 already exceeds the deadline** — the count that blows the
|
|
3222
|
+
* budget is the source system's accessory fan-out, which the operator does not
|
|
3223
|
+
* choose and cannot see. A design that only works below some N is the same bug
|
|
3224
|
+
* deferred.
|
|
3225
|
+
*
|
|
3226
|
+
* ## What the timeout did NOT do
|
|
3227
|
+
*
|
|
3228
|
+
* It did not stop the work. The UDS deadline ends the CALLER's wait; the
|
|
3229
|
+
* provider's loop runs to completion. Measured: a 25-candidate adopt that
|
|
3230
|
+
* "failed" at 60s had adopted 17 by 87s and all 25 by ~130s. The operator saw
|
|
3231
|
+
* an error and had no way to learn that. Every field below exists so that
|
|
3232
|
+
* question has an answer.
|
|
3233
|
+
*
|
|
3234
|
+
* ## Idempotency
|
|
3235
|
+
*
|
|
3236
|
+
* Jobs are in-RAM; a restart forgets them. That is safe here because adoption
|
|
3237
|
+
* is keyed by a stable id (`ha:<broker>:dev:<nativeId>` and equivalents), so
|
|
3238
|
+
* re-running a job re-adopts nothing: an already-adopted candidate is SKIPPED
|
|
3239
|
+
* by the engine before any provider call and lands in `alreadyAdopted`. It is
|
|
3240
|
+
* never a duplicate device, and never an error the operator has to interpret.
|
|
3241
|
+
*/
|
|
3242
|
+
var AdoptionJobStateSchema = z.enum([
|
|
3243
|
+
"running",
|
|
3244
|
+
"done",
|
|
3245
|
+
"failed",
|
|
3246
|
+
"cancelled"
|
|
3247
|
+
]);
|
|
3248
|
+
/**
|
|
3249
|
+
* Per-candidate result. Every candidate the job was asked to adopt ends in
|
|
3250
|
+
* exactly one of these buckets — there is no silent drop, and the operator can
|
|
3251
|
+
* always answer "which of my 25 landed?".
|
|
3252
|
+
*
|
|
3253
|
+
* - `adopted` — created now by this job.
|
|
3254
|
+
* - `already-adopted` — a device for this candidate existed before the job
|
|
3255
|
+
* reached it (a re-run, or a retry after a timeout). Not an error.
|
|
3256
|
+
* - `failed` — the provider threw; `error` carries the message.
|
|
3257
|
+
* - `cancelled` — the operator cancelled before this candidate was reached.
|
|
3258
|
+
*/
|
|
3259
|
+
var AdoptionOutcomeSchema = z.enum([
|
|
3260
|
+
"adopted",
|
|
3261
|
+
"already-adopted",
|
|
3262
|
+
"failed",
|
|
3263
|
+
"cancelled"
|
|
3264
|
+
]);
|
|
3265
|
+
var AdoptionCandidateResultSchema = z.object({
|
|
3266
|
+
childNativeId: z.string(),
|
|
3267
|
+
outcome: AdoptionOutcomeSchema,
|
|
3268
|
+
/** The materialised parent device id — null for `failed` / `cancelled`. */
|
|
3269
|
+
parentDeviceId: z.number().int().nonnegative().nullable(),
|
|
3270
|
+
/** Accessory children created for this candidate. */
|
|
3271
|
+
accessoryCount: z.number().int().nonnegative(),
|
|
3272
|
+
/** Failure message; null unless `outcome === 'failed'`. */
|
|
3273
|
+
error: z.string().nullable()
|
|
3274
|
+
});
|
|
3275
|
+
var AdoptionJobSchema = z.object({
|
|
3276
|
+
jobId: z.string(),
|
|
3277
|
+
/** The integration provider this job adopts through (the `addonId` pin). */
|
|
3278
|
+
addonId: z.string(),
|
|
3279
|
+
integrationId: z.string(),
|
|
3280
|
+
state: AdoptionJobStateSchema,
|
|
3281
|
+
/** Candidates the job was asked to adopt. Known up front, so never null. */
|
|
3282
|
+
total: z.number().int().nonnegative(),
|
|
3283
|
+
/** Candidates that have reached a terminal bucket. */
|
|
3284
|
+
processed: z.number().int().nonnegative(),
|
|
3285
|
+
adopted: z.number().int().nonnegative(),
|
|
3286
|
+
alreadyAdopted: z.number().int().nonnegative(),
|
|
3287
|
+
failed: z.number().int().nonnegative(),
|
|
3288
|
+
/** Accessory child devices created across every candidate — the real unit
|
|
3289
|
+
* of work, surfaced so a slow job is legible rather than mysterious. */
|
|
3290
|
+
accessoriesCreated: z.number().int().nonnegative(),
|
|
3291
|
+
/** The candidate currently being adopted; null when idle or finished. */
|
|
3292
|
+
currentChildNativeId: z.string().nullable(),
|
|
3293
|
+
/** One entry per candidate, in the order they were processed. */
|
|
3294
|
+
results: z.array(AdoptionCandidateResultSchema).readonly(),
|
|
3295
|
+
startedAt: z.number(),
|
|
3296
|
+
finishedAt: z.number().nullable(),
|
|
3297
|
+
/** Set only when the job itself broke (not a per-candidate failure). */
|
|
3298
|
+
error: z.string().nullable()
|
|
3299
|
+
});
|
|
3300
|
+
/**
|
|
3203
3301
|
* Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
|
|
3204
3302
|
* pipeline functions an operator thinks in terms of.
|
|
3205
3303
|
*
|
|
@@ -9484,6 +9582,31 @@ var deviceManagerCapability = {
|
|
|
9484
9582
|
auth: "admin"
|
|
9485
9583
|
}),
|
|
9486
9584
|
/**
|
|
9585
|
+
* Start a background adoption and return its `jobId` immediately. The job
|
|
9586
|
+
* adopts ONE candidate per provider call, so no single request can exceed
|
|
9587
|
+
* the transport deadline, and it skips candidates that are already adopted
|
|
9588
|
+
* — which makes re-submitting a batch after a timeout safe and silent
|
|
9589
|
+
* rather than a wall of duplicate-stableId errors.
|
|
9590
|
+
*/
|
|
9591
|
+
adoptionStartJob: method(AdoptInputSchema.extend({ addonId: z.string() }), z.object({ jobId: z.string() }), {
|
|
9592
|
+
kind: "mutation",
|
|
9593
|
+
auth: "admin"
|
|
9594
|
+
}),
|
|
9595
|
+
/**
|
|
9596
|
+
* Adoption jobs for an integration, newest first. This is the answer to
|
|
9597
|
+
* "which of my 25 landed?" — `results` carries one entry per candidate,
|
|
9598
|
+
* every one of them in a named bucket.
|
|
9599
|
+
*/
|
|
9600
|
+
adoptionListJobs: method(z.object({
|
|
9601
|
+
addonId: z.string(),
|
|
9602
|
+
integrationId: z.string().optional()
|
|
9603
|
+
}), z.array(AdoptionJobSchema).readonly(), { auth: "admin" }),
|
|
9604
|
+
/** Cooperative cancel: the in-flight candidate finishes, the rest never start. */
|
|
9605
|
+
adoptionCancelJob: method(z.object({ jobId: z.string() }), z.object({ cancelled: z.boolean() }), {
|
|
9606
|
+
kind: "mutation",
|
|
9607
|
+
auth: "admin"
|
|
9608
|
+
}),
|
|
9609
|
+
/**
|
|
9487
9610
|
* Re-sync a device with its source via the device-adoption provider of the
|
|
9488
9611
|
* device's OWNING addon (resolved from `camDeviceId`). Unlike the singleton
|
|
9489
9612
|
* `device-adoption.resync`, this routes to the correct integration so a
|
|
@@ -12899,6 +13022,65 @@ var ScopedTokenSchema = z.object({
|
|
|
12899
13022
|
* Each provider returns a static descriptor; the core enumerates them
|
|
12900
13023
|
* to validate the `integration=` query param and resolve the consent
|
|
12901
13024
|
* label + the scopes baked into the issued token.
|
|
13025
|
+
*
|
|
13026
|
+
* ## Declaring one
|
|
13027
|
+
*
|
|
13028
|
+
* An OAuth client is integration-specific knowledge — who the client is, what
|
|
13029
|
+
* it may ask for, where it may be sent — so it is declared by the ADDON that
|
|
13030
|
+
* owns the integration, never by the kernel and never as a branch inside
|
|
13031
|
+
* `oauth2-routes.ts` ([D101](../../../../docs/decisions/adr-0101.md)). Three
|
|
13032
|
+
* steps, no others:
|
|
13033
|
+
*
|
|
13034
|
+
* 1. Add `{ "name": "oauth-integration" }` to the addon's `camstack.addons[]`
|
|
13035
|
+
* manifest entry. This is also what tells the hub, at addon-LOAD time, that
|
|
13036
|
+
* a descriptor is owed — see "the boot window" below.
|
|
13037
|
+
* 2. Return a provider from `onInitialize()`:
|
|
13038
|
+
*
|
|
13039
|
+
* ```ts
|
|
13040
|
+
* const provider: IOauthIntegrationProvider = {
|
|
13041
|
+
* getDescriptor: async () => ({
|
|
13042
|
+
* integrationId: 'my-thing', // the `integration=` query param
|
|
13043
|
+
* displayName: 'My Thing',
|
|
13044
|
+
* requestedScopes: [ … ], // see below
|
|
13045
|
+
* allowedRedirectPrefixes: ['https://callback.example/'],
|
|
13046
|
+
* }),
|
|
13047
|
+
* }
|
|
13048
|
+
* return [{ capability: oauthIntegrationCapability, provider }]
|
|
13049
|
+
* ```
|
|
13050
|
+
*
|
|
13051
|
+
* The descriptor must be **static** — it is read on the authorize path, so
|
|
13052
|
+
* never put an await on network or disk behind it, and never register it
|
|
13053
|
+
* behind one either (a provider is registered only once `onInitialize`
|
|
13054
|
+
* RETURNS, so anything awaited before the return delays linking).
|
|
13055
|
+
* 3. Nothing else. There is no allow-list to join, no id to register with the
|
|
13056
|
+
* core, and no per-integration branch anywhere: `/api/oauth2/authorize` and
|
|
13057
|
+
* `/api/oauth2/integrations` are built from this collection alone.
|
|
13058
|
+
*
|
|
13059
|
+
* **Scopes.** `requestedScopes` is baked into every token this integration is
|
|
13060
|
+
* ever issued and the operator consents to it once. Derive it from the tRPC
|
|
13061
|
+
* paths the client calls **with that token**, against `METHOD_ACCESS_MAP`, and
|
|
13062
|
+
* prefer a narrow `capability:` scope to a `category:` one unless the client
|
|
13063
|
+
* genuinely needs a whole family. A category scope grants every future member
|
|
13064
|
+
* of that category too. `category:system [create]` has been rejected once and
|
|
13065
|
+
* should stay rejected: it hands `addons.installPackage` to an integration.
|
|
13066
|
+
*
|
|
13067
|
+
* What it does NOT cover: calls the ADDON makes over `ctx.api`, which run as
|
|
13068
|
+
* the addon and are not scope-checked. Alexa's descriptor is narrower than
|
|
13069
|
+
* Home Assistant's for exactly that reason — its Lambda posts directives and
|
|
13070
|
+
* the addon does the work, while the Home Assistant component calls tRPC
|
|
13071
|
+
* directly with the token. So `requestedScopes` describes the blast radius of
|
|
13072
|
+
* the GRANT, not the reach of the integration; do not widen one to describe the
|
|
13073
|
+
* other.
|
|
13074
|
+
*
|
|
13075
|
+
* **The boot window.** An addon registers its provider after its runner forks
|
|
13076
|
+
* and initialises, so between hub start and that moment this collection is
|
|
13077
|
+
* incomplete and an `integrationId` can be legitimately absent. The core does
|
|
13078
|
+
* not wait, poll or cache around this ([D3](../../../../docs/decisions/adr-0003.md)):
|
|
13079
|
+
* it compares the manifest declarers against the registered providers and
|
|
13080
|
+
* answers `503 temporarily_unavailable` (with `Retry-After` and the pending
|
|
13081
|
+
* addon ids) instead of `400 unknown integration`, and reports
|
|
13082
|
+
* `complete: false` on `GET /api/oauth2/integrations`. A client should retry
|
|
13083
|
+
* while the list is incomplete rather than conclude the hub cannot do OAuth.
|
|
12902
13084
|
*/
|
|
12903
13085
|
var OauthIntegrationDescriptorSchema = z.object({
|
|
12904
13086
|
/** Stable id used as the `integration=` query param, e.g. 'export-alexa'. */
|
|
@@ -19797,6 +19979,45 @@ onColorChanged: { data: z.object({
|
|
|
19797
19979
|
*/
|
|
19798
19980
|
runtimeState: ColorStatusSchema
|
|
19799
19981
|
};
|
|
19982
|
+
var ConnectionTestOutcomeSchema = z.discriminatedUnion("outcome", [
|
|
19983
|
+
z.object({
|
|
19984
|
+
outcome: z.literal("validated"),
|
|
19985
|
+
/** Round-trip of the sign-in, when the provider measured it. */
|
|
19986
|
+
latencyMs: z.number().nonnegative().optional(),
|
|
19987
|
+
/** Optional human detail worth showing next to the tick
|
|
19988
|
+
* ("3 devices visible on this account"). */
|
|
19989
|
+
detail: z.string().optional()
|
|
19990
|
+
}).strict(),
|
|
19991
|
+
z.object({
|
|
19992
|
+
outcome: z.literal("rejected"),
|
|
19993
|
+
error: z.string()
|
|
19994
|
+
}).strict(),
|
|
19995
|
+
z.object({
|
|
19996
|
+
outcome: z.literal("inconclusive"),
|
|
19997
|
+
error: z.string()
|
|
19998
|
+
}).strict()
|
|
19999
|
+
]);
|
|
20000
|
+
var ConnectionTestInputSchema = z.object({
|
|
20001
|
+
/** Candidate integration settings, exactly as the create form collected them. */
|
|
20002
|
+
settings: z.record(z.string(), z.unknown()) });
|
|
20003
|
+
/**
|
|
20004
|
+
* What the provider's test actually DOES, so the UI can say it in words before
|
|
20005
|
+
* the operator presses the button ("Signs in to the Dreo cloud"). Purely
|
|
20006
|
+
* descriptive — it never changes routing.
|
|
20007
|
+
*/
|
|
20008
|
+
var ConnectionTestDescriptorSchema = z.object({ label: z.string() });
|
|
20009
|
+
var connectionTestCapability = {
|
|
20010
|
+
name: "connection-test",
|
|
20011
|
+
scope: "system",
|
|
20012
|
+
mode: "collection",
|
|
20013
|
+
methods: {
|
|
20014
|
+
testSettings: method(ConnectionTestInputSchema, ConnectionTestOutcomeSchema, {
|
|
20015
|
+
kind: "mutation",
|
|
20016
|
+
auth: "admin"
|
|
20017
|
+
}),
|
|
20018
|
+
describeTest: method(z.void(), ConnectionTestDescriptorSchema, { auth: "admin" })
|
|
20019
|
+
}
|
|
20020
|
+
};
|
|
19800
20021
|
/**
|
|
19801
20022
|
* Upstream-system connectivity sensor — distinct from `device-status`,
|
|
19802
20023
|
* which is the kernel-managed online/offline flag for the device's
|
|
@@ -21240,15 +21461,57 @@ var AvailableIntegrationTypeSchema = z.object({
|
|
|
21240
21461
|
* flow can import (e.g. HA areas). Drives the adopt modal's "import
|
|
21241
21462
|
* locations" checkbox. Provider-declared in the addon manifest. */
|
|
21242
21463
|
supportsLocationImport: z.boolean(),
|
|
21464
|
+
/**
|
|
21465
|
+
* True when this integration DECLARES a pre-creation test (the
|
|
21466
|
+
* `connection-test` cap, or a broker whose settings it stores). Drives the
|
|
21467
|
+
* Test button: an integration that cannot be tested must say so up front
|
|
21468
|
+
* rather than offering a button that always answers the same nonsense.
|
|
21469
|
+
*/
|
|
21470
|
+
canTest: z.boolean(),
|
|
21243
21471
|
existingInstances: z.array(z.object({
|
|
21244
21472
|
id: z.string(),
|
|
21245
21473
|
name: z.string()
|
|
21246
21474
|
})),
|
|
21247
21475
|
canAdd: z.boolean()
|
|
21248
21476
|
});
|
|
21477
|
+
/**
|
|
21478
|
+
* Why a test could not be answered as a plain boolean.
|
|
21479
|
+
*
|
|
21480
|
+
* `success` alone collapsed four different situations into one red box, and the
|
|
21481
|
+
* one that mattered most — "nobody ever asked the remote anything" — looked
|
|
21482
|
+
* exactly like "the remote said no". The status is the discriminator:
|
|
21483
|
+
*
|
|
21484
|
+
* - `validated` — a provider-declared test ran and the remote ACCEPTED.
|
|
21485
|
+
* - `rejected` — a provider-declared test ran and the remote REFUSED.
|
|
21486
|
+
* The only status that blocks `integrations.create`.
|
|
21487
|
+
* - `inconclusive` — a test IS declared but could not complete (timeout,
|
|
21488
|
+
* DNS, 5xx). Nothing was observed; not a failure.
|
|
21489
|
+
* - `unsupported` — this integration declares NO test. Nothing was
|
|
21490
|
+
* observed either; not a failure, and not a pass.
|
|
21491
|
+
*
|
|
21492
|
+
* `unsupported` and `inconclusive` both carry `success: false` so an older
|
|
21493
|
+
* client can never read them as a green tick, and both carry an `error` string
|
|
21494
|
+
* that SAYS the test did not run rather than inventing a failure.
|
|
21495
|
+
*/
|
|
21496
|
+
var TestConnectionStatusEnum = z.enum([
|
|
21497
|
+
"validated",
|
|
21498
|
+
"rejected",
|
|
21499
|
+
"inconclusive",
|
|
21500
|
+
"unsupported"
|
|
21501
|
+
]);
|
|
21249
21502
|
var TestConnectionResultSchema$1 = z.object({
|
|
21503
|
+
/** True ONLY for `validated`. Never true for a test that did not run. */
|
|
21250
21504
|
success: z.boolean(),
|
|
21251
|
-
error: z.string().optional()
|
|
21505
|
+
error: z.string().optional(),
|
|
21506
|
+
/** Optional for wire back-compat with clients built before the tri-state;
|
|
21507
|
+
* the server always sets it. */
|
|
21508
|
+
status: TestConnectionStatusEnum.optional(),
|
|
21509
|
+
/** Addon id whose declared test answered — `null` when none did. Lets the UI
|
|
21510
|
+
* attribute a result instead of blaming "the integration". */
|
|
21511
|
+
testedBy: z.string().nullable().optional(),
|
|
21512
|
+
latencyMs: z.number().nonnegative().optional(),
|
|
21513
|
+
/** Human detail from a `validated` result ("3 devices on this account"). */
|
|
21514
|
+
detail: z.string().optional()
|
|
21252
21515
|
});
|
|
21253
21516
|
var CreateIntegrationInputSchema = z.object({
|
|
21254
21517
|
addonId: z.string(),
|
|
@@ -27046,6 +27309,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
|
|
|
27046
27309
|
carbonMonoxideCapability,
|
|
27047
27310
|
climateControlCapability,
|
|
27048
27311
|
colorCapability,
|
|
27312
|
+
connectionTestCapability,
|
|
27049
27313
|
connectivityCapability,
|
|
27050
27314
|
consumablesCapability,
|
|
27051
27315
|
contactCapability,
|
|
@@ -27938,6 +28202,18 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
27938
28202
|
addonId: null,
|
|
27939
28203
|
access: "create"
|
|
27940
28204
|
},
|
|
28205
|
+
"connectionTest.describeTest": {
|
|
28206
|
+
capName: "connection-test",
|
|
28207
|
+
capScope: "system",
|
|
28208
|
+
addonId: null,
|
|
28209
|
+
access: "view"
|
|
28210
|
+
},
|
|
28211
|
+
"connectionTest.testSettings": {
|
|
28212
|
+
capName: "connection-test",
|
|
28213
|
+
capScope: "system",
|
|
28214
|
+
addonId: null,
|
|
28215
|
+
access: "create"
|
|
28216
|
+
},
|
|
27941
28217
|
"consumables.reset": {
|
|
27942
28218
|
capName: "consumables",
|
|
27943
28219
|
capScope: "device",
|
|
@@ -28328,6 +28604,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
28328
28604
|
addonId: null,
|
|
28329
28605
|
access: "create"
|
|
28330
28606
|
},
|
|
28607
|
+
"deviceManager.adoptionCancelJob": {
|
|
28608
|
+
capName: "device-manager",
|
|
28609
|
+
capScope: "system",
|
|
28610
|
+
addonId: null,
|
|
28611
|
+
access: "create"
|
|
28612
|
+
},
|
|
28331
28613
|
"deviceManager.adoptionListCandidateFilters": {
|
|
28332
28614
|
capName: "device-manager",
|
|
28333
28615
|
capScope: "system",
|
|
@@ -28340,6 +28622,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
28340
28622
|
addonId: null,
|
|
28341
28623
|
access: "view"
|
|
28342
28624
|
},
|
|
28625
|
+
"deviceManager.adoptionListJobs": {
|
|
28626
|
+
capName: "device-manager",
|
|
28627
|
+
capScope: "system",
|
|
28628
|
+
addonId: null,
|
|
28629
|
+
access: "view"
|
|
28630
|
+
},
|
|
28343
28631
|
"deviceManager.adoptionRefresh": {
|
|
28344
28632
|
capName: "device-manager",
|
|
28345
28633
|
capScope: "system",
|
|
@@ -28358,6 +28646,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
28358
28646
|
addonId: null,
|
|
28359
28647
|
access: "create"
|
|
28360
28648
|
},
|
|
28649
|
+
"deviceManager.adoptionStartJob": {
|
|
28650
|
+
capName: "device-manager",
|
|
28651
|
+
capScope: "system",
|
|
28652
|
+
addonId: null,
|
|
28653
|
+
access: "create"
|
|
28654
|
+
},
|
|
28361
28655
|
"deviceManager.allocateDeviceId": {
|
|
28362
28656
|
capName: "device-manager",
|
|
28363
28657
|
capScope: "system",
|
|
@@ -32944,4 +33238,4 @@ function enumerateInferenceDevices(hw) {
|
|
|
32944
33238
|
return out;
|
|
32945
33239
|
}
|
|
32946
33240
|
//#endregion
|
|
32947
|
-
export {
|
|
33241
|
+
export { parseStreamParamsFormPatch as $, deviceManagerCapability as A, isDeviceConfigCap as At, isCollectionArrayMethod as B, bareAddonId as C, asNumber as Ct, coreBlocksCapability as D, emitReadiness as Dt, coreBlockIdFromAddonId as E, emitDownForOwnedCaps as Et, enumerateItemArrayFields as F, resolveCapMount as Ft, lifecycleJobSchema as G, isSameAddonId as H, enumerateSchemaFields as I, scopeKey as It, logLevelAtMost as J, localNetworkCapability as K, extractNestedAddonId as L, sleep as Lt, deviceStatusCapability as M, parseJsonObject as Mt, doorbellCapability as N, parseJsonUnknown as Nt, dataStoreProviderCapability as O, expandCapMethods as Ot, enumerateInferenceDevices as P, readinessKey as Pt, objectInputDeclaresAddonId as Q, filesystemBrowseCapability as R, EventCategory as Rt, backupCapability as S, asJsonObject as St, coreBlockAddonId as T, createEvent as Tt, isVoidInput as U, isObjectInput as V, kebabToCamel as W, metricsProviderCapability as X, looseSchema as Y, normalizeUnit as Z, addonPagesCapability as _, DeviceRole as _t, CAP_NAMES_WITH_STATUS as a, storageCapability as at, alertsCapability as b, ReadinessTimeoutError as bt, CoreBlockSchema as c, userManagementCapability as ct, METHOD_ACCESS_MAP as d, errMsg as dt, platformProbeCapability as et, RUNTIME_DEFAULTS as f, BaseAddon as ft, UserRecordSchema as g, DeviceFeature as gt, StorageLocationTypeSchema as h, DEVICE_STATUS_METHOD as ht, BatteryStatusSchema as i, snapshotCapability as it, deviceStateCapability as j, nodePin as jt, decodeVectorBase64 as k, hydrateSchema as kt, DeclaredDevices as l, vectorDimFromBase64 as lt, ScopedTokenSchema as m, DEVICE_SETTINGS_CONTRIBUTION_METHODS as mt, AlertSchema as n, scoreRuntimes as nt, CORE_BLOCKS_ADDON_ID as o, storageProviderCapability as ot, STREAM_PROFILE_META as p, DATAPLANE_SECRET_HEADER as pt, logDestinationCapability as q, ApiKeyRecordSchema as r, settingsStoreCapability as rt, CORE_BLOCK_ADDON_PREFIX as s, streamQualityLabel as st, ALL_CAPABILITY_DEFINITIONS as t, procedureAuthKey as tt, DeviceStatusSchema as u, vectorStoreCapability as ut, addonSettingsCapability as v, DeviceType as vt, buildStreamParamsConfigSchema as w, asString as wt, authProviderCapability as x, WELL_KNOWN_TAB_MAP as xt, addonWidgetsCapability as y, ReadinessRegistry as yt, isArrayOutputSchema as z };
|