@camstack/server 1.2.785 → 1.2.787
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/api/core/cap-providers.js +106 -103
- package/dist/api/trpc/generated-cap-mounts.js +1 -10
- package/dist/api/trpc/generated-cap-routers.js +2289 -2375
- package/dist/core/addon/addon-registry.service.js +17 -13
- package/dist/core/addon/instances-of-cap.js +35 -0
- package/package.json +32 -13
- package/system/dist/addon-runner.js +11 -2
- package/system/dist/addon-runner.mjs +12 -3
- package/system/dist/addon-utils.mjs +1 -1
- package/system/dist/{agent-https-B7lqIrF1.js → agent-https--lvZp4PX.js} +1 -1
- package/system/dist/{agent-https-CACfLh65.mjs → agent-https-pSCzmbQd.mjs} +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 +3 -3
- 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/composed-device.d.ts +16 -0
- package/system/dist/builtins/composer/composer.addon.js +62 -13
- package/system/dist/builtins/composer/composer.addon.mjs +62 -13
- 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/actions-service.d.ts +16 -0
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +235 -37
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +235 -37
- package/system/dist/builtins/core-blocks/migrations/fountain-drink-drop.d.ts +21 -0
- package/system/dist/builtins/core-blocks/migrations/index.d.ts +1 -0
- 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 +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 +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 +2 -2
- package/system/dist/builtins/loki-logging/index.mjs +2 -2
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +10 -10
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +10 -10
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +1 -1
- package/system/dist/builtins/snapshot/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +20 -20
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/integration-record-kinds.d.ts +0 -1
- package/system/dist/builtins/sqlite-storage/integration-registry.d.ts +2 -4
- package/system/dist/builtins/sqlite-storage/migrations/migration-types.d.ts +6 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +7 -4
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +7 -4
- package/system/dist/builtins/storage-orchestrator/drain-state-store.d.ts +4 -8
- package/system/dist/builtins/storage-orchestrator/location-store.d.ts +9 -26
- package/system/dist/builtins/storage-orchestrator/record-kinds.d.ts +0 -1
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +35 -407
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +36 -407
- 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/{capture-engine-n5mJUHzf.js → capture-engine-CTFHb-UX.js} +1 -1
- package/system/dist/{capture-engine-Dw82x5UW.mjs → capture-engine-N1-UaQr0.mjs} +1 -1
- package/system/dist/{composition-sources-D-bbLadz.mjs → composition-sources-Qe3MRI1x.mjs} +1 -1
- package/system/dist/{composition-sources-Cdow6PNn.js → composition-sources-Yjz-b6-8.js} +1 -1
- package/system/dist/{constants-Dmc-T4Zw.js → constants-7gannWcO.js} +1 -1
- package/system/dist/{constants-C6UsfDdP.mjs → constants-lWMAnwmj.mjs} +1 -1
- package/system/dist/{coral-accelerators-DBlgWB8k.mjs → coral-accelerators-BW3OcrLD.mjs} +6 -6
- package/system/dist/{custom-action-registry-B9zFBNVa.mjs → custom-action-registry-N7flBDwT.mjs} +37 -37
- package/system/dist/{device-ca-OQqtK7Yy.mjs → device-ca-8lpRo9Ss.mjs} +1 -1
- package/system/dist/{device-ca-v8lGdWVk.js → device-ca-HGx3Pwb6.js} +1 -1
- package/system/dist/{dist-CRWinpyX.mjs → dist-DgZrPBbX.mjs} +1865 -1818
- package/system/dist/{dist-1X5ccoX2.js → dist-j7uy5oG9.js} +1876 -1775
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-BQqm5eSM.mjs → hub-mdns-ciao-BM3peDu1.mjs} +2 -2
- package/system/dist/{hub-mdns-ciao-hBZgojNT.js → hub-mdns-ciao-BUKHJL6N.js} +2 -2
- package/system/dist/index.d.ts +2 -2
- package/system/dist/index.js +51 -222
- package/system/dist/index.mjs +265 -434
- package/system/dist/kernel/moleculer/migration-api-facade.d.ts +2 -0
- package/system/dist/kernel/transport/local-child-client.d.ts +9 -0
- package/system/dist/{legacy-integration-rows-door-BUjw8YoW.js → legacy-integration-rows-door-D51X6Fdr.js} +1 -1
- package/system/dist/{legacy-integration-rows-door-B7bwfRev.mjs → legacy-integration-rows-door-DIm4Q3Jj.mjs} +1 -1
- package/system/dist/migrations/hub/2026-11-06-drop-legacy-integrations-and-storage-locations.d.ts +12 -0
- package/system/dist/{restore-archive-D9vM-Kzb.js → restore-archive-8jRnSzmw.js} +1 -1
- package/system/dist/{restore-archive-TST7tvBk.mjs → restore-archive-D-Wmp8OK.mjs} +150 -150
- package/system/dist/{wal-maintenance-C7dJSaPS.mjs → wal-maintenance-CBnqPn4u.mjs} +0 -0
- package/system/dist/{wal-maintenance-wfVwXxO4.js → wal-maintenance-D0FMnpba.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-j7uy5oG9.js");
|
|
7
7
|
const require_log_read_filter = require("../../log-read-filter-Bi066jwU.js");
|
|
8
8
|
let zod = require("zod");
|
|
9
9
|
//#region src/builtins/loki-logging/loki-payload.ts
|
|
@@ -1387,7 +1387,7 @@ var LokiLoggingAddon = class extends require_dist.BaseAddon {
|
|
|
1387
1387
|
*/
|
|
1388
1388
|
destinationConfig(body) {
|
|
1389
1389
|
return {
|
|
1390
|
-
enabled: body
|
|
1390
|
+
enabled: require_dist.isInstanceEnabled(body),
|
|
1391
1391
|
url: body.url,
|
|
1392
1392
|
job: body.job,
|
|
1393
1393
|
node: this.ctx.kernel.localNodeId ?? "hub",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $r as isSameAddonId, As as defineAddonMigrations, Br as integrationInstancesCapability, Gi as preconditionOf, Gs as isInstanceEnabled, Lo as BaseAddon, Ms as defineEntryKind, Xs as isSecretMarker, Ys as isSecretFieldView, ds as RevConflictError, fi as logDestinationCapability, os as RecordIntegrationInstances, wn as bareAddonId } from "../../dist-DgZrPBbX.mjs";
|
|
2
2
|
import { n as compileLogFilter, o as lineMatches } from "../../log-read-filter-D7Ev3zm-.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/builtins/loki-logging/loki-payload.ts
|
|
@@ -1380,7 +1380,7 @@ var LokiLoggingAddon = class extends BaseAddon {
|
|
|
1380
1380
|
*/
|
|
1381
1381
|
destinationConfig(body) {
|
|
1382
1382
|
return {
|
|
1383
|
-
enabled: body
|
|
1383
|
+
enabled: isInstanceEnabled(body),
|
|
1384
1384
|
url: body.url,
|
|
1385
1385
|
job: body.job,
|
|
1386
1386
|
node: this.ctx.kernel.localNodeId ?? "hub",
|
|
@@ -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-j7uy5oG9.js");
|
|
7
7
|
let node_fs = require("node:fs");
|
|
8
8
|
node_fs = require_chunk.__toESM(node_fs);
|
|
9
9
|
let node_fs_promises = require("node:fs/promises");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as fs
|
|
1
|
+
import { $i as reducePoints, Ec as EventCategory, Ht as ROOT_BUCKET_KEY, Lo as BaseAddon, Os as createEvent, Pr as foldSnapshotByFunction, Tc as errMsg, aa as resolveBucketMs, sn as UNATTRIBUTED_BUCKET_KEY, xi as metricsProviderCapability } from "../../dist-DgZrPBbX.mjs";
|
|
2
|
+
import * as fs from "node:fs";
|
|
3
3
|
import { constants, readFileSync } from "node:fs";
|
|
4
4
|
import { access, readFile, readdir } from "node:fs/promises";
|
|
5
5
|
import { promisify } from "node:util";
|
|
@@ -1686,7 +1686,7 @@ var NativeMetricsProvider = class {
|
|
|
1686
1686
|
let swapUsedBytes = 0;
|
|
1687
1687
|
let swapTotalBytes = 0;
|
|
1688
1688
|
if (IS_LINUX) try {
|
|
1689
|
-
const meminfo = fs
|
|
1689
|
+
const meminfo = fs.readFileSync("/proc/meminfo", "utf-8");
|
|
1690
1690
|
const availKb = meminfo.match(/MemAvailable:\s+(\d+)/)?.[1];
|
|
1691
1691
|
if (availKb !== void 0) available = parseInt(availKb, 10) * 1024;
|
|
1692
1692
|
const swapTotal = parseInt(meminfo.match(/SwapTotal:\s+(\d+)/)?.[1] ?? "0", 10) * 1024;
|
|
@@ -1779,7 +1779,7 @@ async function sampleMacMemory(provider) {
|
|
|
1779
1779
|
}
|
|
1780
1780
|
function getDiskSpaceInternal(dirPath) {
|
|
1781
1781
|
return new Promise((resolve, reject) => {
|
|
1782
|
-
fs
|
|
1782
|
+
fs.statfs(dirPath, (err, stats) => {
|
|
1783
1783
|
if (err) return reject(err);
|
|
1784
1784
|
const totalBytes = stats.blocks * stats.bsize;
|
|
1785
1785
|
const availableBytes = stats.bavail * stats.bsize;
|
|
@@ -1797,7 +1797,7 @@ function getDiskSpaceInternal(dirPath) {
|
|
|
1797
1797
|
async function takeDiskIoSnapshot() {
|
|
1798
1798
|
const now = Date.now();
|
|
1799
1799
|
if (IS_LINUX) try {
|
|
1800
|
-
const data = fs
|
|
1800
|
+
const data = fs.readFileSync("/proc/diskstats", "utf-8");
|
|
1801
1801
|
let readOps = 0, readBytes = 0, writeOps = 0, writeBytes = 0;
|
|
1802
1802
|
for (const line of data.split("\n")) {
|
|
1803
1803
|
const parts = line.trim().split(/\s+/);
|
|
@@ -1828,7 +1828,7 @@ async function takeDiskIoSnapshot() {
|
|
|
1828
1828
|
async function takeNetworkIoSnapshot() {
|
|
1829
1829
|
const now = Date.now();
|
|
1830
1830
|
if (IS_LINUX) try {
|
|
1831
|
-
const data = fs
|
|
1831
|
+
const data = fs.readFileSync("/proc/net/dev", "utf-8");
|
|
1832
1832
|
let rxBytes = 0, txBytes = 0, rxPackets = 0, txPackets = 0, rxErrors = 0, txErrors = 0;
|
|
1833
1833
|
for (const line of data.split("\n")) {
|
|
1834
1834
|
const match = line.match(/^\s*(\w+):\s+(.+)$/);
|
|
@@ -1889,7 +1889,7 @@ async function takeNetworkIoSnapshot() {
|
|
|
1889
1889
|
}
|
|
1890
1890
|
async function getCpuTemperatureInternal() {
|
|
1891
1891
|
if (IS_LINUX) for (const p of ["/sys/class/thermal/thermal_zone0/temp", "/sys/class/hwmon/hwmon0/temp1_input"]) try {
|
|
1892
|
-
const raw = fs
|
|
1892
|
+
const raw = fs.readFileSync(p, "utf-8").trim();
|
|
1893
1893
|
const millideg = parseInt(raw, 10);
|
|
1894
1894
|
if (!isNaN(millideg)) return Math.round(millideg / 100) / 10;
|
|
1895
1895
|
} catch {
|
|
@@ -1940,10 +1940,10 @@ function getProcessResources() {
|
|
|
1940
1940
|
let threadCount = 0;
|
|
1941
1941
|
if (IS_LINUX) {
|
|
1942
1942
|
try {
|
|
1943
|
-
openFds = fs
|
|
1943
|
+
openFds = fs.readdirSync(`/proc/${process.pid}/fd`).length;
|
|
1944
1944
|
} catch {}
|
|
1945
1945
|
try {
|
|
1946
|
-
const match = fs
|
|
1946
|
+
const match = fs.readFileSync(`/proc/${process.pid}/status`, "utf-8").match(/Threads:\s+(\d+)/);
|
|
1947
1947
|
if (match) threadCount = parseInt(match[1], 10);
|
|
1948
1948
|
} catch {}
|
|
1949
1949
|
}
|
|
@@ -1958,7 +1958,7 @@ function getProcessResources() {
|
|
|
1958
1958
|
function getPressure(resource) {
|
|
1959
1959
|
if (!IS_LINUX) return null;
|
|
1960
1960
|
try {
|
|
1961
|
-
const data = fs
|
|
1961
|
+
const data = fs.readFileSync(`/proc/pressure/${resource}`, "utf-8");
|
|
1962
1962
|
const parseLine = (prefix) => {
|
|
1963
1963
|
const match = data.match(new RegExp(`${prefix} avg10=(\\d+\\.\\d+) avg60=(\\d+\\.\\d+) avg300=(\\d+\\.\\d+)`));
|
|
1964
1964
|
if (!match) return null;
|
|
@@ -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-j7uy5oG9.js");
|
|
7
7
|
const require_coral_accelerators = require("../../coral-accelerators-BSVsBVzt.js");
|
|
8
8
|
let node_fs = require("node:fs");
|
|
9
9
|
node_fs = require_chunk.__toESM(node_fs);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as __toESM, r as __exportAll } from "../../chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { n as detectCoralAccelerator, r as nodeCoralFs } from "../../coral-accelerators-
|
|
4
|
-
import * as fs
|
|
2
|
+
import { Ec as EventCategory, Fi as parseAcceleratorFactsJson, Fs as emitReadiness, Hi as platformProbeCapability, Lo as BaseAddon, Tc as errMsg, br as enumerateInferenceDevices, xa as scoreRuntimes } from "../../dist-DgZrPBbX.mjs";
|
|
3
|
+
import { n as detectCoralAccelerator, r as nodeCoralFs } from "../../coral-accelerators-BW3OcrLD.mjs";
|
|
4
|
+
import * as fs from "node:fs";
|
|
5
5
|
import * as path$1 from "node:path";
|
|
6
6
|
import { promisify } from "node:util";
|
|
7
7
|
import * as os$1 from "node:os";
|
|
@@ -492,14 +492,14 @@ var PlatformScorer = class {
|
|
|
492
492
|
if (nvidia) gpu = nvidia;
|
|
493
493
|
const listRenderNodes = () => {
|
|
494
494
|
try {
|
|
495
|
-
return fs
|
|
495
|
+
return fs.readdirSync("/dev/dri").filter((n) => n.startsWith("renderD")).map((n) => `/dev/dri/${n}`);
|
|
496
496
|
} catch {
|
|
497
497
|
return [];
|
|
498
498
|
}
|
|
499
499
|
};
|
|
500
500
|
const readDrmAttr = (node, attr) => {
|
|
501
501
|
try {
|
|
502
|
-
return fs
|
|
502
|
+
return fs.readFileSync(`/sys/class/drm/${node.split("/").pop()}/device/${attr}`, "utf8");
|
|
503
503
|
} catch {
|
|
504
504
|
return "";
|
|
505
505
|
}
|
|
@@ -525,12 +525,12 @@ var PlatformScorer = class {
|
|
|
525
525
|
}
|
|
526
526
|
const listDir = (p) => {
|
|
527
527
|
try {
|
|
528
|
-
return fs
|
|
528
|
+
return fs.readdirSync(p);
|
|
529
529
|
} catch {
|
|
530
530
|
return [];
|
|
531
531
|
}
|
|
532
532
|
};
|
|
533
|
-
const exists = (p) => fs
|
|
533
|
+
const exists = (p) => fs.existsSync(p);
|
|
534
534
|
if (!npu) {
|
|
535
535
|
const { classifyIntelNpu } = await import("../../intel-npu-C8HKvRQF.mjs");
|
|
536
536
|
npu = classifyIntelNpu({
|
|
@@ -558,7 +558,7 @@ var PlatformScorer = class {
|
|
|
558
558
|
exists,
|
|
559
559
|
readFile: (p) => {
|
|
560
560
|
try {
|
|
561
|
-
return fs
|
|
561
|
+
return fs.readFileSync(p, "utf8");
|
|
562
562
|
} catch {
|
|
563
563
|
return "";
|
|
564
564
|
}
|
|
@@ -844,7 +844,7 @@ function jsonValue(text) {
|
|
|
844
844
|
function readPublishedAcceleratorFacts(filePath) {
|
|
845
845
|
let text;
|
|
846
846
|
try {
|
|
847
|
-
text = fs
|
|
847
|
+
text = fs.readFileSync(filePath, "utf8");
|
|
848
848
|
} catch {
|
|
849
849
|
return null;
|
|
850
850
|
}
|
|
@@ -859,7 +859,7 @@ function findAcceleratorFactsScript(dataDir, cwd = process.cwd()) {
|
|
|
859
859
|
const candidates = [];
|
|
860
860
|
if (typeof dataDir === "string" && dataDir !== "") candidates.push(path$1.join(dataDir, "addons", "@camstack", "addon-pipeline", "python", "accelerator_facts.py"));
|
|
861
861
|
candidates.push(path$1.join(cwd, "packages", "addon-pipeline", "python", "accelerator_facts.py"));
|
|
862
|
-
for (const candidate of candidates) if (fs
|
|
862
|
+
for (const candidate of candidates) if (fs.existsSync(candidate)) return candidate;
|
|
863
863
|
return null;
|
|
864
864
|
}
|
|
865
865
|
async function defaultExec(command, args, timeoutMs) {
|
|
@@ -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-j7uy5oG9.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 { Lo as BaseAddon, Zi as recordEntriesCapability, gs as UnknownRecordKindError, hc as secretViewsOf, qo as InvalidRecordError } from "../../dist-DgZrPBbX.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-j7uy5oG9.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 { Ec as EventCategory, Lo as BaseAddon } from "../../dist-DgZrPBbX.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-j7uy5oG9.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");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ec as EventCategory, La as streamQualityLabel, Lo as BaseAddon, Sc as DeviceFeature, Tc as errMsg, Tn as batteryCapability, g as BatteryStatusSchema, ka as snapshotCapability, lr as deriveBatteryPresence, nc as nodePin, wc as DeviceType, wn as bareAddonId, yi as memoizePinnedFfmpeg } from "../../dist-DgZrPBbX.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";
|
|
@@ -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-j7uy5oG9.js");
|
|
7
7
|
let node_crypto = require("node:crypto");
|
|
8
8
|
let node_fs = require("node:fs");
|
|
9
9
|
node_fs = require_chunk.__toESM(node_fs);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fa as storageProviderCapability, Lo as BaseAddon, Nr as filesystemBrowseCapability } from "../../dist-DgZrPBbX.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
|
-
import * as fs
|
|
3
|
+
import * as fs from "node:fs";
|
|
4
4
|
import * as path$1 from "node:path";
|
|
5
5
|
import { basename, dirname, isAbsolute, join, resolve, sep } from "node:path";
|
|
6
6
|
import { mkdir, readdir, realpath, statfs } from "node:fs/promises";
|
|
@@ -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-D0FMnpba.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-CBnqPn4u.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 {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import type { CreateIntegrationInput, IIntegrationRegistry, Integration,
|
|
1
|
+
import type { CreateIntegrationInput, IIntegrationRegistry, Integration, RecordKindHandle, RecordsAccess } from "@camstack/types";
|
|
2
2
|
import { type IntegrationBody } from "./integration-record-kinds.js";
|
|
3
3
|
export interface IntegrationRecordStores {
|
|
4
4
|
readonly integrations: RecordKindHandle<IntegrationBody>;
|
|
5
5
|
}
|
|
6
6
|
export declare class IntegrationRegistry implements IIntegrationRegistry {
|
|
7
|
-
private readonly store;
|
|
8
7
|
private readonly recordStores;
|
|
9
|
-
constructor(
|
|
8
|
+
constructor(recordStores: IntegrationRecordStores);
|
|
10
9
|
static recordStoresOf(records: Pick<RecordsAccess, "kind">): IntegrationRecordStores;
|
|
11
10
|
initialize(): Promise<void>;
|
|
12
11
|
private resumeCounter;
|
|
@@ -26,5 +25,4 @@ export declare class IntegrationRegistry implements IIntegrationRegistry {
|
|
|
26
25
|
readonly info: Readonly<Record<string, unknown>> | null;
|
|
27
26
|
}): boolean;
|
|
28
27
|
deleteIntegration(id: string): Promise<boolean>;
|
|
29
|
-
private mapIntegration;
|
|
30
28
|
}
|
|
@@ -25,8 +25,11 @@ export declare const HUB_OWNER = "hub";
|
|
|
25
25
|
/** A hub-store `sql` migration: its identity plus the synchronous body that runs in its transaction. */
|
|
26
26
|
export interface HubSqlMigration {
|
|
27
27
|
readonly meta: MigrationMeta;
|
|
28
|
-
|
|
28
|
+
/** May answer a note (what it dropped or copied by name): kept in the ledger and logged at info. */
|
|
29
|
+
run(db: MigrationDatabase): MigrationNote | undefined;
|
|
29
30
|
}
|
|
31
|
+
/** A `sql` body's account of what it did beyond a row count. */
|
|
32
|
+
export type MigrationNote = Readonly<Record<string, unknown>>;
|
|
30
33
|
/**
|
|
31
34
|
* A hub-store `plan` migration: the body READS through the connection and returns the
|
|
32
35
|
* edits the engine applies, in the same transaction as the `applied` row. It must not
|
|
@@ -48,6 +51,8 @@ export interface PassOutcome {
|
|
|
48
51
|
readonly rowsChanged: number;
|
|
49
52
|
readonly error: string | null;
|
|
50
53
|
readonly reason: string | null;
|
|
54
|
+
/** The `sql` body's own note, when it left one. */
|
|
55
|
+
readonly note?: MigrationNote;
|
|
51
56
|
}
|
|
52
57
|
export interface PreparedPass {
|
|
53
58
|
/** Every catalogued migration of this file, as the ledger has it now. */
|
|
@@ -3,12 +3,12 @@ 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-j7uy5oG9.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-D0FMnpba.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
|
-
const require_legacy_integration_rows_door = require("../../legacy-integration-rows-door-
|
|
11
|
+
const require_legacy_integration_rows_door = require("../../legacy-integration-rows-door-D51X6Fdr.js");
|
|
12
12
|
let zod = require("zod");
|
|
13
13
|
let node_crypto = require("node:crypto");
|
|
14
14
|
let node_fs = require("node:fs");
|
|
@@ -1432,7 +1432,10 @@ var MigrationEngine = class {
|
|
|
1432
1432
|
};
|
|
1433
1433
|
if (outcome.outcome === "applied") log.info("migration applied", {
|
|
1434
1434
|
tags,
|
|
1435
|
-
meta: {
|
|
1435
|
+
meta: {
|
|
1436
|
+
rowsChanged: outcome.rowsChanged,
|
|
1437
|
+
...outcome.note
|
|
1438
|
+
}
|
|
1436
1439
|
});
|
|
1437
1440
|
else if (outcome.outcome === "failed") log.error("migration failed", {
|
|
1438
1441
|
tags,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ct as MIGRATION_API_V1_METHODS, Ec as EventCategory, Es as collectSecretMarkerRefs, F as DATABASE_SNAPSHOT_TIMEOUT_MS, I as DATA_STORE_DATABASES, In as catalogueIssues, Jo as NoCallerError, Lo as BaseAddon, N as DATABASE_SNAPSHOT_PARTIAL_SUFFIX, Ot as MigrationMetaSchema, P as DATABASE_SNAPSHOT_SUFFIX, Pi as orderMigrations, Qa as vectorStoreCapability, Qi as recordsCapability, Si as migrationsCapability, Tc as errMsg$1, Uo as DeclarationRefusedError, es as RECORD_SWEEP_INTERVAL_MS, gs as UnknownRecordKindError, ic as normalizeSecretOwner, ir as databaseSnapshotCapability, ja as storageAdminCapability, js as defineCustomActions, ks as customAction, ms as TransactRefusedError, pa as resolveRunnerId, qo as InvalidRecordError, rr as dataStoreProviderCapability, rs as RUNTIME_DEFAULTS, ss as RecordKindDeclarationSchema, wn as bareAddonId } from "../../dist-DgZrPBbX.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-CBnqPn4u.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
|
-
import { a as patchLegacyIntegrationRows, i as legacyIntegrationAddonId, n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows, r as deleteLegacyIntegrationRowKeys } from "../../legacy-integration-rows-door-
|
|
6
|
+
import { a as patchLegacyIntegrationRows, i as legacyIntegrationAddonId, n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows, r as deleteLegacyIntegrationRowKeys } from "../../legacy-integration-rows-door-DIm4Q3Jj.mjs";
|
|
7
7
|
import { createRequire } from "node:module";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { randomUUID } from "node:crypto";
|
|
@@ -1426,7 +1426,10 @@ var MigrationEngine = class {
|
|
|
1426
1426
|
};
|
|
1427
1427
|
if (outcome.outcome === "applied") log.info("migration applied", {
|
|
1428
1428
|
tags,
|
|
1429
|
-
meta: {
|
|
1429
|
+
meta: {
|
|
1430
|
+
rowsChanged: outcome.rowsChanged,
|
|
1431
|
+
...outcome.note
|
|
1432
|
+
}
|
|
1430
1433
|
});
|
|
1431
1434
|
else if (outcome.outcome === "failed") log.error("migration failed", {
|
|
1432
1435
|
tags,
|
|
@@ -5,21 +5,17 @@
|
|
|
5
5
|
* restart the ratchet at the top of the disk and silently undo every byte of
|
|
6
6
|
* progress — the operator would see a drain that never finishes and no line
|
|
7
7
|
* saying why. So the cap, the drain start and the observed growth are persisted
|
|
8
|
-
* on every sweep,
|
|
9
|
-
* uses.
|
|
8
|
+
* on every sweep, as `drain-state` records.
|
|
10
9
|
*/
|
|
11
|
-
import type {
|
|
10
|
+
import type { RecordKindHandle, RecordsAccess } from "@camstack/types";
|
|
12
11
|
import type { DrainState } from "./drain-ratchet.js";
|
|
13
12
|
import { type StorageDrainStateBody } from "./record-kinds.js";
|
|
14
13
|
import type { DrainStateStore } from "./storage-pressure-manager.js";
|
|
15
|
-
/** {@link DrainStateStore}
|
|
14
|
+
/** {@link DrainStateStore} over the `drain-state` record kind. */
|
|
16
15
|
export declare class SqliteDrainStateStore implements DrainStateStore {
|
|
17
|
-
private readonly store;
|
|
18
|
-
private declared;
|
|
19
16
|
private readonly drainKind;
|
|
20
|
-
constructor(
|
|
17
|
+
constructor(drainKind: RecordKindHandle<StorageDrainStateBody>);
|
|
21
18
|
static recordStoresOf(records: Pick<RecordsAccess, "kind">): RecordKindHandle<StorageDrainStateBody>;
|
|
22
|
-
private ensureDeclared;
|
|
23
19
|
load(): Promise<readonly DrainState[]>;
|
|
24
20
|
save(state: DrainState): Promise<void>;
|
|
25
21
|
clear(locationId: string): Promise<void>;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* tests pass a fake (in-memory `Map`-backed) implementation. Same
|
|
8
8
|
* pattern as `IntegrationRegistry` in `sqlite-storage/`.
|
|
9
9
|
*/
|
|
10
|
-
import type {
|
|
10
|
+
import type { LegacyStorageLocationDefault, RecordKindHandle, RecordsAccess, StorageLocation } from "@camstack/types";
|
|
11
11
|
import { type StorageLocationBody, type StorageSeedMarkerBody } from "./record-kinds.js";
|
|
12
12
|
/**
|
|
13
13
|
* A location as it comes back OFF DISK: the live record plus the retired
|
|
@@ -47,42 +47,25 @@ export interface ILocationStore {
|
|
|
47
47
|
unmarkTypeSeeded?(type: string): Promise<void>;
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
50
|
+
* The keychain scope collection a storage location's secret fields are filed
|
|
51
|
+
* under (`row/storage_locations/<id>`). The table it was named for is gone; the
|
|
52
|
+
* string stays because existing secret markers point at it.
|
|
53
53
|
*/
|
|
54
|
-
export declare const
|
|
54
|
+
export declare const STORAGE_LOCATIONS_SECRET_SCOPE = "storage_locations";
|
|
55
55
|
/**
|
|
56
|
-
* `ILocationStore` on the
|
|
57
|
-
*
|
|
58
|
-
* directly (not the `settings-store` singleton) because since D44 the
|
|
59
|
-
* storage-orchestrator IS that singleton, and asking the registry for it would
|
|
60
|
-
* route this table back through the orchestrator itself.
|
|
56
|
+
* `ILocationStore` on the storage-orchestrator's own record kinds (`locations`
|
|
57
|
+
* and `seed-markers`).
|
|
61
58
|
*/
|
|
62
59
|
export declare class SqliteLocationStore implements ILocationStore {
|
|
63
|
-
private readonly store;
|
|
64
|
-
private declared;
|
|
65
60
|
private readonly locationsKind;
|
|
66
|
-
constructor(store: ISettingsStoreProvider, locationsKind?: RecordKindHandle<StorageLocationBody> | null, seedMarkersKind?: RecordKindHandle<StorageSeedMarkerBody> | null);
|
|
67
61
|
private readonly seedMarkersKind;
|
|
62
|
+
constructor(locationsKind: RecordKindHandle<StorageLocationBody>, seedMarkersKind: RecordKindHandle<StorageSeedMarkerBody>);
|
|
68
63
|
static seedMarkersOf(records: Pick<RecordsAccess, "kind">): RecordKindHandle<StorageSeedMarkerBody>;
|
|
69
64
|
loadSeededTypes(): Promise<readonly string[]>;
|
|
70
65
|
markTypeSeeded(type: string): Promise<void>;
|
|
71
66
|
unmarkTypeSeeded(type: string): Promise<void>;
|
|
72
67
|
static recordStoresOf(records: Pick<RecordsAccess, "kind">): RecordKindHandle<StorageLocationBody>;
|
|
73
|
-
|
|
74
|
-
* Lazy `declareCollection` — keeps the constructor cheap and async-free.
|
|
75
|
-
* Called from every mutation/read path; `declareCollection` is idempotent
|
|
76
|
-
* (and additive on shape changes), so repeated calls collapse to a no-op.
|
|
77
|
-
*/
|
|
78
|
-
private ensureDeclared;
|
|
79
|
-
loadAll(): Promise<readonly StorageLocation[]>;
|
|
80
|
-
/**
|
|
81
|
-
* Replace-or-insert. Implemented as delete + insert rather than a
|
|
82
|
-
* conditional update because the orchestrator serializes every mutation
|
|
83
|
-
* through the in-memory map before dispatching to the store — there's no
|
|
84
|
-
* contention to lose, and delete-then-insert is unconditionally simpler.
|
|
85
|
-
*/
|
|
68
|
+
loadAll(): Promise<readonly PersistedStorageLocation[]>;
|
|
86
69
|
upsert(loc: StorageLocation): Promise<void>;
|
|
87
70
|
delete(id: string): Promise<void>;
|
|
88
71
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { StorageLocationModeSchema, StorageLocationTypeSchema, type DefinedRecordKind } from "@camstack/types";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
export declare const STORAGE_DRAIN_STATE_LEGACY = "storage_drain_state";
|
|
7
6
|
export type StorageLocationBody = {
|
|
8
7
|
readonly type: z.infer<typeof StorageLocationTypeSchema>;
|
|
9
8
|
readonly displayName: string;
|