@camstack/server 1.2.739 → 1.2.741
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/trpc/generated-cap-routers.js +9 -0
- package/package.json +14 -12
- package/system/dist/addon-utils.mjs +1 -1
- package/system/dist/{agent-https-Dwec4v5Z.mjs → agent-https-BtTMjLgk.mjs} +1 -1
- package/system/dist/{agent-https-DX_ypzVA.js → agent-https-CNf7_i1z.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 +1 -1
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -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.js +2 -2
- package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/system/dist/builtins/loki-logging/index.js +127 -32
- package/system/dist/builtins/loki-logging/index.mjs +127 -32
- package/system/dist/builtins/loki-logging/loki-logging.addon.d.ts +8 -0
- package/system/dist/builtins/loki-logging/loki-record-kinds.d.ts +2 -0
- package/system/dist/builtins/loki-logging/migrations/index.d.ts +4 -1
- package/system/dist/builtins/loki-logging/migrations/registry-toggle-to-record.d.ts +26 -0
- 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 +3 -3
- package/system/dist/builtins/snapshot/index.mjs +3 -3
- 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/migrations/installed-runner-resolver.d.ts +3 -0
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +59 -3
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +60 -4
- 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 +285 -285
- 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-jF-eMoO5.js → composition-sources-D9GBwT5d.js} +1 -1
- package/system/dist/{composition-sources-6UWb8sIp.mjs → composition-sources-DUmnnLrw.mjs} +1 -1
- package/system/dist/{constants-v7B-_yzi.mjs → constants-BkiDA8Cf.mjs} +1 -1
- package/system/dist/{constants-dJ_YPC9D.js → constants-Cy5svHxz.js} +1 -1
- package/system/dist/{coral-accelerators-DBlgWB8k.mjs → coral-accelerators-BW3OcrLD.mjs} +6 -6
- package/system/dist/{custom-action-registry-oHl1xltx.mjs → custom-action-registry-BIJZBObd.mjs} +37 -37
- package/system/dist/{device-ca-CImkiiR-.js → device-ca-CxlqxrvG.js} +1 -1
- package/system/dist/{device-ca-BVaCxlFs.mjs → device-ca-Cxu7j6aY.mjs} +1 -1
- package/system/dist/{dist-BvHqoBym.mjs → dist-C5sQPOZX.mjs} +136 -11
- package/system/dist/{dist-BXWXN1Dl.js → dist-Cyc4oyGh.js} +141 -10
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-B_ldgRYZ.mjs → hub-mdns-ciao-CTPWSgwo.mjs} +2 -2
- package/system/dist/{hub-mdns-ciao-B7wwnU92.js → hub-mdns-ciao-YxQ97aHW.js} +2 -2
- package/system/dist/index.js +7 -7
- package/system/dist/index.mjs +218 -218
- package/system/dist/{restore-archive-CLfRtdYG.mjs → restore-archive-08Uthry1.mjs} +150 -150
- package/system/dist/{restore-archive-ne_KESE9.js → restore-archive-b5rBXY1e.js} +1 -1
- package/system/dist/{retention--waznpBD.js → retention-DWCHp91p.js} +1 -1
- package/system/dist/{retention-MD1lPsHB.mjs → retention-i8aZ6vE5.mjs} +1 -1
- package/system/dist/{wal-maintenance-D8DIMgjl.mjs → wal-maintenance-CEi8PqMh.mjs} +0 -0
- package/system/dist/{wal-maintenance-DmhOVavh.js → wal-maintenance-DNE7RTcS.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
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-Cyc4oyGh.js");
|
|
7
7
|
let zod = require("zod");
|
|
8
8
|
let node_crypto = require("node:crypto");
|
|
9
9
|
//#region src/builtins/record-entries/entries-service.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ko as UnknownRecordKindError, Mi as recordEntriesCapability, Ws as secretViewsOf, mo as BaseAddon, wo as InvalidRecordError } from "../../dist-C5sQPOZX.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
//#region src/builtins/record-entries/entries-service.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-Cyc4oyGh.js");
|
|
7
7
|
//#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
|
|
8
8
|
/**
|
|
9
9
|
* Reconcile the durable `enabledProviders` set against authoritative
|
package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mo as BaseAddon, tc as EventCategory } from "../../dist-C5sQPOZX.mjs";
|
|
2
2
|
//#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
|
|
3
3
|
/**
|
|
4
4
|
* Reconcile the durable `enabledProviders` set against authoritative
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-Cyc4oyGh.js");
|
|
7
7
|
const require_snapshot_courtesy = require("../../snapshot-courtesy-D_C5-nC0.js");
|
|
8
8
|
let zod = require("zod");
|
|
9
9
|
let node_crypto = require("node:crypto");
|
|
@@ -1912,7 +1912,7 @@ var SnapshotAddon = class SnapshotAddon extends require_dist.BaseAddon {
|
|
|
1912
1912
|
this.stateFrames.delete(deviceId);
|
|
1913
1913
|
this.cache.set(deviceId, effectiveStreamId, {
|
|
1914
1914
|
data: result,
|
|
1915
|
-
ts: now,
|
|
1915
|
+
ts: Date.now(),
|
|
1916
1916
|
streamId: effectiveStreamId ?? null
|
|
1917
1917
|
});
|
|
1918
1918
|
this.durable.put(deviceId, Buffer.from(result.base64, "base64"));
|
|
@@ -1960,7 +1960,7 @@ var SnapshotAddon = class SnapshotAddon extends require_dist.BaseAddon {
|
|
|
1960
1960
|
this.stateFrames.delete(deviceId);
|
|
1961
1961
|
this.cache.set(deviceId, effectiveStreamId, {
|
|
1962
1962
|
data: fallback,
|
|
1963
|
-
ts: now,
|
|
1963
|
+
ts: Date.now(),
|
|
1964
1964
|
streamId: effectiveStreamId ?? null
|
|
1965
1965
|
});
|
|
1966
1966
|
this.durable.put(deviceId, Buffer.from(fallback.base64, "base64"));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $s as
|
|
1
|
+
import { $s as DeviceType, Zn as deriveBatteryPresence, Zs as DeviceFeature, ec as errMsg, gn as batteryCapability, h as BatteryStatusSchema, hn as bareAddonId, ii as memoizePinnedFfmpeg, js as nodePin, mo as BaseAddon, tc as EventCategory, ua as snapshotCapability, va as streamQualityLabel } from "../../dist-C5sQPOZX.mjs";
|
|
2
2
|
import { i as renderCourtesyOverlayJpeg, n as courtesyCacheKey, r as renderCourtesyJpeg } from "../../snapshot-courtesy-CyFs1M3I.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
@@ -1906,7 +1906,7 @@ var SnapshotAddon = class SnapshotAddon extends BaseAddon {
|
|
|
1906
1906
|
this.stateFrames.delete(deviceId);
|
|
1907
1907
|
this.cache.set(deviceId, effectiveStreamId, {
|
|
1908
1908
|
data: result,
|
|
1909
|
-
ts: now,
|
|
1909
|
+
ts: Date.now(),
|
|
1910
1910
|
streamId: effectiveStreamId ?? null
|
|
1911
1911
|
});
|
|
1912
1912
|
this.durable.put(deviceId, Buffer.from(result.base64, "base64"));
|
|
@@ -1954,7 +1954,7 @@ var SnapshotAddon = class SnapshotAddon extends BaseAddon {
|
|
|
1954
1954
|
this.stateFrames.delete(deviceId);
|
|
1955
1955
|
this.cache.set(deviceId, effectiveStreamId, {
|
|
1956
1956
|
data: fallback,
|
|
1957
|
-
ts: now,
|
|
1957
|
+
ts: Date.now(),
|
|
1958
1958
|
streamId: effectiveStreamId ?? null
|
|
1959
1959
|
});
|
|
1960
1960
|
this.durable.put(deviceId, Buffer.from(fallback.base64, "base64"));
|
|
@@ -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-Cyc4oyGh.js");
|
|
7
7
|
let node_crypto = require("node:crypto");
|
|
8
8
|
let node_fs_promises = require("node:fs/promises");
|
|
9
9
|
let node_path = require("node:path");
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { br as filesystemBrowseCapability,
|
|
1
|
+
import { br as filesystemBrowseCapability, ga as storageProviderCapability, mo as BaseAddon } from "../../dist-C5sQPOZX.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import { mkdir, readdir, realpath, statfs } from "node:fs/promises";
|
|
4
4
|
import * as path$1 from "node:path";
|
|
5
5
|
import { basename, dirname, isAbsolute, join, resolve, sep } from "node:path";
|
|
6
6
|
import { homedir } from "node:os";
|
|
7
|
-
import * as fs
|
|
7
|
+
import * as fs from "node:fs";
|
|
8
8
|
//#region src/builtins/sqlite-storage/path-guard.ts
|
|
9
9
|
/**
|
|
10
10
|
* Guards for the filesystem-browse cap. Pure + synchronous so they are
|
|
@@ -169,16 +169,16 @@ var FilesystemStorageProvider = class FilesystemStorageProvider {
|
|
|
169
169
|
error: "config.basePath must be a non-empty string"
|
|
170
170
|
};
|
|
171
171
|
try {
|
|
172
|
-
const stat = await fs
|
|
172
|
+
const stat = await fs.promises.stat(basePath).catch(() => null);
|
|
173
173
|
if (stat) {
|
|
174
174
|
if (!stat.isDirectory()) return {
|
|
175
175
|
ok: false,
|
|
176
176
|
error: `Path "${basePath}" exists but is not a directory`
|
|
177
177
|
};
|
|
178
|
-
await fs
|
|
178
|
+
await fs.promises.access(basePath, fs.constants.W_OK);
|
|
179
179
|
return { ok: true };
|
|
180
180
|
}
|
|
181
|
-
await fs
|
|
181
|
+
await fs.promises.mkdir(basePath, { recursive: true });
|
|
182
182
|
return { ok: true };
|
|
183
183
|
} catch (err) {
|
|
184
184
|
return {
|
|
@@ -192,12 +192,12 @@ var FilesystemStorageProvider = class FilesystemStorageProvider {
|
|
|
192
192
|
}
|
|
193
193
|
async write({ location, relativePath, data }) {
|
|
194
194
|
const filePath = safeResolve(getBasePath(location), relativePath);
|
|
195
|
-
await fs
|
|
196
|
-
await fs
|
|
195
|
+
await fs.promises.mkdir(path$1.dirname(filePath), { recursive: true });
|
|
196
|
+
await fs.promises.writeFile(filePath, data);
|
|
197
197
|
}
|
|
198
198
|
async read({ location, relativePath }) {
|
|
199
199
|
const filePath = safeResolve(getBasePath(location), relativePath);
|
|
200
|
-
const buf = await fs
|
|
200
|
+
const buf = await fs.promises.readFile(filePath);
|
|
201
201
|
const out = new Uint8Array(new ArrayBuffer(buf.byteLength));
|
|
202
202
|
out.set(buf);
|
|
203
203
|
return out;
|
|
@@ -205,7 +205,7 @@ var FilesystemStorageProvider = class FilesystemStorageProvider {
|
|
|
205
205
|
async exists({ location, relativePath }) {
|
|
206
206
|
const filePath = safeResolve(getBasePath(location), relativePath);
|
|
207
207
|
try {
|
|
208
|
-
await fs
|
|
208
|
+
await fs.promises.access(filePath);
|
|
209
209
|
return true;
|
|
210
210
|
} catch {
|
|
211
211
|
return false;
|
|
@@ -215,25 +215,25 @@ var FilesystemStorageProvider = class FilesystemStorageProvider {
|
|
|
215
215
|
const base = getBasePath(location);
|
|
216
216
|
const dir = prefix ? safeResolve(base, prefix) : path$1.resolve(base);
|
|
217
217
|
try {
|
|
218
|
-
return (await fs
|
|
218
|
+
return (await fs.promises.readdir(dir, { withFileTypes: true })).map((e) => prefix ? `${prefix}/${e.name}` : e.name);
|
|
219
219
|
} catch {
|
|
220
220
|
return [];
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
async delete({ location, relativePath }) {
|
|
224
224
|
const filePath = safeResolve(getBasePath(location), relativePath);
|
|
225
|
-
await fs
|
|
225
|
+
await fs.promises.rm(filePath, { force: true });
|
|
226
226
|
}
|
|
227
227
|
async getAvailableSpace({ location }) {
|
|
228
228
|
const base = path$1.resolve(getBasePath(location));
|
|
229
229
|
try {
|
|
230
230
|
let target = base;
|
|
231
|
-
while (!fs
|
|
231
|
+
while (!fs.existsSync(target)) {
|
|
232
232
|
const parent = path$1.dirname(target);
|
|
233
233
|
if (!parent || parent === target) return null;
|
|
234
234
|
target = parent;
|
|
235
235
|
}
|
|
236
|
-
const stats = await fs
|
|
236
|
+
const stats = await fs.promises.statfs(target);
|
|
237
237
|
return stats.bavail * stats.bsize;
|
|
238
238
|
} catch {
|
|
239
239
|
return null;
|
|
@@ -242,9 +242,9 @@ var FilesystemStorageProvider = class FilesystemStorageProvider {
|
|
|
242
242
|
async beginUpload({ location, relativePath }) {
|
|
243
243
|
const target = safeResolve(getBasePath(location), relativePath);
|
|
244
244
|
const partial = `${target}.partial`;
|
|
245
|
-
await fs
|
|
246
|
-
await fs
|
|
247
|
-
const stream = fs
|
|
245
|
+
await fs.promises.mkdir(path$1.dirname(target), { recursive: true });
|
|
246
|
+
await fs.promises.unlink(partial).catch(() => {});
|
|
247
|
+
const stream = fs.createWriteStream(partial);
|
|
248
248
|
const uploadId = randomUUID();
|
|
249
249
|
const session = {
|
|
250
250
|
stream,
|
|
@@ -285,7 +285,7 @@ var FilesystemStorageProvider = class FilesystemStorageProvider {
|
|
|
285
285
|
session.stream.end(() => resolve());
|
|
286
286
|
session.stream.on("error", reject);
|
|
287
287
|
});
|
|
288
|
-
await fs
|
|
288
|
+
await fs.promises.rename(session.partial, session.target);
|
|
289
289
|
clearTimeout(session.timer);
|
|
290
290
|
this.uploads.delete(uploadId);
|
|
291
291
|
}
|
|
@@ -295,14 +295,14 @@ var FilesystemStorageProvider = class FilesystemStorageProvider {
|
|
|
295
295
|
try {
|
|
296
296
|
session.stream.destroy();
|
|
297
297
|
} catch {}
|
|
298
|
-
await fs
|
|
298
|
+
await fs.promises.unlink(session.partial).catch(() => {});
|
|
299
299
|
clearTimeout(session.timer);
|
|
300
300
|
this.uploads.delete(uploadId);
|
|
301
301
|
}
|
|
302
302
|
async beginDownload({ location, relativePath }) {
|
|
303
303
|
const target = safeResolve(getBasePath(location), relativePath);
|
|
304
|
-
const stat = await fs
|
|
305
|
-
const fd = await fs
|
|
304
|
+
const stat = await fs.promises.stat(target);
|
|
305
|
+
const fd = await fs.promises.open(target, "r");
|
|
306
306
|
const downloadId = randomUUID();
|
|
307
307
|
const session = {
|
|
308
308
|
fd,
|
|
@@ -4,7 +4,7 @@ Object.defineProperties(exports, {
|
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
6
|
const require_builtins_sqlite_storage_filesystem_storage_addon = require("./filesystem-storage.addon.js");
|
|
7
|
-
const require_wal_maintenance = require("../../wal-maintenance-
|
|
7
|
+
const require_wal_maintenance = require("../../wal-maintenance-DNE7RTcS.js");
|
|
8
8
|
const require_builtins_sqlite_storage_sqlite_settings_addon = require("./sqlite-settings.addon.js");
|
|
9
9
|
//#region src/builtins/sqlite-storage/config-store.ts
|
|
10
10
|
var ConfigStore = class {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FilesystemStorageAddon, t as FilesystemStorageProvider } from "./filesystem-storage.addon.mjs";
|
|
2
|
-
import { B as SQLITE_ENGINE_STORM_WALL_SHARE, F as SQLITE_MMAP_FLOOR_BYTES, G as SqliteOpProfiler, H as SQLITE_PROFILE_REPORT_INTERVAL_MS, I as SQLITE_PAGE_CACHE_CEILING_KIB, K as sqliteEngineStorm, L as SQLITE_PAGE_CACHE_FLOOR_KIB, N as SQLITE_JOURNAL_SIZE_LIMIT_BYTES, P as SQLITE_MMAP_CEILING_BYTES, R as sqliteMmapSizeFor, U as SQLITE_PROFILE_TOP_N, V as SQLITE_PROFILE_REPORT_FLOOR_MS, W as SQLITE_SLOW_CALL_MS, a as WalMaintenance, i as WAL_MAINTENANCE_INTERVAL_MS, l as SqliteSettingsBackend, n as WAL_HIGH_WATER_BYTES, r as WAL_IDLE_QUIET_MS, t as WAL_CHECKPOINT_BUSY_TIMEOUT_MS, z as sqlitePageCacheKibFor } from "../../wal-maintenance-
|
|
2
|
+
import { B as SQLITE_ENGINE_STORM_WALL_SHARE, F as SQLITE_MMAP_FLOOR_BYTES, G as SqliteOpProfiler, H as SQLITE_PROFILE_REPORT_INTERVAL_MS, I as SQLITE_PAGE_CACHE_CEILING_KIB, K as sqliteEngineStorm, L as SQLITE_PAGE_CACHE_FLOOR_KIB, N as SQLITE_JOURNAL_SIZE_LIMIT_BYTES, P as SQLITE_MMAP_CEILING_BYTES, R as sqliteMmapSizeFor, U as SQLITE_PROFILE_TOP_N, V as SQLITE_PROFILE_REPORT_FLOOR_MS, W as SQLITE_SLOW_CALL_MS, a as WalMaintenance, i as WAL_MAINTENANCE_INTERVAL_MS, l as SqliteSettingsBackend, n as WAL_HIGH_WATER_BYTES, r as WAL_IDLE_QUIET_MS, t as WAL_CHECKPOINT_BUSY_TIMEOUT_MS, z as sqlitePageCacheKibFor } from "../../wal-maintenance-CEi8PqMh.mjs";
|
|
3
3
|
import { SqliteSettingsAddon } from "./sqlite-settings.addon.mjs";
|
|
4
4
|
//#region src/builtins/sqlite-storage/config-store.ts
|
|
5
5
|
var ConfigStore = class {
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function installedRunnerResolver(addonsDir: string): (addonId: string) => string;
|
|
2
|
+
/** The kernel's resolver where the context has one (hub in-process), else the installed manifests. */
|
|
3
|
+
export declare function runnerResolverFor(kernelResolver: ((addonId: string) => string) | undefined, addonsDir: string): (addonId: string) => string;
|
|
@@ -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-Cyc4oyGh.js");
|
|
7
7
|
const require_retired_settings_keys = require("../../retired-settings-keys-C8nOOr5H.js");
|
|
8
|
-
const require_wal_maintenance = require("../../wal-maintenance-
|
|
8
|
+
const require_wal_maintenance = require("../../wal-maintenance-DNE7RTcS.js");
|
|
9
9
|
const require_sqlite_snapshot_protocol = require("../../sqlite-snapshot-protocol-B9OndqZv.js");
|
|
10
10
|
const require_wal_checkpoint_policy = require("../../wal-checkpoint-policy-d2z2qPqx.js");
|
|
11
11
|
let zod = require("zod");
|
|
@@ -1128,6 +1128,62 @@ var DatabaseSnapshotProvider = class {
|
|
|
1128
1128
|
}
|
|
1129
1129
|
};
|
|
1130
1130
|
//#endregion
|
|
1131
|
+
//#region src/builtins/sqlite-storage/migrations/installed-runner-resolver.ts
|
|
1132
|
+
/**
|
|
1133
|
+
* The runner an addon runs in, for a process that has no kernel resolver.
|
|
1134
|
+
*
|
|
1135
|
+
* `ctx.kernel.runnerIdForAddon` exists only in hub in-process contexts. The
|
|
1136
|
+
* engine's own runner (`sqlite-settings`, `execution.isolate`) is forked: its
|
|
1137
|
+
* kernel has no resolver, yet a grouped owner (`homeassistant-export`, group
|
|
1138
|
+
* `integrations`) reaches it stamped with its RUNNER id. The answer is the one
|
|
1139
|
+
* the hub gives — `resolveRunnerId` over the addon's installed manifest — read
|
|
1140
|
+
* from the addons directory every node already has. An addon that is not
|
|
1141
|
+
* installed resolves to itself, so a stamp is never accepted for a stranger.
|
|
1142
|
+
*/
|
|
1143
|
+
var ManifestSchema = zod.z.object({ camstack: zod.z.object({ addons: zod.z.array(zod.z.object({
|
|
1144
|
+
id: zod.z.string(),
|
|
1145
|
+
execution: zod.z.object({ group: zod.z.string().optional() }).passthrough().optional()
|
|
1146
|
+
})) }).partial().optional() });
|
|
1147
|
+
function packageDirs(addonsDir) {
|
|
1148
|
+
const dirs = [];
|
|
1149
|
+
try {
|
|
1150
|
+
for (const entry of (0, node_fs.readdirSync)(addonsDir, { withFileTypes: true })) {
|
|
1151
|
+
if (!entry.isDirectory()) continue;
|
|
1152
|
+
const entryDir = node_path.default.join(addonsDir, entry.name);
|
|
1153
|
+
if (!entry.name.startsWith("@")) {
|
|
1154
|
+
dirs.push(entryDir);
|
|
1155
|
+
continue;
|
|
1156
|
+
}
|
|
1157
|
+
for (const scoped of (0, node_fs.readdirSync)(entryDir, { withFileTypes: true })) if (scoped.isDirectory()) dirs.push(node_path.default.join(entryDir, scoped.name));
|
|
1158
|
+
}
|
|
1159
|
+
} catch {
|
|
1160
|
+
return dirs;
|
|
1161
|
+
}
|
|
1162
|
+
return dirs;
|
|
1163
|
+
}
|
|
1164
|
+
function declarationsIn(dir) {
|
|
1165
|
+
try {
|
|
1166
|
+
const parsed = ManifestSchema.safeParse(JSON.parse((0, node_fs.readFileSync)(node_path.default.join(dir, "package.json"), "utf-8")));
|
|
1167
|
+
if (!parsed.success) return [];
|
|
1168
|
+
return (parsed.data.camstack?.addons ?? []).map((addon) => ({
|
|
1169
|
+
id: addon.id,
|
|
1170
|
+
decl: addon.execution === void 0 ? {} : { execution: addon.execution }
|
|
1171
|
+
}));
|
|
1172
|
+
} catch {
|
|
1173
|
+
return [];
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
function installedRunnerResolver(addonsDir) {
|
|
1177
|
+
return (addonId) => {
|
|
1178
|
+
for (const dir of packageDirs(addonsDir)) for (const { id, decl } of declarationsIn(dir)) if (id === addonId) return require_dist.resolveRunnerId(decl, addonId);
|
|
1179
|
+
return addonId;
|
|
1180
|
+
};
|
|
1181
|
+
}
|
|
1182
|
+
/** The kernel's resolver where the context has one (hub in-process), else the installed manifests. */
|
|
1183
|
+
function runnerResolverFor(kernelResolver, addonsDir) {
|
|
1184
|
+
return kernelResolver ?? installedRunnerResolver(addonsDir);
|
|
1185
|
+
}
|
|
1186
|
+
//#endregion
|
|
1131
1187
|
//#region src/builtins/sqlite-storage/migrations/migration-hold.ts
|
|
1132
1188
|
/**
|
|
1133
1189
|
* The hold a restore of a pre-migration snapshot leaves behind (D987).
|
|
@@ -2778,7 +2834,7 @@ var SqliteSettingsAddon = class extends require_dist.BaseAddon {
|
|
|
2778
2834
|
logger: this.ctx.logger.child("PreMigrationSnapshot")
|
|
2779
2835
|
}),
|
|
2780
2836
|
announce: (kind, ids) => this.announceMigrations(kind, ids),
|
|
2781
|
-
runnerIdOf: this.ctx.kernel?.runnerIdForAddon ?? (
|
|
2837
|
+
runnerIdOf: runnerResolverFor(this.ctx.kernel?.runnerIdForAddon, node_path.default.join(this.ctx.nodeDataDir ?? node_path.default.resolve(dir, "..", ".."), "addons")),
|
|
2782
2838
|
scheduleRestore: (request) => scheduleMigrationRestore(node_path.default.resolve(dir, "..", ".."), request)
|
|
2783
2839
|
});
|
|
2784
2840
|
const deps = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Dn as catalogueIssues, Gn as dataStoreProviderCapability, Ji as resolveRunnerId, Kn as databaseSnapshotCapability, Ko as UnknownRecordKindError, Lo as RecordKindDeclarationSchema, M as DATABASE_SNAPSHOT_SUFFIX, Ma as vectorStoreCapability, N as DATABASE_SNAPSHOT_TIMEOUT_MS, Ni as recordsCapability, Ns as normalizeSecretOwner, P as DATA_STORE_DATABASES, Po as RUNTIME_DEFAULTS, To as NoCallerError, Tt as MigrationMetaSchema, Wo as TransactRefusedError, as as customAction, bo as DeclarationRefusedError, ec as errMsg$1, fa as storageAdminCapability, hn as bareAddonId, j as DATABASE_SNAPSHOT_PARTIAL_SUFFIX, jo as RECORD_SWEEP_INTERVAL_MS, mo as BaseAddon, ns as collectSecretMarkerRefs, si as migrationsCapability, ss as defineCustomActions, tc as EventCategory, wo as InvalidRecordError, yi as orderMigrations } from "../../dist-C5sQPOZX.mjs";
|
|
2
2
|
import { r as retiredKeyStoreOf, t as purgeRetiredSettingsKeys } from "../../retired-settings-keys-u6xQA6r7.mjs";
|
|
3
|
-
import { A as callRecords, D as RecordsEngine, E as databaseOfStore, M as controlTargetOf, O as callControl, T as trustResult, _ as rehydrateError, a as WalMaintenance, b as collectTransferables, c as vectorProviderOfOwnedFile, d as callMigrate, f as migrateTargetOf, g as DuplicatePlacementError, h as DatabaseBusyError, j as callVector, k as callData, l as SqliteSettingsBackend, m as CrossDatabaseTransactError, o as createVectorIndex, p as CollectionPlacementError, s as vectorProviderOf, u as HUB_MIGRATIONS, x as isFileHostMessage } from "../../wal-maintenance-
|
|
3
|
+
import { A as callRecords, D as RecordsEngine, E as databaseOfStore, M as controlTargetOf, O as callControl, T as trustResult, _ as rehydrateError, a as WalMaintenance, b as collectTransferables, c as vectorProviderOfOwnedFile, d as callMigrate, f as migrateTargetOf, g as DuplicatePlacementError, h as DatabaseBusyError, j as callVector, k as callData, l as SqliteSettingsBackend, m as CrossDatabaseTransactError, o as createVectorIndex, p as CollectionPlacementError, s as vectorProviderOf, u as HUB_MIGRATIONS, x as isFileHostMessage } from "../../wal-maintenance-CEi8PqMh.mjs";
|
|
4
4
|
import { r as isSnapshotWorkerMessage } from "../../sqlite-snapshot-protocol-2QaTouWV.mjs";
|
|
5
5
|
import { a as isWorkerMessage, t as WAL_CHECKPOINT_LARGE_PASS_FRAMES } from "../../wal-checkpoint-policy-BahrTtyD.mjs";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
@@ -8,7 +8,7 @@ import { z } from "zod";
|
|
|
8
8
|
import { randomUUID } from "node:crypto";
|
|
9
9
|
import { mkdir } from "node:fs/promises";
|
|
10
10
|
import path from "node:path";
|
|
11
|
-
import { existsSync, promises, readFileSync, statSync } from "node:fs";
|
|
11
|
+
import { existsSync, promises, readFileSync, readdirSync, statSync } from "node:fs";
|
|
12
12
|
import { Worker } from "node:worker_threads";
|
|
13
13
|
//#region src/builtins/sqlite-storage/file-host-client.ts
|
|
14
14
|
/**
|
|
@@ -1122,6 +1122,62 @@ var DatabaseSnapshotProvider = class {
|
|
|
1122
1122
|
}
|
|
1123
1123
|
};
|
|
1124
1124
|
//#endregion
|
|
1125
|
+
//#region src/builtins/sqlite-storage/migrations/installed-runner-resolver.ts
|
|
1126
|
+
/**
|
|
1127
|
+
* The runner an addon runs in, for a process that has no kernel resolver.
|
|
1128
|
+
*
|
|
1129
|
+
* `ctx.kernel.runnerIdForAddon` exists only in hub in-process contexts. The
|
|
1130
|
+
* engine's own runner (`sqlite-settings`, `execution.isolate`) is forked: its
|
|
1131
|
+
* kernel has no resolver, yet a grouped owner (`homeassistant-export`, group
|
|
1132
|
+
* `integrations`) reaches it stamped with its RUNNER id. The answer is the one
|
|
1133
|
+
* the hub gives — `resolveRunnerId` over the addon's installed manifest — read
|
|
1134
|
+
* from the addons directory every node already has. An addon that is not
|
|
1135
|
+
* installed resolves to itself, so a stamp is never accepted for a stranger.
|
|
1136
|
+
*/
|
|
1137
|
+
var ManifestSchema = z.object({ camstack: z.object({ addons: z.array(z.object({
|
|
1138
|
+
id: z.string(),
|
|
1139
|
+
execution: z.object({ group: z.string().optional() }).passthrough().optional()
|
|
1140
|
+
})) }).partial().optional() });
|
|
1141
|
+
function packageDirs(addonsDir) {
|
|
1142
|
+
const dirs = [];
|
|
1143
|
+
try {
|
|
1144
|
+
for (const entry of readdirSync(addonsDir, { withFileTypes: true })) {
|
|
1145
|
+
if (!entry.isDirectory()) continue;
|
|
1146
|
+
const entryDir = path.join(addonsDir, entry.name);
|
|
1147
|
+
if (!entry.name.startsWith("@")) {
|
|
1148
|
+
dirs.push(entryDir);
|
|
1149
|
+
continue;
|
|
1150
|
+
}
|
|
1151
|
+
for (const scoped of readdirSync(entryDir, { withFileTypes: true })) if (scoped.isDirectory()) dirs.push(path.join(entryDir, scoped.name));
|
|
1152
|
+
}
|
|
1153
|
+
} catch {
|
|
1154
|
+
return dirs;
|
|
1155
|
+
}
|
|
1156
|
+
return dirs;
|
|
1157
|
+
}
|
|
1158
|
+
function declarationsIn(dir) {
|
|
1159
|
+
try {
|
|
1160
|
+
const parsed = ManifestSchema.safeParse(JSON.parse(readFileSync(path.join(dir, "package.json"), "utf-8")));
|
|
1161
|
+
if (!parsed.success) return [];
|
|
1162
|
+
return (parsed.data.camstack?.addons ?? []).map((addon) => ({
|
|
1163
|
+
id: addon.id,
|
|
1164
|
+
decl: addon.execution === void 0 ? {} : { execution: addon.execution }
|
|
1165
|
+
}));
|
|
1166
|
+
} catch {
|
|
1167
|
+
return [];
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
function installedRunnerResolver(addonsDir) {
|
|
1171
|
+
return (addonId) => {
|
|
1172
|
+
for (const dir of packageDirs(addonsDir)) for (const { id, decl } of declarationsIn(dir)) if (id === addonId) return resolveRunnerId(decl, addonId);
|
|
1173
|
+
return addonId;
|
|
1174
|
+
};
|
|
1175
|
+
}
|
|
1176
|
+
/** The kernel's resolver where the context has one (hub in-process), else the installed manifests. */
|
|
1177
|
+
function runnerResolverFor(kernelResolver, addonsDir) {
|
|
1178
|
+
return kernelResolver ?? installedRunnerResolver(addonsDir);
|
|
1179
|
+
}
|
|
1180
|
+
//#endregion
|
|
1125
1181
|
//#region src/builtins/sqlite-storage/migrations/migration-hold.ts
|
|
1126
1182
|
/**
|
|
1127
1183
|
* The hold a restore of a pre-migration snapshot leaves behind (D987).
|
|
@@ -2771,7 +2827,7 @@ var SqliteSettingsAddon = class extends BaseAddon {
|
|
|
2771
2827
|
logger: this.ctx.logger.child("PreMigrationSnapshot")
|
|
2772
2828
|
}),
|
|
2773
2829
|
announce: (kind, ids) => this.announceMigrations(kind, ids),
|
|
2774
|
-
runnerIdOf: this.ctx.kernel?.runnerIdForAddon ?? (
|
|
2830
|
+
runnerIdOf: runnerResolverFor(this.ctx.kernel?.runnerIdForAddon, path.join(this.ctx.nodeDataDir ?? path.resolve(dir, "..", ".."), "addons")),
|
|
2775
2831
|
scheduleRestore: (request) => scheduleMigrationRestore(path.resolve(dir, "..", ".."), request)
|
|
2776
2832
|
});
|
|
2777
2833
|
const deps = {
|
|
@@ -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-Cyc4oyGh.js");
|
|
7
7
|
const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
|
|
8
8
|
let zod = require("zod");
|
|
9
9
|
let node_crypto = require("node:crypto");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bs as resolveSecretMarkers, Fa as withLocationMode, Gr as legacyModeOf, Hs as secretTreeFromPaths, Js as transformSecretWrite, Jt as StorageLocationTypeSchema, Kt as StorageCleanupJobSchema, Mo as REDACTED_SECRET, Ms as normalizeNodeId, Ps as parseJsonObject, Rr as isLocationEnabled, Ts as isSecretMarker, Wi as resolveLocationMode, Yt as StorageMigrationJobSchema, ci as modeMayWrite, es as collectSecretConfigKeys, fr as evictionPolicyOfLocation, ls as defineRecordKinds, ma as storageMigrationCapability, mo as BaseAddon, ni as mayWriteToLocation, pa as storageCapability, qt as StorageLocationModeSchema, ra as settingsStoreCapability, tc as EventCategory, ti as mayReadLocation, wr as gbToBytes, yt as LegacyStorageLocationDefaultSchema } from "../../dist-C5sQPOZX.mjs";
|
|
2
2
|
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
@@ -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-
|
|
6
|
+
const require_dist = require("../../dist-Cyc4oyGh.js");
|
|
7
7
|
const require_safe_buffer$1 = require("../../safe-buffer-D3aoa-7X.js");
|
|
8
8
|
const require_x509_es = require("../../x509.es-WtnRNyYS.js");
|
|
9
|
-
const require_agent_https = require("../../agent-https-
|
|
10
|
-
const require_constants$8 = require("../../constants-
|
|
9
|
+
const require_agent_https = require("../../agent-https-CNf7_i1z.js");
|
|
10
|
+
const require_constants$8 = require("../../constants-Cy5svHxz.js");
|
|
11
11
|
const require_src$1 = require("../../src-CnAqG6EF.js");
|
|
12
12
|
let zod = require("zod");
|
|
13
13
|
let node_crypto = require("node:crypto");
|