@camstack/system 1.2.200 → 1.2.202

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.
Files changed (57) hide show
  1. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  2. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  3. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/alerts/alerts.addon.js +1 -1
  6. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  7. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.d.ts +38 -9
  8. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +234 -81
  9. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +234 -81
  10. package/dist/builtins/backup-orchestrator/destination-policy.d.ts +32 -14
  11. package/dist/builtins/backup-orchestrator/schedule-store.d.ts +12 -2
  12. package/dist/builtins/console-logging/index.js +1 -1
  13. package/dist/builtins/console-logging/index.mjs +1 -1
  14. package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
  15. package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
  16. package/dist/builtins/device-manager/device-manager.addon.js +2 -2
  17. package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
  18. package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
  19. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
  20. package/dist/builtins/hub-forwarder/index.js +1 -1
  21. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  22. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  23. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  24. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  25. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  26. package/dist/builtins/local-network/local-network.addon.js +1 -1
  27. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  28. package/dist/builtins/loki-logging/index.js +1 -1
  29. package/dist/builtins/loki-logging/index.mjs +1 -1
  30. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  31. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  32. package/dist/builtins/platform-probe/index.js +1 -1
  33. package/dist/builtins/platform-probe/index.mjs +1 -1
  34. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  35. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  36. package/dist/builtins/snapshot/index.js +1 -1
  37. package/dist/builtins/snapshot/index.mjs +1 -1
  38. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  39. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  40. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
  41. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
  42. package/dist/builtins/storage-orchestrator/location-store.d.ts +12 -3
  43. package/dist/builtins/storage-orchestrator/storage-migration-coordinator.d.ts +9 -9
  44. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +181 -129
  45. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +181 -129
  46. package/dist/builtins/storage-orchestrator/storage-orchestrator.service.d.ts +54 -31
  47. package/dist/builtins/system-config/system-config.addon.js +1 -1
  48. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  49. package/dist/builtins/winston-logging/index.js +1 -1
  50. package/dist/builtins/winston-logging/index.mjs +1 -1
  51. package/dist/{dist-CCp74QLJ.mjs → dist-CiHYspij.mjs} +235 -199
  52. package/dist/{dist-KQ5D2wqr.js → dist-jZb-HKI5.js} +246 -198
  53. package/dist/index.js +1 -1
  54. package/dist/index.mjs +1 -1
  55. package/dist/{retired-settings-keys-7P9XwNdl.mjs → retired-settings-keys-DeRxo3vg.mjs} +1 -1
  56. package/dist/{retired-settings-keys-2lWk7OeU.js → retired-settings-keys-Dxv9S_lO.js} +1 -1
  57. package/package.json +1 -1
@@ -184,23 +184,31 @@ export declare class StorageOrchestratorService {
184
184
  */
185
185
  attachStore(store: ILocationStore): Promise<void>;
186
186
  /**
187
- * Shout about a persisted row that is BOTH the type default and disabled.
187
+ * ONE explicit migration onto the enabled write set (D383), run once per
188
+ * boot against the rows that came off disk. Idempotent: the second boot finds
189
+ * nothing to do.
188
190
  *
189
- * `upsertLocation` can now produce this (enabled is the write set; `isDefault`
190
- * is store residue). Hydrate also writes rows straight into the map, so a
191
- * hand-edited store or a row written by another build can too. It matters
192
- * because every bare-type ref still resolves through {@link getDefaultLocation}
193
- * until Stage 5 of the enabled-write-set design: on such a row
194
- * `storage.write({ location: 'eventMedia' })` and the migration coordinator's
195
- * drain destination both point at a disk the operator turned off.
191
+ * Two steps, in order, and each one is a WRITE — the point is that "absent"
192
+ * stops existing rather than being re-interpreted on every read forever:
196
193
  *
197
- * Reported, never repaired: flipping an operator's flag back on at boot would
198
- * be the system overruling the switch instead of obeying it. The coordinator
199
- * refuses the drain (`storage-migration-coordinator.drain`); the bare-ref read
200
- * path is deliberately left working, because narrowing a READ is a worse bug
201
- * than the one this line reports.
194
+ * 1. A flagless row (persisted before `enabled` existed) is stamped
195
+ * `enabled: true`. Absence already meant active, so this preserves
196
+ * behaviour exactly; it is the operator's "the initial locations are
197
+ * enabled" spelled into the store.
198
+ * 2. A type left with NO enabled row — only reachable from a hand-edited
199
+ * store or a row an older build wrote — gets one enabled back, chosen as
200
+ * the row the RETIRED default flag named, else the `:default`-slugged
201
+ * row, else the lexicographically first. Loudly: a class with no write
202
+ * target records nowhere, and refusing to repair it here would leave the
203
+ * hub silently unable to write with no operator action pending.
204
+ *
205
+ * An operator's explicit `enabled: false` is never reversed by step 1 — only
206
+ * step 2 touches it, and only when the alternative is a class that cannot
207
+ * write at all.
202
208
  */
203
- private reportDisabledDefaults;
209
+ private migrateOntoTheWriteSet;
210
+ /** Apply one migrated row in memory and mirror it to the store. */
211
+ private persistMigrated;
204
212
  /**
205
213
  * Inject the declaration-driven cardinality source. Called once by the
206
214
  * addon after the kernel aggregates every addon's `storageLocations`
@@ -259,22 +267,36 @@ export declare class StorageOrchestratorService {
259
267
  */
260
268
  backfillNodeIds(hubNodeId: string): Promise<void>;
261
269
  listLocations(filter?: ListLocationsFilter): readonly StorageLocation[];
262
- getDefaultLocation(type: string): StorageLocation | null;
263
270
  /**
264
- * Repoint several logical defaults as one in-memory commit. The migration
265
- * coordinator persists its `repointing` phase before calling this method, so
266
- * a process crash during the backing-store writes is recovered by replaying
267
- * the same idempotent target set before anyone resumes writers.
271
+ * The WRITE SET of a type: every enabled location of it, in stable id order.
272
+ * This replaced `getDefaultLocation` (D383) — a type does not have one write
273
+ * target any more, it has a pool, and every consumer that must pick one picks
274
+ * from here by its own rule (the recorder by headroom, a drain by an operator
275
+ * -named destination).
276
+ */
277
+ writeTargets(type: string): readonly StorageLocation[];
278
+ /**
279
+ * Change the WRITE SET as one compensated commit: each named location is
280
+ * enabled (it joins the pool) or disabled (it becomes read-only — still read,
281
+ * still played back, still age-swept, still drained).
282
+ *
283
+ * This is the cutover verb, and its only caller is the migration coordinator,
284
+ * which persists its `repointing` phase BEFORE calling so a crash mid-write
285
+ * is recovered by replaying the same idempotent set before writers resume.
286
+ *
287
+ * It moves ONLY the locations it is given: a cutover from A to C on a class
288
+ * that also writes to B leaves B in the pool, because the operator's pool is
289
+ * the authority and a migration is not a licence to shrink it. The commit is
290
+ * refused when it would leave a write-serving type with nothing enabled —
291
+ * the same refusal `upsertLocation` applies, judged on the RESULT so an
292
+ * enable and a disable in one commit are weighed together.
268
293
  */
269
- setDefaultLocations(targetByType: ReadonlyMap<string, string>): Promise<void>;
294
+ setWriteTargets(enabledByLocationId: ReadonlyMap<string, boolean>): Promise<void>;
270
295
  /**
271
- * Insert or update a location. If `isDefault: true`, atomically
272
- * demotes any other default for the same type — operators always see
273
- * exactly one default per type.
296
+ * Insert or update a location.
274
297
  *
275
- * When a persistence store is wired (Task 6), the new record AND any
276
- * implicitly-demoted siblings are persisted before the in-memory map
277
- * mutation returns. Persistence errors propagate to the caller.
298
+ * When a persistence store is wired (Task 6), the record is mirrored to it;
299
+ * the mirror is fire-and-forget and its errors reach the logger.
278
300
  */
279
301
  /**
280
302
  * Refuse a `(location kind, provider)` pair the kind cannot use.
@@ -310,8 +332,7 @@ export declare class StorageOrchestratorService {
310
332
  /**
311
333
  * Remove a location. Refuses the last location of a type and the last
312
334
  * enabled location of a type. `isSystem` is informational — a frozen
313
- * recordings `:default` is deletable once a sibling is live. Deleting
314
- * the flagged default promotes an enabled sibling. Occupancy still
335
+ * recordings `:default` is deletable once a sibling is live. Occupancy still
315
336
  * refuses unless `force` is set; force never overrides uniqueness /
316
337
  * last-enabled.
317
338
  */
@@ -392,9 +413,11 @@ export declare class StorageOrchestratorService {
392
413
  * declarations on a populated map is a no-op (each declared `id`
393
414
  * already resolves to an existing `<id>:default`).
394
415
  *
395
- * Convention: the bare-type ref `'recordings'` resolves via
396
- * `getDefaultLocation('recordings')` (walks `isDefault === true`); the
397
- * actual stored `id` is `'recordings:default'` so it satisfies the
416
+ * The seeded row is born ENABLED — a fresh install must be able to write the
417
+ * moment it boots, and `enabled` is the only write switch there is (D383).
418
+ * The `:default` suffix is a NAME kept for idempotency across existing
419
+ * installs, not a flag: the stored `id` is `'recordings:default'` so it
420
+ * satisfies the
398
421
  * `^[a-z][a-z0-9-]*:[a-z0-9-]+$` regex on `StorageLocationSchema.id`.
399
422
  *
400
423
  * `basePath` is the storage root (e.g. `<CAMSTACK_DATA>`). Each
@@ -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-KQ5D2wqr.js");
6
+ const require_dist = require("../../dist-jZb-HKI5.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 { $t as hydrateSchema, Ft as errMsg, It as BaseAddon } from "../../dist-CCp74QLJ.mjs";
1
+ import { Lt as errMsg, Rt as BaseAddon, tn as hydrateSchema } from "../../dist-CiHYspij.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-KQ5D2wqr.js");
6
+ const require_dist = require("../../dist-jZb-HKI5.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 { It as BaseAddon, lt as logDestinationCapability } from "../../dist-CCp74QLJ.mjs";
1
+ import { Rt as BaseAddon, dt as logDestinationCapability } from "../../dist-CiHYspij.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";