@camstack/system 1.2.89 → 1.2.91
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/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +25 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +25 -1
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/core-block-store.d.ts +11 -0
- package/dist/builtins/core-blocks/core-blocks.addon.js +12 -1
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +12 -1
- package/dist/builtins/device-manager/device-manager.addon.js +1 -1
- package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
- package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
- package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/auth-schema.d.ts +42 -0
- package/dist/builtins/local-auth/local-auth.addon.js +43 -1
- package/dist/builtins/local-auth/local-auth.addon.mjs +43 -1
- package/dist/builtins/local-network/local-network.addon.js +1 -1
- package/dist/builtins/local-network/local-network.addon.mjs +1 -1
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +16 -5
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +16 -5
- package/dist/builtins/storage-orchestrator/index.mjs +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +65 -4
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +64 -4
- package/dist/builtins/storage-orchestrator/storage-orchestrator.service.d.ts +12 -0
- package/dist/builtins/system-config/system-config.addon.js +1 -1
- package/dist/builtins/system-config/system-config.addon.mjs +1 -1
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{dist-Dq0ebOuS.js → dist-9Gfk4KOk.js} +500 -47
- package/dist/{dist-Bij6agsS.mjs → dist-DhrTd8LL.mjs} +500 -47
- package/dist/index.js +39 -46
- package/dist/index.mjs +39 -46
- package/package.json +1 -1
|
@@ -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-9Gfk4KOk.js");
|
|
7
7
|
let node_crypto = require("node:crypto");
|
|
8
8
|
let node_fs = require("node:fs");
|
|
9
9
|
let node_module = require("node:module");
|
|
@@ -1144,10 +1144,21 @@ var SqliteSettingsBackend = class SqliteSettingsBackend {
|
|
|
1144
1144
|
}
|
|
1145
1145
|
}
|
|
1146
1146
|
this.getDb().exec(`CREATE TABLE IF NOT EXISTS "${table}" (${colDefs.join(", ")})`);
|
|
1147
|
-
if (schema.indexes)
|
|
1148
|
-
const
|
|
1149
|
-
const
|
|
1150
|
-
|
|
1147
|
+
if (schema.indexes) {
|
|
1148
|
+
const pkName = schema.columns.find((c) => c.primaryKey === true)?.name ?? "id";
|
|
1149
|
+
const nonPkColumns = schema.columns.filter((c) => c.name !== pkName).map((c) => c.name);
|
|
1150
|
+
const kvBlobColumn = nonPkColumns.length === 1 && nonPkColumns[0] === "data" ? "data" : null;
|
|
1151
|
+
const isRealColumn = (field) => field === pkName || nonPkColumns.includes(field);
|
|
1152
|
+
const indexExpr = (field) => {
|
|
1153
|
+
if (isRealColumn(field)) return `"${field}"`;
|
|
1154
|
+
return kvBlobColumn === null ? null : `json_extract("${kvBlobColumn}", '$.${field}')`;
|
|
1155
|
+
};
|
|
1156
|
+
for (const idx of schema.indexes) {
|
|
1157
|
+
const exprs = idx.columns.map((c) => indexExpr(c));
|
|
1158
|
+
if (exprs.some((e) => e === null)) continue;
|
|
1159
|
+
const unique = idx.unique ? "UNIQUE " : "";
|
|
1160
|
+
this.getDb().exec(`CREATE ${unique}INDEX IF NOT EXISTS "${idx.name}" ON "${table}" (${exprs.join(", ")})`);
|
|
1161
|
+
}
|
|
1151
1162
|
}
|
|
1152
1163
|
this.structuredTables.set(table, fingerprint);
|
|
1153
1164
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as decodeVectorBase64, Dt as asJsonObject, Rt as parseJsonUnknown, _t as BaseAddon, f as RUNTIME_DEFAULTS, gt as errMsg, ht as vectorStoreCapability, k as dataStoreProviderCapability, mt as vectorDimFromBase64, w as bareAddonId } from "../../dist-
|
|
1
|
+
import { A as decodeVectorBase64, Dt as asJsonObject, Rt as parseJsonUnknown, _t as BaseAddon, f as RUNTIME_DEFAULTS, gt as errMsg, ht as vectorStoreCapability, k as dataStoreProviderCapability, mt as vectorDimFromBase64, w as bareAddonId } from "../../dist-DhrTd8LL.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
import { statSync } from "node:fs";
|
|
@@ -1138,10 +1138,21 @@ var SqliteSettingsBackend = class SqliteSettingsBackend {
|
|
|
1138
1138
|
}
|
|
1139
1139
|
}
|
|
1140
1140
|
this.getDb().exec(`CREATE TABLE IF NOT EXISTS "${table}" (${colDefs.join(", ")})`);
|
|
1141
|
-
if (schema.indexes)
|
|
1142
|
-
const
|
|
1143
|
-
const
|
|
1144
|
-
|
|
1141
|
+
if (schema.indexes) {
|
|
1142
|
+
const pkName = schema.columns.find((c) => c.primaryKey === true)?.name ?? "id";
|
|
1143
|
+
const nonPkColumns = schema.columns.filter((c) => c.name !== pkName).map((c) => c.name);
|
|
1144
|
+
const kvBlobColumn = nonPkColumns.length === 1 && nonPkColumns[0] === "data" ? "data" : null;
|
|
1145
|
+
const isRealColumn = (field) => field === pkName || nonPkColumns.includes(field);
|
|
1146
|
+
const indexExpr = (field) => {
|
|
1147
|
+
if (isRealColumn(field)) return `"${field}"`;
|
|
1148
|
+
return kvBlobColumn === null ? null : `json_extract("${kvBlobColumn}", '$.${field}')`;
|
|
1149
|
+
};
|
|
1150
|
+
for (const idx of schema.indexes) {
|
|
1151
|
+
const exprs = idx.columns.map((c) => indexExpr(c));
|
|
1152
|
+
if (exprs.some((e) => e === null)) continue;
|
|
1153
|
+
const unique = idx.unique ? "UNIQUE " : "";
|
|
1154
|
+
this.getDb().exec(`CREATE ${unique}INDEX IF NOT EXISTS "${idx.name}" ON "${table}" (${exprs.join(", ")})`);
|
|
1155
|
+
}
|
|
1145
1156
|
}
|
|
1146
1157
|
this.structuredTables.set(table, fingerprint);
|
|
1147
1158
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { StorageOrchestratorAddon,
|
|
1
|
+
import { StorageOrchestratorAddon, i as SqliteLocationStore, r as StorageMigrationCoordinator, t as StorageOrchestratorService } from "./storage-orchestrator.addon.mjs";
|
|
2
2
|
export { SqliteLocationStore, StorageMigrationCoordinator, StorageOrchestratorAddon, StorageOrchestratorAddon as default, StorageOrchestratorService };
|
|
@@ -3,14 +3,18 @@ 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-9Gfk4KOk.js");
|
|
7
7
|
let node_crypto = require("node:crypto");
|
|
8
8
|
let node_fs_promises = require("node:fs/promises");
|
|
9
9
|
node_fs_promises = require_chunk.__toESM(node_fs_promises);
|
|
10
10
|
let node_path = require("node:path");
|
|
11
11
|
node_path = require_chunk.__toESM(node_path);
|
|
12
|
-
let _camstack_system = require("@camstack/system");
|
|
13
12
|
//#region src/builtins/storage-orchestrator/location-store.ts
|
|
13
|
+
/**
|
|
14
|
+
* @durable class=config owner=storage-orchestrator
|
|
15
|
+
* write="an operator creates or edits a location (basePath, minFreePercent, enabled, node pin); plus the boot reconcile — declared defaults seeded on a fresh install, and in-memory-only locations backfilled when the store is late-wired"
|
|
16
|
+
* retention="none — a row goes only when the operator deletes the location, or when the declaration pass prunes one whose declaring addon is gone. Bounded by the storage targets a human configures."
|
|
17
|
+
*/
|
|
14
18
|
var STORAGE_LOCATIONS = "storage_locations";
|
|
15
19
|
/**
|
|
16
20
|
* Reserved key under which the cluster `nodeId` (SP1) is persisted INSIDE
|
|
@@ -577,6 +581,50 @@ function isTerminal(job) {
|
|
|
577
581
|
return job.phase === "done" || job.phase === "failed" || job.phase === "cancelled";
|
|
578
582
|
}
|
|
579
583
|
//#endregion
|
|
584
|
+
//#region src/kernel/storage-location-registry.ts
|
|
585
|
+
/**
|
|
586
|
+
* Aggregates per-addon {@link StorageLocationDeclaration} arrays into a single
|
|
587
|
+
* {@link StorageLocationRegistry}.
|
|
588
|
+
*
|
|
589
|
+
* Merge rules:
|
|
590
|
+
* - Declarations are keyed by `id`; iteration order follows first occurrence.
|
|
591
|
+
* - **First declarer wins** for metadata (`displayName`, `description`,
|
|
592
|
+
* `defaultsTo`): if a later addon declares the same `id`, its metadata is
|
|
593
|
+
* silently ignored.
|
|
594
|
+
* - **Cardinality conflict throws**: if two addons declare the same `id` with
|
|
595
|
+
* different `cardinality` values an `Error` is thrown immediately (message
|
|
596
|
+
* contains the words "cardinality" and the conflicting `id`).
|
|
597
|
+
*
|
|
598
|
+
* @param perAddon - One entry per addon; each entry is that addon's
|
|
599
|
+
* `storageLocations` declaration array.
|
|
600
|
+
*/
|
|
601
|
+
function buildStorageLocationRegistry(perAddon) {
|
|
602
|
+
const map = /* @__PURE__ */ new Map();
|
|
603
|
+
for (const addonDeclarations of perAddon) for (const declaration of addonDeclarations) {
|
|
604
|
+
const existing = map.get(declaration.id);
|
|
605
|
+
if (existing !== void 0) {
|
|
606
|
+
if (existing.cardinality !== declaration.cardinality) throw new Error(`Storage location cardinality conflict for id "${declaration.id}": "${existing.cardinality}" (first declarer) vs "${declaration.cardinality}" (later declarer). All addons declaring the same storage location id must agree on cardinality.`);
|
|
607
|
+
continue;
|
|
608
|
+
}
|
|
609
|
+
map.set(declaration.id, declaration);
|
|
610
|
+
}
|
|
611
|
+
const frozen = Object.freeze([...map.values()]);
|
|
612
|
+
return {
|
|
613
|
+
get(id) {
|
|
614
|
+
return map.get(id);
|
|
615
|
+
},
|
|
616
|
+
has(id) {
|
|
617
|
+
return map.has(id);
|
|
618
|
+
},
|
|
619
|
+
cardinalityOf(id) {
|
|
620
|
+
return map.get(id)?.cardinality ?? null;
|
|
621
|
+
},
|
|
622
|
+
list() {
|
|
623
|
+
return frozen;
|
|
624
|
+
}
|
|
625
|
+
};
|
|
626
|
+
}
|
|
627
|
+
//#endregion
|
|
580
628
|
//#region src/builtins/storage-orchestrator/data-store-dispatch.ts
|
|
581
629
|
/**
|
|
582
630
|
* Pick the engine to serve a call.
|
|
@@ -756,11 +804,23 @@ var StorageOrchestratorService = class {
|
|
|
756
804
|
* 2. backfill — in-memory locations the DB doesn't have yet (the
|
|
757
805
|
* pre-store seed defaults on a fresh install) are persisted, so the
|
|
758
806
|
* store becomes the durable source of truth from here on.
|
|
807
|
+
*
|
|
808
|
+
* **The re-entry guard latches on a SUCCESSFUL hydrate, not on the attempt** —
|
|
809
|
+
* `loadAll()` is awaited BEFORE `this.locationStore` is assigned, and the
|
|
810
|
+
* order is load-bearing. Latching first meant one transient read error
|
|
811
|
+
* answered `hasStore()` true forever, so the addon's `ensureStoreWired` gate
|
|
812
|
+
* skipped every retry; the service then ran the whole process lifetime on
|
|
813
|
+
* pre-store seed defaults while `upsert` mirrored them onto rows it had never
|
|
814
|
+
* read, silently replacing the operator's persisted `minFreePercent`. Failing
|
|
815
|
+
* back to store-less is the safe direction: an in-memory-only service writes
|
|
816
|
+
* nothing over what is on disk, and the next `capability:provider-registered`
|
|
817
|
+
* event tries again. Held by
|
|
818
|
+
* `__tests__/storage-orchestrator-persistence.spec.ts`.
|
|
759
819
|
*/
|
|
760
820
|
async attachStore(store) {
|
|
761
821
|
if (this.locationStore) return;
|
|
762
|
-
this.locationStore = store;
|
|
763
822
|
const rows = await store.loadAll();
|
|
823
|
+
this.locationStore = store;
|
|
764
824
|
const dbIds = new Set(rows.map((r) => r.id));
|
|
765
825
|
for (const loc of rows) {
|
|
766
826
|
const upgraded = !loc.isSystem && loc.id === `${loc.type}:default` ? {
|
|
@@ -1925,7 +1985,7 @@ var StorageOrchestratorAddon = class extends require_dist.BaseAddon {
|
|
|
1925
1985
|
async seedFromDeclarations() {
|
|
1926
1986
|
if (!this.service) return;
|
|
1927
1987
|
await this.refreshNodeLocalCache();
|
|
1928
|
-
const registry =
|
|
1988
|
+
const registry = buildStorageLocationRegistry(this.ctx.kernel.listStorageLocationDeclarations?.() ?? []);
|
|
1929
1989
|
this.service.setRegistry(registry);
|
|
1930
1990
|
this.service.pruneUndeclaredSystemLocations();
|
|
1931
1991
|
const mediaRoot = process.env.CAMSTACK_MEDIA_ROOT?.trim();
|
|
@@ -1963,3 +2023,4 @@ exports.StorageMigrationCoordinator = StorageMigrationCoordinator;
|
|
|
1963
2023
|
exports.StorageOrchestratorAddon = StorageOrchestratorAddon;
|
|
1964
2024
|
exports.default = StorageOrchestratorAddon;
|
|
1965
2025
|
exports.StorageOrchestratorService = StorageOrchestratorService;
|
|
2026
|
+
exports.buildStorageLocationRegistry = buildStorageLocationRegistry;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { Lt as parseJsonObject, _t as BaseAddon, g as StorageMigrationJobSchema, h as StorageLocationTypeSchema, lt as storageCapability, st as settingsStoreCapability, ut as storageMigrationCapability } from "../../dist-
|
|
1
|
+
import { Lt as parseJsonObject, _t as BaseAddon, g as StorageMigrationJobSchema, h as StorageLocationTypeSchema, lt as storageCapability, st as settingsStoreCapability, ut as storageMigrationCapability } from "../../dist-DhrTd8LL.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import * as fs from "node:fs/promises";
|
|
4
4
|
import * as path$1 from "node:path";
|
|
5
|
-
import { buildStorageLocationRegistry } from "@camstack/system";
|
|
6
5
|
//#region src/builtins/storage-orchestrator/location-store.ts
|
|
6
|
+
/**
|
|
7
|
+
* @durable class=config owner=storage-orchestrator
|
|
8
|
+
* write="an operator creates or edits a location (basePath, minFreePercent, enabled, node pin); plus the boot reconcile — declared defaults seeded on a fresh install, and in-memory-only locations backfilled when the store is late-wired"
|
|
9
|
+
* retention="none — a row goes only when the operator deletes the location, or when the declaration pass prunes one whose declaring addon is gone. Bounded by the storage targets a human configures."
|
|
10
|
+
*/
|
|
7
11
|
var STORAGE_LOCATIONS = "storage_locations";
|
|
8
12
|
/**
|
|
9
13
|
* Reserved key under which the cluster `nodeId` (SP1) is persisted INSIDE
|
|
@@ -570,6 +574,50 @@ function isTerminal(job) {
|
|
|
570
574
|
return job.phase === "done" || job.phase === "failed" || job.phase === "cancelled";
|
|
571
575
|
}
|
|
572
576
|
//#endregion
|
|
577
|
+
//#region src/kernel/storage-location-registry.ts
|
|
578
|
+
/**
|
|
579
|
+
* Aggregates per-addon {@link StorageLocationDeclaration} arrays into a single
|
|
580
|
+
* {@link StorageLocationRegistry}.
|
|
581
|
+
*
|
|
582
|
+
* Merge rules:
|
|
583
|
+
* - Declarations are keyed by `id`; iteration order follows first occurrence.
|
|
584
|
+
* - **First declarer wins** for metadata (`displayName`, `description`,
|
|
585
|
+
* `defaultsTo`): if a later addon declares the same `id`, its metadata is
|
|
586
|
+
* silently ignored.
|
|
587
|
+
* - **Cardinality conflict throws**: if two addons declare the same `id` with
|
|
588
|
+
* different `cardinality` values an `Error` is thrown immediately (message
|
|
589
|
+
* contains the words "cardinality" and the conflicting `id`).
|
|
590
|
+
*
|
|
591
|
+
* @param perAddon - One entry per addon; each entry is that addon's
|
|
592
|
+
* `storageLocations` declaration array.
|
|
593
|
+
*/
|
|
594
|
+
function buildStorageLocationRegistry(perAddon) {
|
|
595
|
+
const map = /* @__PURE__ */ new Map();
|
|
596
|
+
for (const addonDeclarations of perAddon) for (const declaration of addonDeclarations) {
|
|
597
|
+
const existing = map.get(declaration.id);
|
|
598
|
+
if (existing !== void 0) {
|
|
599
|
+
if (existing.cardinality !== declaration.cardinality) throw new Error(`Storage location cardinality conflict for id "${declaration.id}": "${existing.cardinality}" (first declarer) vs "${declaration.cardinality}" (later declarer). All addons declaring the same storage location id must agree on cardinality.`);
|
|
600
|
+
continue;
|
|
601
|
+
}
|
|
602
|
+
map.set(declaration.id, declaration);
|
|
603
|
+
}
|
|
604
|
+
const frozen = Object.freeze([...map.values()]);
|
|
605
|
+
return {
|
|
606
|
+
get(id) {
|
|
607
|
+
return map.get(id);
|
|
608
|
+
},
|
|
609
|
+
has(id) {
|
|
610
|
+
return map.has(id);
|
|
611
|
+
},
|
|
612
|
+
cardinalityOf(id) {
|
|
613
|
+
return map.get(id)?.cardinality ?? null;
|
|
614
|
+
},
|
|
615
|
+
list() {
|
|
616
|
+
return frozen;
|
|
617
|
+
}
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
//#endregion
|
|
573
621
|
//#region src/builtins/storage-orchestrator/data-store-dispatch.ts
|
|
574
622
|
/**
|
|
575
623
|
* Pick the engine to serve a call.
|
|
@@ -749,11 +797,23 @@ var StorageOrchestratorService = class {
|
|
|
749
797
|
* 2. backfill — in-memory locations the DB doesn't have yet (the
|
|
750
798
|
* pre-store seed defaults on a fresh install) are persisted, so the
|
|
751
799
|
* store becomes the durable source of truth from here on.
|
|
800
|
+
*
|
|
801
|
+
* **The re-entry guard latches on a SUCCESSFUL hydrate, not on the attempt** —
|
|
802
|
+
* `loadAll()` is awaited BEFORE `this.locationStore` is assigned, and the
|
|
803
|
+
* order is load-bearing. Latching first meant one transient read error
|
|
804
|
+
* answered `hasStore()` true forever, so the addon's `ensureStoreWired` gate
|
|
805
|
+
* skipped every retry; the service then ran the whole process lifetime on
|
|
806
|
+
* pre-store seed defaults while `upsert` mirrored them onto rows it had never
|
|
807
|
+
* read, silently replacing the operator's persisted `minFreePercent`. Failing
|
|
808
|
+
* back to store-less is the safe direction: an in-memory-only service writes
|
|
809
|
+
* nothing over what is on disk, and the next `capability:provider-registered`
|
|
810
|
+
* event tries again. Held by
|
|
811
|
+
* `__tests__/storage-orchestrator-persistence.spec.ts`.
|
|
752
812
|
*/
|
|
753
813
|
async attachStore(store) {
|
|
754
814
|
if (this.locationStore) return;
|
|
755
|
-
this.locationStore = store;
|
|
756
815
|
const rows = await store.loadAll();
|
|
816
|
+
this.locationStore = store;
|
|
757
817
|
const dbIds = new Set(rows.map((r) => r.id));
|
|
758
818
|
for (const loc of rows) {
|
|
759
819
|
const upgraded = !loc.isSystem && loc.id === `${loc.type}:default` ? {
|
|
@@ -1951,4 +2011,4 @@ var StorageOrchestratorAddon = class extends BaseAddon {
|
|
|
1951
2011
|
}
|
|
1952
2012
|
};
|
|
1953
2013
|
//#endregion
|
|
1954
|
-
export { StorageOrchestratorAddon, StorageOrchestratorAddon as default,
|
|
2014
|
+
export { StorageOrchestratorAddon, StorageOrchestratorAddon as default, SqliteLocationStore as i, buildStorageLocationRegistry as n, StorageMigrationCoordinator as r, StorageOrchestratorService as t };
|
|
@@ -139,6 +139,18 @@ export declare class StorageOrchestratorService {
|
|
|
139
139
|
* 2. backfill — in-memory locations the DB doesn't have yet (the
|
|
140
140
|
* pre-store seed defaults on a fresh install) are persisted, so the
|
|
141
141
|
* store becomes the durable source of truth from here on.
|
|
142
|
+
*
|
|
143
|
+
* **The re-entry guard latches on a SUCCESSFUL hydrate, not on the attempt** —
|
|
144
|
+
* `loadAll()` is awaited BEFORE `this.locationStore` is assigned, and the
|
|
145
|
+
* order is load-bearing. Latching first meant one transient read error
|
|
146
|
+
* answered `hasStore()` true forever, so the addon's `ensureStoreWired` gate
|
|
147
|
+
* skipped every retry; the service then ran the whole process lifetime on
|
|
148
|
+
* pre-store seed defaults while `upsert` mirrored them onto rows it had never
|
|
149
|
+
* read, silently replacing the operator's persisted `minFreePercent`. Failing
|
|
150
|
+
* back to store-less is the safe direction: an in-memory-only service writes
|
|
151
|
+
* nothing over what is on disk, and the next `capability:provider-registered`
|
|
152
|
+
* event tries again. Held by
|
|
153
|
+
* `__tests__/storage-orchestrator-persistence.spec.ts`.
|
|
142
154
|
*/
|
|
143
155
|
attachStore(store: ILocationStore): Promise<void>;
|
|
144
156
|
/**
|
|
@@ -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-9Gfk4KOk.js");
|
|
7
7
|
//#region src/builtins/system-config/system-config.addon.ts
|
|
8
8
|
/**
|
|
9
9
|
* Built-in `system-config` addon — Phase 4 of the settings redesign.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Pt as hydrateSchema, _t as BaseAddon, gt as errMsg } from "../../dist-
|
|
1
|
+
import { Pt as hydrateSchema, _t as BaseAddon, gt as errMsg } from "../../dist-DhrTd8LL.mjs";
|
|
2
2
|
//#region src/builtins/system-config/system-config.addon.ts
|
|
3
3
|
/**
|
|
4
4
|
* Built-in `system-config` addon — Phase 4 of the settings redesign.
|
|
@@ -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-9Gfk4KOk.js");
|
|
7
7
|
const require_formatter = require("../../formatter-DqAKDlvN.js");
|
|
8
8
|
let node_path = require("node:path");
|
|
9
9
|
node_path = require_chunk.__toESM(node_path);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { J as logDestinationCapability, _t as BaseAddon } from "../../dist-
|
|
1
|
+
import { J as logDestinationCapability, _t as BaseAddon } from "../../dist-DhrTd8LL.mjs";
|
|
2
2
|
import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
|
|
3
3
|
import * as path$1 from "node:path";
|
|
4
4
|
import path from "node:path";
|