@camstack/server 1.2.928 → 1.2.930

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 (241) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.json +10 -10
  3. package/system/dist/addon-id-CVg1_r5E.mjs +39 -0
  4. package/system/dist/addon-id-Di0lNJ89.js +50 -0
  5. package/system/dist/addon-pages.cap-Df9FQwN1.js +49 -0
  6. package/system/dist/addon-pages.cap-DksUlE8j.mjs +44 -0
  7. package/system/dist/addon-settings.cap-3-TIIMq_.mjs +592 -0
  8. package/system/dist/addon-settings.cap-DAiE0Nb0.js +651 -0
  9. package/system/dist/addon-utils.mjs +1 -1
  10. package/system/dist/addon-widgets.cap-C4jxflbF.js +200 -0
  11. package/system/dist/addon-widgets.cap-D9m48X78.mjs +183 -0
  12. package/system/dist/base-addon-DD5dIfcZ.js +4624 -0
  13. package/system/dist/base-addon-Md14i7pe.mjs +4505 -0
  14. package/system/dist/base-device-2sL1DMm1.js +1103 -0
  15. package/system/dist/base-device-IuM1AwXZ.mjs +1098 -0
  16. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +8 -6
  17. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +6 -4
  18. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +8 -6
  19. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +7 -5
  20. package/system/dist/builtins/alerts/alerts.addon.js +113 -56
  21. package/system/dist/builtins/alerts/alerts.addon.mjs +60 -3
  22. package/system/dist/builtins/autotrack/index.js +21 -17
  23. package/system/dist/builtins/autotrack/index.mjs +5 -1
  24. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +14 -11
  25. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +8 -5
  26. package/system/dist/builtins/calendars/calendars.addon.js +8 -6
  27. package/system/dist/builtins/calendars/calendars.addon.mjs +3 -1
  28. package/system/dist/builtins/camera-grid/index.js +615 -58
  29. package/system/dist/builtins/camera-grid/index.mjs +558 -1
  30. package/system/dist/builtins/composer/composer.addon.js +788 -209
  31. package/system/dist/builtins/composer/composer.addon.mjs +583 -4
  32. package/system/dist/builtins/console-logging/index.js +4 -3
  33. package/system/dist/builtins/console-logging/index.mjs +2 -1
  34. package/system/dist/builtins/core-blocks/actions-service.d.ts +18 -1
  35. package/system/dist/builtins/core-blocks/core-blocks.addon.js +8670 -386
  36. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +8294 -11
  37. package/system/dist/builtins/core-blocks/tcp-connect.d.ts +3 -0
  38. package/system/dist/builtins/core-notifier/core-notifier.addon.js +250 -21
  39. package/system/dist/builtins/core-notifier/core-notifier.addon.mjs +230 -1
  40. package/system/dist/builtins/device-history/device-history.addon.js +110 -31
  41. package/system/dist/builtins/device-history/device-history.addon.mjs +81 -2
  42. package/system/dist/builtins/device-manager/device-manager.addon.js +12806 -227
  43. package/system/dist/builtins/device-manager/device-manager.addon.mjs +12583 -5
  44. package/system/dist/builtins/hub-forwarder/index.js +4 -3
  45. package/system/dist/builtins/hub-forwarder/index.mjs +2 -1
  46. package/system/dist/builtins/keychain/index.js +31 -28
  47. package/system/dist/builtins/keychain/index.mjs +7 -4
  48. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +15 -12
  49. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +4 -1
  50. package/system/dist/builtins/local-auth/local-auth.addon.js +140 -39
  51. package/system/dist/builtins/local-auth/local-auth.addon.mjs +106 -6
  52. package/system/dist/builtins/local-network/local-network.addon.js +43 -39
  53. package/system/dist/builtins/local-network/local-network.addon.mjs +7 -3
  54. package/system/dist/builtins/loki-logging/index.js +23 -17
  55. package/system/dist/builtins/loki-logging/index.mjs +7 -1
  56. package/system/dist/builtins/native-metrics/native-metrics.addon.js +156 -15
  57. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +151 -10
  58. package/system/dist/builtins/platform-probe/index.js +25 -23
  59. package/system/dist/builtins/platform-probe/index.mjs +12 -10
  60. package/system/dist/builtins/record-entries/index.js +9 -7
  61. package/system/dist/builtins/record-entries/index.mjs +3 -1
  62. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +4 -4
  63. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  64. package/system/dist/builtins/snapshot/index.js +97 -44
  65. package/system/dist/builtins/snapshot/index.mjs +54 -1
  66. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +5 -4
  67. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +21 -20
  68. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  69. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  70. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +87 -61
  71. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +29 -3
  72. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +81 -72
  73. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +10 -1
  74. package/system/dist/builtins/system-config/system-config.addon.js +17 -14
  75. package/system/dist/builtins/system-config/system-config.addon.mjs +118 -115
  76. package/system/dist/builtins/winston-logging/index.js +7 -5
  77. package/system/dist/builtins/winston-logging/index.mjs +3 -1
  78. package/system/dist/calendars.cap-CaFlShS9.js +155 -0
  79. package/system/dist/calendars.cap-_C4eD4fi.mjs +138 -0
  80. package/system/dist/camstack-error-DJ-TUAi1.js +23 -0
  81. package/system/dist/camstack-error-viZYfcj9.mjs +18 -0
  82. package/system/dist/cap-call-context-Bd76CbOW.js +95 -0
  83. package/system/dist/cap-call-context-DNwdgGSQ.mjs +78 -0
  84. package/system/dist/capability-definition-C2rJdVeX.mjs +177 -0
  85. package/system/dist/capability-definition-HCmTem8c.js +242 -0
  86. package/system/dist/{capture-engine-BcuwOSXv.js → capture-engine-DZ0LIUqA.js} +5 -4
  87. package/system/dist/{capture-engine-Bz7eXFjT.mjs → capture-engine-DiwbjoWp.mjs} +2 -1
  88. package/system/dist/command-origin-claim-Cief660O.js +35 -0
  89. package/system/dist/command-origin-claim-D1Wy7Qld.mjs +24 -0
  90. package/system/dist/composition-sources-BEUWn2s_.mjs +391 -0
  91. package/system/dist/composition-sources-acfR4hDq.js +408 -0
  92. package/system/dist/{constants-D2etJ02O.js → constants-Ba3FTIHl.js} +1 -1
  93. package/system/dist/constants-C860Y6U4.js +26 -0
  94. package/system/dist/{constants-BcUTQd1M.mjs → constants-DB4piTD5.mjs} +1 -1
  95. package/system/dist/constants-DCLpoF4L.mjs +21 -0
  96. package/system/dist/coral-accelerators-7o8hqvcN.js +564 -0
  97. package/system/dist/coral-accelerators-BKcXP59c.mjs +521 -0
  98. package/system/dist/core-blocks.cap-BMeMCBrx.js +18733 -0
  99. package/system/dist/core-blocks.cap-BRPsLAij.mjs +18008 -0
  100. package/system/dist/{custom-action-registry-N7flBDwT.mjs → custom-action-registry-B9zFBNVa.mjs} +37 -37
  101. package/system/dist/custom-actions-BFUSalC9.mjs +25 -0
  102. package/system/dist/custom-actions-D92NRi2c.js +36 -0
  103. package/system/dist/database-snapshot.cap-DF38e-0P.js +162 -0
  104. package/system/dist/database-snapshot.cap-dhrc9xnY.mjs +133 -0
  105. package/system/dist/declared-device-BWphj9WE.js +303 -0
  106. package/system/dist/declared-device-CKERA1Hi.mjs +286 -0
  107. package/system/dist/{device-ca-ExMN3xW3.mjs → device-ca-BLM6fccc.mjs} +2 -1
  108. package/system/dist/{device-ca-CU8zh9Pi.js → device-ca-C5kJE6mL.js} +7 -6
  109. package/system/dist/device-certificate-Cddm4Idn.mjs +91 -0
  110. package/system/dist/device-certificate-CguVACQO.js +162 -0
  111. package/system/dist/device-identifiers-BQg9EQi1.js +600 -0
  112. package/system/dist/device-identifiers-iSuQCKmK.mjs +529 -0
  113. package/system/dist/device-kind-BJ2pfsjw.mjs +78 -0
  114. package/system/dist/device-kind-CsSiv_YF.js +101 -0
  115. package/system/dist/device-manager.cap-2abwVLCM.js +2874 -0
  116. package/system/dist/device-manager.cap-CFZSPfUh.mjs +2749 -0
  117. package/system/dist/device-provider.cap-3Uvk6f5-.mjs +331 -0
  118. package/system/dist/device-provider.cap-D7TV2kVH.js +366 -0
  119. package/system/dist/{device-row-store-CeW_GWh9.mjs → device-row-store-YF3jtmkk.mjs} +4 -1
  120. package/system/dist/{device-row-store-BMIR-n3m.js → device-row-store-doTfMOqn.js} +12 -9
  121. package/system/dist/device-transitions.cap-B5w5PYU_.js +860 -0
  122. package/system/dist/device-transitions.cap-DojcwEuX.mjs +819 -0
  123. package/system/dist/device-type-CbQsnFdC.js +477 -0
  124. package/system/dist/device-type-DgEvK3ch.mjs +454 -0
  125. package/system/dist/entry-kind-D9MuVJCK.mjs +44 -0
  126. package/system/dist/entry-kind-cq90c--V.js +55 -0
  127. package/system/dist/error.cap-CSM_SRfR.mjs +3423 -0
  128. package/system/dist/error.cap-DBhgPeWK.js +3848 -0
  129. package/system/dist/file-host-worker.js +1 -1
  130. package/system/dist/file-host-worker.mjs +1 -1
  131. package/system/dist/history-catalog-BKRarIL_.js +831 -0
  132. package/system/dist/history-catalog-BwTeQ4Mr.mjs +802 -0
  133. package/system/dist/{hub-identity-Csxx2Q8k.js → hub-identity-BMdR3Mw9.js} +2 -2
  134. package/system/dist/{hub-identity-CYC1820R.mjs → hub-identity-DjMN9Ac2.mjs} +10 -10
  135. package/system/dist/{hub-mdns-ciao-By5577HM.js → hub-mdns-ciao--0v1TKME.js} +5 -5
  136. package/system/dist/{hub-mdns-ciao-CCDxM5qz.mjs → hub-mdns-ciao-DBrtHOcc.mjs} +2 -2
  137. package/system/dist/index.js +763 -151
  138. package/system/dist/index.mjs +832 -220
  139. package/system/dist/integration-instances.cap-Cl9O-k4h.mjs +538 -0
  140. package/system/dist/integration-instances.cap-dJIxg2_s.js +549 -0
  141. package/system/dist/keychain-admin.cap-Db_oFX4H.js +425 -0
  142. package/system/dist/keychain-admin.cap-GtM7gVGG.mjs +396 -0
  143. package/system/dist/l10n-Bu6aUvSY.mjs +10 -0
  144. package/system/dist/l10n-CGMvp7NF.js +15 -0
  145. package/system/dist/labels-DX5S8deC.js +81 -0
  146. package/system/dist/labels-DsBcU7md.mjs +64 -0
  147. package/system/dist/{legacy-integration-rows-door-CVwOo5aq.js → legacy-integration-rows-door-B1nzxxr5.js} +2 -2
  148. package/system/dist/{legacy-integration-rows-door-D9tQOUzh.mjs → legacy-integration-rows-door-nTvo_6jQ.mjs} +1 -1
  149. package/system/dist/log-destination.cap-CxZzAVaR.mjs +143 -0
  150. package/system/dist/log-destination.cap-DELPJkZ0.js +148 -0
  151. package/system/dist/low-power-sleep.cap-7lfVU41N.js +103 -0
  152. package/system/dist/low-power-sleep.cap-tGPmaZ_V.mjs +92 -0
  153. package/system/dist/mask-shape-Ci8Co9w0.mjs +57 -0
  154. package/system/dist/mask-shape-CmPA2fst.js +92 -0
  155. package/system/dist/metrics-provider.cap-BNmcHDkQ.mjs +405 -0
  156. package/system/dist/metrics-provider.cap-BcmQUt6l.js +410 -0
  157. package/system/dist/migration-BMjgkyG2.js +380 -0
  158. package/system/dist/migration-DRJAtdy7.mjs +321 -0
  159. package/system/dist/network-access.cap-B5TWLDCC.js +1099 -0
  160. package/system/dist/network-access.cap-BJnGbE6n.mjs +1004 -0
  161. package/system/dist/notification-rules.cap-BDh0LDhV.js +3428 -0
  162. package/system/dist/notification-rules.cap-DUmiMBQB.mjs +3357 -0
  163. package/system/dist/notification-targets-CRH-9Dy5.js +509 -0
  164. package/system/dist/notification-targets-DaNE-pIt.mjs +486 -0
  165. package/system/dist/ops-log-CB4pIdqi.mjs +64 -0
  166. package/system/dist/ops-log-pxt9176Z.js +81 -0
  167. package/system/dist/pinned-binary-BOhOSNff.js +28 -0
  168. package/system/dist/pinned-binary-CrIRAi4G.mjs +23 -0
  169. package/system/dist/platform-probe.cap-1WrMhWHx.js +250 -0
  170. package/system/dist/platform-probe.cap-BFeqFLtQ.mjs +233 -0
  171. package/system/dist/prefix-walk-BkMxoXpL.js +843 -0
  172. package/system/dist/prefix-walk-ifwg_ukx.mjs +790 -0
  173. package/system/dist/ptz-autotrack.cap-BW7w0zHD.js +229 -0
  174. package/system/dist/ptz-autotrack.cap-DT2GypXw.mjs +224 -0
  175. package/system/dist/quantity-D3g5SxsZ.mjs +114 -0
  176. package/system/dist/quantity-lY1KiTSZ.js +143 -0
  177. package/system/dist/raw-secret-migration-DxuBFtvi.js +50 -0
  178. package/system/dist/raw-secret-migration-iv88mLoc.mjs +39 -0
  179. package/system/dist/record-entries.cap-sMUhTvTU.mjs +75 -0
  180. package/system/dist/record-entries.cap-ti1C046R.js +80 -0
  181. package/system/dist/record-kind-DoBfYHCs.js +203 -0
  182. package/system/dist/record-kind-ub6NXqfh.mjs +162 -0
  183. package/system/dist/recording-archive.cap-7OrIn9e5.mjs +1299 -0
  184. package/system/dist/recording-archive.cap-D7bo-QSM.js +1328 -0
  185. package/system/dist/records.cap-ClcWV64i.js +329 -0
  186. package/system/dist/records.cap-CwLT2ByG.mjs +294 -0
  187. package/system/dist/relocate-CdVQAk-w.js +804 -0
  188. package/system/dist/relocate-CoZZTui1.mjs +661 -0
  189. package/system/dist/rename-composition-block-BJsL58Ih.js +34798 -0
  190. package/system/dist/rename-composition-block-OAtErZgq.mjs +33631 -0
  191. package/system/dist/{restore-archive-BJfyu0sG.mjs → restore-archive-CjAyKpgX.mjs} +96 -94
  192. package/system/dist/{restore-archive-CIFvqOze.js → restore-archive-CkTkv3Ss.js} +6 -4
  193. package/system/dist/scoped-settings-CylSSq_8.js +955 -0
  194. package/system/dist/scoped-settings-DVWUIP7Z.mjs +650 -0
  195. package/system/dist/server-name-BIhLuHvX.mjs +35 -0
  196. package/system/dist/server-name-OALNvpqC.js +52 -0
  197. package/system/dist/settings-store.cap-Ci4F2zul.mjs +569 -0
  198. package/system/dist/settings-store.cap-wlJhCspr.js +640 -0
  199. package/system/dist/snapshot.cap-3suPdBHV.js +250 -0
  200. package/system/dist/snapshot.cap-Bs8Oyaqh.mjs +245 -0
  201. package/system/dist/source-info-DGB7SdB_.mjs +190 -0
  202. package/system/dist/source-info-DtWf4k2j.js +225 -0
  203. package/system/dist/storage-admin.cap-BSv1NjKJ.mjs +883 -0
  204. package/system/dist/storage-admin.cap-he0OqvVM.js +906 -0
  205. package/system/dist/storage-location-CBT8GCD6.mjs +163 -0
  206. package/system/dist/storage-location-CTweDMZf.js +198 -0
  207. package/system/dist/storage-location-mode-B21UVRRX.mjs +167 -0
  208. package/system/dist/storage-location-mode-CS4sMzo-.js +232 -0
  209. package/system/dist/storage-migration.cap-CyyATY_p.js +330 -0
  210. package/system/dist/storage-migration.cap-D7QqGobp.mjs +313 -0
  211. package/system/dist/storage-occupancy.cap-2rmnS58Z.js +622 -0
  212. package/system/dist/storage-occupancy.cap-CqBztTl9.mjs +611 -0
  213. package/system/dist/storage-provider.cap-Bw0CfxVc.js +213 -0
  214. package/system/dist/storage-provider.cap-CMeck2w4.mjs +202 -0
  215. package/system/dist/stream-catalog.cap-Bp7SkgIf.mjs +6560 -0
  216. package/system/dist/stream-catalog.cap-D3uwePiA.js +6763 -0
  217. package/system/dist/streaming-shared-B8cXatuU.mjs +431 -0
  218. package/system/dist/streaming-shared-DQwFZOSi.js +526 -0
  219. package/system/dist/system-reasons-Be_k1W8g.js +25 -0
  220. package/system/dist/system-reasons-CYj4qwyS.mjs +20 -0
  221. package/system/dist/tag-BxLazvVb.js +2138 -0
  222. package/system/dist/tag-uZBAq6ox.mjs +2073 -0
  223. package/system/dist/user-management.cap-B9QDu8NE.js +825 -0
  224. package/system/dist/user-management.cap-DBIi77sB.mjs +766 -0
  225. package/system/dist/vector-store.cap-DnyfrYDn.js +330 -0
  226. package/system/dist/vector-store.cap-h2GHWQ1t.mjs +319 -0
  227. package/system/dist/{wal-maintenance-CTrCPzds.mjs → wal-maintenance-BG01rOn9.mjs} +0 -0
  228. package/system/dist/{wal-maintenance-dq7T3quB.js → wal-maintenance-DyrebYKF.js} +0 -0
  229. package/system/dist/zod-secret-DS7mj1bk.js +78 -0
  230. package/system/dist/zod-secret-zY4nM61M.mjs +73 -0
  231. package/system/package.json +1 -1
  232. package/system/dist/composition-sources-BI614LJx.mjs +0 -141
  233. package/system/dist/composition-sources-v_kkb8A9.js +0 -152
  234. package/system/dist/coral-accelerators-BSVsBVzt.js +0 -250
  235. package/system/dist/coral-accelerators-BW3OcrLD.mjs +0 -231
  236. package/system/dist/dist-BCHMSqzc.mjs +0 -143467
  237. package/system/dist/dist-BZfvhfS1.js +0 -146970
  238. package/system/dist/prefix-walk-DAOBSyH1.mjs +0 -88
  239. package/system/dist/prefix-walk-Dv6MLZlM.js +0 -99
  240. package/system/dist/rename-composition-block-C9HuBrKS.js +0 -112
  241. package/system/dist/rename-composition-block-DtaYmYAR.mjs +0 -101
@@ -0,0 +1,177 @@
1
+ import { z } from "zod";
2
+ //#region ../types/dist/esm/capabilities/capability-definition.mjs
3
+ /** The catalog field path of an item field: `<itemsPath>[].<field>` (`items[].level`). */
4
+ function historyItemFieldPath(itemsPath, field) {
5
+ return `${itemsPath}[].${field}`;
6
+ }
7
+ /** Capture floor (ms) applied to `gauge` / `counter` series when a field states none. */
8
+ var HISTORY_DEFAULT_MIN_INTERVAL_MS = 1e4;
9
+ /**
10
+ * Resolve the EFFECTIVE mount hint for a cap — the explicit `mount` when
11
+ * present, else the scope/mode/deviceNative-derived default. Single source
12
+ * of truth shared by the runtime builder and any codegen that needs the
13
+ * same classification, so the two can never disagree.
14
+ */
15
+ function resolveCapMount(def) {
16
+ if (def.mount) return def.mount;
17
+ if (def.deviceNative === true) return { kind: "device-native" };
18
+ if (def.scope === "device" && def.kind === "wrapper") return { kind: "device-scoped" };
19
+ if (def.mode === "collection") return { kind: "collection" };
20
+ return { kind: "singleton" };
21
+ }
22
+ /**
23
+ * Output schema shared by the contribution + live methods.
24
+ *
25
+ * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
26
+ * tabs[]) without importing from `../interfaces/config-ui.js` — a
27
+ * concrete-but-lenient Zod object keeps tRPC output inference happy
28
+ * (using `z.unknown()` here collapses unrelated router branches to
29
+ * `unknown` when the generator re-inlines the huge AppRouter type).
30
+ *
31
+ * `.passthrough()` on sections/fields accepts whatever FormBuilder
32
+ * extensions the caller adds (showWhen, displayScale, …) without
33
+ * rebuilding every time a new field kind is introduced.
34
+ */
35
+ var ContributionSectionSchema = /* @__PURE__ */ z.object({
36
+ id: /* @__PURE__ */ z.string(),
37
+ title: /* @__PURE__ */ z.string(),
38
+ description: /* @__PURE__ */ z.string().optional(),
39
+ style: /* @__PURE__ */ z.enum(["card", "accordion"]).optional(),
40
+ defaultCollapsed: /* @__PURE__ */ z.boolean().optional(),
41
+ columns: /* @__PURE__ */ z.union([
42
+ /* @__PURE__ */ z.literal(1),
43
+ /* @__PURE__ */ z.literal(2),
44
+ /* @__PURE__ */ z.literal(3),
45
+ /* @__PURE__ */ z.literal(4)
46
+ ]).optional(),
47
+ tab: /* @__PURE__ */ z.string().optional(),
48
+ location: /* @__PURE__ */ z.enum([
49
+ "settings",
50
+ "top-tab",
51
+ "hero"
52
+ ]).optional(),
53
+ order: /* @__PURE__ */ z.number().optional(),
54
+ fields: /* @__PURE__ */ z.array(/* @__PURE__ */ z.any())
55
+ });
56
+ var ContributionTabSchema = /* @__PURE__ */ z.object({
57
+ id: /* @__PURE__ */ z.string(),
58
+ label: /* @__PURE__ */ z.string(),
59
+ icon: /* @__PURE__ */ z.string(),
60
+ order: /* @__PURE__ */ z.number().optional()
61
+ });
62
+ var ContributionOutputSchema = /* @__PURE__ */ (/* @__PURE__ */ z.object({
63
+ tabs: /* @__PURE__ */ z.array(ContributionTabSchema).optional(),
64
+ sections: /* @__PURE__ */ z.array(ContributionSectionSchema)
65
+ })).nullable();
66
+ var DEVICE_SETTINGS_CONTRIBUTION_METHODS = {
67
+ getDeviceSettingsContribution: {
68
+ input: /* @__PURE__ */ z.object({ deviceId: /* @__PURE__ */ z.number() }),
69
+ output: ContributionOutputSchema,
70
+ kind: "query",
71
+ auth: "protected"
72
+ },
73
+ getDeviceLiveContribution: {
74
+ input: /* @__PURE__ */ z.object({ deviceId: /* @__PURE__ */ z.number() }),
75
+ output: ContributionOutputSchema,
76
+ kind: "query",
77
+ auth: "protected"
78
+ },
79
+ applyDeviceSettingsPatch: {
80
+ input: /* @__PURE__ */ z.object({
81
+ deviceId: /* @__PURE__ */ z.number(),
82
+ patch: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.unknown())
83
+ }),
84
+ output: /* @__PURE__ */ z.object({ success: /* @__PURE__ */ z.literal(true) }),
85
+ kind: "mutation",
86
+ auth: "admin"
87
+ }
88
+ };
89
+ /**
90
+ * Schema for the `getStatus` method auto-injected when a cap declares
91
+ * `status`. The runtime shape of the output is the cap's own
92
+ * `status.schema` — but at codegen time we need a concrete Zod to emit
93
+ * a typed tRPC route, so we keep the output as `z.unknown().nullable()`
94
+ * here and tighten it on the client side via the generated
95
+ * `CapStatusTypeMap` (see `scripts/generate-cap-status-types.ts`).
96
+ */
97
+ var DEVICE_STATUS_METHOD = { getStatus: {
98
+ input: /* @__PURE__ */ z.object({ deviceId: /* @__PURE__ */ z.number() }),
99
+ output: /* @__PURE__ */ z.unknown().nullable(),
100
+ kind: "query",
101
+ auth: "protected"
102
+ } };
103
+ /**
104
+ * Expand a cap def's methods map with every auto-injected method:
105
+ * - `exposesDeviceSettings: true` → 3 contribution methods
106
+ * - `status: {...}` → `getStatus`
107
+ *
108
+ * Callers walk `expandCapMethods(def)` instead of `def.methods` when
109
+ * they need the effective runtime method surface (Moleculer actions,
110
+ * proxy shape, tRPC router entries). The cap def stays the single
111
+ * source of truth. Providers still declare their concrete `methods`
112
+ * block; the expansion happens at every consumption point, so there's
113
+ * no accidental divergence between the declared surface and what's
114
+ * actually mounted.
115
+ */
116
+ function expandCapMethods(def) {
117
+ let out = def.methods;
118
+ if (def.exposesDeviceSettings) out = {
119
+ ...DEVICE_SETTINGS_CONTRIBUTION_METHODS,
120
+ ...out
121
+ };
122
+ if (def.status) out = {
123
+ ...DEVICE_STATUS_METHOD,
124
+ ...out
125
+ };
126
+ return out;
127
+ }
128
+ function method(input, output, options) {
129
+ return {
130
+ input,
131
+ output,
132
+ kind: options?.kind ?? "query",
133
+ ...options?.auth !== void 0 ? { auth: options.auth } : {},
134
+ ...options?.access !== void 0 ? { access: options.access } : {},
135
+ ...options?.role !== void 0 ? { role: options.role } : {},
136
+ ...options?.caller !== void 0 ? { caller: options.caller } : {},
137
+ ...options?.actions !== void 0 ? { actions: options.actions } : {},
138
+ ...options?.notOperatorFacing !== void 0 ? { notOperatorFacing: options.notOperatorFacing } : {},
139
+ timeoutMs: options?.timeoutMs
140
+ };
141
+ }
142
+ /**
143
+ * A wrapper/system-only method: served exclusively by the cap's system-level
144
+ * provider (`InferProvider`), and OPTIONAL on `InferNativeProvider` so per-device
145
+ * driver natives don't stub out a wrapper concern (e.g. a cross-device cache
146
+ * overview). The `systemOnly: true` literal is what `InferNativeProvider` keys on.
147
+ */
148
+ function systemMethod(input, output, options) {
149
+ return {
150
+ ...method(input, output, options),
151
+ systemOnly: true
152
+ };
153
+ }
154
+ function optionalMethod(input, output, options) {
155
+ return {
156
+ ...method(input, output, options),
157
+ providerOptional: true
158
+ };
159
+ }
160
+ /** Shorthand to define an event schema */
161
+ function event(data, vocabulary) {
162
+ if (vocabulary?.trigger !== void 0) return {
163
+ data,
164
+ trigger: vocabulary.trigger
165
+ };
166
+ if (vocabulary?.notOperatorFacing !== void 0) return {
167
+ data,
168
+ notOperatorFacing: vocabulary.notOperatorFacing
169
+ };
170
+ return { data };
171
+ }
172
+ /** Type guard: does this cap declare the D14 device-config archetype? */
173
+ function isDeviceConfigCap(def) {
174
+ return def?.deviceConfig !== void 0;
175
+ }
176
+ //#endregion
177
+ export { expandCapMethods as a, method as c, systemMethod as d, event as i, optionalMethod as l, DEVICE_STATUS_METHOD as n, historyItemFieldPath as o, HISTORY_DEFAULT_MIN_INTERVAL_MS as r, isDeviceConfigCap as s, DEVICE_SETTINGS_CONTRIBUTION_METHODS as t, resolveCapMount as u };
@@ -0,0 +1,242 @@
1
+ let zod = require("zod");
2
+ //#region ../types/dist/esm/capabilities/capability-definition.mjs
3
+ /** The catalog field path of an item field: `<itemsPath>[].<field>` (`items[].level`). */
4
+ function historyItemFieldPath(itemsPath, field) {
5
+ return `${itemsPath}[].${field}`;
6
+ }
7
+ /** Capture floor (ms) applied to `gauge` / `counter` series when a field states none. */
8
+ var HISTORY_DEFAULT_MIN_INTERVAL_MS = 1e4;
9
+ /**
10
+ * Resolve the EFFECTIVE mount hint for a cap — the explicit `mount` when
11
+ * present, else the scope/mode/deviceNative-derived default. Single source
12
+ * of truth shared by the runtime builder and any codegen that needs the
13
+ * same classification, so the two can never disagree.
14
+ */
15
+ function resolveCapMount(def) {
16
+ if (def.mount) return def.mount;
17
+ if (def.deviceNative === true) return { kind: "device-native" };
18
+ if (def.scope === "device" && def.kind === "wrapper") return { kind: "device-scoped" };
19
+ if (def.mode === "collection") return { kind: "collection" };
20
+ return { kind: "singleton" };
21
+ }
22
+ /**
23
+ * Output schema shared by the contribution + live methods.
24
+ *
25
+ * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
26
+ * tabs[]) without importing from `../interfaces/config-ui.js` — a
27
+ * concrete-but-lenient Zod object keeps tRPC output inference happy
28
+ * (using `z.unknown()` here collapses unrelated router branches to
29
+ * `unknown` when the generator re-inlines the huge AppRouter type).
30
+ *
31
+ * `.passthrough()` on sections/fields accepts whatever FormBuilder
32
+ * extensions the caller adds (showWhen, displayScale, …) without
33
+ * rebuilding every time a new field kind is introduced.
34
+ */
35
+ var ContributionSectionSchema = /* @__PURE__ */ zod.z.object({
36
+ id: /* @__PURE__ */ zod.z.string(),
37
+ title: /* @__PURE__ */ zod.z.string(),
38
+ description: /* @__PURE__ */ zod.z.string().optional(),
39
+ style: /* @__PURE__ */ zod.z.enum(["card", "accordion"]).optional(),
40
+ defaultCollapsed: /* @__PURE__ */ zod.z.boolean().optional(),
41
+ columns: /* @__PURE__ */ zod.z.union([
42
+ /* @__PURE__ */ zod.z.literal(1),
43
+ /* @__PURE__ */ zod.z.literal(2),
44
+ /* @__PURE__ */ zod.z.literal(3),
45
+ /* @__PURE__ */ zod.z.literal(4)
46
+ ]).optional(),
47
+ tab: /* @__PURE__ */ zod.z.string().optional(),
48
+ location: /* @__PURE__ */ zod.z.enum([
49
+ "settings",
50
+ "top-tab",
51
+ "hero"
52
+ ]).optional(),
53
+ order: /* @__PURE__ */ zod.z.number().optional(),
54
+ fields: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.any())
55
+ });
56
+ var ContributionTabSchema = /* @__PURE__ */ zod.z.object({
57
+ id: /* @__PURE__ */ zod.z.string(),
58
+ label: /* @__PURE__ */ zod.z.string(),
59
+ icon: /* @__PURE__ */ zod.z.string(),
60
+ order: /* @__PURE__ */ zod.z.number().optional()
61
+ });
62
+ var ContributionOutputSchema = /* @__PURE__ */ (/* @__PURE__ */ zod.z.object({
63
+ tabs: /* @__PURE__ */ zod.z.array(ContributionTabSchema).optional(),
64
+ sections: /* @__PURE__ */ zod.z.array(ContributionSectionSchema)
65
+ })).nullable();
66
+ var DEVICE_SETTINGS_CONTRIBUTION_METHODS = {
67
+ getDeviceSettingsContribution: {
68
+ input: /* @__PURE__ */ zod.z.object({ deviceId: /* @__PURE__ */ zod.z.number() }),
69
+ output: ContributionOutputSchema,
70
+ kind: "query",
71
+ auth: "protected"
72
+ },
73
+ getDeviceLiveContribution: {
74
+ input: /* @__PURE__ */ zod.z.object({ deviceId: /* @__PURE__ */ zod.z.number() }),
75
+ output: ContributionOutputSchema,
76
+ kind: "query",
77
+ auth: "protected"
78
+ },
79
+ applyDeviceSettingsPatch: {
80
+ input: /* @__PURE__ */ zod.z.object({
81
+ deviceId: /* @__PURE__ */ zod.z.number(),
82
+ patch: /* @__PURE__ */ zod.z.record(/* @__PURE__ */ zod.z.string(), /* @__PURE__ */ zod.z.unknown())
83
+ }),
84
+ output: /* @__PURE__ */ zod.z.object({ success: /* @__PURE__ */ zod.z.literal(true) }),
85
+ kind: "mutation",
86
+ auth: "admin"
87
+ }
88
+ };
89
+ /**
90
+ * Schema for the `getStatus` method auto-injected when a cap declares
91
+ * `status`. The runtime shape of the output is the cap's own
92
+ * `status.schema` — but at codegen time we need a concrete Zod to emit
93
+ * a typed tRPC route, so we keep the output as `z.unknown().nullable()`
94
+ * here and tighten it on the client side via the generated
95
+ * `CapStatusTypeMap` (see `scripts/generate-cap-status-types.ts`).
96
+ */
97
+ var DEVICE_STATUS_METHOD = { getStatus: {
98
+ input: /* @__PURE__ */ zod.z.object({ deviceId: /* @__PURE__ */ zod.z.number() }),
99
+ output: /* @__PURE__ */ zod.z.unknown().nullable(),
100
+ kind: "query",
101
+ auth: "protected"
102
+ } };
103
+ /**
104
+ * Expand a cap def's methods map with every auto-injected method:
105
+ * - `exposesDeviceSettings: true` → 3 contribution methods
106
+ * - `status: {...}` → `getStatus`
107
+ *
108
+ * Callers walk `expandCapMethods(def)` instead of `def.methods` when
109
+ * they need the effective runtime method surface (Moleculer actions,
110
+ * proxy shape, tRPC router entries). The cap def stays the single
111
+ * source of truth. Providers still declare their concrete `methods`
112
+ * block; the expansion happens at every consumption point, so there's
113
+ * no accidental divergence between the declared surface and what's
114
+ * actually mounted.
115
+ */
116
+ function expandCapMethods(def) {
117
+ let out = def.methods;
118
+ if (def.exposesDeviceSettings) out = {
119
+ ...DEVICE_SETTINGS_CONTRIBUTION_METHODS,
120
+ ...out
121
+ };
122
+ if (def.status) out = {
123
+ ...DEVICE_STATUS_METHOD,
124
+ ...out
125
+ };
126
+ return out;
127
+ }
128
+ function method(input, output, options) {
129
+ return {
130
+ input,
131
+ output,
132
+ kind: options?.kind ?? "query",
133
+ ...options?.auth !== void 0 ? { auth: options.auth } : {},
134
+ ...options?.access !== void 0 ? { access: options.access } : {},
135
+ ...options?.role !== void 0 ? { role: options.role } : {},
136
+ ...options?.caller !== void 0 ? { caller: options.caller } : {},
137
+ ...options?.actions !== void 0 ? { actions: options.actions } : {},
138
+ ...options?.notOperatorFacing !== void 0 ? { notOperatorFacing: options.notOperatorFacing } : {},
139
+ timeoutMs: options?.timeoutMs
140
+ };
141
+ }
142
+ /**
143
+ * A wrapper/system-only method: served exclusively by the cap's system-level
144
+ * provider (`InferProvider`), and OPTIONAL on `InferNativeProvider` so per-device
145
+ * driver natives don't stub out a wrapper concern (e.g. a cross-device cache
146
+ * overview). The `systemOnly: true` literal is what `InferNativeProvider` keys on.
147
+ */
148
+ function systemMethod(input, output, options) {
149
+ return {
150
+ ...method(input, output, options),
151
+ systemOnly: true
152
+ };
153
+ }
154
+ function optionalMethod(input, output, options) {
155
+ return {
156
+ ...method(input, output, options),
157
+ providerOptional: true
158
+ };
159
+ }
160
+ /** Shorthand to define an event schema */
161
+ function event(data, vocabulary) {
162
+ if (vocabulary?.trigger !== void 0) return {
163
+ data,
164
+ trigger: vocabulary.trigger
165
+ };
166
+ if (vocabulary?.notOperatorFacing !== void 0) return {
167
+ data,
168
+ notOperatorFacing: vocabulary.notOperatorFacing
169
+ };
170
+ return { data };
171
+ }
172
+ /** Type guard: does this cap declare the D14 device-config archetype? */
173
+ function isDeviceConfigCap(def) {
174
+ return def?.deviceConfig !== void 0;
175
+ }
176
+ //#endregion
177
+ Object.defineProperty(exports, "DEVICE_SETTINGS_CONTRIBUTION_METHODS", {
178
+ enumerable: true,
179
+ get: function() {
180
+ return DEVICE_SETTINGS_CONTRIBUTION_METHODS;
181
+ }
182
+ });
183
+ Object.defineProperty(exports, "DEVICE_STATUS_METHOD", {
184
+ enumerable: true,
185
+ get: function() {
186
+ return DEVICE_STATUS_METHOD;
187
+ }
188
+ });
189
+ Object.defineProperty(exports, "HISTORY_DEFAULT_MIN_INTERVAL_MS", {
190
+ enumerable: true,
191
+ get: function() {
192
+ return HISTORY_DEFAULT_MIN_INTERVAL_MS;
193
+ }
194
+ });
195
+ Object.defineProperty(exports, "event", {
196
+ enumerable: true,
197
+ get: function() {
198
+ return event;
199
+ }
200
+ });
201
+ Object.defineProperty(exports, "expandCapMethods", {
202
+ enumerable: true,
203
+ get: function() {
204
+ return expandCapMethods;
205
+ }
206
+ });
207
+ Object.defineProperty(exports, "historyItemFieldPath", {
208
+ enumerable: true,
209
+ get: function() {
210
+ return historyItemFieldPath;
211
+ }
212
+ });
213
+ Object.defineProperty(exports, "isDeviceConfigCap", {
214
+ enumerable: true,
215
+ get: function() {
216
+ return isDeviceConfigCap;
217
+ }
218
+ });
219
+ Object.defineProperty(exports, "method", {
220
+ enumerable: true,
221
+ get: function() {
222
+ return method;
223
+ }
224
+ });
225
+ Object.defineProperty(exports, "optionalMethod", {
226
+ enumerable: true,
227
+ get: function() {
228
+ return optionalMethod;
229
+ }
230
+ });
231
+ Object.defineProperty(exports, "resolveCapMount", {
232
+ enumerable: true,
233
+ get: function() {
234
+ return resolveCapMount;
235
+ }
236
+ });
237
+ Object.defineProperty(exports, "systemMethod", {
238
+ enumerable: true,
239
+ get: function() {
240
+ return systemMethod;
241
+ }
242
+ });
@@ -1,4 +1,5 @@
1
- const require_dist = require("./dist-BZfvhfS1.js");
1
+ const require_capability_definition = require("./capability-definition-HCmTem8c.js");
2
+ const require_device_type = require("./device-type-CbQsnFdC.js");
2
3
  //#region src/builtins/shared/device-state-changed.ts
3
4
  /** Structural narrowing helper for untrusted bus payloads. */
4
5
  function isRecord$2(value) {
@@ -225,7 +226,7 @@ var DEADBAND_EPSILON = 1e-9;
225
226
  /** The capture floor of a field: its own `minIntervalMs`, else the kind's default. */
226
227
  function minIntervalOf(spec) {
227
228
  if (spec.minIntervalMs !== void 0) return spec.minIntervalMs;
228
- return spec.kind === "boolean" || spec.kind === "enum" ? 0 : require_dist.HISTORY_DEFAULT_MIN_INTERVAL_MS;
229
+ return spec.kind === "boolean" || spec.kind === "enum" ? 0 : require_capability_definition.HISTORY_DEFAULT_MIN_INTERVAL_MS;
229
230
  }
230
231
  function clearsDeadband(spec, last, value) {
231
232
  if (spec.kind === "boolean" || spec.kind === "enum") return true;
@@ -272,7 +273,7 @@ function decideCapture(spec, recorded, value, now, options = {}) {
272
273
  * stays, and the failure is counted and logged, never read as "no devices".
273
274
  */
274
275
  function isRealDeviceType(type) {
275
- return type !== require_dist.DeviceType.Container;
276
+ return type !== require_device_type.DeviceType.Container;
276
277
  }
277
278
  var DeviceDirectory = class {
278
279
  source;
@@ -420,7 +421,7 @@ function capSeriesKey(capName, fieldPath) {
420
421
  }
421
422
  /** The series key of an item field: `cap:<capName>.<path>[].<field>`. */
422
423
  function capItemSeriesKey(capName, items, field) {
423
- return capSeriesKey(capName, require_dist.historyItemFieldPath(items.path, field));
424
+ return capSeriesKey(capName, require_capability_definition.historyItemFieldPath(items.path, field));
424
425
  }
425
426
  function humanize(capName, fieldPath) {
426
427
  const field = fieldPath.replace(/([A-Z])/g, " $1").replace(/\./g, " ").toLowerCase();
@@ -1,4 +1,5 @@
1
- import { Jl as historyItemFieldPath, Vu as DeviceType, qc as HISTORY_DEFAULT_MIN_INTERVAL_MS } from "./dist-BCHMSqzc.mjs";
1
+ import { o as historyItemFieldPath, r as HISTORY_DEFAULT_MIN_INTERVAL_MS } from "./capability-definition-C2rJdVeX.mjs";
2
+ import { r as DeviceType } from "./device-type-DgEvK3ch.mjs";
2
3
  //#region src/builtins/shared/device-state-changed.ts
3
4
  /** Structural narrowing helper for untrusted bus payloads. */
4
5
  function isRecord$2(value) {
@@ -0,0 +1,35 @@
1
+ let zod = require("zod");
2
+ //#region ../types/dist/esm/audit/command-origin-claim.mjs
3
+ /** The ecosystems an exporter speaks for. */
4
+ var OnBehalfSourceSchema = /* @__PURE__ */ zod.z.enum([
5
+ "homeassistant",
6
+ "homekit",
7
+ "alexa",
8
+ "google",
9
+ "matter"
10
+ ]);
11
+ /** WHO an exporter acts for: the ecosystem and the principal it reported, never invented. */
12
+ var OnBehalfSchema = /* @__PURE__ */ zod.z.object({
13
+ source: OnBehalfSourceSchema,
14
+ principalId: /* @__PURE__ */ zod.z.string(),
15
+ principalName: /* @__PURE__ */ zod.z.string().optional()
16
+ });
17
+ /** The rule fire a claim carries, if it carries one. */
18
+ function ruleFireOfClaim(claim) {
19
+ if (claim === void 0) return void 0;
20
+ if (claim.kind === "rule") return claim.fire;
21
+ if (claim.kind === "action") return claim.ruleFire;
22
+ }
23
+ //#endregion
24
+ Object.defineProperty(exports, "OnBehalfSchema", {
25
+ enumerable: true,
26
+ get: function() {
27
+ return OnBehalfSchema;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "ruleFireOfClaim", {
31
+ enumerable: true,
32
+ get: function() {
33
+ return ruleFireOfClaim;
34
+ }
35
+ });
@@ -0,0 +1,24 @@
1
+ import { z } from "zod";
2
+ //#region ../types/dist/esm/audit/command-origin-claim.mjs
3
+ /** The ecosystems an exporter speaks for. */
4
+ var OnBehalfSourceSchema = /* @__PURE__ */ z.enum([
5
+ "homeassistant",
6
+ "homekit",
7
+ "alexa",
8
+ "google",
9
+ "matter"
10
+ ]);
11
+ /** WHO an exporter acts for: the ecosystem and the principal it reported, never invented. */
12
+ var OnBehalfSchema = /* @__PURE__ */ z.object({
13
+ source: OnBehalfSourceSchema,
14
+ principalId: /* @__PURE__ */ z.string(),
15
+ principalName: /* @__PURE__ */ z.string().optional()
16
+ });
17
+ /** The rule fire a claim carries, if it carries one. */
18
+ function ruleFireOfClaim(claim) {
19
+ if (claim === void 0) return void 0;
20
+ if (claim.kind === "rule") return claim.fire;
21
+ if (claim.kind === "action") return claim.ruleFire;
22
+ }
23
+ //#endregion
24
+ export { ruleFireOfClaim as n, OnBehalfSchema as t };