@camstack/server 1.2.788 → 1.2.790
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 +14 -0
- package/dist/agent/agent-child-manifest.js +39 -0
- package/dist/agent/agent-hub-registration.js +11 -1
- package/dist/agent/forward-to-hub.js +43 -0
- package/dist/agent/main.js +31 -81
- package/dist/agent/stale-addon-gate.js +70 -34
- package/dist/api/trpc/generated-cap-mounts.js +1 -6
- package/dist/api/trpc/generated-cap-routers.js +1221 -1417
- package/dist/core/addon/addon-registry.service.js +25 -33
- package/dist/core/addon/boot-health-snapshot.js +0 -28
- package/dist/core/addon/{hub-spawn-gate.js → hub-addon-support.js} +12 -35
- package/dist/core/moleculer/moleculer.service.js +2 -13
- package/dist/core/moleculer/runner-hosted-on-node.js +23 -0
- package/dist/core/updates/required-addon-update.js +1 -1
- package/package.json +23 -58
- package/system/dist/addon-utils.mjs +1 -1
- package/system/dist/{agent-https-jJDe-XNl.js → agent-https-BmXXKQAA.js} +1 -1
- package/system/dist/{agent-https-szf2FU49.mjs → agent-https-ByceQLwr.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.d.ts +8 -0
- package/system/dist/builtins/alerts/alerts.addon.js +72 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +74 -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/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 +11 -5
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +11 -5
- 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 +1 -1
- package/system/dist/builtins/loki-logging/index.mjs +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +10 -10
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +10 -10
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +1 -1
- package/system/dist/builtins/snapshot/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +20 -20
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
- package/system/dist/builtins/storage-orchestrator/access-guards.d.ts +1 -1
- package/system/dist/builtins/storage-orchestrator/custom-actions.d.ts +11 -0
- package/system/dist/builtins/storage-orchestrator/index.d.ts +1 -0
- package/system/dist/builtins/storage-orchestrator/index.js +2 -0
- package/system/dist/builtins/storage-orchestrator/index.mjs +2 -2
- package/system/dist/builtins/storage-orchestrator/location-instances.d.ts +72 -0
- package/system/dist/builtins/storage-orchestrator/location-repoint-move.d.ts +1 -1
- package/system/dist/builtins/storage-orchestrator/location-secret-refs.d.ts +26 -0
- package/system/dist/builtins/storage-orchestrator/location-store.d.ts +28 -2
- package/system/dist/builtins/storage-orchestrator/migrations/index.d.ts +9 -2
- package/system/dist/builtins/storage-orchestrator/migrations/legacy-location-secret-refs.d.ts +13 -0
- package/system/dist/builtins/storage-orchestrator/migrations/location-secret-ports.d.ts +15 -0
- package/system/dist/builtins/storage-orchestrator/migrations/location-secrets-to-record.d.ts +57 -0
- package/system/dist/builtins/storage-orchestrator/provider-discovery.d.ts +10 -13
- package/system/dist/builtins/storage-orchestrator/record-kinds.d.ts +6 -0
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.d.ts +39 -8
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +954 -131
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +954 -132
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.service.d.ts +8 -0
- package/system/dist/builtins/system-config/system-config.addon.js +3 -3
- package/system/dist/builtins/system-config/system-config.addon.mjs +115 -115
- package/system/dist/builtins/winston-logging/index.js +112 -3
- package/system/dist/builtins/winston-logging/index.mjs +112 -3
- package/system/dist/builtins/winston-logging/migrations/index.d.ts +8 -0
- package/system/dist/builtins/winston-logging/migrations/node-fields.d.ts +43 -0
- package/system/dist/builtins/winston-logging/winston-logging.addon.d.ts +10 -2
- package/system/dist/{capture-engine-DNHgjQot.js → capture-engine-BHj1fNYC.js} +1 -1
- package/system/dist/{capture-engine-BsKY_3xa.mjs → capture-engine-D9n4KDaN.mjs} +1 -1
- package/system/dist/{composition-sources-BgO0GQYW.js → composition-sources-BGgIuuvd.js} +1 -1
- package/system/dist/{composition-sources-BRdGsbVT.mjs → composition-sources-wI4qWTz2.mjs} +1 -1
- package/system/dist/{constants-CQeMrR4f.mjs → constants-DHqkxbYk.mjs} +1 -1
- package/system/dist/{constants-C3jGKQSQ.js → constants-DNdriMRD.js} +1 -1
- package/system/dist/{coral-accelerators-BW3OcrLD.mjs → coral-accelerators-DBlgWB8k.mjs} +6 -6
- package/system/dist/{custom-action-registry-N7flBDwT.mjs → custom-action-registry-B9zFBNVa.mjs} +37 -37
- package/system/dist/{device-ca-D3y6wGmn.js → device-ca-C2RzT1VT.js} +1 -1
- package/system/dist/{device-ca-ByVi5eUC.mjs → device-ca-gr5eE3h5.mjs} +1 -1
- package/system/dist/{dist-BsQA6-0i.mjs → dist-BUoL5bbr.mjs} +116 -418
- package/system/dist/{dist-BRI-Mwx0.js → dist-DV0V3JiE.js} +133 -417
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-Ry_Jpljx.js → hub-mdns-ciao-Be5PGXW6.js} +2 -2
- package/system/dist/{hub-mdns-ciao-8dJTW2LI.mjs → hub-mdns-ciao-DoSb8dwB.mjs} +2 -2
- package/system/dist/index.js +151 -53
- package/system/dist/index.mjs +362 -266
- package/system/dist/kernel/addon-health-monitor.d.ts +0 -21
- package/system/dist/kernel/index.d.ts +2 -0
- package/system/dist/kernel/transport/runner-of-addon.d.ts +2 -0
- package/system/dist/kernel/unsupported-addon-tracker.d.ts +74 -0
- package/system/dist/{legacy-integration-rows-door-D5BdSNla.js → legacy-integration-rows-door-D5s8oM7e.js} +1 -1
- package/system/dist/{legacy-integration-rows-door-CjXTbmvH.mjs → legacy-integration-rows-door-DRC0xn6k.mjs} +1 -1
- package/system/dist/migrations/hub/2026-11-06-addon-settings-bare-rows.d.ts +3 -0
- package/system/dist/{restore-archive-Co2lk3OU.mjs → restore-archive-DH3P9j-V.mjs} +94 -94
- package/system/dist/{restore-archive-GoWJMdHy.js → restore-archive-Dh4gfCRY.js} +1 -1
- package/system/dist/{wal-maintenance-DRnV6QYu.mjs → wal-maintenance-BWfH3Lov.mjs} +0 -0
- package/system/dist/{wal-maintenance-C1Haue74.js → wal-maintenance-DgN_WD5T.js} +0 -0
- package/system/package.json +4 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as fs from "node:fs";
|
|
1
|
+
import { Bo as BaseAddon, Fr as foldSnapshotByFunction, Ht as ROOT_BUCKET_KEY, Oc as errMsg, Si as metricsProviderCapability, cn as UNATTRIBUTED_BUCKET_KEY, js as createEvent, kc as EventCategory, sa as resolveBucketMs, ta as reducePoints } from "../../dist-BUoL5bbr.mjs";
|
|
2
|
+
import * as fs$1 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.readFileSync("/proc/meminfo", "utf-8");
|
|
1689
|
+
const meminfo = fs$1.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.statfs(dirPath, (err, stats) => {
|
|
1782
|
+
fs$1.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.readFileSync("/proc/diskstats", "utf-8");
|
|
1800
|
+
const data = fs$1.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.readFileSync("/proc/net/dev", "utf-8");
|
|
1831
|
+
const data = fs$1.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.readFileSync(p, "utf-8").trim();
|
|
1892
|
+
const raw = fs$1.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.readdirSync(`/proc/${process.pid}/fd`).length;
|
|
1943
|
+
openFds = fs$1.readdirSync(`/proc/${process.pid}/fd`).length;
|
|
1944
1944
|
} catch {}
|
|
1945
1945
|
try {
|
|
1946
|
-
const match = fs.readFileSync(`/proc/${process.pid}/status`, "utf-8").match(/Threads:\s+(\d+)/);
|
|
1946
|
+
const match = fs$1.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.readFileSync(`/proc/pressure/${resource}`, "utf-8");
|
|
1961
|
+
const data = fs$1.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-DV0V3JiE.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 from "node:fs";
|
|
2
|
+
import { Bo as BaseAddon, Ca as scoreRuntimes, Li as parseAcceleratorFactsJson, Oc as errMsg, Rs as emitReadiness, Wi as platformProbeCapability, kc as EventCategory, xr as enumerateInferenceDevices } from "../../dist-BUoL5bbr.mjs";
|
|
3
|
+
import { n as detectCoralAccelerator, r as nodeCoralFs } from "../../coral-accelerators-DBlgWB8k.mjs";
|
|
4
|
+
import * as fs$1 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.readdirSync("/dev/dri").filter((n) => n.startsWith("renderD")).map((n) => `/dev/dri/${n}`);
|
|
495
|
+
return fs$1.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.readFileSync(`/sys/class/drm/${node.split("/").pop()}/device/${attr}`, "utf8");
|
|
502
|
+
return fs$1.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.readdirSync(p);
|
|
528
|
+
return fs$1.readdirSync(p);
|
|
529
529
|
} catch {
|
|
530
530
|
return [];
|
|
531
531
|
}
|
|
532
532
|
};
|
|
533
|
-
const exists = (p) => fs.existsSync(p);
|
|
533
|
+
const exists = (p) => fs$1.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.readFileSync(p, "utf8");
|
|
561
|
+
return fs$1.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.readFileSync(filePath, "utf8");
|
|
847
|
+
text = fs$1.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.existsSync(candidate)) return candidate;
|
|
862
|
+
for (const candidate of candidates) if (fs$1.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-DV0V3JiE.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 { $i as recordEntriesCapability, Bo as BaseAddon, Xo as InvalidRecordError, vc as secretViewsOf, ys as UnknownRecordKindError } from "../../dist-BUoL5bbr.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-DV0V3JiE.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 { Bo as BaseAddon, kc as EventCategory } from "../../dist-BUoL5bbr.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-DV0V3JiE.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 { Bo as BaseAddon, Dc as DeviceType, En as batteryCapability, Oc as errMsg, Tc as DeviceFeature, Tn as bareAddonId, ac as nodePin, bi as memoizePinnedFfmpeg, g as BatteryStatusSchema, ja as snapshotCapability, kc as EventCategory, ur as deriveBatteryPresence, za as streamQualityLabel } from "../../dist-BUoL5bbr.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-DV0V3JiE.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 { Bo as BaseAddon, La as storageProviderCapability, Pr as filesystemBrowseCapability } from "../../dist-BUoL5bbr.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
|
-
import * as fs from "node:fs";
|
|
3
|
+
import * as fs$1 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.promises.stat(basePath).catch(() => null);
|
|
172
|
+
const stat = await fs$1.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.promises.access(basePath, fs.constants.W_OK);
|
|
178
|
+
await fs$1.promises.access(basePath, fs$1.constants.W_OK);
|
|
179
179
|
return { ok: true };
|
|
180
180
|
}
|
|
181
|
-
await fs.promises.mkdir(basePath, { recursive: true });
|
|
181
|
+
await fs$1.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.promises.mkdir(path$1.dirname(filePath), { recursive: true });
|
|
196
|
-
await fs.promises.writeFile(filePath, data);
|
|
195
|
+
await fs$1.promises.mkdir(path$1.dirname(filePath), { recursive: true });
|
|
196
|
+
await fs$1.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.promises.readFile(filePath);
|
|
200
|
+
const buf = await fs$1.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.promises.access(filePath);
|
|
208
|
+
await fs$1.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.promises.readdir(dir, { withFileTypes: true })).map((e) => prefix ? `${prefix}/${e.name}` : e.name);
|
|
218
|
+
return (await fs$1.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.promises.rm(filePath, { force: true });
|
|
225
|
+
await fs$1.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.existsSync(target)) {
|
|
231
|
+
while (!fs$1.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.promises.statfs(target);
|
|
236
|
+
const stats = await fs$1.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.promises.mkdir(path$1.dirname(target), { recursive: true });
|
|
246
|
-
await fs.promises.unlink(partial).catch(() => {});
|
|
247
|
-
const stream = fs.createWriteStream(partial);
|
|
245
|
+
await fs$1.promises.mkdir(path$1.dirname(target), { recursive: true });
|
|
246
|
+
await fs$1.promises.unlink(partial).catch(() => {});
|
|
247
|
+
const stream = fs$1.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.promises.rename(session.partial, session.target);
|
|
288
|
+
await fs$1.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.promises.unlink(session.partial).catch(() => {});
|
|
298
|
+
await fs$1.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.promises.stat(target);
|
|
305
|
-
const fd = await fs.promises.open(target, "r");
|
|
304
|
+
const stat = await fs$1.promises.stat(target);
|
|
305
|
+
const fd = await fs$1.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-DgN_WD5T.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-BWfH3Lov.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 {
|
|
@@ -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-DV0V3JiE.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-DgN_WD5T.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-D5s8oM7e.js");
|
|
12
12
|
let zod = require("zod");
|
|
13
13
|
let node_crypto = require("node:crypto");
|
|
14
14
|
let node_fs = require("node:fs");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bo as BaseAddon, Ci as migrationsCapability, Ct as MIGRATION_API_V1_METHODS, F as DATABASE_SNAPSHOT_TIMEOUT_MS, I as DATA_STORE_DATABASES, Ii as orderMigrations, Ko as DeclarationRefusedError, Ln as catalogueIssues, Ms as customAction, N as DATABASE_SNAPSHOT_PARTIAL_SUFFIX, Na as storageAdminCapability, Oc as errMsg$1, Ot as MigrationMetaSchema, P as DATABASE_SNAPSHOT_SUFFIX, Ps as defineCustomActions, Tn as bareAddonId, Xo as InvalidRecordError, Zo as NoCallerError, _s as TransactRefusedError, ar as databaseSnapshotCapability, ea as recordsCapability, ha as resolveRunnerId, ir as dataStoreProviderCapability, kc as EventCategory, ks as collectSecretMarkerRefs, os as RUNTIME_DEFAULTS, rs as RECORD_SWEEP_INTERVAL_MS, sc as normalizeSecretOwner, to as vectorStoreCapability, us as RecordKindDeclarationSchema, ys as UnknownRecordKindError } from "../../dist-BUoL5bbr.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-BWfH3Lov.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-DRC0xn6k.mjs";
|
|
7
7
|
import { createRequire } from "node:module";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { randomUUID } from "node:crypto";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* up an addon.
|
|
5
5
|
*
|
|
6
6
|
* They are the second and third locks of D296. The first is
|
|
7
|
-
*
|
|
7
|
+
* the create-time refusal, which stops the configuration from existing.
|
|
8
8
|
* These two hold for a row that predates the guard, for one written by a
|
|
9
9
|
* future code path, and for a provider that changes its own `nodeLocal`
|
|
10
10
|
* answer after a location was made.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type CustomActionsSpec } from "@camstack/types";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
/**
|
|
4
|
+
* The forced delete of a storage location (D49). `deleteInstance` keeps the occupancy refusal;
|
|
5
|
+
* this is the separate, explicit action for a location the check could not read (a removed disk,
|
|
6
|
+
* another node, a remote provider). The caller states it after a second confirmation.
|
|
7
|
+
*/
|
|
8
|
+
export declare const forceDeleteLocationInput: z.ZodType<{
|
|
9
|
+
id: string;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const storageOrchestratorActions: CustomActionsSpec;
|
|
@@ -5,3 +5,4 @@ export { StorageMigrationCoordinator } from "./storage-migration-coordinator.js"
|
|
|
5
5
|
export { StorageOrchestratorAddon, StorageOrchestratorAddon as default } from "./storage-orchestrator.addon.js";
|
|
6
6
|
export type { ListLocationsFilter, StorageProviderLookup } from "./storage-orchestrator.service.js";
|
|
7
7
|
export { StorageOrchestratorService } from "./storage-orchestrator.service.js";
|
|
8
|
+
export { storageOrchestratorActions, storageOrchestratorActions as customActions } from "./custom-actions.js";
|
|
@@ -8,4 +8,6 @@ exports.SqliteLocationStore = require_builtins_storage_orchestrator_storage_orch
|
|
|
8
8
|
exports.StorageMigrationCoordinator = require_builtins_storage_orchestrator_storage_orchestrator_addon.StorageMigrationCoordinator;
|
|
9
9
|
exports.StorageOrchestratorAddon = require_builtins_storage_orchestrator_storage_orchestrator_addon.StorageOrchestratorAddon;
|
|
10
10
|
exports.StorageOrchestratorService = require_builtins_storage_orchestrator_storage_orchestrator_addon.StorageOrchestratorService;
|
|
11
|
+
exports.customActions = require_builtins_storage_orchestrator_storage_orchestrator_addon.storageOrchestratorActions;
|
|
11
12
|
exports.default = require_builtins_storage_orchestrator_storage_orchestrator_addon.StorageOrchestratorAddon;
|
|
13
|
+
exports.storageOrchestratorActions = require_builtins_storage_orchestrator_storage_orchestrator_addon.storageOrchestratorActions;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { StorageOrchestratorAddon, c as SqliteLocationStore,
|
|
2
|
-
export { SqliteLocationStore, StorageMigrationCoordinator, StorageOrchestratorAddon, StorageOrchestratorAddon as default, StorageOrchestratorService };
|
|
1
|
+
import { StorageOrchestratorAddon, c as StorageMigrationCoordinator, l as SqliteLocationStore, n as storageOrchestratorActions, t as StorageOrchestratorService } from "./storage-orchestrator.addon.mjs";
|
|
2
|
+
export { SqliteLocationStore, StorageMigrationCoordinator, StorageOrchestratorAddon, StorageOrchestratorAddon as default, StorageOrchestratorService, storageOrchestratorActions as customActions, storageOrchestratorActions };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The storage locations as `integration-instances` (planning#440 step 6, D985, D986): one
|
|
3
|
+
* instance per location, one KIND per declared location type (`recordings`, `backups`, ...).
|
|
4
|
+
* The form is the provider select, the provider's own fields and the location's state; the
|
|
5
|
+
* credentials the provider declares go to the keychain bound to the location's record
|
|
6
|
+
* (`location-secret-refs.ts`, D879).
|
|
7
|
+
*
|
|
8
|
+
* A location keeps ONE typed state (`mode`, D385) and only `storage-location-mode.ts` reads it.
|
|
9
|
+
* The row switch maps to it: on is `active`; off is `readonly` (the write switch, D383), and a
|
|
10
|
+
* location that is already `drain` or `disabled` stays as it is. Delete keeps the occupancy
|
|
11
|
+
* refusal; the forced delete is NOT a flag here, it is the separate `forceDeleteLocation`
|
|
12
|
+
* action (D49: destructive, confirmed by a second read).
|
|
13
|
+
*
|
|
14
|
+
* The edit form is the provider's schema as it is. The create form offers every provider, so
|
|
15
|
+
* each provider's fields are namespaced `<providerId>.<key>` and shown for that provider; a
|
|
16
|
+
* `notEquals` / `notIn` condition on a select is rewritten to the options it leaves, because the
|
|
17
|
+
* selector of another provider is unset and an unset value would satisfy a negation.
|
|
18
|
+
*/
|
|
19
|
+
import { type ConfigSection, type IIntegrationInstancesProvider, type StorageLocation, type StorageLocationDeclaration } from "@camstack/types";
|
|
20
|
+
import type { StorageProviderListEntry } from "./provider-discovery.js";
|
|
21
|
+
export declare const STORAGE_INSTANCE_KIND = "storage-location";
|
|
22
|
+
export declare const STORAGE_FUNCTION_CAP = "storage";
|
|
23
|
+
/** The generic widget id the admin UI maps to its path browser. */
|
|
24
|
+
export declare const STORAGE_PATH_WIDGET = "storage/path-browser";
|
|
25
|
+
/** A probe of a remote provider waits this long; a hung host must not hang the form. */
|
|
26
|
+
export declare const LOCATION_TEST_TIMEOUT_MS = 2e4;
|
|
27
|
+
export type LocationSaveInput = Omit<StorageLocation, "createdAt" | "updatedAt">;
|
|
28
|
+
export interface LocationInstancesDeps {
|
|
29
|
+
readonly locations: () => readonly StorageLocation[];
|
|
30
|
+
readonly declarations: () => readonly StorageLocationDeclaration[];
|
|
31
|
+
readonly providers: () => Promise<readonly StorageProviderListEntry[]>;
|
|
32
|
+
/** The one save every door goes through; `clearSecrets` names the credentials to remove. */
|
|
33
|
+
readonly save: (input: LocationSaveInput, clearSecrets: readonly string[]) => Promise<StorageLocation>;
|
|
34
|
+
/** Delete with the occupancy refusal; `force` is never passed from this provider. */
|
|
35
|
+
readonly remove: (id: string) => Promise<void>;
|
|
36
|
+
/** Probe a config (markers allowed) against a provider; the addon resolves the markers. */
|
|
37
|
+
readonly probe: (providerId: string, config: Readonly<Record<string, unknown>>) => Promise<{
|
|
38
|
+
readonly ok: boolean;
|
|
39
|
+
readonly error?: string;
|
|
40
|
+
}>;
|
|
41
|
+
/** The config keys that are credentials; fails closed for an unregistered provider. */
|
|
42
|
+
readonly secretKeys: (providerId: string, config: Readonly<Record<string, unknown>>) => ReadonlySet<string>;
|
|
43
|
+
readonly testTimeoutMs?: number;
|
|
44
|
+
}
|
|
45
|
+
/** The sections a provider's `configSchema` carries; anything else is no form. */
|
|
46
|
+
export declare function providerSections(schema: unknown): readonly ConfigSection[];
|
|
47
|
+
export declare class StorageLocationInstances {
|
|
48
|
+
private readonly deps;
|
|
49
|
+
constructor(deps: LocationInstancesDeps);
|
|
50
|
+
private kinds;
|
|
51
|
+
private viewOf;
|
|
52
|
+
describe: IIntegrationInstancesProvider["describe"];
|
|
53
|
+
instanceFormSchema: IIntegrationInstancesProvider["instanceFormSchema"];
|
|
54
|
+
listInstances: IIntegrationInstancesProvider["listInstances"];
|
|
55
|
+
getInstance: IIntegrationInstancesProvider["getInstance"];
|
|
56
|
+
/**
|
|
57
|
+
* The config and credentials a form `values` object means for a provider: its own namespaced
|
|
58
|
+
* keys (create form) or plain keys (edit form), the framework numbers, nothing of another
|
|
59
|
+
* provider. `base` is the stored config; a credential kept stays as stored.
|
|
60
|
+
*/
|
|
61
|
+
private configFrom;
|
|
62
|
+
private mintId;
|
|
63
|
+
createInstance: IIntegrationInstancesProvider["createInstance"];
|
|
64
|
+
/** The whole location again, from the stored row, with `patch` on top (the save REPLACES). */
|
|
65
|
+
private rebuilt;
|
|
66
|
+
updateInstance: IIntegrationInstancesProvider["updateInstance"];
|
|
67
|
+
setInstanceEnabled: IIntegrationInstancesProvider["setInstanceEnabled"];
|
|
68
|
+
/** The occupancy refusal stays; the forced delete is the separate action. */
|
|
69
|
+
deleteInstance: IIntegrationInstancesProvider["deleteInstance"];
|
|
70
|
+
testInstance: NonNullable<IIntegrationInstancesProvider["testInstance"]>;
|
|
71
|
+
toProvider(): IIntegrationInstancesProvider;
|
|
72
|
+
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* A `multi` location moves the sanctioned way: register a second instance,
|
|
7
7
|
* drain the first, watch it empty (D386). A **singleton** cannot — the
|
|
8
|
-
* cardinality guard
|
|
8
|
+
* cardinality guard on location create refuses the second instance by
|
|
9
9
|
* declaration, so there is no destination to drain into. For those, editing
|
|
10
10
|
* the `basePath` IS the migration, and either it carries the data or the data
|
|
11
11
|
* is stranded.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a storage location's credentials live (planning#440 step 6, D879, D987).
|
|
3
|
+
*
|
|
4
|
+
* A credential is a keychain value bound to the location's OWN record: the body's `secrets` map
|
|
5
|
+
* (`secrets{password}`) is what the records door stores, so deleting the row deletes the value and
|
|
6
|
+
* one location's credential is never another's. Before this, the credential was filed under
|
|
7
|
+
* `row/storage_locations/<id>` and the row's `config` held the marker; those refs are the LEGACY
|
|
8
|
+
* ones the migration `storage-orchestrator/2026-11-07-location-secrets-to-record` moves.
|
|
9
|
+
*
|
|
10
|
+
* The in-memory location still carries a marker per credential in `config` (the orchestrator
|
|
11
|
+
* resolves it through `ctx.secrets` when a provider needs the value); the marker built here is the
|
|
12
|
+
* one the records door itself wrote, so both ends agree without a read.
|
|
13
|
+
*/
|
|
14
|
+
import { type SecretMarker } from "@camstack/types";
|
|
15
|
+
/** The addon id the records door and the keychain both file this owner's values under. */
|
|
16
|
+
export declare const STORAGE_RECORD_OWNER = "storage-orchestrator";
|
|
17
|
+
/** The record kind the locations live in (`record-kinds.ts`). */
|
|
18
|
+
export declare const LOCATIONS_RECORD_KIND = "locations";
|
|
19
|
+
/** The body field that holds the credentials, by config key. */
|
|
20
|
+
export declare const LOCATION_SECRETS_FIELD = "secrets";
|
|
21
|
+
/** The ref the records door files the credential `key` of location `id` under. */
|
|
22
|
+
export declare function locationSecretRef(id: string, key: string): string;
|
|
23
|
+
/** The marker the location carries in memory for a credential kept in its record. */
|
|
24
|
+
export declare function locationSecretMarker(id: string, key: string): SecretMarker;
|
|
25
|
+
/** Is `value` the marker of the credential `key` of location `id` kept in its own record? */
|
|
26
|
+
export declare function isOwnLocationMarker(id: string, key: string, value: unknown): boolean;
|
|
@@ -53,13 +53,33 @@ export interface ILocationStore {
|
|
|
53
53
|
*/
|
|
54
54
|
export declare const STORAGE_LOCATIONS_SECRET_SCOPE = "storage_locations";
|
|
55
55
|
/**
|
|
56
|
+
* Credentials a save carries, by config key, until the store writes the row: a value sets the
|
|
57
|
+
* credential, `null` removes it. The service persists without waiting (`upsert` is fire and
|
|
58
|
+
* forget), so the plaintext cannot ride on the location itself; it is staged here, one shot per
|
|
59
|
+
* location id, and `SqliteLocationStore.upsert` hands it to the records door with the row.
|
|
60
|
+
*/
|
|
61
|
+
export declare class LocationSecretStaging {
|
|
62
|
+
private readonly staged;
|
|
63
|
+
private readonly waiting;
|
|
64
|
+
private readonly settledBy;
|
|
65
|
+
stage(id: string, secrets: Readonly<Record<string, string | null>>): void;
|
|
66
|
+
/** The staged credentials of `id`, once; a save that was refused discards them instead. */
|
|
67
|
+
take(id: string): Readonly<Record<string, string | null>>;
|
|
68
|
+
/** The row of `id` is written (or the write failed): whoever waits for the credential may go on. */
|
|
69
|
+
written(id: string): void;
|
|
70
|
+
discard(id: string): void;
|
|
71
|
+
/** Resolves when the staged credentials of `id` are written; at once when none are staged. */
|
|
72
|
+
settled(id: string): Promise<void>;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
56
75
|
* `ILocationStore` on the storage-orchestrator's own record kinds (`locations`
|
|
57
76
|
* and `seed-markers`).
|
|
58
77
|
*/
|
|
59
78
|
export declare class SqliteLocationStore implements ILocationStore {
|
|
60
79
|
private readonly locationsKind;
|
|
61
80
|
private readonly seedMarkersKind;
|
|
62
|
-
|
|
81
|
+
readonly staging: LocationSecretStaging;
|
|
82
|
+
constructor(locationsKind: RecordKindHandle<StorageLocationBody>, seedMarkersKind: RecordKindHandle<StorageSeedMarkerBody>, staging?: LocationSecretStaging);
|
|
63
83
|
static seedMarkersOf(records: Pick<RecordsAccess, "kind">): RecordKindHandle<StorageSeedMarkerBody>;
|
|
64
84
|
loadSeededTypes(): Promise<readonly string[]>;
|
|
65
85
|
markTypeSeeded(type: string): Promise<void>;
|
|
@@ -69,5 +89,11 @@ export declare class SqliteLocationStore implements ILocationStore {
|
|
|
69
89
|
upsert(loc: StorageLocation): Promise<void>;
|
|
70
90
|
delete(id: string): Promise<void>;
|
|
71
91
|
}
|
|
72
|
-
|
|
92
|
+
/**
|
|
93
|
+
* The body a location is stored as. A credential the location keeps in its own record (the marker
|
|
94
|
+
* of `location-secret-refs.ts`) leaves `config` for `secrets`, where the records door keeps the
|
|
95
|
+
* value and the redaction token means "keep what is stored"; `staged` sets or removes one. Any
|
|
96
|
+
* other marker (a legacy ref the migration has not moved yet) stays in `config` untouched.
|
|
97
|
+
*/
|
|
98
|
+
export declare function locationToBody(loc: StorageLocation, staged?: Readonly<Record<string, string | null>>): StorageLocationBody;
|
|
73
99
|
export declare function bodyToPersistedLocation(id: string, body: StorageLocationBody): PersistedStorageLocation | null;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import type { AddonMigration } from "@camstack/types";
|
|
2
|
+
import { type LocationSecretPorts } from "./location-secrets-to-record.js";
|
|
3
|
+
export type { LegacyLocationRow, LegacySecretRead, LocationSecretPorts, MovedLocationRow } from "./location-secrets-to-record.js";
|
|
2
4
|
export declare const STORAGE_ORCHESTRATOR_ID = "storage-orchestrator";
|
|
3
5
|
export declare const RESEED_PRUNED_DEFAULTS_ID = "storage-orchestrator/2026-11-04-reseed-pruned-defaults";
|
|
6
|
+
export declare const LOCATION_SECRETS_TO_RECORD_ID = "storage-orchestrator/2026-11-07-location-secrets-to-record";
|
|
4
7
|
/** What the repair may do: ask the service to re-create the defaults a prune removed. */
|
|
5
8
|
export interface ReseedPorts {
|
|
6
9
|
/** Re-seed every declared type whose seed marker survived the loss of all its rows; returns the types restored. */
|
|
7
10
|
reseed(): readonly string[];
|
|
8
11
|
}
|
|
9
|
-
/**
|
|
10
|
-
export
|
|
12
|
+
/** Every body of the catalogue reads through ONE port object, so the addon binds it once. */
|
|
13
|
+
export type StorageCataloguePorts = ReseedPorts & LocationSecretPorts;
|
|
14
|
+
export declare const RESEED_PRUNED_DEFAULTS_MIGRATION: AddonMigration<ReseedPorts>;
|
|
15
|
+
export declare const LOCATION_SECRETS_TO_RECORD_MIGRATION: AddonMigration<LocationSecretPorts>;
|
|
16
|
+
/** The `storage-orchestrator` catalogue (D987), declared whole every time and run by id. */
|
|
17
|
+
export declare const ADDON_MIGRATIONS: readonly AddonMigration<StorageCataloguePorts>[];
|