@camstack/server 1.2.752 → 1.2.754

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 (93) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/api/trpc/generated-cap-routers.js +10 -0
  3. package/dist/core/moleculer/moleculer.service.js +13 -1
  4. package/package.json +8 -8
  5. package/system/dist/addon-utils.mjs +1 -1
  6. package/system/dist/{agent-https-Oc0Go3Gs.js → agent-https-B0bjQVfy.js} +1 -1
  7. package/system/dist/{agent-https-DoGV9jKg.mjs → agent-https-cxghRfum.mjs} +1 -1
  8. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  9. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +4 -4
  10. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  11. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +5 -5
  12. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  13. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  14. package/system/dist/builtins/autotrack/index.js +1 -1
  15. package/system/dist/builtins/autotrack/index.mjs +1 -1
  16. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  17. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +5 -5
  18. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  19. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  20. package/system/dist/builtins/camera-grid/index.js +1 -1
  21. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  22. package/system/dist/builtins/composer/composer.addon.js +18 -22
  23. package/system/dist/builtins/composer/composer.addon.mjs +17 -21
  24. package/system/dist/builtins/console-logging/index.js +1 -1
  25. package/system/dist/builtins/console-logging/index.mjs +1 -1
  26. package/system/dist/builtins/core-blocks/composition-api.d.ts +4 -1
  27. package/system/dist/builtins/core-blocks/core-blocks.addon.js +232 -15
  28. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +232 -15
  29. package/system/dist/builtins/core-blocks/running-proposal.d.ts +32 -0
  30. package/system/dist/builtins/device-history/device-history.addon.js +24 -23
  31. package/system/dist/builtins/device-history/device-history.addon.mjs +3 -2
  32. package/system/dist/builtins/device-manager/device-manager.addon.js +1 -1
  33. package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  34. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  35. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  36. package/system/dist/builtins/keychain/index.js +3 -3
  37. package/system/dist/builtins/keychain/index.mjs +3 -3
  38. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  39. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  40. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  41. package/system/dist/builtins/local-auth/local-auth.addon.mjs +5 -5
  42. package/system/dist/builtins/local-network/local-network.addon.js +2 -2
  43. package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
  44. package/system/dist/builtins/loki-logging/index.js +1 -1
  45. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  46. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  47. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +10 -10
  48. package/system/dist/builtins/platform-probe/index.js +1 -1
  49. package/system/dist/builtins/platform-probe/index.mjs +10 -10
  50. package/system/dist/builtins/record-entries/index.js +1 -1
  51. package/system/dist/builtins/record-entries/index.mjs +1 -1
  52. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  53. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  54. package/system/dist/builtins/snapshot/index.js +5 -1
  55. package/system/dist/builtins/snapshot/index.mjs +5 -1
  56. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  57. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +20 -20
  58. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  59. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  60. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +2 -2
  61. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
  62. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  63. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  64. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  65. package/system/dist/builtins/system-config/system-config.addon.mjs +285 -285
  66. package/system/dist/builtins/winston-logging/index.js +1 -1
  67. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  68. package/system/dist/{retention-C-lijsmN.mjs → capture-engine-CfJdhMTH.mjs} +2 -246
  69. package/system/dist/{retention-WjI-Op7G.js → capture-engine-eRAebXP1.js} +1 -305
  70. package/system/dist/{composition-sources-Bxahhz4f.js → composition-sources-BvDYLpw_.js} +1 -1
  71. package/system/dist/{composition-sources-CzRiSzCV.mjs → composition-sources-ChtkMq1Q.mjs} +1 -1
  72. package/system/dist/{constants-uI6uXyjP.mjs → constants-CYNsr0lM.mjs} +1 -1
  73. package/system/dist/{constants-0rC5QY6i.js → constants-DkC9-VOa.js} +1 -1
  74. package/system/dist/{coral-accelerators-DBlgWB8k.mjs → coral-accelerators-BW3OcrLD.mjs} +6 -6
  75. package/system/dist/{custom-action-registry-oHl1xltx.mjs → custom-action-registry-BIJZBObd.mjs} +37 -37
  76. package/system/dist/{device-ca-CL_Arugd.js → device-ca-BxInMpK2.js} +1 -1
  77. package/system/dist/{device-ca-D7TyMlsS.mjs → device-ca-CQg3PTnE.mjs} +1 -1
  78. package/system/dist/{dist-Iq3vrBOE.mjs → dist-C5eIFTMo.mjs} +752 -554
  79. package/system/dist/{dist-CYnRCUzN.js → dist-DFWnAzAY.js} +775 -553
  80. package/system/dist/file-host-worker.js +1 -1
  81. package/system/dist/file-host-worker.mjs +1 -1
  82. package/system/dist/{hub-mdns-ciao-CNLYSVyJ.js → hub-mdns-ciao-BQDdPkPO.js} +2 -2
  83. package/system/dist/{hub-mdns-ciao-CvMKderb.mjs → hub-mdns-ciao-DW_g42El.mjs} +2 -2
  84. package/system/dist/index.js +9 -8
  85. package/system/dist/index.mjs +220 -219
  86. package/system/dist/kernel/transport/parent-unowned-call.d.ts +10 -0
  87. package/system/dist/{restore-archive-vzWYLf6p.mjs → restore-archive-D8ZIN10X.mjs} +150 -150
  88. package/system/dist/{restore-archive-Dw04PiG5.js → restore-archive-DRjYgh6D.js} +1 -1
  89. package/system/dist/retention-B9l9TnGE.mjs +245 -0
  90. package/system/dist/retention-BNONb5X_.js +304 -0
  91. package/system/dist/{wal-maintenance-DQXiTaph.js → wal-maintenance-D0zSmIwJ.js} +0 -0
  92. package/system/dist/{wal-maintenance-BzTHorT2.mjs → wal-maintenance-xYk-FpJW.mjs} +0 -0
  93. package/system/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.2.754] - 2026-11-03
11
+
12
+ ### Changed
13
+
14
+ - Rebuilt against updated dependencies.
15
+
16
+ ## [1.2.753] - 2026-11-03
17
+
18
+ ### Changed
19
+
20
+ - The running-threshold proposal is reachable as a core-blocks query (admin, view access)
21
+
22
+ ### Fixed
23
+
24
+ - An in-process addon's call to a system-only capability method no longer routes to the camera's driver by its device id
25
+
10
26
  ## [1.2.752] - 2026-11-03
11
27
 
12
28
  ### Changed
@@ -2480,6 +2480,16 @@ function createCapRouter_coreBlocks(getProvider, createRemoteProxy) {
2480
2480
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
2481
2481
  return p.validateComposition(methodInput);
2482
2482
  }),
2483
+ proposeRunningThreshold: trpc_middleware_js_1.adminProcedure
2484
+ .input(types_40.coreBlocksCapability.methods.proposeRunningThreshold.input.loose())
2485
+ .output(types_40.coreBlocksCapability.methods.proposeRunningThreshold.output)
2486
+ .query(async ({ input, ctx }) => {
2487
+ const parsedInput = ctx.req !== undefined ? (0, types_3.withoutCallerStamp)(input) : input;
2488
+ const { nodeId, ...methodInput } = parsedInput;
2489
+ const p = resolveProvider('core-blocks', nodeId, () => getProvider(ctx), createRemoteProxy);
2490
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
2491
+ return p.proposeRunningThreshold(methodInput);
2492
+ }),
2483
2493
  reportAutomationRun: trpc_middleware_js_1.adminProcedure
2484
2494
  .input(types_40.coreBlocksCapability.methods.reportAutomationRun.input.loose())
2485
2495
  .output(types_40.coreBlocksCapability.methods.reportAutomationRun.output)
@@ -324,6 +324,9 @@ class MoleculerService {
324
324
  // handler retries the hub-local route then throws a precise error rather
325
325
  // than the unroutable broker fallback (`switch.switch.getStatus`).
326
326
  isDeviceNativeCap: (capName) => this.capabilityService.getRegistry()?.getDefinition(capName)?.deviceNative === true,
327
+ // A `systemMethod()` routes to the cap's system/wrapper provider, never
328
+ // the device-native owner its `deviceId` argument would select.
329
+ isSystemOnlyMethod: (capName, method) => this.isSystemOnlyMethod(capName, method),
327
330
  // `native: true` route — a forked WRAPPER asking for the per-device
328
331
  // native behind its own cap name (the snapshot wrapper, once it moved
329
332
  // out of hub-main). `getNativeProvider` is the single authority that
@@ -835,6 +838,11 @@ class MoleculerService {
835
838
  },
836
839
  };
837
840
  }
841
+ /** True when `(capName, method)` is declared with `systemMethod()`. */
842
+ isSystemOnlyMethod(capName, method) {
843
+ const def = this.capabilityService.getRegistry()?.getDefinition(capName);
844
+ return def?.methods[method]?.systemOnly === true;
845
+ }
838
846
  /**
839
847
  * Call a capability method on a specific node.
840
848
  *
@@ -876,7 +884,11 @@ class MoleculerService {
876
884
  // resolve through the resolver's deviceId-aware snapshot instead of falling back to
877
885
  // the legacy callFn store. The deviceId hint is a number extracted from the method args.
878
886
  const rawDeviceId = params !== null && typeof params === 'object' ? Reflect.get(params, 'deviceId') : undefined;
879
- const routeDeviceId = typeof rawDeviceId === 'number' ? rawDeviceId : undefined;
887
+ // A `systemMethod()` names its device in the args only — it routes to the
888
+ // cap's system/wrapper provider, not to the device-native owner.
889
+ const routeDeviceId = typeof rawDeviceId === 'number' && !this.isSystemOnlyMethod(capabilityName, methodName)
890
+ ? rawDeviceId
891
+ : undefined;
880
892
  try {
881
893
  const route = resolver.resolveCapRoute(capabilityName, { nodeId, deviceId: routeDeviceId });
882
894
  return await resolver.dispatch(route, methodName, params);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/server",
3
- "version": "1.2.752",
3
+ "version": "1.2.754",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -66,7 +66,7 @@
66
66
  ],
67
67
  "requires": {
68
68
  "addons": {
69
- "@camstack/addon-admin-ui": ">=1.2.569"
69
+ "@camstack/addon-admin-ui": ">=1.2.571"
70
70
  },
71
71
  "wrapper": {
72
72
  "desktop": ">=0.0.1",
@@ -75,19 +75,19 @@
75
75
  }
76
76
  },
77
77
  "dependencies": {
78
- "@camstack/addon-admin-ui": "1.2.569",
79
- "@camstack/addon-agent-ui": "1.2.319",
78
+ "@camstack/addon-admin-ui": "1.2.571",
79
+ "@camstack/addon-agent-ui": "1.2.320",
80
80
  "@camstack/addon-auth": "1.2.175",
81
81
  "@camstack/addon-benchmark": "1.2.311",
82
82
  "@camstack/addon-decoder-nodeav": "1.2.145",
83
83
  "@camstack/addon-notifiers": "1.2.628",
84
84
  "@camstack/addon-pipeline": "1.2.639",
85
- "@camstack/addon-pipeline-orchestrator": "1.2.656",
86
- "@camstack/addon-post-analysis": "1.2.666",
85
+ "@camstack/addon-pipeline-orchestrator": "1.2.657",
86
+ "@camstack/addon-post-analysis": "1.2.667",
87
87
  "@camstack/develop": "0.1.44",
88
88
  "@camstack/sdk": "1.2.155",
89
- "@camstack/types": "1.2.487",
90
- "@camstack/ui-library": "1.2.377",
89
+ "@camstack/types": "1.2.488",
90
+ "@camstack/ui-library": "1.2.378",
91
91
  "@fastify/compress": "^9.0.0",
92
92
  "@fastify/cookie": "^11.0.2",
93
93
  "@fastify/cors": "^11.2.0",
@@ -1,3 +1,3 @@
1
- import { C as isModelDownloaded, S as isModelDownloadHttpError, _ as downloadFile, a as startEventLoopStallMonitor, f as ModelDownloadService, g as deleteModelFromDisk, h as collectModelFiles, i as attributeStall, l as parseRangeHeader, m as adoptModelRevisions, n as STALL_REPORT_MS, o as createFileDataPlaneHandler, p as ModelDownloadHttpError, r as STALL_TICK_MS, s as contentTypeFor, t as CustomActionRegistry, w as resolveFormatRevision, x as getModelFilePath, y as ensureModel } from "./custom-action-registry-oHl1xltx.mjs";
1
+ import { C as isModelDownloaded, S as isModelDownloadHttpError, _ as downloadFile, a as startEventLoopStallMonitor, f as ModelDownloadService, g as deleteModelFromDisk, h as collectModelFiles, i as attributeStall, l as parseRangeHeader, m as adoptModelRevisions, n as STALL_REPORT_MS, o as createFileDataPlaneHandler, p as ModelDownloadHttpError, r as STALL_TICK_MS, s as contentTypeFor, t as CustomActionRegistry, w as resolveFormatRevision, x as getModelFilePath, y as ensureModel } from "./custom-action-registry-BIJZBObd.mjs";
2
2
  import { i as renderCourtesyOverlayJpeg, n as courtesyCacheKey, r as renderCourtesyJpeg, t as COURTESY_DEFAULT_WIDTH } from "./snapshot-courtesy-CyFs1M3I.mjs";
3
3
  export { COURTESY_DEFAULT_WIDTH, CustomActionRegistry, ModelDownloadHttpError, ModelDownloadService, STALL_REPORT_MS, STALL_TICK_MS, adoptModelRevisions, attributeStall, collectModelFiles, contentTypeFor, courtesyCacheKey, createFileDataPlaneHandler, deleteModelFromDisk, downloadFile, ensureModel, getModelFilePath, isModelDownloadHttpError, isModelDownloaded, parseRangeHeader, renderCourtesyJpeg, renderCourtesyOverlayJpeg, resolveFormatRevision, startEventLoopStallMonitor };
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_dist = require("./dist-CYnRCUzN.js");
2
+ const require_dist = require("./dist-DFWnAzAY.js");
3
3
  const require_x509_es = require("./x509.es-WtnRNyYS.js");
4
4
  let zod = require("zod");
5
5
  let node_crypto = require("node:crypto");
@@ -1,4 +1,4 @@
1
- import { hs as defineRecordKinds } from "./dist-Iq3vrBOE.mjs";
1
+ import { ys as defineRecordKinds } from "./dist-C5eIFTMo.mjs";
2
2
  import { C as backdatedNotBefore, S as withUtcTimeEncoding, _ as NameConstraints, a as KeyUsageFlags, c as Pkcs10CertificateRequest, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, g as GeneralSubtrees, h as GeneralSubtree, i as Extension, l as Pkcs10CertificateRequestGenerator, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension, u as SubjectAlternativeNameExtension, v as GeneralName, x as AsnConvert } from "./x509.es-BRiJgOvu.mjs";
3
3
  import { z } from "zod";
4
4
  import { X509Certificate, createHash, createPrivateKey, randomBytes, webcrypto } 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-CYnRCUzN.js");
6
+ const require_dist = require("../../dist-DFWnAzAY.js");
7
7
  const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
8
8
  let node_crypto = require("node:crypto");
9
9
  let node_path = require("node:path");
@@ -1,8 +1,8 @@
1
- import { bo as BaseAddon, oc as errMsg, sc as EventCategory, sn as addonPagesCapability } from "../../dist-Iq3vrBOE.mjs";
1
+ import { cn as addonPagesCapability, dc as EventCategory, uc as errMsg, wo as BaseAddon } from "../../dist-C5eIFTMo.mjs";
2
2
  import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
3
3
  import { createHash, randomUUID } from "node:crypto";
4
4
  import * as path$1 from "node:path";
5
- import * as fs$1 from "node:fs";
5
+ import * as fs from "node:fs";
6
6
  //#region src/builtins/addon-pages-aggregator/dedupe-pages.ts
7
7
  /** Stable identity for an addon page, independent of which node reported it. */
8
8
  function pageKey(info) {
@@ -211,11 +211,11 @@ var AddonPagesAggregatorAddon = class extends BaseAddon {
211
211
  const bundlePath = this.resolveBundlePath(addonId, bundle);
212
212
  if (bundlePath === null) return `/api/addon-pages/${addonId}/${bundle}?v=${Math.floor(Date.now())}`;
213
213
  try {
214
- const stat = fs$1.statSync(bundlePath);
214
+ const stat = fs.statSync(bundlePath);
215
215
  const cacheKey = `${bundlePath}:${stat.size}:${stat.mtimeMs}`;
216
216
  let v = this.bundleHashCache.get(cacheKey);
217
217
  if (v === void 0) {
218
- v = createHash("sha1").update(fs$1.readFileSync(bundlePath)).digest("hex").slice(0, 12);
218
+ v = createHash("sha1").update(fs.readFileSync(bundlePath)).digest("hex").slice(0, 12);
219
219
  this.bundleHashCache.set(cacheKey, v);
220
220
  }
221
221
  return `/api/addon-pages/${addonId}/${bundle}?v=${v}`;
@@ -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-CYnRCUzN.js");
6
+ const require_dist = require("../../dist-DFWnAzAY.js");
7
7
  const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
8
8
  let node_crypto = require("node:crypto");
9
9
  let node_path = require("node:path");
@@ -1,8 +1,8 @@
1
- import { bo as BaseAddon, ln as addonWidgetsCapability, oc as errMsg, sc as EventCategory } from "../../dist-Iq3vrBOE.mjs";
1
+ import { dc as EventCategory, uc as errMsg, un as addonWidgetsCapability, wo as BaseAddon } from "../../dist-C5eIFTMo.mjs";
2
2
  import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
3
3
  import { createHash, randomUUID } from "node:crypto";
4
4
  import * as path$1 from "node:path";
5
- import * as fs$1 from "node:fs";
5
+ import * as fs from "node:fs";
6
6
  //#region src/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.ts
7
7
  /**
8
8
  * Addon Widgets Aggregator — hub-local builtin that owns the singleton
@@ -204,9 +204,9 @@ var AddonWidgetsAggregatorAddon = class extends BaseAddon {
204
204
  if (entryPath === null) return String(Math.floor(Date.now()));
205
205
  try {
206
206
  const dir = path$1.dirname(entryPath);
207
- const files = fs$1.readdirSync(dir).filter((f) => fs$1.statSync(path$1.join(dir, f)).isFile()).sort();
207
+ const files = fs.readdirSync(dir).filter((f) => fs.statSync(path$1.join(dir, f)).isFile()).sort();
208
208
  const cacheKey = `${dir}#${files.map((f) => {
209
- const s = fs$1.statSync(path$1.join(dir, f));
209
+ const s = fs.statSync(path$1.join(dir, f));
210
210
  return `${f}:${s.size}:${s.mtimeMs}`;
211
211
  }).join("|")}`;
212
212
  const cached = this.bundleHashCache.get(cacheKey);
@@ -214,7 +214,7 @@ var AddonWidgetsAggregatorAddon = class extends BaseAddon {
214
214
  const hash = createHash("sha1");
215
215
  for (const f of files) {
216
216
  hash.update(f);
217
- hash.update(fs$1.readFileSync(path$1.join(dir, f)));
217
+ hash.update(fs.readFileSync(path$1.join(dir, f)));
218
218
  }
219
219
  const digest = hash.digest("hex").slice(0, 12);
220
220
  this.bundleHashCache.set(cacheKey, digest);
@@ -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-CYnRCUzN.js");
6
+ const require_dist = require("../../dist-DFWnAzAY.js");
7
7
  const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
8
8
  //#region src/builtins/alerts/alert-episode-policy.ts
9
9
  /**
@@ -1,4 +1,4 @@
1
- import { Nr as isAlertEpisodeOpen, Pr as isAlertEpisodeSeverity, bo as BaseAddon, d as AlertSchema, dn as alertEpisodePayload, fn as alertsCapability, hs as defineRecordKinds, oc as errMsg, sc as EventCategory, un as alertEpisodeId, us as createEvent } from "../../dist-Iq3vrBOE.mjs";
1
+ import { Fr as isAlertEpisodeSeverity, Pr as isAlertEpisodeOpen, d as AlertSchema, dc as EventCategory, dn as alertEpisodeId, fn as alertEpisodePayload, ms as createEvent, pn as alertsCapability, uc as errMsg, wo as BaseAddon, ys as defineRecordKinds } from "../../dist-C5eIFTMo.mjs";
2
2
  import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
3
3
  //#region src/builtins/alerts/alert-episode-policy.ts
4
4
  /**
@@ -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-CYnRCUzN.js");
6
+ const require_dist = require("../../dist-DFWnAzAY.js");
7
7
  //#region src/builtins/autotrack/autotrack-config.ts
8
8
  var DEFAULT_AUTOTRACK_LOOP_CONFIG = {
9
9
  deadZoneFraction: .5,
@@ -1,4 +1,4 @@
1
- import { Es as isEvent, Ii as ptzAutotrackCapability, _n as bareAddonId, bo as BaseAddon, oc as errMsg, sc as EventCategory, tt as FIRST_LEVEL_MACRO_CLASSES } from "../../dist-Iq3vrBOE.mjs";
1
+ import { As as isEvent, Ri as ptzAutotrackCapability, dc as EventCategory, tt as FIRST_LEVEL_MACRO_CLASSES, uc as errMsg, vn as bareAddonId, wo as BaseAddon } from "../../dist-C5eIFTMo.mjs";
2
2
  //#region src/builtins/autotrack/autotrack-config.ts
3
3
  var DEFAULT_AUTOTRACK_LOOP_CONFIG = {
4
4
  deadZoneFraction: .5,
@@ -3,9 +3,9 @@ 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-CYnRCUzN.js");
6
+ const require_dist = require("../../dist-DFWnAzAY.js");
7
7
  const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
8
- const require_restore_archive = require("../../restore-archive-Dw04PiG5.js");
8
+ const require_restore_archive = require("../../restore-archive-DRjYgh6D.js");
9
9
  let node_crypto = require("node:crypto");
10
10
  let node_fs_promises = require("node:fs/promises");
11
11
  node_fs_promises = require_chunk.__toESM(node_fs_promises);
@@ -1,10 +1,10 @@
1
- import { Ls as nodePin, Qs as toNodeId, ba as storageOccupancyCapability, bo as BaseAddon, gn as backupCapability, oi as mayWriteToLocation, sc as EventCategory } from "../../dist-Iq3vrBOE.mjs";
1
+ import { Sa as storageOccupancyCapability, Vs as nodePin, _n as backupCapability, dc as EventCategory, nc as toNodeId, si as mayWriteToLocation, wo as BaseAddon } from "../../dist-C5eIFTMo.mjs";
2
2
  import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
3
- import { _ as backupRecordStoresOf, a as BackupSnapshotRefusedError, d as ENCRYPTED_BACKUP_SUFFIX, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, i as BackupCancelledError, l as BackupKeyFormatError, m as parseBackupSecretKey, n as precheckRestoreKey, o as DEFAULT_BACKUP_DATABASES, p as parseBackupPublicKey, r as prepareRestoreArchive, s as SystemBackupService } from "../../restore-archive-vzWYLf6p.mjs";
3
+ import { _ as backupRecordStoresOf, a as BackupSnapshotRefusedError, d as ENCRYPTED_BACKUP_SUFFIX, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, i as BackupCancelledError, l as BackupKeyFormatError, m as parseBackupSecretKey, n as precheckRestoreKey, o as DEFAULT_BACKUP_DATABASES, p as parseBackupPublicKey, r as prepareRestoreArchive, s as SystemBackupService } from "../../restore-archive-D8ZIN10X.mjs";
4
4
  import { randomUUID } from "node:crypto";
5
5
  import * as fsp from "node:fs/promises";
6
6
  import * as path$1 from "node:path";
7
- import * as fs$1 from "node:fs";
7
+ import * as fs from "node:fs";
8
8
  //#region src/builtins/backup-orchestrator/backup-databases.ts
9
9
  /** Stable id of the seeded weekly schedule. */
10
10
  var WEEKLY_SCHEDULE_ID = "weekly-events-history";
@@ -1018,7 +1018,7 @@ async function downloadArchiveToCache(input) {
1018
1018
  location: input.locationId,
1019
1019
  relativePath: input.filename
1020
1020
  });
1021
- const writeStream = fs$1.createWriteStream(input.cachePath);
1021
+ const writeStream = fs.createWriteStream(input.cachePath);
1022
1022
  let offset = 0;
1023
1023
  try {
1024
1024
  while (offset < sizeBytes) {
@@ -2502,7 +2502,7 @@ var BackupOrchestratorAddon = class extends BaseAddon {
2502
2502
  });
2503
2503
  try {
2504
2504
  let offset = 0;
2505
- const stream = fs$1.createReadStream(input.cachePath, { highWaterMark: UPLOAD_CHUNK_BYTES });
2505
+ const stream = fs.createReadStream(input.cachePath, { highWaterMark: UPLOAD_CHUNK_BYTES });
2506
2506
  for await (const rawChunk of stream) {
2507
2507
  if (input.signal?.aborted) {
2508
2508
  stream.destroy();
@@ -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-CYnRCUzN.js");
6
+ const require_dist = require("../../dist-DFWnAzAY.js");
7
7
  const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
8
8
  let zod = require("zod");
9
9
  //#region src/builtins/calendars/calendar-color.ts
@@ -1,4 +1,4 @@
1
- import { T as CalendarPreferencesSchema, Tn as calendarsCapability, bo as BaseAddon, hs as defineRecordKinds } from "../../dist-Iq3vrBOE.mjs";
1
+ import { En as calendarsCapability, T as CalendarPreferencesSchema, wo as BaseAddon, ys as defineRecordKinds } from "../../dist-C5eIFTMo.mjs";
2
2
  import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
3
3
  import { z } from "zod";
4
4
  //#region src/builtins/calendars/calendar-color.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-CYnRCUzN.js");
6
+ const require_dist = require("../../dist-DFWnAzAY.js");
7
7
  let zod = require("zod");
8
8
  let _camstack_types_node = require("@camstack/types/node");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { Cs as hydrateSchema, En as cameraGridLayoutCapability, K as DeclaredDevices, L as DERIVED_CAMERA_SILENCED_CAP_NAMES, Sa as streamCatalogCapability, St as MOTION_CLOSE_AFTER_MS, Xa as buildFfmpegArgs, Xn as declarationOwnerNodeId, _n as bareAddonId, ac as DeviceType, bo as BaseAddon, ha as snapshotCapability, li as memoizePinnedFfmpeg, m as BaseDevice, mi as motionCapability, oc as errMsg, rc as DeviceFeature, sc as EventCategory, us as createEvent } from "../../dist-Iq3vrBOE.mjs";
1
+ import { $a as buildFfmpegArgs, Dn as cameraGridLayoutCapability, Ds as hydrateSchema, K as DeclaredDevices, L as DERIVED_CAMERA_SILENCED_CAP_NAMES, St as MOTION_CLOSE_AFTER_MS, Zn as declarationOwnerNodeId, _a as snapshotCapability, dc as EventCategory, hi as motionCapability, lc as DeviceType, m as BaseDevice, ms as createEvent, sc as DeviceFeature, uc as errMsg, ui as memoizePinnedFfmpeg, vn as bareAddonId, wa as streamCatalogCapability, wo as BaseAddon } from "../../dist-C5eIFTMo.mjs";
2
2
  import { z } from "zod";
3
3
  import { FfmpegProcess } from "@camstack/types/node";
4
4
  import { join } from "node:path";
@@ -3,9 +3,10 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CYnRCUzN.js");
7
- const require_composition_sources = require("../../composition-sources-Bxahhz4f.js");
8
- const require_retention = require("../../retention-WjI-Op7G.js");
6
+ const require_dist = require("../../dist-DFWnAzAY.js");
7
+ const require_composition_sources = require("../../composition-sources-BvDYLpw_.js");
8
+ const require_capture_engine = require("../../capture-engine-eRAebXP1.js");
9
+ const require_retention = require("../../retention-BNONb5X_.js");
9
10
  let zod = require("zod");
10
11
  //#region src/builtins/composer/actuator-invoke.ts
11
12
  /**
@@ -3719,7 +3720,7 @@ var HistoryHelpers = class {
3719
3720
  try {
3720
3721
  result = await this.ports.query({
3721
3722
  deviceId,
3722
- key: require_retention.capSeriesKey(helper.source.cap, helper.source.fieldPath),
3723
+ key: require_capture_engine.capSeriesKey(helper.source.cap, helper.source.fieldPath),
3723
3724
  from: range.from,
3724
3725
  to: range.to,
3725
3726
  resolution: tierPlan.tier,
@@ -3984,7 +3985,7 @@ function mergePulseDecisions(decisions) {
3984
3985
  */
3985
3986
  var ROSE_CALL = String.raw`rose\(\s*([A-Za-z_][A-Za-z0-9_]*)\s*,\s*([A-Za-z_][A-Za-z0-9_]*)`;
3986
3987
  function historySeriesKey(cap, fieldPath) {
3987
- return require_retention.capSeriesKey(cap, fieldPath);
3988
+ return require_capture_engine.capSeriesKey(cap, fieldPath);
3988
3989
  }
3989
3990
  async function resolvePulseSeeds(input) {
3990
3991
  try {
@@ -4691,6 +4692,17 @@ var Composer = class {
4691
4692
  });
4692
4693
  continue;
4693
4694
  }
4695
+ if (targetSeed === void 0 && p.target.kind === "new" && device !== null && p.block.enabled && p.fields.length > 0) try {
4696
+ targetSeed = await readExistingTargetSeeds(device.id, p.fields.map((field) => field.cap), this.deps.readExistingTargetCap);
4697
+ } catch (err) {
4698
+ this.deps.logger.warn("composed device slice could not be read — the runtime starts without a restored seed", {
4699
+ tags: { deviceId: device.id },
4700
+ meta: {
4701
+ blockId: p.block.id,
4702
+ error: require_dist.errMsg(err)
4703
+ }
4704
+ });
4705
+ }
4694
4706
  const heldFields = this.heldFieldsFor(p, previous);
4695
4707
  if (previous === void 0 || restart.has(p.block.id) || previous.planned.block.updatedAt !== p.block.updatedAt) for (const key of operatorResetKeys(p)) reset.add(key);
4696
4708
  const writer = writerFor(this.deps, p, device, (deviceId, cap, owner, event) => {
@@ -6053,7 +6065,7 @@ var ComposerAddon = class extends require_dist.BaseAddon {
6053
6065
  maxPoints: input.maxPoints
6054
6066
  }),
6055
6067
  readHistoryRetention: async () => {
6056
- return historyRetentionOf(await api.addonSettingsRaw.getGlobal.query({ addonId: "device-history" }));
6068
+ return require_dist.historyRetentionFromSettings(await api.addonSettingsRaw.getGlobal.query({ addonId: "device-history" }));
6057
6069
  },
6058
6070
  readSourceQuantity: async (deviceId) => {
6059
6071
  const quantity = (await api.deviceManager.getDevice.query({ deviceId }))?.sourceInfo?.quantity;
@@ -6272,22 +6284,6 @@ var ComposerAddon = class extends require_dist.BaseAddon {
6272
6284
  return this.composer;
6273
6285
  }
6274
6286
  };
6275
- /** `dayDays` of 0 keeps the daily tier forever (device-history). A missing number is the default. */
6276
- function historyRetentionOf(raw) {
6277
- return {
6278
- rawMs: positiveDays(raw["rawDays"], require_dist.DEFAULT_HISTORY_RETENTION.rawMs),
6279
- fiveMinuteMs: positiveDays(raw["fiveMinuteDays"], require_dist.DEFAULT_HISTORY_RETENTION.fiveMinuteMs),
6280
- hourMs: positiveDays(raw["hourDays"], require_dist.DEFAULT_HISTORY_RETENTION.hourMs),
6281
- dayMs: positiveDaysOrForever(raw["dayDays"])
6282
- };
6283
- }
6284
- function positiveDays(value, fallbackMs) {
6285
- return typeof value === "number" && Number.isFinite(value) && value > 0 ? value * require_dist.DAY_MS : fallbackMs;
6286
- }
6287
- function positiveDaysOrForever(value) {
6288
- if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return null;
6289
- return value * require_dist.DAY_MS;
6290
- }
6291
6287
  //#endregion
6292
6288
  exports.ComposerAddon = ComposerAddon;
6293
6289
  exports.default = ComposerAddon;
@@ -1,6 +1,7 @@
1
- import { $a as composedDeviceStableId, Ei as parseColorInput, Ga as DEFAULT_HISTORY_RETENTION, Gr as kebabToCamel, Ha as COMPOSER_ADDON_ID, In as composerCapability, Ja as HOUR_MS, K as DeclaredDevices, Ka as HISTORY_FAST_MS, Ln as compositionFieldKey, Mn as climateControlCapability, Or as groupCommandsCapability, Os as isReadingQuantity, Pa as valveCapability, Pn as colorCapability, Qa as composedDeviceRef, Sr as featureForwards, Ta as switchCapability, Wa as DAY_MS, Wn as coverCapability, Ya as MINUTE_MS, Za as cloneStatefulExpressionMemory, Zi as resolveMutate, Zn as declaredSeriesKind, _o as statisticCadenceMs, _r as expressionContainsBuiltinCall, ac as DeviceType, ao as disarmRoseMemory, b as COMPOSED_ITEM_FIXED_FIELDS, bo as BaseAddon, br as fanOutTargets, ci as mediaPlayerFeaturesOfRoles, da as sharedColorModes, do as isHistoryHelper, ei as lockControlCapability, eo as compositionFeatureEnabled, fo as nextLocalMidnight, ft as HvacModeSchema, go as planStatisticTier, ho as planResetTier, io as createStatefulExpressionMemory, ki as planComposition, kr as groupTemplate, la as sharedActuatorFeatures, lo as integrateReading, m as BaseDevice, mi as motionCapability, mo as openStatistic, n as ACTUATOR_METHODS, no as compositionSliceKey, o as ALL_CAPABILITY_DEFINITIONS, oc as errMsg, oo as evaluateDerivative, po as openReset, pr as evaluateCompositionField, qa as HISTORY_SLOW_MS, r as ACTUATOR_TEMPLATE_IDS, ro as compositionSourceKey, rt as FanDirectionSchema, sc as EventCategory, si as mediaPlayerCapability, so as evaluateStatistic, st as GroupCommandResultSchema, ta as runFanOut, to as compositionItemFieldPath, ua as sharedActuatorMethods, ui as methodRefusal, uo as isForwardInputRef, us as createEvent, vo as toExpressionValue, xn as buildCapabilityLookup, yn as brightnessCapability, yr as fanControlCapability } from "../../dist-Iq3vrBOE.mjs";
2
- import { i as parseDeviceStateChanged, n as normalizedNativeOwner, r as isRecord$4 } from "../../composition-sources-CzRiSzCV.mjs";
3
- import { i as DAY_MS$1, m as capSeriesKey, t as DEFAULT_RETENTION } from "../../retention-C-lijsmN.mjs";
1
+ import { $i as resolveMutate, Ai as planComposition, Ar as groupTemplate, Cr as featureForwards, Da as switchCapability, Di as parseColorInput, Fn as colorCapability, Gn as coverCapability, Ia as valveCapability, Ja as HISTORY_FAST_MS, K as DeclaredDevices, Kr as kebabToCamel, Ln as composerCapability, Ms as isReadingQuantity, Nn as climateControlCapability, Qa as MINUTE_MS, Qn as declaredSeriesKind, Rn as compositionFieldKey, Sn as buildCapabilityLookup, So as toExpressionValue, Wa as COMPOSER_ADDON_ID, Xa as HOUR_MS, Ya as HISTORY_SLOW_MS, _o as openReset, ao as compositionSliceKey, b as COMPOSED_ITEM_FIXED_FIELDS, bn as brightnessCapability, bo as planStatisticTier, br as fanControlCapability, ci as mediaPlayerCapability, co as disarmRoseMemory, da as sharedActuatorFeatures, dc as EventCategory, di as methodRefusal, eo as cloneStatefulExpressionMemory, fa as sharedActuatorMethods, fo as historyRetentionFromSettings, ft as HvacModeSchema, go as nextLocalMidnight, hi as motionCapability, ho as isHistoryHelper, io as compositionItemFieldPath, kr as groupCommandsCapability, lc as DeviceType, li as mediaPlayerFeaturesOfRoles, lo as evaluateDerivative, m as BaseDevice, mo as isForwardInputRef, mr as evaluateCompositionField, ms as createEvent, n as ACTUATOR_METHODS, no as composedDeviceStableId, o as ALL_CAPABILITY_DEFINITIONS, oo as compositionSourceKey, pa as sharedColorModes, po as integrateReading, qa as DEFAULT_HISTORY_RETENTION, r as ACTUATOR_TEMPLATE_IDS, ra as runFanOut, ro as compositionFeatureEnabled, rt as FanDirectionSchema, so as createStatefulExpressionMemory, st as GroupCommandResultSchema, ti as lockControlCapability, to as composedDeviceRef, uc as errMsg, uo as evaluateStatistic, vo as openStatistic, vr as expressionContainsBuiltinCall, wo as BaseAddon, xo as statisticCadenceMs, xr as fanOutTargets, yo as planResetTier } from "../../dist-C5eIFTMo.mjs";
2
+ import { i as parseDeviceStateChanged, n as normalizedNativeOwner, r as isRecord$4 } from "../../composition-sources-ChtkMq1Q.mjs";
3
+ import { i as capSeriesKey } from "../../capture-engine-CfJdhMTH.mjs";
4
+ import { i as DAY_MS, t as DEFAULT_RETENTION } from "../../retention-B9l9TnGE.mjs";
4
5
  import { z } from "zod";
5
6
  //#region src/builtins/composer/actuator-invoke.ts
6
7
  /**
@@ -4069,7 +4070,7 @@ async function decidePair(input, pair, owned, nativeStamp) {
4069
4070
  async function historyOf(input, deviceId, pair) {
4070
4071
  if (!recordsField(input.lookupCap, pair.cap, pair.activeField)) return { kind: "absent" };
4071
4072
  const now = input.now();
4072
- const fromMs = now - DEFAULT_RETENTION.rawDays * DAY_MS$1;
4073
+ const fromMs = now - DEFAULT_RETENTION.rawDays * DAY_MS;
4073
4074
  try {
4074
4075
  const answer = await input.readPulseHistory(deviceId, pair.cap, pair.activeField, fromMs, now);
4075
4076
  if (answer.kind === "unread") return { kind: "unread" };
@@ -4686,6 +4687,17 @@ var Composer = class {
4686
4687
  });
4687
4688
  continue;
4688
4689
  }
4690
+ if (targetSeed === void 0 && p.target.kind === "new" && device !== null && p.block.enabled && p.fields.length > 0) try {
4691
+ targetSeed = await readExistingTargetSeeds(device.id, p.fields.map((field) => field.cap), this.deps.readExistingTargetCap);
4692
+ } catch (err) {
4693
+ this.deps.logger.warn("composed device slice could not be read — the runtime starts without a restored seed", {
4694
+ tags: { deviceId: device.id },
4695
+ meta: {
4696
+ blockId: p.block.id,
4697
+ error: errMsg(err)
4698
+ }
4699
+ });
4700
+ }
4689
4701
  const heldFields = this.heldFieldsFor(p, previous);
4690
4702
  if (previous === void 0 || restart.has(p.block.id) || previous.planned.block.updatedAt !== p.block.updatedAt) for (const key of operatorResetKeys(p)) reset.add(key);
4691
4703
  const writer = writerFor(this.deps, p, device, (deviceId, cap, owner, event) => {
@@ -6048,7 +6060,7 @@ var ComposerAddon = class extends BaseAddon {
6048
6060
  maxPoints: input.maxPoints
6049
6061
  }),
6050
6062
  readHistoryRetention: async () => {
6051
- return historyRetentionOf(await api.addonSettingsRaw.getGlobal.query({ addonId: "device-history" }));
6063
+ return historyRetentionFromSettings(await api.addonSettingsRaw.getGlobal.query({ addonId: "device-history" }));
6052
6064
  },
6053
6065
  readSourceQuantity: async (deviceId) => {
6054
6066
  const quantity = (await api.deviceManager.getDevice.query({ deviceId }))?.sourceInfo?.quantity;
@@ -6267,21 +6279,5 @@ var ComposerAddon = class extends BaseAddon {
6267
6279
  return this.composer;
6268
6280
  }
6269
6281
  };
6270
- /** `dayDays` of 0 keeps the daily tier forever (device-history). A missing number is the default. */
6271
- function historyRetentionOf(raw) {
6272
- return {
6273
- rawMs: positiveDays(raw["rawDays"], DEFAULT_HISTORY_RETENTION.rawMs),
6274
- fiveMinuteMs: positiveDays(raw["fiveMinuteDays"], DEFAULT_HISTORY_RETENTION.fiveMinuteMs),
6275
- hourMs: positiveDays(raw["hourDays"], DEFAULT_HISTORY_RETENTION.hourMs),
6276
- dayMs: positiveDaysOrForever(raw["dayDays"])
6277
- };
6278
- }
6279
- function positiveDays(value, fallbackMs) {
6280
- return typeof value === "number" && Number.isFinite(value) && value > 0 ? value * DAY_MS : fallbackMs;
6281
- }
6282
- function positiveDaysOrForever(value) {
6283
- if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return null;
6284
- return value * DAY_MS;
6285
- }
6286
6282
  //#endregion
6287
6283
  export { ComposerAddon, ComposerAddon as default };
@@ -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-CYnRCUzN.js");
6
+ const require_dist = require("../../dist-DFWnAzAY.js");
7
7
  const require_formatter = require("../../formatter-xbxeV4GD.js");
8
8
  //#region src/builtins/console-logging/console-destination.ts
9
9
  var LEVEL_RANK = {
@@ -1,4 +1,4 @@
1
- import { bo as BaseAddon, ni as logDestinationCapability } from "../../dist-Iq3vrBOE.mjs";
1
+ import { ri as logDestinationCapability, wo as BaseAddon } from "../../dist-C5eIFTMo.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-DkYZ4LXp.mjs";
3
3
  //#region src/builtins/console-logging/console-destination.ts
4
4
  var LEVEL_RANK = {
@@ -15,6 +15,7 @@
15
15
  import { type CapabilityDefinition, type CapabilityLookup, type CompositionBlockPatch, type CompositionBlockState, type CompositionSourceRef, type CoreBlock, type ICoreBlocksProvider, type IScopedLogger, type UnreleasedClaim } from "@camstack/types";
16
16
  import type { NamedCompositionInput } from "./core-block-store.js";
17
17
  import type { CompositionDescriptions } from "./composition-sources.js";
18
+ import { type RunningProposalPorts } from "./running-proposal.js";
18
19
  export interface CompositionStoreView {
19
20
  /** False until the table has been READ; a verdict against an empty peer set would hide a cycle. */
20
21
  isLoaded(): boolean;
@@ -36,11 +37,13 @@ export interface CompositionApiDeps {
36
37
  * and is in the list.
37
38
  */
38
39
  readonly convergeForClaims: () => Promise<readonly UnreleasedClaim[]>;
40
+ /** The history reads behind `proposeRunningThreshold`. */
41
+ readonly runningProposal: RunningProposalPorts;
39
42
  readonly logger: IScopedLogger;
40
43
  /** Every capability definition — the listing is derived from them, never from the registry's live state. */
41
44
  readonly capabilityDefinitions: readonly CapabilityDefinition[];
42
45
  }
43
- export type CompositionApi = Pick<ICoreBlocksProvider, "createComposition" | "updateComposition" | "getComposition" | "listCompositions" | "validateComposition" | "getCustomization" | "listComposableCaps">;
46
+ export type CompositionApi = Pick<ICoreBlocksProvider, "createComposition" | "updateComposition" | "getComposition" | "listCompositions" | "validateComposition" | "getCustomization" | "listComposableCaps" | "proposeRunningThreshold">;
44
47
  /**
45
48
  * Every write runs validate-then-persist on ONE chain. Validation awaits a
46
49
  * source read before the save lands; two unserialized saves (A reads B, B