@camstack/server 1.2.893 → 1.2.895
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 +12 -0
- package/dist/api/core/api-catalog.js +93 -0
- package/dist/api/core/api-catalog.router.js +74 -0
- package/dist/api/trpc/generated-cap-mounts.js +3 -1
- package/dist/api/trpc/generated-cap-routers.js +1528 -1499
- package/dist/api/trpc/trpc.middleware.js +17 -0
- package/dist/api/trpc/trpc.router.js +10 -3
- package/package.json +27 -13
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/alerts/alerts.addon.js +1 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/system/dist/builtins/autotrack/index.js +1 -1
- package/system/dist/builtins/autotrack/index.mjs +1 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- package/system/dist/builtins/calendars/calendars.addon.js +1 -1
- package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/system/dist/builtins/camera-grid/index.js +1 -1
- package/system/dist/builtins/camera-grid/index.mjs +1 -1
- package/system/dist/builtins/composer/composer.addon.js +5 -5
- package/system/dist/builtins/composer/composer.addon.mjs +5 -5
- package/system/dist/builtins/composer/graft-host.d.ts +1 -1
- package/system/dist/builtins/console-logging/index.js +1 -1
- package/system/dist/builtins/console-logging/index.mjs +1 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +3 -3
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +3 -3
- 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 +79 -8
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +79 -8
- package/system/dist/builtins/device-manager/device-provider-context.d.ts +5 -0
- package/system/dist/builtins/device-manager/device-state-mirror.d.ts +10 -0
- package/system/dist/builtins/device-manager/runtime-state-persist-gate.d.ts +20 -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 +4 -4
- package/system/dist/builtins/keychain/index.mjs +4 -4
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
- package/system/dist/builtins/local-network/local-network.addon.js +3 -3
- package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
- package/system/dist/builtins/loki-logging/index.js +1 -1
- package/system/dist/builtins/loki-logging/index.mjs +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +1 -1
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +14 -12
- package/system/dist/builtins/snapshot/index.mjs +14 -12
- package/system/dist/builtins/snapshot/snapshot.addon.d.ts +6 -4
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/system-config/system-config.addon.js +3 -3
- package/system/dist/builtins/system-config/system-config.addon.mjs +284 -284
- package/system/dist/builtins/winston-logging/index.js +1 -1
- package/system/dist/builtins/winston-logging/index.mjs +1 -1
- package/system/dist/{capture-engine-mZ2J-GD6.js → capture-engine-BgIjQWh6.js} +1 -1
- package/system/dist/{capture-engine-CIVKm_jN.mjs → capture-engine-DPn6JaPc.mjs} +1 -1
- package/system/dist/{composition-sources-bJP8_Z2o.mjs → composition-sources-B0rdPm85.mjs} +1 -1
- package/system/dist/{composition-sources-CGP5ZUYo.js → composition-sources-Bec_hQMM.js} +1 -1
- package/system/dist/{constants-BD8oSQro.js → constants-CsYMak6g.js} +1 -1
- package/system/dist/{constants-w-6vvTPp.mjs → constants-DsQsO8PD.mjs} +1 -1
- package/system/dist/{device-ca-CXxnQaff.js → device-ca-BeK8EI_7.js} +1 -1
- package/system/dist/{device-ca-DE_oetBE.mjs → device-ca-BuDqRFZd.mjs} +1 -1
- package/system/dist/{dist-B2-Uflhy.js → dist-CHC8tlB1.js} +351 -110
- package/system/dist/{dist-Be8yFd71.mjs → dist-DiknL6UU.mjs} +334 -99
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-identity-BjYvJU_v.js → hub-identity-BM26oLpK.js} +1 -1
- package/system/dist/{hub-identity-C3g7b58L.mjs → hub-identity-Dt-mbtkY.mjs} +1 -1
- package/system/dist/{hub-mdns-ciao-BRfv9GfW.js → hub-mdns-ciao-BDgSHCPM.js} +2 -2
- package/system/dist/{hub-mdns-ciao-v6X_SbWl.mjs → hub-mdns-ciao-CHq7b1FX.mjs} +2 -2
- package/system/dist/index.js +8 -8
- package/system/dist/index.mjs +8 -8
- package/system/dist/kernel/status-overlay.d.ts +1 -1
- package/system/dist/{legacy-integration-rows-door-DG35DG06.mjs → legacy-integration-rows-door-1WauJNCy.mjs} +1 -1
- package/system/dist/{legacy-integration-rows-door-B0q34gh3.js → legacy-integration-rows-door-BYJa0xPI.js} +1 -1
- package/system/dist/{rename-composition-block-LEbZ4oZE.mjs → rename-composition-block-BOoAElGp.mjs} +1 -1
- package/system/dist/{rename-composition-block-DNte3Cs9.js → rename-composition-block-fMaUic9d.js} +1 -1
- package/system/dist/{restore-archive-DpFPheMK.js → restore-archive-CeZV08vh.js} +1 -1
- package/system/dist/{restore-archive--4ENkU5f.mjs → restore-archive-DZDV10KN.mjs} +82 -82
- package/system/dist/{wal-maintenance-DQVDhuVJ.mjs → wal-maintenance-CekT_qH6.mjs} +0 -0
- package/system/dist/{wal-maintenance-BWUJktqT.js → wal-maintenance-CmCCUKZO.js} +0 -0
- package/system/package.json +1 -1
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.adminProcedure = exports.protectedProcedure = exports.createCallerFactory = exports.publicProcedure = exports.trpcRouter = void 0;
|
|
7
7
|
exports.iterableSubscription = iterableSubscription;
|
|
8
8
|
exports.iterableInterval = iterableInterval;
|
|
9
|
+
exports.procedureTierOf = procedureTierOf;
|
|
9
10
|
const system_1 = require("@camstack/server/system");
|
|
10
11
|
const types_1 = require("@camstack/types");
|
|
11
12
|
const device_access_js_1 = require("./device-access.js");
|
|
@@ -198,3 +199,19 @@ exports.adminProcedure = exports.protectedProcedure.use(({ ctx, next, path }) =>
|
|
|
198
199
|
}
|
|
199
200
|
return next({ ctx });
|
|
200
201
|
});
|
|
202
|
+
/**
|
|
203
|
+
* The tier of a built procedure, read off its middleware chain: a procedure
|
|
204
|
+
* built from `adminProcedure` carries the admin gate's function, one built from
|
|
205
|
+
* `protectedProcedure` the authentication gate's. The marks are the SAME
|
|
206
|
+
* function references the builders pipe, so the answer is the gate the call
|
|
207
|
+
* actually passes through — capability and core routes alike.
|
|
208
|
+
*/
|
|
209
|
+
const PROTECTED_MARK = exports.protectedProcedure._def.middlewares.at(-1);
|
|
210
|
+
const ADMIN_MARK = exports.adminProcedure._def.middlewares.at(-1);
|
|
211
|
+
function procedureTierOf(middlewares) {
|
|
212
|
+
if (middlewares.includes(ADMIN_MARK))
|
|
213
|
+
return 'admin';
|
|
214
|
+
if (middlewares.includes(PROTECTED_MARK))
|
|
215
|
+
return 'protected';
|
|
216
|
+
return 'public';
|
|
217
|
+
}
|
|
@@ -43,6 +43,7 @@ const path = __importStar(require("node:path"));
|
|
|
43
43
|
const addon_settings_router_js_1 = require("../core/addon-settings.router.js");
|
|
44
44
|
const session_connections_js_1 = require("../../auth/session-connections.js");
|
|
45
45
|
const agent_pairing_router_js_1 = require("../core/agent-pairing.router.js");
|
|
46
|
+
const api_catalog_router_js_1 = require("../core/api-catalog.router.js");
|
|
46
47
|
const certificates_router_js_1 = require("../core/certificates.router.js");
|
|
47
48
|
const node_certificates_client_js_1 = require("../../core/agent/node-certificates-client.js");
|
|
48
49
|
const auth_router_js_1 = require("../core/auth.router.js");
|
|
@@ -291,7 +292,7 @@ function buildServerProviders(services) {
|
|
|
291
292
|
* runtime builder; the server only supplies `server-provided` provider factories
|
|
292
293
|
* (`buildServerProviders`), never a hand-written cap-router override.
|
|
293
294
|
*/
|
|
294
|
-
function buildCapabilityRouters(services) {
|
|
295
|
+
function buildCapabilityRouters(services, servedProcedures) {
|
|
295
296
|
// ── Dynamic cap routers (value) → static cap-router map (type). ──────
|
|
296
297
|
// The runtime builder returns `Record<string, unknown>`; assigning it to
|
|
297
298
|
// `ReturnType<typeof mountAllCaps>` is the documented type boundary that
|
|
@@ -356,6 +357,9 @@ function buildCapabilityRouters(services) {
|
|
|
356
357
|
log: services.loggingService.createLogger('certificates'),
|
|
357
358
|
}),
|
|
358
359
|
// preferences - the caller's own account preferences, synced across their devices (D894).
|
|
360
|
+
// The API explorer (planning#595): reads the procedures of the router this
|
|
361
|
+
// object is mounted in, so it lists exactly what the hub serves.
|
|
362
|
+
apiCatalog: (0, api_catalog_router_js_1.createApiCatalogRouter)(servedProcedures),
|
|
359
363
|
preferences: (0, preferences_router_js_1.createPreferencesRouter)({
|
|
360
364
|
preferences: (0, preferences_router_js_1.preferencesFromRegistry)(services.capabilityRegistry),
|
|
361
365
|
}),
|
|
@@ -384,7 +388,10 @@ function buildCapabilityRouters(services) {
|
|
|
384
388
|
};
|
|
385
389
|
}
|
|
386
390
|
function buildAppRouter(services) {
|
|
387
|
-
|
|
388
|
-
|
|
391
|
+
// `apiCatalog` reads the finished router lazily (at request time), after
|
|
392
|
+
// `appRouter` below is assigned.
|
|
393
|
+
const appRouter = (0, trpc_middleware_1.trpcRouter)({
|
|
394
|
+
...buildCapabilityRouters(services, () => appRouter._def.procedures),
|
|
389
395
|
});
|
|
396
|
+
return appRouter;
|
|
390
397
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/server",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.895",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -66,11 +66,25 @@
|
|
|
66
66
|
],
|
|
67
67
|
"requires": {
|
|
68
68
|
"addons": {
|
|
69
|
-
"@camstack/addon-admin-ui": ">=1.2.
|
|
70
|
-
"@camstack/addon-agent-ui": ">=1.2.
|
|
71
|
-
"@camstack/addon-export-
|
|
72
|
-
"@camstack/addon-
|
|
73
|
-
"@camstack/addon-
|
|
69
|
+
"@camstack/addon-admin-ui": ">=1.2.695",
|
|
70
|
+
"@camstack/addon-agent-ui": ">=1.2.406",
|
|
71
|
+
"@camstack/addon-export-alexa": ">=1.2.201",
|
|
72
|
+
"@camstack/addon-matter-broker": ">=0.2.171",
|
|
73
|
+
"@camstack/addon-pipeline": ">=1.2.658",
|
|
74
|
+
"@camstack/addon-pipeline-orchestrator": ">=1.2.699",
|
|
75
|
+
"@camstack/addon-post-analysis": ">=1.2.713",
|
|
76
|
+
"@camstack/addon-provider-bosch": ">=0.1.59",
|
|
77
|
+
"@camstack/addon-provider-dreame": ">=0.2.179",
|
|
78
|
+
"@camstack/addon-provider-dreo": ">=0.2.166",
|
|
79
|
+
"@camstack/addon-provider-ecowitt": ">=0.2.170",
|
|
80
|
+
"@camstack/addon-provider-esphome": ">=0.1.24",
|
|
81
|
+
"@camstack/addon-provider-gree": ">=0.2.161",
|
|
82
|
+
"@camstack/addon-provider-homeassistant": ">=1.2.693",
|
|
83
|
+
"@camstack/addon-provider-homematic": ">=1.2.206",
|
|
84
|
+
"@camstack/addon-provider-mqtt-ha": ">=0.1.52",
|
|
85
|
+
"@camstack/addon-provider-reolink": ">=1.2.244",
|
|
86
|
+
"@camstack/addon-provider-unifi": ">=0.2.167",
|
|
87
|
+
"@camstack/addon-provider-unraid": ">=0.2.170"
|
|
74
88
|
},
|
|
75
89
|
"wrapper": {
|
|
76
90
|
"desktop": ">=0.0.1",
|
|
@@ -79,19 +93,19 @@
|
|
|
79
93
|
}
|
|
80
94
|
},
|
|
81
95
|
"dependencies": {
|
|
82
|
-
"@camstack/addon-admin-ui": "1.2.
|
|
83
|
-
"@camstack/addon-agent-ui": "1.2.
|
|
96
|
+
"@camstack/addon-admin-ui": "1.2.695",
|
|
97
|
+
"@camstack/addon-agent-ui": "1.2.406",
|
|
84
98
|
"@camstack/addon-auth": "1.2.182",
|
|
85
99
|
"@camstack/addon-benchmark": "1.2.313",
|
|
86
100
|
"@camstack/addon-decoder-nodeav": "1.2.149",
|
|
87
101
|
"@camstack/addon-notifiers": "1.2.639",
|
|
88
|
-
"@camstack/addon-pipeline": "1.2.
|
|
89
|
-
"@camstack/addon-pipeline-orchestrator": "1.2.
|
|
90
|
-
"@camstack/addon-post-analysis": "1.2.
|
|
102
|
+
"@camstack/addon-pipeline": "1.2.658",
|
|
103
|
+
"@camstack/addon-pipeline-orchestrator": "1.2.699",
|
|
104
|
+
"@camstack/addon-post-analysis": "1.2.713",
|
|
91
105
|
"@camstack/develop": "0.1.54",
|
|
92
106
|
"@camstack/sdk": "1.2.159",
|
|
93
|
-
"@camstack/types": "1.2.
|
|
94
|
-
"@camstack/ui-library": "1.2.
|
|
107
|
+
"@camstack/types": "1.2.590",
|
|
108
|
+
"@camstack/ui-library": "1.2.467",
|
|
95
109
|
"@fastify/compress": "^9.0.0",
|
|
96
110
|
"@fastify/cookie": "^11.0.2",
|
|
97
111
|
"@fastify/cors": "^11.2.0",
|
|
@@ -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-CHC8tlB1.js");
|
|
7
7
|
const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
|
|
8
8
|
let node_crypto = require("node:crypto");
|
|
9
9
|
let node_fs = require("node:fs");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Nn as addonPagesCapability,
|
|
1
|
+
import { Nn as addonPagesCapability, hu as EventCategory, pc as BaseAddon, pu as errMsg } from "../../dist-DiknL6UU.mjs";
|
|
2
2
|
import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
4
|
import * as fs$1 from "node:fs";
|
|
@@ -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-CHC8tlB1.js");
|
|
7
7
|
const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
|
|
8
8
|
let node_crypto = require("node:crypto");
|
|
9
9
|
let node_fs = require("node:fs");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fn as addonWidgetsCapability,
|
|
1
|
+
import { Fn as addonWidgetsCapability, hu as EventCategory, pc as BaseAddon, pu as errMsg } from "../../dist-DiknL6UU.mjs";
|
|
2
2
|
import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
4
|
import * as fs$1 from "node:fs";
|
|
@@ -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-CHC8tlB1.js");
|
|
7
7
|
const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
|
|
8
8
|
const require_log_redactor = require("../../log-redactor-BhIEMaG9.js");
|
|
9
9
|
let node_fs = require("node:fs");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ai as isAlertEpisodeOpen,
|
|
1
|
+
import { Ai as isAlertEpisodeOpen, E as CORE_BLOCK_ADDON_PREFIX, In as alertEpisodeId, Ln as alertEpisodePayload, Rn as alertsCapability, hl as defineRecordKinds, hu as EventCategory, ji as isAlertEpisodeSeverity, p as AlertSchema, pc as BaseAddon, pu as errMsg, ul as createEvent } from "../../dist-DiknL6UU.mjs";
|
|
2
2
|
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
3
3
|
import { a as redactLogText } from "../../log-redactor-XLDrPzOi.mjs";
|
|
4
4
|
import * as fs$1 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-CHC8tlB1.js");
|
|
7
7
|
let zod = require("zod");
|
|
8
8
|
//#region src/builtins/autotrack/autotrack-config.ts
|
|
9
9
|
var DEFAULT_AUTOTRACK_LOOP_CONFIG = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ja as ptzAutotrackCapability, Ol as isEvent, Wn as bareAddonId, hu as EventCategory, mt as FIRST_LEVEL_MACRO_CLASSES, pc as BaseAddon, pu as errMsg } from "../../dist-DiknL6UU.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region src/builtins/autotrack/autotrack-config.ts
|
|
4
4
|
var DEFAULT_AUTOTRACK_LOOP_CONFIG = {
|
|
@@ -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-CHC8tlB1.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-CeZV08vh.js");
|
|
9
9
|
let node_crypto = require("node:crypto");
|
|
10
10
|
let node_fs = require("node:fs");
|
|
11
11
|
node_fs = require_chunk.__toESM(node_fs);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bl as nodePin, Un as backupCapability, Xo as storageOccupancyCapability, hu as EventCategory, la as mayWriteToLocation, nu as toNodeId, pc as BaseAddon } from "../../dist-DiknL6UU.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-DZDV10KN.mjs";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import * as fs$1 from "node:fs";
|
|
6
6
|
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-CHC8tlB1.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 { $n as calendarsCapability, O as CalendarPreferencesSchema, hl as defineRecordKinds, pc as BaseAddon } from "../../dist-DiknL6UU.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-CHC8tlB1.js");
|
|
7
7
|
let zod = require("zod");
|
|
8
8
|
let _camstack_types_node = require("@camstack/types/node");
|
|
9
9
|
let node_fs = require("node:fs");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ar as declarationOwnerNodeId, B as DERIVED_CAMERA_SILENCED_CAP_NAMES, Ci as hostEngineDevice, Fo as selectEngineHostedBlocks, Ls as buildFfmpegArgs, Lt as MOTION_CLOSE_AFTER_MS, Os as COMPOSER_ADDON_ID, Qo as streamCatalogCapability, Tt as HostedWithdrawalGate, Wn as bareAddonId, Wo as snapshotCapability, Zi as legacySweepDone, er as cameraGridLayoutCapability, fa as memoizePinnedFfmpeg, hu as EventCategory, pc as BaseAddon, pr as compileHelper, pu as errMsg, ts as sweepLegacyEngineRows, ul as createEvent, uu as DeviceFeature, v as BaseDevice, wl as hydrateSchema, ya as motionCapability } from "../../dist-DiknL6UU.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { FfmpegProcess } from "@camstack/types/node";
|
|
4
4
|
import { promises } from "node:fs";
|
|
@@ -3,11 +3,11 @@ 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_capture_engine = require("../../capture-engine-
|
|
6
|
+
const require_dist = require("../../dist-CHC8tlB1.js");
|
|
7
|
+
const require_composition_sources = require("../../composition-sources-Bec_hQMM.js");
|
|
8
|
+
const require_capture_engine = require("../../capture-engine-BgIjQWh6.js");
|
|
9
9
|
const require_retention = require("../../retention-BcOSL6b9.js");
|
|
10
|
-
const require_rename_composition_block = require("../../rename-composition-block-
|
|
10
|
+
const require_rename_composition_block = require("../../rename-composition-block-fMaUic9d.js");
|
|
11
11
|
let zod = require("zod");
|
|
12
12
|
//#region src/builtins/composer/actuator-invoke.ts
|
|
13
13
|
/**
|
|
@@ -5162,7 +5162,7 @@ var NodeDeadlineTimer = class {
|
|
|
5162
5162
|
* ADDS to a device the composer does not own — a battery on an HA pet feeder
|
|
5163
5163
|
* that registers none. Without it the added cap has claimed values on the hub
|
|
5164
5164
|
* but nothing answers its methods, so `getBindings` never lists it and a caller
|
|
5165
|
-
* of `
|
|
5165
|
+
* of the cap (its `getStatus`, a composed method) finds no provider.
|
|
5166
5166
|
*
|
|
5167
5167
|
* - The provider is built ONLY from the cap's `composedMethods` (Task 1): an
|
|
5168
5168
|
* `answer` resolves to its value, a `refuse` rejects naming its reason. A cap
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as parseDeviceStateChanged, n as normalizedNativeOwner, r as isRecord$4 } from "../../composition-sources-
|
|
3
|
-
import { i as capSeriesKey } from "../../capture-engine-
|
|
1
|
+
import { $s as historyRetentionFromSettings, Bo as sharedColorModes, C as COMPOSED_ITEM_FIXED_FIELDS, Cs as withDefaultRunning, Et as HvacModeSchema, Ga as processTimeZoneOr, Gn as brightnessCapability, Gs as compositionItemFieldPath, Hs as composedDeviceRef, Ia as planComposition, Is as MINUTE_MS, Js as createStatefulExpressionMemory, Ki as kebabToCamel, Ks as compositionSliceKey, Ms as HISTORY_FAST_MS, Na as petFountainCapability, Ns as HISTORY_SLOW_MS, Os as COMPOSER_ADDON_ID, Pa as petFountainWaterItem, Ps as HOUR_MS, Qr as evaluateCompositionField, Ro as sharedActuatorFeatures, Tr as coverCapability, Us as composedDeviceStableId, Vs as cloneStatefulExpressionMemory, Ws as compositionFeatureEnabled, Xs as evaluateDerivative, Ys as disarmRoseMemory, Zs as evaluateStatistic, ac as nextLocalMidnight, bi as groupTemplate, bt as GroupCommandResultSchema, cc as planResetTier, ci as fanOutTargets, cr as climateControlCapability, da as mediaPlayerFeaturesOfRoles, dc as toExpressionValue, dr as colorCapability, fu as DeviceType, gr as compositionFieldKey, gt as FanDirectionSchema, hr as composerCapability, hu as EventCategory, i as ACTUATOR_TEMPLATE_IDS, ic as isHistoryHelper, j as ConsumableItemSchema, ja as parseColorInput, jl as isReadingQuantity, jr as declaredSeriesKind, js as DEFAULT_HISTORY_RETENTION, lc as planStatisticTier, ma as methodRefusal, mu as featuresOfBoundCaps, na as lockControlCapability, nc as isEngineHostedHelper, ns as switchCapability, oc as openReset, pc as BaseAddon, pu as errMsg, qn as buildCapabilityLookup, qs as compositionSourceKey, qt as PetFountainStatusSchema, r as ACTUATOR_METHODS, rc as isForwardInputRef, ri as expressionContainsBuiltinCall, s as ALL_CAPABILITY_DEFINITIONS, sc as openStatistic, si as fanControlCapability, tc as integrateReading, tt as DeclaredDevices, ua as mediaPlayerCapability, uc as statisticCadenceMs, ui as featureForwards, ul as createEvent, v as BaseDevice, vo as resolveMutate, vs as valveCapability, wo as runFanOut, ya as motionCapability, yi as groupCommandsCapability, yr as consumablesCapability, zo as sharedActuatorMethods } from "../../dist-DiknL6UU.mjs";
|
|
2
|
+
import { i as parseDeviceStateChanged, n as normalizedNativeOwner, r as isRecord$4 } from "../../composition-sources-B0rdPm85.mjs";
|
|
3
|
+
import { i as capSeriesKey } from "../../capture-engine-DPn6JaPc.mjs";
|
|
4
4
|
import { i as DAY_MS, t as DEFAULT_RETENTION } from "../../retention-CUOVI1p7.mjs";
|
|
5
|
-
import { n as renameCompositionBlock } from "../../rename-composition-block-
|
|
5
|
+
import { n as renameCompositionBlock } from "../../rename-composition-block-BOoAElGp.mjs";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
//#region src/builtins/composer/actuator-invoke.ts
|
|
8
8
|
/**
|
|
@@ -5157,7 +5157,7 @@ var NodeDeadlineTimer = class {
|
|
|
5157
5157
|
* ADDS to a device the composer does not own — a battery on an HA pet feeder
|
|
5158
5158
|
* that registers none. Without it the added cap has claimed values on the hub
|
|
5159
5159
|
* but nothing answers its methods, so `getBindings` never lists it and a caller
|
|
5160
|
-
* of `
|
|
5160
|
+
* of the cap (its `getStatus`, a composed method) finds no provider.
|
|
5161
5161
|
*
|
|
5162
5162
|
* - The provider is built ONLY from the cap's `composedMethods` (Task 1): an
|
|
5163
5163
|
* `answer` resolves to its value, a `refuse` rejects naming its reason. A cap
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* ADDS to a device the composer does not own — a battery on an HA pet feeder
|
|
4
4
|
* that registers none. Without it the added cap has claimed values on the hub
|
|
5
5
|
* but nothing answers its methods, so `getBindings` never lists it and a caller
|
|
6
|
-
* of `
|
|
6
|
+
* of the cap (its `getStatus`, a composed method) finds no provider.
|
|
7
7
|
*
|
|
8
8
|
* - The provider is built ONLY from the cap's `composedMethods` (Task 1): an
|
|
9
9
|
* `answer` resolves to its value, a `refuse` rejects naming its reason. A cap
|
|
@@ -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-CHC8tlB1.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 { ia as logDestinationCapability, pc as BaseAddon } from "../../dist-DiknL6UU.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,9 +1,9 @@
|
|
|
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-CHC8tlB1.js");
|
|
4
4
|
const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
|
|
5
|
-
const require_composition_sources = require("../../composition-sources-
|
|
6
|
-
const require_capture_engine = require("../../capture-engine-
|
|
5
|
+
const require_composition_sources = require("../../composition-sources-Bec_hQMM.js");
|
|
6
|
+
const require_capture_engine = require("../../capture-engine-BgIjQWh6.js");
|
|
7
7
|
const require_prefix_range = require("../../prefix-range-D_KueXbQ.js");
|
|
8
8
|
const require_prefix_walk = require("../../prefix-walk-Dv6MLZlM.js");
|
|
9
9
|
const require_cap_call_scope = require("../../cap-call-scope-8eiugfLl.js");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $i as localDateOf, $
|
|
1
|
+
import { $i as localDateOf, $l as secretTreeFromSchema, $r as evaluateStepCondition, $s as historyRetentionFromSettings, A as ConditionMirror, An as actionWaitTotalMs, As as DAY_MS, Ba as powerSourceLinkOfComposition, Ca as normalizeCoreBlockWrite, Cn as TemplateKindSchema, Cr as coreBlockSourceKind, Di as internalActionId, Dr as customKeyOfRole, Ds as zoneOnlySite, Dt as IDLE_ACTION_STATUS, E as CORE_BLOCK_ADDON_PREFIX, Ei as integrationInstancesCapability, Fs as HelperMemberSchema, Ha as prepareRecipeUnits, Ho as siteFor, Hs as composedDeviceRef, Ia as planComposition, Il as isSecretRefOwnedBy, Ir as describeComposableCaps, Jc as VocabActionError, Jt as PowerSourceInfoSchema, Ka as projectDeviceRow, Ki as kebabToCamel, Kn as buildActionSteps, Ko as stableIdMapOf, Lc as RecordIntegrationInstances, M as CoreBlockSchema, Mn as addonIdOfActionId, Nr as defaultTagColorId, Oa as occurrenceOn, Os as COMPOSER_ADDON_ID, Ot as INTERNAL_ACTION_PREFIX, Pi as isBuiltinTemplateId, Pl as isSecretMarker, Po as seedInstanceOnce, Qn as builtinAutomationTemplate, Qs as helperMembers, Qt as QuantityUnitError, Ra as powerSourceActuatorConflicts, Rs as canonicalStoredBlockTarget, Rt as MediaPlayerStatusSchema, Sa as normalizeActionUnits, Si as heroLayoutCapability, Sn as TagsFieldSchema, So as resolveStepArgs, Sr as coreBlockIdFromAddonId, Ss as weekdayOfLocalDate, T as CORE_BLOCKS_ADDON_ID, Ti as instanceCodeHash, To as runSteps, Ua as problemsBlockSave, Us as composedDeviceStableId, Vn as assertStepsOffered, Vt as NcTaggedRuleKindSchema, Ws as compositionFeatureEnabled, Xa as readStoredRemoteConfig, Xc as actionEffect, Xl as ruleFireOfClaim, Xn as buildHeroModel, Ya as readRecipeLiteral, Yl as resolveSecretMarkers, _ as BUILTIN_REMOTE_COMPONENTS, _i as generateAutomationBlock, _r as compositionSourceRefs, _s as validateSchedulerInput, _t as FanPresetSchema, an as RunningStateStatusSchema, ao as removeFromTags, as as tagsCapability, ba as nextOccurrence, bn as TagNameSchema, bo as resolveRemoteSource, br as coreBlockAddonId, c as ActionError, co as replacedFieldKeys, cs as timedRunLimitOf, ct as EMPTY_REMOTE_ASSUMED_STATE, d as ActionTargetResolver, dn as SchedulerSchema, ds as timedRunSeconds, dt as FAN_CAPTURE_FIELDS, du as DeviceRole, ei as evaluateWhenTree, en as REMOTE_MEDIA_COMMANDS, f as ActionVariableSchema, fi as findChannelSource, fl as defineAddonMigrations, fo as resolveCoreBlockEntry, fs as toTimings, ft as FAN_OSCILLATION_AXES, fu as DeviceType$1, g as BUILTIN_AUTOMATION_TEMPLATES, h as AutomationTemplatePayloadSchema, hl as defineRecordKinds, hs as validateComposition, ht as FanControlStatusSchema, hu as EventCategory$1, in as RemoteLayoutPayloadSchema, io as remoteSourceSteps, is as tagKey, iu as transformSecretWrite, jn as actionsCapability, kn as actionSourceCapability, ko as schedulersCapability, ks as CompositionSchema, l as ActionMinDelaySecSchema, li as fanPresetsCapability, ll as commandOrigin$1, ln as SWITCH_DEFAULT_OPTIONS, lo as resolveActionVariables, lr as collectDeviceTemplates, ls as timedRunMaxIn, lt as EMPTY_REMOTE_CONFIG, m as AutomationStateDocSchema, ml as defineEntryKind, mn as SetOscillationAxisInputSchema, mo as resolveHeroLayout, mr as compileScalarOverride, n as ACTION_TARGET_INVALIDATION_EVENTS, no as remoteCapability, nr as canonicalStoredStepTargets, oi as fanAxisPath, ol as collectSecretMarkerRefs, oo as renameInTags, os as templateCapability, ou as vocabActionIdFor, pc as BaseAddon, po as resolveCoreBlockFiles, pt as FAN_OSCILLATION_AXIS_SETTABLE, pu as errMsg$1, qa as proposeRunningThreshold, qn as buildCapabilityLookup, qs as compositionSourceKey, ra as lockDoorLinkOfComposition, rn as RemoteAssumedStateSchema, ro as remoteLayoutComponentsCapability, rr as capUnitResolver, s as ALL_CAPABILITY_DEFINITIONS, so as replaceRecipeLiteral, sr as checkTemplatePayload, ss as timedRunCapability, st as EMPTY_AUTOMATION_STATE, su as vocabCall, to as reexpandAutomationInstance, tt as DeclaredDevices, u as ActionStepSchema, un as SchedulerError, ur as collectWhenMirrorSources, us as timedRunQuickRun, vl as entryBody, vr as compositionUnionReads, w as COMPOSER_RUNNER_ID, wa as normalizeTags, wl as hydrateSchema, wr as coreBlocksCapability, xa as nextTimeBoundaryInMs, xi as hasTimeLeaves, xn as TagStyleSchema, xr as coreBlockComposition, z as DEFAULT_HOLD_OVERRIDE, za as powerSourceCapability, zi as isInternalActionId, zn as appendTrace } from "../../dist-DiknL6UU.mjs";
|
|
2
2
|
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
3
|
-
import { i as parseDeviceStateChanged, r as isRecord$1, t as describeCompositionSources } from "../../composition-sources-
|
|
4
|
-
import { i as capSeriesKey } from "../../capture-engine-
|
|
3
|
+
import { i as parseDeviceStateChanged, r as isRecord$1, t as describeCompositionSources } from "../../composition-sources-B0rdPm85.mjs";
|
|
4
|
+
import { i as capSeriesKey } from "../../capture-engine-DPn6JaPc.mjs";
|
|
5
5
|
import { t as prefixRange } from "../../prefix-range-Dl0znowN.mjs";
|
|
6
6
|
import { n as unwrapStoredValue, t as loadPrefixed } from "../../prefix-walk-DAOBSyH1.mjs";
|
|
7
7
|
import { n as readCurrentCommandOrigin } from "../../cap-call-scope-Bic6Ekfw.mjs";
|
|
@@ -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_capture_engine = require("../../capture-engine-
|
|
6
|
+
const require_dist = require("../../dist-CHC8tlB1.js");
|
|
7
|
+
const require_capture_engine = require("../../capture-engine-BgIjQWh6.js");
|
|
8
8
|
const require_retention = require("../../retention-BcOSL6b9.js");
|
|
9
9
|
let node_crypto = require("node:crypto");
|
|
10
10
|
//#region src/builtins/device-history/capture/point-writer.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as catalogMetrics, c as DeviceDirectory, d as identityOf, f as subjectIdOf, i as capSeriesKey, l as isRealDeviceType, n as CaptureEngine, o as readPath, r as capItemSeriesKey, s as readUnit, t as CAP_KEY_PREFIX, u as SeriesRegistry } from "../../capture-engine-
|
|
1
|
+
import { Bc as RecordTooLargeError, Bn as armRemovalReconcile, Br as deviceHistoryCapability, Cl as historyUnitFor, H as DEVICE_HISTORY_ENERGY_KEY, Jr as deviceTransitionsCapability, St as HISTORY_ITEM_CATALOG, Ur as deviceRemovalHookCapability, Wr as deviceRunsCapability, _l as emitReadiness, bc as DeviceTransitionSchema, fc as wattMillisecondsToKwh, fu as DeviceType, hl as defineRecordKinds, hu as EventCategory, jl as isReadingQuantity, pc as BaseAddon, rt as DeviceRunSchema, wc as InvalidRecordError, xt as HISTORY_CATALOG } from "../../dist-DiknL6UU.mjs";
|
|
2
|
+
import { a as catalogMetrics, c as DeviceDirectory, d as identityOf, f as subjectIdOf, i as capSeriesKey, l as isRealDeviceType, n as CaptureEngine, o as readPath, r as capItemSeriesKey, s as readUnit, t as CAP_KEY_PREFIX, u as SeriesRegistry } from "../../capture-engine-DPn6JaPc.mjs";
|
|
3
3
|
import { a as FIVE_MINUTES_MS, c as bucketEndOf, i as DAY_MS, l as bucketStartOf, n as RetentionJob, o as HOUR_MS, r as DepartureTracker, s as ROLLUP_GRACE_MS, t as DEFAULT_RETENTION, u as floorTo } from "../../retention-CUOVI1p7.mjs";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
//#region src/builtins/device-history/capture/point-writer.ts
|
|
@@ -3,10 +3,10 @@ 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-CHC8tlB1.js");
|
|
7
7
|
const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
|
|
8
8
|
const require_log_redactor = require("../../log-redactor-BhIEMaG9.js");
|
|
9
|
-
const require_rename_composition_block = require("../../rename-composition-block-
|
|
9
|
+
const require_rename_composition_block = require("../../rename-composition-block-fMaUic9d.js");
|
|
10
10
|
const require_prefix_range = require("../../prefix-range-D_KueXbQ.js");
|
|
11
11
|
const require_prefix_walk = require("../../prefix-walk-Dv6MLZlM.js");
|
|
12
12
|
const require_retired_settings_keys = require("../../retired-settings-keys-C8nOOr5H.js");
|
|
@@ -8326,8 +8326,7 @@ async function loadRuntimeState(pctx, input) {
|
|
|
8326
8326
|
const { deviceId } = input;
|
|
8327
8327
|
if (!await pctx.metaStore.resolvePersistedById(deviceId)) return {};
|
|
8328
8328
|
const data = await pctx.settings.readDeviceRuntimeState(deviceId);
|
|
8329
|
-
pctx.host.
|
|
8330
|
-
return splitRuntimeBlob(data).native;
|
|
8329
|
+
return splitRuntimeBlob(pctx.host.seedMirrorFromRow(deviceId, data, pctx.settings)).native;
|
|
8331
8330
|
}
|
|
8332
8331
|
/**
|
|
8333
8332
|
* Union of (1) operator-curated location registry and (2) labels
|
|
@@ -11593,17 +11592,62 @@ function persistableBlob(blob, policyFor) {
|
|
|
11593
11592
|
/**
|
|
11594
11593
|
* The part of a `restored` slice that may live on disk (D1024). A cap that
|
|
11595
11594
|
* names `restoredFields` keeps only those; every other restored cap keeps the
|
|
11596
|
-
* whole slice. One function for both directions — what is written and what the
|
|
11595
|
+
* whole slice; a renamed field is read under its new name. One function for both directions — what is written and what the
|
|
11597
11596
|
* boot seed reads back — so the two cannot drift.
|
|
11598
11597
|
*/
|
|
11599
11598
|
function restoredPart(slice, policy) {
|
|
11599
|
+
const current = withRenamedFields(slice, policy.renamedFields);
|
|
11600
11600
|
const names = policy.restoredFields;
|
|
11601
|
-
if (names === void 0) return
|
|
11601
|
+
if (names === void 0) return current;
|
|
11602
11602
|
const out = {};
|
|
11603
|
-
for (const name of names) if (name in
|
|
11603
|
+
for (const name of names) if (name in current) out[name] = current[name];
|
|
11604
11604
|
return out;
|
|
11605
11605
|
}
|
|
11606
11606
|
/**
|
|
11607
|
+
* A field the cap renamed (`restoredFieldRenames`, #459): a row persisted
|
|
11608
|
+
* before the rename carries the OLD key. It is read once into the new name —
|
|
11609
|
+
* only when the new one is absent, a value under the new name always wins — and
|
|
11610
|
+
* dropped, so no reader of the mirror ever meets the old key.
|
|
11611
|
+
*/
|
|
11612
|
+
function withRenamedFields(slice, renames) {
|
|
11613
|
+
const out = { ...slice };
|
|
11614
|
+
if (renames === void 0) return out;
|
|
11615
|
+
for (const [from, to] of Object.entries(renames)) {
|
|
11616
|
+
if (!(from in out)) continue;
|
|
11617
|
+
if (!(to in out)) out[to] = out[from];
|
|
11618
|
+
delete out[from];
|
|
11619
|
+
}
|
|
11620
|
+
return out;
|
|
11621
|
+
}
|
|
11622
|
+
/**
|
|
11623
|
+
* Read a whole stored row under the current field names (`restoredFieldRenames`).
|
|
11624
|
+
* Only the renames are applied — nothing is trimmed — so the worker that loads
|
|
11625
|
+
* the row is handed the same fields it would have got, under their new names.
|
|
11626
|
+
* `renamed` names the slices that still carry an old key on disk: the row must
|
|
11627
|
+
* be rewritten once, or the rename could never be retired.
|
|
11628
|
+
*/
|
|
11629
|
+
function upgradeRenamedFields(row, policyFor) {
|
|
11630
|
+
const blob = { ...row };
|
|
11631
|
+
const renamed = [];
|
|
11632
|
+
for (const [capName, slice] of Object.entries(row)) {
|
|
11633
|
+
if (capName === "$owned" || !isPlainRecord(slice)) continue;
|
|
11634
|
+
const renames = policyFor(capName).renamedFields;
|
|
11635
|
+
if (renames === void 0) continue;
|
|
11636
|
+
const legacy = {};
|
|
11637
|
+
for (const from of Object.keys(renames)) if (from in slice) legacy[from] = slice[from];
|
|
11638
|
+
if (Object.keys(legacy).length === 0) continue;
|
|
11639
|
+
blob[capName] = withRenamedFields(slice, renames);
|
|
11640
|
+
renamed.push({
|
|
11641
|
+
capName,
|
|
11642
|
+
legacy
|
|
11643
|
+
});
|
|
11644
|
+
}
|
|
11645
|
+
return {
|
|
11646
|
+
blob,
|
|
11647
|
+
renamed
|
|
11648
|
+
};
|
|
11649
|
+
}
|
|
11650
|
+
/**
|
|
11607
11651
|
* Are two slices the same, ignoring the fields the cap declared volatile?
|
|
11608
11652
|
*
|
|
11609
11653
|
* A volatile field is still WRITTEN — it simply does not, on its own, justify
|
|
@@ -12433,7 +12477,7 @@ var DeviceStateMirror = class {
|
|
|
12433
12477
|
const read = (async () => {
|
|
12434
12478
|
try {
|
|
12435
12479
|
const row = await settings.readDeviceRuntimeState(deviceId);
|
|
12436
|
-
this.
|
|
12480
|
+
this.seedMirrorFromRow(deviceId, row, settings);
|
|
12437
12481
|
this.seedRefusalLogged.delete(deviceId);
|
|
12438
12482
|
} catch (err) {
|
|
12439
12483
|
if (!this.seedRefusalLogged.has(deviceId)) {
|
|
@@ -12553,6 +12597,32 @@ var DeviceStateMirror = class {
|
|
|
12553
12597
|
this.writer.markPersisted(deviceId, persistableBlob(joinRuntimeBlob(split.native, split.owned, this.policyFor), this.policyFor));
|
|
12554
12598
|
}
|
|
12555
12599
|
/**
|
|
12600
|
+
* Seed from the device's STORED row (`fill`), and return the row read under
|
|
12601
|
+
* the current field names. A row that still carries a field under its
|
|
12602
|
+
* pre-rename name (`restoredFieldRenames`) is rewritten once: the baseline
|
|
12603
|
+
* keeps the old key — that is what disk holds — so the write is not skipped
|
|
12604
|
+
* as already persisted, and a write is armed even if nothing else changes.
|
|
12605
|
+
* Without it the old key would stay on disk and the rename could never be
|
|
12606
|
+
* retired.
|
|
12607
|
+
*/
|
|
12608
|
+
seedMirrorFromRow(deviceId, row, settings) {
|
|
12609
|
+
const upgraded = upgradeRenamedFields(row, this.policyFor);
|
|
12610
|
+
this.seedMirror(deviceId, this.withResetSessionProbe(upgraded.blob));
|
|
12611
|
+
if (upgraded.renamed.length === 0) return upgraded.blob;
|
|
12612
|
+
const baseline = { ...this.writer.persisted(deviceId) };
|
|
12613
|
+
for (const { capName, legacy } of upgraded.renamed) baseline[capName] = {
|
|
12614
|
+
...baseline[capName],
|
|
12615
|
+
...legacy
|
|
12616
|
+
};
|
|
12617
|
+
this.writer.markPersisted(deviceId, baseline);
|
|
12618
|
+
this.ctx.logger.info("stored runtime state carries a renamed field — rewriting the row once", {
|
|
12619
|
+
tags: { deviceId },
|
|
12620
|
+
meta: { caps: upgraded.renamed.map((r) => r.capName) }
|
|
12621
|
+
});
|
|
12622
|
+
this.writer.armOrHold(deviceId, settings);
|
|
12623
|
+
return upgraded.blob;
|
|
12624
|
+
}
|
|
12625
|
+
/**
|
|
12556
12626
|
* The hub mirror's `feature-probe.lastProbedAt` is a PER-SESSION liveness
|
|
12557
12627
|
* signal — it means "this worker process completed a probe THIS session".
|
|
12558
12628
|
* Persisted runtime state carries the PRE-RESTART timestamp, which is stale
|
|
@@ -14008,6 +14078,7 @@ var DeviceManagerAddon = class extends require_dist.BaseAddon {
|
|
|
14008
14078
|
},
|
|
14009
14079
|
remoteNativeCaps: this.remoteNativeCaps,
|
|
14010
14080
|
seedMirror: (deviceId, blob, mode) => this.stateMirror.seedMirror(deviceId, blob, mode),
|
|
14081
|
+
seedMirrorFromRow: (deviceId, row, settings) => this.stateMirror.seedMirrorFromRow(deviceId, row, settings),
|
|
14011
14082
|
withResetSessionProbe: (blob) => this.stateMirror.withResetSessionProbe(blob),
|
|
14012
14083
|
get fieldClaims() {
|
|
14013
14084
|
return fieldClaims();
|