@camstack/server 1.2.815 → 1.2.817
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 +2 -43
- package/dist/api/trpc/generated-cap-routers.js +14 -17
- package/dist/core/addon/addon-registry.service.js +3 -3
- package/dist/core/addon/instance-lifecycle.js +79 -4
- package/package.json +18 -9
- package/system/dist/{agent-https-eMihTWJ4.mjs → agent-https-8yyIi2Mv.mjs} +1 -1
- package/system/dist/{agent-https-Dwbpz4K6.js → agent-https-CSHd24Sz.js} +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/alerts/alerts.addon.js +1 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/system/dist/builtins/autotrack/index.js +1 -1
- package/system/dist/builtins/autotrack/index.mjs +1 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- package/system/dist/builtins/calendars/calendars.addon.js +1 -1
- package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/system/dist/builtins/camera-grid/index.js +8 -4
- package/system/dist/builtins/camera-grid/index.mjs +8 -4
- 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.d.ts +1 -0
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +16 -8
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +16 -8
- 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 +64 -5
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +64 -5
- package/system/dist/builtins/device-manager/last-active-mode.d.ts +1 -0
- package/system/dist/builtins/device-manager/runtime-state-persist-gate.d.ts +9 -0
- package/system/dist/builtins/hub-forwarder/index.js +1 -1
- package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/system/dist/builtins/keychain/index.js +4 -4
- package/system/dist/builtins/keychain/index.mjs +4 -4
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
- package/system/dist/builtins/local-network/local-network.addon.js +2 -2
- package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/system/dist/builtins/loki-logging/index.js +3 -3
- package/system/dist/builtins/loki-logging/index.mjs +3 -3
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +1 -1
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +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 +1 -1
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
- package/system/dist/builtins/storage-orchestrator/location-store.d.ts +5 -14
- package/system/dist/builtins/storage-orchestrator/record-kinds.d.ts +0 -1
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +35 -75
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +35 -75
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.service.d.ts +9 -32
- package/system/dist/builtins/system-config/system-config.addon.js +3 -3
- package/system/dist/builtins/system-config/system-config.addon.mjs +3 -3
- 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-uxR5sOQN.js → capture-engine-Cius-WCQ.js} +1 -1
- package/system/dist/{capture-engine-CYPDOIF6.mjs → capture-engine-D2eAoc9W.mjs} +1 -1
- package/system/dist/{composition-sources-DkvntZci.js → composition-sources-AJ8V5KOI.js} +1 -1
- package/system/dist/{composition-sources-CU3p3INI.mjs → composition-sources-CdcDO-Ut.mjs} +1 -1
- package/system/dist/{constants-BP-Txn_J.js → constants-BVIwtt_O.js} +1 -1
- package/system/dist/{constants-DMFJ6Fky.mjs → constants-GPP-Z7D3.mjs} +1 -1
- package/system/dist/{device-ca-D-0zxmFi.js → device-ca-BFJn5TzU.js} +1 -1
- package/system/dist/{device-ca-tmcd_VBC.mjs → device-ca-WLUZEMzG.mjs} +1 -1
- package/system/dist/{dist-DmCVWvtK.mjs → dist-QnMV8AH-.mjs} +2455 -207
- package/system/dist/{dist-CznnwtQ8.js → dist-X-i__4Xc.js} +2454 -212
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-FTf16-JR.js → hub-mdns-ciao-DxC8z6eX.js} +2 -2
- package/system/dist/{hub-mdns-ciao-DbwyiHD5.mjs → hub-mdns-ciao-awDw9o6E.mjs} +2 -2
- package/system/dist/index.js +8 -8
- package/system/dist/index.mjs +8 -8
- package/system/dist/{legacy-integration-rows-door-CASQgifG.mjs → legacy-integration-rows-door-COW5hMUZ.mjs} +1 -1
- package/system/dist/{legacy-integration-rows-door-gW0xpMJI.js → legacy-integration-rows-door-Cbb1WKDb.js} +1 -1
- package/system/dist/migrations/hub/2026-11-08-storage-locations-write-set.d.ts +3 -0
- package/system/dist/{restore-archive-DlaC_gyl.mjs → restore-archive-Dp13UUld.mjs} +1 -1
- package/system/dist/{restore-archive-B9TEFWRE.js → restore-archive-q01U_u2A.js} +1 -1
- package/system/dist/{wal-maintenance-Da2Rozz6.js → wal-maintenance-F8p6X7gc.js} +0 -0
- package/system/dist/{wal-maintenance-Cn164tp0.mjs → wal-maintenance-PzTcTuqZ.mjs} +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-X-i__4Xc.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
|
|
@@ -1222,10 +1222,10 @@ var LokiLoggingAddon = class extends require_dist.BaseAddon {
|
|
|
1222
1222
|
ensureIntegration: async (name) => {
|
|
1223
1223
|
const existing = await this.ctx.api.integrations.getByAddonId.query({ addonId: this.ctx.id });
|
|
1224
1224
|
if (existing !== null && existing !== void 0) return existing.id;
|
|
1225
|
-
return (await this.ctx.api.
|
|
1225
|
+
return (await this.ctx.api.integrationInstances.createInstance.mutate({
|
|
1226
1226
|
addonId: this.ctx.id,
|
|
1227
1227
|
name,
|
|
1228
|
-
|
|
1228
|
+
seed: { info: {} }
|
|
1229
1229
|
})).id;
|
|
1230
1230
|
},
|
|
1231
1231
|
putRecord: async (id, body) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ds as RevConflictError, Qo as BaseAddon, Qs as defineEntryKind, Sn as bareAddonId, Ss as RecordIntegrationInstances, Ur as integrationInstancesCapability, Xs as defineAddonMigrations, Yi as preconditionOf, _c as isSecretFieldView, hi as logDestinationCapability, ni as isSameAddonId, pc as isInstanceEnabled, vc as isSecretMarker } from "../../dist-QnMV8AH-.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
|
|
@@ -1215,10 +1215,10 @@ var LokiLoggingAddon = class extends BaseAddon {
|
|
|
1215
1215
|
ensureIntegration: async (name) => {
|
|
1216
1216
|
const existing = await this.ctx.api.integrations.getByAddonId.query({ addonId: this.ctx.id });
|
|
1217
1217
|
if (existing !== null && existing !== void 0) return existing.id;
|
|
1218
|
-
return (await this.ctx.api.
|
|
1218
|
+
return (await this.ctx.api.integrationInstances.createInstance.mutate({
|
|
1219
1219
|
addonId: this.ctx.id,
|
|
1220
1220
|
name,
|
|
1221
|
-
|
|
1221
|
+
seed: { info: {} }
|
|
1222
1222
|
})).id;
|
|
1223
1223
|
},
|
|
1224
1224
|
putRecord: async (id, body) => {
|
|
@@ -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-X-i__4Xc.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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fr as foldSnapshotByFunction, Jc as errMsg, Js as createEvent, Qo as BaseAddon, Vt as ROOT_BUCKET_KEY, Xc as EventCategory, aa as reducePoints, fa as resolveBucketMs, on as UNATTRIBUTED_BUCKET_KEY, wi as metricsProviderCapability } from "../../dist-QnMV8AH-.mjs";
|
|
2
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";
|
|
@@ -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-X-i__4Xc.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,5 +1,5 @@
|
|
|
1
1
|
import { o as __toESM, r as __exportAll } from "../../chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { Aa as scoreRuntimes, Jc as errMsg, Ki as platformProbeCapability, Qo as BaseAddon, Xc as EventCategory, br as enumerateInferenceDevices, tc as emitReadiness, zi as parseAcceleratorFactsJson } from "../../dist-QnMV8AH-.mjs";
|
|
3
3
|
import { n as detectCoralAccelerator, r as nodeCoralFs } from "../../coral-accelerators-DBlgWB8k.mjs";
|
|
4
4
|
import * as fs$1 from "node:fs";
|
|
5
5
|
import * as path$1 from "node:path";
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-X-i__4Xc.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 { Lc as secretViewsOf, Ms as UnknownRecordKindError, Qo as BaseAddon, ls as InvalidRecordError, ra as recordEntriesCapability } from "../../dist-QnMV8AH-.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-X-i__4Xc.js");
|
|
7
7
|
let zod = require("zod");
|
|
8
8
|
//#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
|
|
9
9
|
/**
|
package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Qo as BaseAddon, Xc as EventCategory } from "../../dist-QnMV8AH-.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
|
|
4
4
|
/**
|
|
@@ -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-X-i__4Xc.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 { Cn as batteryCapability, Gc as DeviceFeature, Ja as streamQualityLabel, Jc as errMsg, Qo as BaseAddon, Si as memoizePinnedFfmpeg, Sn as bareAddonId, Xc as EventCategory, cr as deriveBatteryPresence, g as BatteryStatusSchema, qc as DeviceType, wc as nodePin, za as snapshotCapability } from "../../dist-QnMV8AH-.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-X-i__4Xc.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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ka as storageProviderCapability, Nr as filesystemBrowseCapability, Qo as BaseAddon } from "../../dist-QnMV8AH-.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import * as fs$1 from "node:fs";
|
|
4
4
|
import * as path$1 from "node:path";
|
|
@@ -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-F8p6X7gc.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-PzTcTuqZ.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-X-i__4Xc.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-F8p6X7gc.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-Cbb1WKDb.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 { As as TransactRefusedError, Cs as RecordKindDeclarationSchema, Dt as MigrationMetaSchema, Ec as normalizeSecretOwner, F as DATABASE_SNAPSHOT_TIMEOUT_MS, Fn as catalogueIssues, Ha as storageAdminCapability, I as DATA_STORE_DATABASES, Jc as errMsg$1, Ms as UnknownRecordKindError, N as DATABASE_SNAPSHOT_PARTIAL_SUFFIX, P as DATABASE_SNAPSHOT_SUFFIX, Qo as BaseAddon, Ri as orderMigrations, Sa as resolveRunnerId, Sn as bareAddonId, St as MIGRATION_API_V1_METHODS, Ti as migrationsCapability, Ws as collectSecretMarkerRefs, Xc as EventCategory, Ys as customAction, Zs as defineCustomActions, gs as RECORD_SWEEP_INTERVAL_MS, ia as recordsCapability, is as DeclarationRefusedError, ls as InvalidRecordError, nr as dataStoreProviderCapability, po as vectorStoreCapability, rr as databaseSnapshotCapability, us as NoCallerError, ys as RUNTIME_DEFAULTS } from "../../dist-QnMV8AH-.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-PzTcTuqZ.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-COW5hMUZ.mjs";
|
|
7
7
|
import { createRequire } from "node:module";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { randomUUID } from "node:crypto";
|
|
@@ -7,26 +7,17 @@
|
|
|
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 { RecordKindHandle, RecordsAccess, StorageLocation } from "@camstack/types";
|
|
11
11
|
import { type StorageLocationBody, type StorageSeedMarkerBody } from "./record-kinds.js";
|
|
12
12
|
/**
|
|
13
|
-
* A location as it comes back OFF DISK: the live record plus the retired
|
|
14
|
-
* `isDefault` column, which exists only so the orchestrator's boot migration
|
|
15
|
-
* can turn an old default into the enabled write set and say which row it came
|
|
16
|
-
* from. No other reader may take this type.
|
|
17
|
-
*/
|
|
18
|
-
export type PersistedStorageLocation = StorageLocation & LegacyStorageLocationDefault;
|
|
19
|
-
/**
|
|
20
13
|
* Abstract storage interface for `StorageLocation` records. Methods are
|
|
21
14
|
* async because production-side implementations hit SQLite — but the
|
|
22
15
|
* orchestrator's mutation paths fire-and-forget the writes so a slow
|
|
23
16
|
* disk doesn't block the cap surface.
|
|
24
17
|
*/
|
|
25
18
|
export interface ILocationStore {
|
|
26
|
-
/** Read every persisted location. Called once at boot.
|
|
27
|
-
|
|
28
|
-
* see it: the orchestrator's boot migration onto the `enabled` write set. */
|
|
29
|
-
loadAll(): Promise<readonly PersistedStorageLocation[]>;
|
|
19
|
+
/** Read every persisted location. Called once at boot. */
|
|
20
|
+
loadAll(): Promise<readonly StorageLocation[]>;
|
|
30
21
|
/** Insert or replace a single location by id. */
|
|
31
22
|
upsert(loc: StorageLocation): Promise<void>;
|
|
32
23
|
/** Remove a location by id. */
|
|
@@ -79,7 +70,7 @@ export declare class SqliteLocationStore implements ILocationStore {
|
|
|
79
70
|
markTypeSeeded(type: string): Promise<void>;
|
|
80
71
|
unmarkTypeSeeded(type: string): Promise<void>;
|
|
81
72
|
static recordStoresOf(records: Pick<RecordsAccess, "kind">): RecordKindHandle<StorageLocationBody>;
|
|
82
|
-
loadAll(): Promise<readonly
|
|
73
|
+
loadAll(): Promise<readonly StorageLocation[]>;
|
|
83
74
|
upsert(loc: StorageLocation): Promise<void>;
|
|
84
75
|
delete(id: string): Promise<void>;
|
|
85
76
|
}
|
|
@@ -90,4 +81,4 @@ export declare class SqliteLocationStore implements ILocationStore {
|
|
|
90
81
|
* other marker (a legacy ref the migration has not moved yet) stays in `config` untouched.
|
|
91
82
|
*/
|
|
92
83
|
export declare function locationToBody(loc: StorageLocation, staged?: Readonly<Record<string, string | null>>): StorageLocationBody;
|
|
93
|
-
export declare function bodyToPersistedLocation(id: string, body: StorageLocationBody):
|
|
84
|
+
export declare function bodyToPersistedLocation(id: string, body: StorageLocationBody): StorageLocation | null;
|
|
@@ -14,7 +14,6 @@ export type StorageLocationBody = {
|
|
|
14
14
|
readonly nodeId?: string;
|
|
15
15
|
readonly enabled?: boolean;
|
|
16
16
|
readonly mode?: z.infer<typeof StorageLocationModeSchema>;
|
|
17
|
-
readonly isDefault?: boolean;
|
|
18
17
|
/**
|
|
19
18
|
* The provider's credentials by config key (`password`, `privateKey`, ...), kept in the keychain
|
|
20
19
|
* and bound to THIS row: the records door stores the value and deleting the row deletes it.
|
|
@@ -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-X-i__4Xc.js");
|
|
7
7
|
const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
|
|
8
8
|
let zod = require("zod");
|
|
9
9
|
let node_crypto = require("node:crypto");
|
|
@@ -58,7 +58,6 @@ var StorageLocationBodySchema = zod.z.object({
|
|
|
58
58
|
nodeId: zod.z.string().optional(),
|
|
59
59
|
enabled: zod.z.boolean().optional(),
|
|
60
60
|
mode: require_dist.StorageLocationModeSchema.optional(),
|
|
61
|
-
isDefault: zod.z.boolean().optional(),
|
|
62
61
|
secrets: zod.z.record(zod.z.string(), zod.z.string().meta({ secret: true })).optional()
|
|
63
62
|
});
|
|
64
63
|
var StorageSeedMarkerBodySchema = zod.z.object({ seededAt: zod.z.number() });
|
|
@@ -248,7 +247,6 @@ function bodyToPersistedLocation(id, body) {
|
|
|
248
247
|
...body.nodeId !== void 0 ? { nodeId: body.nodeId } : {},
|
|
249
248
|
...body.enabled !== void 0 ? { enabled: body.enabled } : {},
|
|
250
249
|
...body.mode !== void 0 ? { mode: body.mode } : {},
|
|
251
|
-
...require_dist.LegacyStorageLocationDefaultSchema.parse({ isDefault: body.isDefault ?? false }),
|
|
252
250
|
isSystem: body.isSystem,
|
|
253
251
|
createdAt: body.createdAt,
|
|
254
252
|
updatedAt: body.updatedAt
|
|
@@ -3255,77 +3253,7 @@ var StorageOrchestratorService = class {
|
|
|
3255
3253
|
backfilled: backfill.length,
|
|
3256
3254
|
total: this.locations.size
|
|
3257
3255
|
} });
|
|
3258
|
-
this.
|
|
3259
|
-
}
|
|
3260
|
-
/**
|
|
3261
|
-
* ONE explicit migration onto the four-state model (D385), run once per boot
|
|
3262
|
-
* against the rows that came off disk. Idempotent: the second boot finds
|
|
3263
|
-
* nothing to do.
|
|
3264
|
-
*
|
|
3265
|
-
* Two steps, in order, and each one is a WRITE — the point is that "absent"
|
|
3266
|
-
* stops existing rather than being re-interpreted on every read forever:
|
|
3267
|
-
*
|
|
3268
|
-
* 1. A row with no `mode` is stamped with the mode its legacy flags imply
|
|
3269
|
-
* (`legacyModeOf`): `config.readOnly === true` → `readonly` and the
|
|
3270
|
-
* config key is DELETED; `enabled === false` → `readonly` (the
|
|
3271
|
-
* CONSERVATIVE direction — a state change must never start deleting
|
|
3272
|
-
* footage on its own); everything else → `active`. `withLocationMode`
|
|
3273
|
-
* derives `enabled` from the mode, so the two can never disagree, and
|
|
3274
|
-
* this subsumes the D383 pass that stamped flagless rows `enabled: true`.
|
|
3275
|
-
* 2. A type left with NO write target — only reachable from a hand-edited
|
|
3276
|
-
* store or a row an older build wrote — gets one made `active`, chosen as
|
|
3277
|
-
* the row the RETIRED default flag named, else the `:default`-slugged
|
|
3278
|
-
* row, else the lexicographically first. Loudly: a class with no write
|
|
3279
|
-
* target records nowhere, and refusing to repair it here would leave the
|
|
3280
|
-
* hub silently unable to write with no operator action pending.
|
|
3281
|
-
*
|
|
3282
|
-
* An operator's explicit `readonly`/`drain`/`disabled` is never reversed by
|
|
3283
|
-
* step 1 — only step 2 touches it, and only when the alternative is a class
|
|
3284
|
-
* that cannot write at all.
|
|
3285
|
-
*
|
|
3286
|
-
* On the live hub every location is enabled with no `readOnly`, so step 1 is
|
|
3287
|
-
* a no-op that stamps `active` and nothing else changes.
|
|
3288
|
-
*/
|
|
3289
|
-
migrateOntoTheWriteSet(rows) {
|
|
3290
|
-
const legacyDefaultOfType = /* @__PURE__ */ new Map();
|
|
3291
|
-
for (const row of rows) if (row.isDefault === true) legacyDefaultOfType.set(row.type, row.id);
|
|
3292
|
-
const stamped = [];
|
|
3293
|
-
for (const loc of this.locations.values()) {
|
|
3294
|
-
if (loc.mode !== void 0) continue;
|
|
3295
|
-
this.persistMigrated(require_dist.withLocationMode(loc, require_dist.legacyModeOf(loc) ?? "active"));
|
|
3296
|
-
stamped.push(loc.id);
|
|
3297
|
-
}
|
|
3298
|
-
const repaired = [];
|
|
3299
|
-
for (const type of new Set([...this.locations.values()].map((l) => l.type))) {
|
|
3300
|
-
const ofType = [...this.locations.values()].filter((l) => l.type === type);
|
|
3301
|
-
if (ofType.some((l) => require_dist.isLocationEnabled(l))) continue;
|
|
3302
|
-
const legacyDefault = legacyDefaultOfType.get(type);
|
|
3303
|
-
const pick = ofType.find((l) => l.id === legacyDefault) ?? ofType.find((l) => l.id === `${type}:default`) ?? ofType.toSorted((a, b) => a.id.localeCompare(b.id))[0];
|
|
3304
|
-
if (!pick) continue;
|
|
3305
|
-
this.persistMigrated(require_dist.withLocationMode(pick, "active"));
|
|
3306
|
-
repaired.push(pick.id);
|
|
3307
|
-
}
|
|
3308
|
-
if (stamped.length > 0 || repaired.length > 0) this.logger.info("storage-orchestrator: migrated locations onto the state model", { meta: {
|
|
3309
|
-
stamped,
|
|
3310
|
-
repaired
|
|
3311
|
-
} });
|
|
3312
|
-
for (const id of repaired) this.logger.warn("storage-orchestrator: a storage type had NO enabled location — re-enabled one so it can write. Every other location of that type stays read-only until you enable it.", { meta: { id } });
|
|
3313
|
-
}
|
|
3314
|
-
/** Apply one migrated row in memory and mirror it to the store. */
|
|
3315
|
-
persistMigrated(next) {
|
|
3316
|
-
const withStamp = {
|
|
3317
|
-
...next,
|
|
3318
|
-
updatedAt: Date.now()
|
|
3319
|
-
};
|
|
3320
|
-
this.locations.set(withStamp.id, withStamp);
|
|
3321
|
-
const store = this.locationStore;
|
|
3322
|
-
if (!store) return;
|
|
3323
|
-
store.upsert(withStamp).catch((err) => {
|
|
3324
|
-
this.logger.error("storage-orchestrator: state-model migration persist failed", { meta: {
|
|
3325
|
-
id: withStamp.id,
|
|
3326
|
-
error: err instanceof Error ? err.message : String(err)
|
|
3327
|
-
} });
|
|
3328
|
-
});
|
|
3256
|
+
this.repairWriteSets();
|
|
3329
3257
|
}
|
|
3330
3258
|
/**
|
|
3331
3259
|
* Inject the declaration-driven cardinality source. Called once by the
|
|
@@ -3381,7 +3309,39 @@ var StorageOrchestratorService = class {
|
|
|
3381
3309
|
await this.loadSeedMemory(this.locationStore, rows.length);
|
|
3382
3310
|
for (const loc of rows) this.locations.set(loc.id, loc);
|
|
3383
3311
|
this.logger.info("storage-orchestrator: hydrated locations from store", { meta: { loaded: this.locations.size } });
|
|
3384
|
-
this.
|
|
3312
|
+
this.repairWriteSets();
|
|
3313
|
+
}
|
|
3314
|
+
/**
|
|
3315
|
+
* A type with NO enabled location records nowhere, so this is a runtime invariant, not a
|
|
3316
|
+
* one-time migration: a hand-edited store, a restore or an older build can break it at any
|
|
3317
|
+
* boot. Idempotent: a type that can write is left alone. One location is made `active` (the
|
|
3318
|
+
* `<type>:default` row, else the lexicographically first id), persisted, and said loudly.
|
|
3319
|
+
* The mode is read and written only through `storage-location-mode` (D385); an operator's
|
|
3320
|
+
* `readonly`/`drain`/`disabled` is touched only when the alternative is a type that cannot write.
|
|
3321
|
+
*/
|
|
3322
|
+
repairWriteSets() {
|
|
3323
|
+
const repaired = [];
|
|
3324
|
+
for (const type of new Set([...this.locations.values()].map((l) => l.type))) {
|
|
3325
|
+
const ofType = [...this.locations.values()].filter((l) => l.type === type);
|
|
3326
|
+
if (ofType.some((l) => require_dist.isLocationEnabled(l))) continue;
|
|
3327
|
+
const pick = ofType.find((l) => l.id === `${type}:default`) ?? ofType.toSorted((a, b) => a.id.localeCompare(b.id))[0];
|
|
3328
|
+
if (!pick) continue;
|
|
3329
|
+
const next = {
|
|
3330
|
+
...require_dist.withLocationMode(pick, "active"),
|
|
3331
|
+
updatedAt: Date.now()
|
|
3332
|
+
};
|
|
3333
|
+
this.locations.set(next.id, next);
|
|
3334
|
+
repaired.push(next.id);
|
|
3335
|
+
const store = this.locationStore;
|
|
3336
|
+
if (!store) continue;
|
|
3337
|
+
store.upsert(next).catch((err) => {
|
|
3338
|
+
this.logger.error("storage-orchestrator: write-set repair persist failed", { meta: {
|
|
3339
|
+
id: next.id,
|
|
3340
|
+
error: err instanceof Error ? err.message : String(err)
|
|
3341
|
+
} });
|
|
3342
|
+
});
|
|
3343
|
+
}
|
|
3344
|
+
for (const id of repaired) this.logger.warn("storage-orchestrator: a storage type had NO enabled location — re-enabled one so it can write. Every other location of that type stays read-only until you enable it.", { meta: { id } });
|
|
3385
3345
|
}
|
|
3386
3346
|
/**
|
|
3387
3347
|
* Boot backfill (SP1): stamp `nodeId` on every persisted node-local
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $
|
|
1
|
+
import { $s as defineRecordKinds, $t as StorageCleanupJobSchema, Bc as toSecretFieldView, Di as modeMayWrite, Ei as modeForSwitch, Hs as collectSecretConfigKeys, Kt as STORAGE_LOCATION_MODES, Ma as settingsStoreCapability, Nc as resolveSecretMarkers, Qo as BaseAddon, Rr as gbToBytes, Tc as normalizeNodeId, Tr as evictionPolicyOfLocation, Ua as storageCapability, Ur as integrationInstancesCapability, Vs as buildSecretRef, Wa as storageMigrationCapability, Xc as EventCategory, Xs as defineAddonMigrations, Ys as customAction, Za as switchStateOfMode, Zs as defineCustomActions, _a as resolveLocationMode, _c as isSecretFieldView, _s as REDACTED_SECRET, ei as isLocationEnabled, en as StorageLocationModeSchema, gc as isSecretClear, go as withLocationMode, jc as recordSecretRef, kc as parseSecretRef, nn as StorageMigrationJobSchema, tn as StorageLocationTypeSchema, vc as isSecretMarker, vi as mayReadLocation, xc as makeSecretMarker, yi as mayWriteToLocation } from "../../dist-QnMV8AH-.mjs";
|
|
2
2
|
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
@@ -53,7 +53,6 @@ var StorageLocationBodySchema = z.object({
|
|
|
53
53
|
nodeId: z.string().optional(),
|
|
54
54
|
enabled: z.boolean().optional(),
|
|
55
55
|
mode: StorageLocationModeSchema.optional(),
|
|
56
|
-
isDefault: z.boolean().optional(),
|
|
57
56
|
secrets: z.record(z.string(), z.string().meta({ secret: true })).optional()
|
|
58
57
|
});
|
|
59
58
|
var StorageSeedMarkerBodySchema = z.object({ seededAt: z.number() });
|
|
@@ -243,7 +242,6 @@ function bodyToPersistedLocation(id, body) {
|
|
|
243
242
|
...body.nodeId !== void 0 ? { nodeId: body.nodeId } : {},
|
|
244
243
|
...body.enabled !== void 0 ? { enabled: body.enabled } : {},
|
|
245
244
|
...body.mode !== void 0 ? { mode: body.mode } : {},
|
|
246
|
-
...LegacyStorageLocationDefaultSchema.parse({ isDefault: body.isDefault ?? false }),
|
|
247
245
|
isSystem: body.isSystem,
|
|
248
246
|
createdAt: body.createdAt,
|
|
249
247
|
updatedAt: body.updatedAt
|
|
@@ -3250,77 +3248,7 @@ var StorageOrchestratorService = class {
|
|
|
3250
3248
|
backfilled: backfill.length,
|
|
3251
3249
|
total: this.locations.size
|
|
3252
3250
|
} });
|
|
3253
|
-
this.
|
|
3254
|
-
}
|
|
3255
|
-
/**
|
|
3256
|
-
* ONE explicit migration onto the four-state model (D385), run once per boot
|
|
3257
|
-
* against the rows that came off disk. Idempotent: the second boot finds
|
|
3258
|
-
* nothing to do.
|
|
3259
|
-
*
|
|
3260
|
-
* Two steps, in order, and each one is a WRITE — the point is that "absent"
|
|
3261
|
-
* stops existing rather than being re-interpreted on every read forever:
|
|
3262
|
-
*
|
|
3263
|
-
* 1. A row with no `mode` is stamped with the mode its legacy flags imply
|
|
3264
|
-
* (`legacyModeOf`): `config.readOnly === true` → `readonly` and the
|
|
3265
|
-
* config key is DELETED; `enabled === false` → `readonly` (the
|
|
3266
|
-
* CONSERVATIVE direction — a state change must never start deleting
|
|
3267
|
-
* footage on its own); everything else → `active`. `withLocationMode`
|
|
3268
|
-
* derives `enabled` from the mode, so the two can never disagree, and
|
|
3269
|
-
* this subsumes the D383 pass that stamped flagless rows `enabled: true`.
|
|
3270
|
-
* 2. A type left with NO write target — only reachable from a hand-edited
|
|
3271
|
-
* store or a row an older build wrote — gets one made `active`, chosen as
|
|
3272
|
-
* the row the RETIRED default flag named, else the `:default`-slugged
|
|
3273
|
-
* row, else the lexicographically first. Loudly: a class with no write
|
|
3274
|
-
* target records nowhere, and refusing to repair it here would leave the
|
|
3275
|
-
* hub silently unable to write with no operator action pending.
|
|
3276
|
-
*
|
|
3277
|
-
* An operator's explicit `readonly`/`drain`/`disabled` is never reversed by
|
|
3278
|
-
* step 1 — only step 2 touches it, and only when the alternative is a class
|
|
3279
|
-
* that cannot write at all.
|
|
3280
|
-
*
|
|
3281
|
-
* On the live hub every location is enabled with no `readOnly`, so step 1 is
|
|
3282
|
-
* a no-op that stamps `active` and nothing else changes.
|
|
3283
|
-
*/
|
|
3284
|
-
migrateOntoTheWriteSet(rows) {
|
|
3285
|
-
const legacyDefaultOfType = /* @__PURE__ */ new Map();
|
|
3286
|
-
for (const row of rows) if (row.isDefault === true) legacyDefaultOfType.set(row.type, row.id);
|
|
3287
|
-
const stamped = [];
|
|
3288
|
-
for (const loc of this.locations.values()) {
|
|
3289
|
-
if (loc.mode !== void 0) continue;
|
|
3290
|
-
this.persistMigrated(withLocationMode(loc, legacyModeOf(loc) ?? "active"));
|
|
3291
|
-
stamped.push(loc.id);
|
|
3292
|
-
}
|
|
3293
|
-
const repaired = [];
|
|
3294
|
-
for (const type of new Set([...this.locations.values()].map((l) => l.type))) {
|
|
3295
|
-
const ofType = [...this.locations.values()].filter((l) => l.type === type);
|
|
3296
|
-
if (ofType.some((l) => isLocationEnabled(l))) continue;
|
|
3297
|
-
const legacyDefault = legacyDefaultOfType.get(type);
|
|
3298
|
-
const pick = ofType.find((l) => l.id === legacyDefault) ?? ofType.find((l) => l.id === `${type}:default`) ?? ofType.toSorted((a, b) => a.id.localeCompare(b.id))[0];
|
|
3299
|
-
if (!pick) continue;
|
|
3300
|
-
this.persistMigrated(withLocationMode(pick, "active"));
|
|
3301
|
-
repaired.push(pick.id);
|
|
3302
|
-
}
|
|
3303
|
-
if (stamped.length > 0 || repaired.length > 0) this.logger.info("storage-orchestrator: migrated locations onto the state model", { meta: {
|
|
3304
|
-
stamped,
|
|
3305
|
-
repaired
|
|
3306
|
-
} });
|
|
3307
|
-
for (const id of repaired) this.logger.warn("storage-orchestrator: a storage type had NO enabled location — re-enabled one so it can write. Every other location of that type stays read-only until you enable it.", { meta: { id } });
|
|
3308
|
-
}
|
|
3309
|
-
/** Apply one migrated row in memory and mirror it to the store. */
|
|
3310
|
-
persistMigrated(next) {
|
|
3311
|
-
const withStamp = {
|
|
3312
|
-
...next,
|
|
3313
|
-
updatedAt: Date.now()
|
|
3314
|
-
};
|
|
3315
|
-
this.locations.set(withStamp.id, withStamp);
|
|
3316
|
-
const store = this.locationStore;
|
|
3317
|
-
if (!store) return;
|
|
3318
|
-
store.upsert(withStamp).catch((err) => {
|
|
3319
|
-
this.logger.error("storage-orchestrator: state-model migration persist failed", { meta: {
|
|
3320
|
-
id: withStamp.id,
|
|
3321
|
-
error: err instanceof Error ? err.message : String(err)
|
|
3322
|
-
} });
|
|
3323
|
-
});
|
|
3251
|
+
this.repairWriteSets();
|
|
3324
3252
|
}
|
|
3325
3253
|
/**
|
|
3326
3254
|
* Inject the declaration-driven cardinality source. Called once by the
|
|
@@ -3376,7 +3304,39 @@ var StorageOrchestratorService = class {
|
|
|
3376
3304
|
await this.loadSeedMemory(this.locationStore, rows.length);
|
|
3377
3305
|
for (const loc of rows) this.locations.set(loc.id, loc);
|
|
3378
3306
|
this.logger.info("storage-orchestrator: hydrated locations from store", { meta: { loaded: this.locations.size } });
|
|
3379
|
-
this.
|
|
3307
|
+
this.repairWriteSets();
|
|
3308
|
+
}
|
|
3309
|
+
/**
|
|
3310
|
+
* A type with NO enabled location records nowhere, so this is a runtime invariant, not a
|
|
3311
|
+
* one-time migration: a hand-edited store, a restore or an older build can break it at any
|
|
3312
|
+
* boot. Idempotent: a type that can write is left alone. One location is made `active` (the
|
|
3313
|
+
* `<type>:default` row, else the lexicographically first id), persisted, and said loudly.
|
|
3314
|
+
* The mode is read and written only through `storage-location-mode` (D385); an operator's
|
|
3315
|
+
* `readonly`/`drain`/`disabled` is touched only when the alternative is a type that cannot write.
|
|
3316
|
+
*/
|
|
3317
|
+
repairWriteSets() {
|
|
3318
|
+
const repaired = [];
|
|
3319
|
+
for (const type of new Set([...this.locations.values()].map((l) => l.type))) {
|
|
3320
|
+
const ofType = [...this.locations.values()].filter((l) => l.type === type);
|
|
3321
|
+
if (ofType.some((l) => isLocationEnabled(l))) continue;
|
|
3322
|
+
const pick = ofType.find((l) => l.id === `${type}:default`) ?? ofType.toSorted((a, b) => a.id.localeCompare(b.id))[0];
|
|
3323
|
+
if (!pick) continue;
|
|
3324
|
+
const next = {
|
|
3325
|
+
...withLocationMode(pick, "active"),
|
|
3326
|
+
updatedAt: Date.now()
|
|
3327
|
+
};
|
|
3328
|
+
this.locations.set(next.id, next);
|
|
3329
|
+
repaired.push(next.id);
|
|
3330
|
+
const store = this.locationStore;
|
|
3331
|
+
if (!store) continue;
|
|
3332
|
+
store.upsert(next).catch((err) => {
|
|
3333
|
+
this.logger.error("storage-orchestrator: write-set repair persist failed", { meta: {
|
|
3334
|
+
id: next.id,
|
|
3335
|
+
error: err instanceof Error ? err.message : String(err)
|
|
3336
|
+
} });
|
|
3337
|
+
});
|
|
3338
|
+
}
|
|
3339
|
+
for (const id of repaired) this.logger.warn("storage-orchestrator: a storage type had NO enabled location — re-enabled one so it can write. Every other location of that type stays read-only until you enable it.", { meta: { id } });
|
|
3380
3340
|
}
|
|
3381
3341
|
/**
|
|
3382
3342
|
* Boot backfill (SP1): stamp `nodeId` on every persisted node-local
|
|
@@ -215,38 +215,6 @@ export declare class StorageOrchestratorService {
|
|
|
215
215
|
*/
|
|
216
216
|
attachStore(store: ILocationStore): Promise<void>;
|
|
217
217
|
/**
|
|
218
|
-
* ONE explicit migration onto the four-state model (D385), run once per boot
|
|
219
|
-
* against the rows that came off disk. Idempotent: the second boot finds
|
|
220
|
-
* nothing to do.
|
|
221
|
-
*
|
|
222
|
-
* Two steps, in order, and each one is a WRITE — the point is that "absent"
|
|
223
|
-
* stops existing rather than being re-interpreted on every read forever:
|
|
224
|
-
*
|
|
225
|
-
* 1. A row with no `mode` is stamped with the mode its legacy flags imply
|
|
226
|
-
* (`legacyModeOf`): `config.readOnly === true` → `readonly` and the
|
|
227
|
-
* config key is DELETED; `enabled === false` → `readonly` (the
|
|
228
|
-
* CONSERVATIVE direction — a state change must never start deleting
|
|
229
|
-
* footage on its own); everything else → `active`. `withLocationMode`
|
|
230
|
-
* derives `enabled` from the mode, so the two can never disagree, and
|
|
231
|
-
* this subsumes the D383 pass that stamped flagless rows `enabled: true`.
|
|
232
|
-
* 2. A type left with NO write target — only reachable from a hand-edited
|
|
233
|
-
* store or a row an older build wrote — gets one made `active`, chosen as
|
|
234
|
-
* the row the RETIRED default flag named, else the `:default`-slugged
|
|
235
|
-
* row, else the lexicographically first. Loudly: a class with no write
|
|
236
|
-
* target records nowhere, and refusing to repair it here would leave the
|
|
237
|
-
* hub silently unable to write with no operator action pending.
|
|
238
|
-
*
|
|
239
|
-
* An operator's explicit `readonly`/`drain`/`disabled` is never reversed by
|
|
240
|
-
* step 1 — only step 2 touches it, and only when the alternative is a class
|
|
241
|
-
* that cannot write at all.
|
|
242
|
-
*
|
|
243
|
-
* On the live hub every location is enabled with no `readOnly`, so step 1 is
|
|
244
|
-
* a no-op that stamps `active` and nothing else changes.
|
|
245
|
-
*/
|
|
246
|
-
private migrateOntoTheWriteSet;
|
|
247
|
-
/** Apply one migrated row in memory and mirror it to the store. */
|
|
248
|
-
private persistMigrated;
|
|
249
|
-
/**
|
|
250
218
|
* Inject the declaration-driven cardinality source. Called once by the
|
|
251
219
|
* addon after the kernel aggregates every addon's `storageLocations`
|
|
252
220
|
* declarations into a `StorageLocationRegistry`.
|
|
@@ -288,6 +256,15 @@ export declare class StorageOrchestratorService {
|
|
|
288
256
|
*/
|
|
289
257
|
initialize(): Promise<void>;
|
|
290
258
|
/**
|
|
259
|
+
* A type with NO enabled location records nowhere, so this is a runtime invariant, not a
|
|
260
|
+
* one-time migration: a hand-edited store, a restore or an older build can break it at any
|
|
261
|
+
* boot. Idempotent: a type that can write is left alone. One location is made `active` (the
|
|
262
|
+
* `<type>:default` row, else the lexicographically first id), persisted, and said loudly.
|
|
263
|
+
* The mode is read and written only through `storage-location-mode` (D385); an operator's
|
|
264
|
+
* `readonly`/`drain`/`disabled` is touched only when the alternative is a type that cannot write.
|
|
265
|
+
*/
|
|
266
|
+
private repairWriteSets;
|
|
267
|
+
/**
|
|
291
268
|
* Boot backfill (SP1): stamp `nodeId` on every persisted node-local
|
|
292
269
|
* location that lacks one. Single-node deployments seeded their
|
|
293
270
|
* filesystem locations before `nodeId` existed — they live on `hubNodeId`
|
|
@@ -3,11 +3,11 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-X-i__4Xc.js");
|
|
7
7
|
const require_safe_buffer$1 = require("../../safe-buffer-D3aoa-7X.js");
|
|
8
8
|
const require_x509_es = require("../../x509.es-WtnRNyYS.js");
|
|
9
|
-
const require_agent_https = require("../../agent-https-
|
|
10
|
-
const require_constants$8 = require("../../constants-
|
|
9
|
+
const require_agent_https = require("../../agent-https-CSHd24Sz.js");
|
|
10
|
+
const require_constants$8 = require("../../constants-BVIwtt_O.js");
|
|
11
11
|
const require_src$1 = require("../../src-CnAqG6EF.js");
|
|
12
12
|
let zod = require("zod");
|
|
13
13
|
let node_crypto = require("node:crypto");
|