@camstack/server 1.2.928 → 1.2.929

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 (237) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/package.json +10 -8
  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/core-blocks.addon.js +7887 -381
  35. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +7511 -5
  36. package/system/dist/builtins/core-notifier/core-notifier.addon.js +731 -21
  37. package/system/dist/builtins/core-notifier/core-notifier.addon.mjs +711 -1
  38. package/system/dist/builtins/device-history/device-history.addon.js +110 -31
  39. package/system/dist/builtins/device-history/device-history.addon.mjs +81 -2
  40. package/system/dist/builtins/device-manager/device-manager.addon.js +12806 -227
  41. package/system/dist/builtins/device-manager/device-manager.addon.mjs +12583 -5
  42. package/system/dist/builtins/hub-forwarder/index.js +4 -3
  43. package/system/dist/builtins/hub-forwarder/index.mjs +2 -1
  44. package/system/dist/builtins/keychain/index.js +31 -28
  45. package/system/dist/builtins/keychain/index.mjs +7 -4
  46. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +15 -12
  47. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +4 -1
  48. package/system/dist/builtins/local-auth/local-auth.addon.js +140 -39
  49. package/system/dist/builtins/local-auth/local-auth.addon.mjs +106 -6
  50. package/system/dist/builtins/local-network/local-network.addon.js +43 -39
  51. package/system/dist/builtins/local-network/local-network.addon.mjs +7 -3
  52. package/system/dist/builtins/loki-logging/index.js +23 -17
  53. package/system/dist/builtins/loki-logging/index.mjs +7 -1
  54. package/system/dist/builtins/native-metrics/native-metrics.addon.js +156 -15
  55. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +151 -10
  56. package/system/dist/builtins/platform-probe/index.js +25 -23
  57. package/system/dist/builtins/platform-probe/index.mjs +12 -10
  58. package/system/dist/builtins/record-entries/index.js +9 -7
  59. package/system/dist/builtins/record-entries/index.mjs +3 -1
  60. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +4 -4
  61. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  62. package/system/dist/builtins/snapshot/index.js +97 -44
  63. package/system/dist/builtins/snapshot/index.mjs +54 -1
  64. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +5 -4
  65. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +21 -20
  66. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  67. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  68. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +87 -61
  69. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +29 -3
  70. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +81 -72
  71. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +10 -1
  72. package/system/dist/builtins/system-config/system-config.addon.js +17 -14
  73. package/system/dist/builtins/system-config/system-config.addon.mjs +118 -115
  74. package/system/dist/builtins/winston-logging/index.js +7 -5
  75. package/system/dist/builtins/winston-logging/index.mjs +3 -1
  76. package/system/dist/calendars.cap-CaFlShS9.js +155 -0
  77. package/system/dist/calendars.cap-_C4eD4fi.mjs +138 -0
  78. package/system/dist/camstack-error-DJ-TUAi1.js +23 -0
  79. package/system/dist/camstack-error-viZYfcj9.mjs +18 -0
  80. package/system/dist/cap-call-context-Bd76CbOW.js +95 -0
  81. package/system/dist/cap-call-context-DNwdgGSQ.mjs +78 -0
  82. package/system/dist/capability-definition-C2rJdVeX.mjs +177 -0
  83. package/system/dist/capability-definition-HCmTem8c.js +242 -0
  84. package/system/dist/{capture-engine-BcuwOSXv.js → capture-engine-DZ0LIUqA.js} +5 -4
  85. package/system/dist/{capture-engine-Bz7eXFjT.mjs → capture-engine-DiwbjoWp.mjs} +2 -1
  86. package/system/dist/command-origin-claim-Cief660O.js +35 -0
  87. package/system/dist/command-origin-claim-D1Wy7Qld.mjs +24 -0
  88. package/system/dist/composition-sources-Caqv7O7z.mjs +391 -0
  89. package/system/dist/composition-sources-CgnHjm8Q.js +408 -0
  90. package/system/dist/{constants-D2etJ02O.js → constants-Ba3FTIHl.js} +1 -1
  91. package/system/dist/constants-C860Y6U4.js +26 -0
  92. package/system/dist/{constants-BcUTQd1M.mjs → constants-DB4piTD5.mjs} +1 -1
  93. package/system/dist/constants-DCLpoF4L.mjs +21 -0
  94. package/system/dist/coral-accelerators-7o8hqvcN.js +564 -0
  95. package/system/dist/coral-accelerators-BKcXP59c.mjs +521 -0
  96. package/system/dist/core-blocks.cap-C6iKAZ-x.mjs +17986 -0
  97. package/system/dist/core-blocks.cap-LEMqVwxO.js +18705 -0
  98. package/system/dist/{custom-action-registry-N7flBDwT.mjs → custom-action-registry-B9zFBNVa.mjs} +37 -37
  99. package/system/dist/custom-actions-BFUSalC9.mjs +25 -0
  100. package/system/dist/custom-actions-D92NRi2c.js +36 -0
  101. package/system/dist/database-snapshot.cap-DF38e-0P.js +162 -0
  102. package/system/dist/database-snapshot.cap-dhrc9xnY.mjs +133 -0
  103. package/system/dist/declared-device-BWphj9WE.js +303 -0
  104. package/system/dist/declared-device-CKERA1Hi.mjs +286 -0
  105. package/system/dist/{device-ca-ExMN3xW3.mjs → device-ca-BLM6fccc.mjs} +2 -1
  106. package/system/dist/{device-ca-CU8zh9Pi.js → device-ca-C5kJE6mL.js} +7 -6
  107. package/system/dist/device-certificate-Cddm4Idn.mjs +91 -0
  108. package/system/dist/device-certificate-CguVACQO.js +162 -0
  109. package/system/dist/device-identifiers-BQg9EQi1.js +600 -0
  110. package/system/dist/device-identifiers-iSuQCKmK.mjs +529 -0
  111. package/system/dist/device-kind-BJ2pfsjw.mjs +78 -0
  112. package/system/dist/device-kind-CsSiv_YF.js +101 -0
  113. package/system/dist/device-manager.cap-2abwVLCM.js +2874 -0
  114. package/system/dist/device-manager.cap-CFZSPfUh.mjs +2749 -0
  115. package/system/dist/device-provider.cap-3Uvk6f5-.mjs +331 -0
  116. package/system/dist/device-provider.cap-D7TV2kVH.js +366 -0
  117. package/system/dist/{device-row-store-CeW_GWh9.mjs → device-row-store-YF3jtmkk.mjs} +4 -1
  118. package/system/dist/{device-row-store-BMIR-n3m.js → device-row-store-doTfMOqn.js} +12 -9
  119. package/system/dist/device-transitions.cap-B5w5PYU_.js +860 -0
  120. package/system/dist/device-transitions.cap-DojcwEuX.mjs +819 -0
  121. package/system/dist/device-type-CbQsnFdC.js +477 -0
  122. package/system/dist/device-type-DgEvK3ch.mjs +454 -0
  123. package/system/dist/entry-kind-D9MuVJCK.mjs +44 -0
  124. package/system/dist/entry-kind-cq90c--V.js +55 -0
  125. package/system/dist/error.cap-CSM_SRfR.mjs +3423 -0
  126. package/system/dist/error.cap-DBhgPeWK.js +3848 -0
  127. package/system/dist/file-host-worker.js +1 -1
  128. package/system/dist/file-host-worker.mjs +1 -1
  129. package/system/dist/history-catalog-BKRarIL_.js +831 -0
  130. package/system/dist/history-catalog-BwTeQ4Mr.mjs +802 -0
  131. package/system/dist/{hub-identity-Csxx2Q8k.js → hub-identity-BMdR3Mw9.js} +2 -2
  132. package/system/dist/{hub-identity-CYC1820R.mjs → hub-identity-DjMN9Ac2.mjs} +10 -10
  133. package/system/dist/{hub-mdns-ciao-By5577HM.js → hub-mdns-ciao--0v1TKME.js} +5 -5
  134. package/system/dist/{hub-mdns-ciao-CCDxM5qz.mjs → hub-mdns-ciao-DBrtHOcc.mjs} +2 -2
  135. package/system/dist/index.js +763 -151
  136. package/system/dist/index.mjs +832 -220
  137. package/system/dist/integration-instances.cap-Cl9O-k4h.mjs +538 -0
  138. package/system/dist/integration-instances.cap-dJIxg2_s.js +549 -0
  139. package/system/dist/keychain-admin.cap-Db_oFX4H.js +425 -0
  140. package/system/dist/keychain-admin.cap-GtM7gVGG.mjs +396 -0
  141. package/system/dist/l10n-Bu6aUvSY.mjs +10 -0
  142. package/system/dist/l10n-CGMvp7NF.js +15 -0
  143. package/system/dist/labels-DX5S8deC.js +81 -0
  144. package/system/dist/labels-DsBcU7md.mjs +64 -0
  145. package/system/dist/{legacy-integration-rows-door-CVwOo5aq.js → legacy-integration-rows-door-B1nzxxr5.js} +2 -2
  146. package/system/dist/{legacy-integration-rows-door-D9tQOUzh.mjs → legacy-integration-rows-door-nTvo_6jQ.mjs} +1 -1
  147. package/system/dist/log-destination.cap-CxZzAVaR.mjs +143 -0
  148. package/system/dist/log-destination.cap-DELPJkZ0.js +148 -0
  149. package/system/dist/low-power-sleep.cap-7lfVU41N.js +103 -0
  150. package/system/dist/low-power-sleep.cap-tGPmaZ_V.mjs +92 -0
  151. package/system/dist/mask-shape-Ci8Co9w0.mjs +57 -0
  152. package/system/dist/mask-shape-CmPA2fst.js +92 -0
  153. package/system/dist/metrics-provider.cap-BNmcHDkQ.mjs +405 -0
  154. package/system/dist/metrics-provider.cap-BcmQUt6l.js +410 -0
  155. package/system/dist/migration-BMjgkyG2.js +380 -0
  156. package/system/dist/migration-DRJAtdy7.mjs +321 -0
  157. package/system/dist/network-access.cap-B5TWLDCC.js +1099 -0
  158. package/system/dist/network-access.cap-BJnGbE6n.mjs +1004 -0
  159. package/system/dist/notification-rules.cap-B__YBgnG.js +3422 -0
  160. package/system/dist/notification-rules.cap-D9ArZlwx.mjs +3357 -0
  161. package/system/dist/ops-log-CB4pIdqi.mjs +64 -0
  162. package/system/dist/ops-log-pxt9176Z.js +81 -0
  163. package/system/dist/pinned-binary-BOhOSNff.js +28 -0
  164. package/system/dist/pinned-binary-CrIRAi4G.mjs +23 -0
  165. package/system/dist/platform-probe.cap-1WrMhWHx.js +250 -0
  166. package/system/dist/platform-probe.cap-BFeqFLtQ.mjs +233 -0
  167. package/system/dist/prefix-walk-B4b2-9aK.mjs +790 -0
  168. package/system/dist/prefix-walk-DC0ljmbB.js +843 -0
  169. package/system/dist/ptz-autotrack.cap-BW7w0zHD.js +229 -0
  170. package/system/dist/ptz-autotrack.cap-DT2GypXw.mjs +224 -0
  171. package/system/dist/quantity-D3g5SxsZ.mjs +114 -0
  172. package/system/dist/quantity-lY1KiTSZ.js +143 -0
  173. package/system/dist/raw-secret-migration-DxuBFtvi.js +50 -0
  174. package/system/dist/raw-secret-migration-iv88mLoc.mjs +39 -0
  175. package/system/dist/record-entries.cap-sMUhTvTU.mjs +75 -0
  176. package/system/dist/record-entries.cap-ti1C046R.js +80 -0
  177. package/system/dist/record-kind-DoBfYHCs.js +203 -0
  178. package/system/dist/record-kind-ub6NXqfh.mjs +162 -0
  179. package/system/dist/recording-archive.cap-7OrIn9e5.mjs +1299 -0
  180. package/system/dist/recording-archive.cap-D7bo-QSM.js +1328 -0
  181. package/system/dist/records.cap-ClcWV64i.js +329 -0
  182. package/system/dist/records.cap-CwLT2ByG.mjs +294 -0
  183. package/system/dist/relocate-CdVQAk-w.js +804 -0
  184. package/system/dist/relocate-CoZZTui1.mjs +661 -0
  185. package/system/dist/rename-composition-block-7WIICIDq.mjs +33525 -0
  186. package/system/dist/rename-composition-block-CcWLwVhG.js +34692 -0
  187. package/system/dist/{restore-archive-BJfyu0sG.mjs → restore-archive-CjAyKpgX.mjs} +96 -94
  188. package/system/dist/{restore-archive-CIFvqOze.js → restore-archive-CkTkv3Ss.js} +6 -4
  189. package/system/dist/scoped-settings-CylSSq_8.js +955 -0
  190. package/system/dist/scoped-settings-DVWUIP7Z.mjs +650 -0
  191. package/system/dist/server-name-BIhLuHvX.mjs +35 -0
  192. package/system/dist/server-name-OALNvpqC.js +52 -0
  193. package/system/dist/settings-store.cap-Ci4F2zul.mjs +569 -0
  194. package/system/dist/settings-store.cap-wlJhCspr.js +640 -0
  195. package/system/dist/snapshot.cap-3suPdBHV.js +250 -0
  196. package/system/dist/snapshot.cap-Bs8Oyaqh.mjs +245 -0
  197. package/system/dist/source-info-DGB7SdB_.mjs +190 -0
  198. package/system/dist/source-info-DtWf4k2j.js +225 -0
  199. package/system/dist/storage-admin.cap-BSv1NjKJ.mjs +883 -0
  200. package/system/dist/storage-admin.cap-he0OqvVM.js +906 -0
  201. package/system/dist/storage-location-CBT8GCD6.mjs +163 -0
  202. package/system/dist/storage-location-CTweDMZf.js +198 -0
  203. package/system/dist/storage-location-mode-B21UVRRX.mjs +167 -0
  204. package/system/dist/storage-location-mode-CS4sMzo-.js +232 -0
  205. package/system/dist/storage-migration.cap-CyyATY_p.js +330 -0
  206. package/system/dist/storage-migration.cap-D7QqGobp.mjs +313 -0
  207. package/system/dist/storage-occupancy.cap-2rmnS58Z.js +622 -0
  208. package/system/dist/storage-occupancy.cap-CqBztTl9.mjs +611 -0
  209. package/system/dist/storage-provider.cap-Bw0CfxVc.js +213 -0
  210. package/system/dist/storage-provider.cap-CMeck2w4.mjs +202 -0
  211. package/system/dist/stream-catalog.cap-Bp7SkgIf.mjs +6560 -0
  212. package/system/dist/stream-catalog.cap-D3uwePiA.js +6763 -0
  213. package/system/dist/streaming-shared-B8cXatuU.mjs +431 -0
  214. package/system/dist/streaming-shared-DQwFZOSi.js +526 -0
  215. package/system/dist/system-reasons-Be_k1W8g.js +25 -0
  216. package/system/dist/system-reasons-CYj4qwyS.mjs +20 -0
  217. package/system/dist/tag-BxLazvVb.js +2138 -0
  218. package/system/dist/tag-uZBAq6ox.mjs +2073 -0
  219. package/system/dist/user-management.cap-B9QDu8NE.js +825 -0
  220. package/system/dist/user-management.cap-DBIi77sB.mjs +766 -0
  221. package/system/dist/vector-store.cap-DnyfrYDn.js +330 -0
  222. package/system/dist/vector-store.cap-h2GHWQ1t.mjs +319 -0
  223. package/system/dist/{wal-maintenance-CTrCPzds.mjs → wal-maintenance-BG01rOn9.mjs} +0 -0
  224. package/system/dist/{wal-maintenance-dq7T3quB.js → wal-maintenance-DyrebYKF.js} +0 -0
  225. package/system/dist/zod-secret-DS7mj1bk.js +78 -0
  226. package/system/dist/zod-secret-zY4nM61M.mjs +73 -0
  227. package/system/package.json +1 -1
  228. package/system/dist/composition-sources-BI614LJx.mjs +0 -141
  229. package/system/dist/composition-sources-v_kkb8A9.js +0 -152
  230. package/system/dist/coral-accelerators-BSVsBVzt.js +0 -250
  231. package/system/dist/coral-accelerators-BW3OcrLD.mjs +0 -231
  232. package/system/dist/dist-BCHMSqzc.mjs +0 -143467
  233. package/system/dist/dist-BZfvhfS1.js +0 -146970
  234. package/system/dist/prefix-walk-DAOBSyH1.mjs +0 -88
  235. package/system/dist/prefix-walk-Dv6MLZlM.js +0 -99
  236. package/system/dist/rename-composition-block-C9HuBrKS.js +0 -112
  237. package/system/dist/rename-composition-block-DtaYmYAR.mjs +0 -101
@@ -0,0 +1,366 @@
1
+ const require_capability_definition = require("./capability-definition-HCmTem8c.js");
2
+ const require_system_reasons = require("./system-reasons-Be_k1W8g.js");
3
+ const require_device_type = require("./device-type-CbQsnFdC.js");
4
+ const require_source_info = require("./source-info-DtWf4k2j.js");
5
+ let zod = require("zod");
6
+ //#region ../types/dist/esm/capabilities/device-provider.cap.mjs
7
+ var ProviderStatusSchema = /* @__PURE__ */ zod.z.object({
8
+ connected: /* @__PURE__ */ zod.z.boolean(),
9
+ deviceCount: /* @__PURE__ */ zod.z.number(),
10
+ error: /* @__PURE__ */ zod.z.string().optional(),
11
+ /**
12
+ * `'orchestrator'`: this provider writes NO camera's `motion` runtime slice
13
+ * — the orchestrator is its only writer (D696). Set by `BaseDeviceProvider`,
14
+ * which every provider bundles, so only a provider BUILT from D696-amended
15
+ * code says it. ABSENT means an older provider that may still write it (raw
16
+ * VMD writes, a boot seed), and the orchestrator's provider gate keeps that
17
+ * provider's cameras unwritten (`camera-sensors/motion-slice-provider-gate.ts`)
18
+ * — the provider twin of the runner's `getLocalLoad().motionSliceWriter`.
19
+ */
20
+ motionSliceWriter: /* @__PURE__ */ zod.z.literal("orchestrator").optional()
21
+ });
22
+ /**
23
+ * HOW a provider can be found on the network. The provider only DECLARES the
24
+ * mode; the `local-network` scan engine runs it once for every provider that
25
+ * asked (one multicast browse, one host sweep) and hands the raw hits back to
26
+ * `classifyDiscoveryHits`. A provider never opens a discovery socket itself,
27
+ * except through a `custom` mode.
28
+ */
29
+ var DiscoveryModeSchema = /* @__PURE__ */ zod.z.discriminatedUnion("kind", [
30
+ /* @__PURE__ */ zod.z.object({
31
+ kind: /* @__PURE__ */ zod.z.literal("mdns"),
32
+ /** DNS-SD service type, e.g. `_esphomelib._tcp`. */
33
+ serviceType: /* @__PURE__ */ zod.z.string().min(1),
34
+ /** Regular expression an instance name must match (case-insensitive). */
35
+ instancePattern: /* @__PURE__ */ zod.z.string().optional()
36
+ }),
37
+ /* @__PURE__ */ zod.z.object({
38
+ kind: /* @__PURE__ */ zod.z.literal("ws-discovery"),
39
+ /** Probe types (e.g. `dn:NetworkVideoTransmitter`); omitted = any device. */
40
+ types: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).optional()
41
+ }),
42
+ /* @__PURE__ */ zod.z.object({
43
+ kind: /* @__PURE__ */ zod.z.literal("ssdp"),
44
+ searchTarget: /* @__PURE__ */ zod.z.string().min(1)
45
+ }),
46
+ /* @__PURE__ */ zod.z.object({
47
+ kind: /* @__PURE__ */ zod.z.literal("udp-broadcast"),
48
+ port: /* @__PURE__ */ zod.z.number().int().min(1).max(65535),
49
+ payloadHex: /* @__PURE__ */ zod.z.string().regex(/^([0-9a-fA-F]{2})*$/),
50
+ /** Port replies arrive on, when the device answers somewhere other than the source port. */
51
+ listenPort: /* @__PURE__ */ zod.z.number().int().min(1).max(65535).optional()
52
+ }),
53
+ /* @__PURE__ */ zod.z.object({
54
+ kind: /* @__PURE__ */ zod.z.literal("http-probe"),
55
+ port: /* @__PURE__ */ zod.z.number().int().min(1).max(65535),
56
+ path: /* @__PURE__ */ zod.z.string().startsWith("/"),
57
+ method: /* @__PURE__ */ zod.z.enum(["GET", "POST"]).default("GET"),
58
+ bodyText: /* @__PURE__ */ zod.z.string().optional(),
59
+ contentType: /* @__PURE__ */ zod.z.string().optional(),
60
+ tls: /* @__PURE__ */ zod.z.boolean().default(false),
61
+ /** Status codes that count as a hit. Omitted = any HTTP answer. */
62
+ acceptStatus: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.number().int()).optional()
63
+ }),
64
+ /* @__PURE__ */ zod.z.object({
65
+ kind: /* @__PURE__ */ zod.z.literal("custom"),
66
+ /** Why the engine cannot do it (an allowlisted exception, e.g. a vendor UDP protocol). */
67
+ reason: /* @__PURE__ */ zod.z.string().min(1)
68
+ })
69
+ ]);
70
+ /** What the engine saw on the wire for ONE declared mode; the provider classifies it. */
71
+ var DiscoveryHitSchema = /* @__PURE__ */ zod.z.object({
72
+ /** Index into the provider's own `getDiscoveryModes()` array. */
73
+ modeIndex: /* @__PURE__ */ zod.z.number().int().min(0),
74
+ host: /* @__PURE__ */ zod.z.string(),
75
+ port: /* @__PURE__ */ zod.z.number().int(),
76
+ http: /* @__PURE__ */ zod.z.object({
77
+ status: /* @__PURE__ */ zod.z.number().int(),
78
+ headers: /* @__PURE__ */ zod.z.record(/* @__PURE__ */ zod.z.string(), /* @__PURE__ */ zod.z.string()),
79
+ /** At most 16 KiB. */
80
+ bodyText: /* @__PURE__ */ zod.z.string()
81
+ }).optional(),
82
+ mdns: /* @__PURE__ */ zod.z.object({
83
+ instance: /* @__PURE__ */ zod.z.string(),
84
+ host: /* @__PURE__ */ zod.z.string(),
85
+ port: /* @__PURE__ */ zod.z.number().int(),
86
+ txt: /* @__PURE__ */ zod.z.record(/* @__PURE__ */ zod.z.string(), /* @__PURE__ */ zod.z.string())
87
+ }).optional(),
88
+ udp: /* @__PURE__ */ zod.z.object({ payloadHex: /* @__PURE__ */ zod.z.string() }).optional(),
89
+ wsd: /* @__PURE__ */ zod.z.object({
90
+ xaddrs: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()),
91
+ types: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()),
92
+ scopes: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string())
93
+ }).optional()
94
+ });
95
+ /**
96
+ * Candidate handed back from discovery and accepted by
97
+ * `adoptDiscoveredDevice`. Shape mirrors the in-process
98
+ * `DiscoveredDevice` interface used by `DeviceDiscovery`.
99
+ */
100
+ var DiscoveryCandidateSchema = /* @__PURE__ */ zod.z.object({
101
+ stableId: /* @__PURE__ */ zod.z.string(),
102
+ type: /* @__PURE__ */ zod.z.enum(require_device_type.DeviceType),
103
+ suggestedName: /* @__PURE__ */ zod.z.string(),
104
+ prefilledConfig: /* @__PURE__ */ zod.z.record(/* @__PURE__ */ zod.z.string(), /* @__PURE__ */ zod.z.unknown()),
105
+ /**
106
+ * Optional upstream-system identity (HA entity_id, vendor MAC, …).
107
+ * Discovery pre-populates this for systems that know the upstream
108
+ * identity ahead of adoption. Rendering metadata (unit, precision)
109
+ * flows live through the cap STATUS SLICE after adoption.
110
+ */
111
+ sourceInfo: /* @__PURE__ */ require_source_info.SourceInfoSchema.optional(),
112
+ /**
113
+ * Set when this candidate is a device the provider ALREADY owns.
114
+ *
115
+ * A scan cannot generally produce the identity a device was onboarded under
116
+ * (Reolink keys on `mac-<mac>`, learned at adopt time), so a stableId
117
+ * comparison never matches and an owned device looks addable. Re-adopting one
118
+ * overwrites its config with scan-derived values — that is how a Home Hub's
119
+ * Baichuan port was overwritten with its ONVIF port, taking the hub and its
120
+ * three child cameras offline for four hours.
121
+ *
122
+ * A provider that can recognise its own devices says so here. Absent means
123
+ * "not recognised", which is not the same as "known to be new" — a provider
124
+ * that cannot tell simply never sets it.
125
+ */
126
+ alreadyOnboarded: /* @__PURE__ */ zod.z.boolean().optional(),
127
+ /** Numeric id of the device this candidate was matched to. Set with `alreadyOnboarded`. */
128
+ onboardedDeviceId: /* @__PURE__ */ zod.z.number().optional(),
129
+ /** Operator-facing name of the matched device, so the UI can say WHICH one it is. */
130
+ onboardedName: /* @__PURE__ */ zod.z.string().optional(),
131
+ /**
132
+ * This candidate is an INTEGRATION to set up (a gateway, a hub, a controller),
133
+ * not a device to adopt. Replaces the `prefilledConfig.setupIntegration` marker,
134
+ * which is still read for one release.
135
+ */
136
+ setupIntegration: /* @__PURE__ */ zod.z.boolean().optional(),
137
+ /** `stableId` of the gateway candidate this device was found BEHIND. */
138
+ parentStableId: /* @__PURE__ */ zod.z.string().optional(),
139
+ /** `false` = shown for context but not pickable. Default true. */
140
+ selectable: /* @__PURE__ */ zod.z.boolean().optional(),
141
+ /**
142
+ * Keys of the provider's creation form (`getChildCreationSchema`) this candidate
143
+ * cannot be adopted without — a key for an encrypted board, a pairing code. The
144
+ * admin asks for exactly these, on the creation form prefilled with
145
+ * `prefilledConfig`, before it adopts. Absent or empty = adopt as it is.
146
+ */
147
+ needsParams: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).optional()
148
+ });
149
+ /**
150
+ * Flat device summary returned by `createDevice` / `adoptDiscoveredDevice`.
151
+ * Mirrors `toDeviceShape()` output in `device-management.router.ts` so the
152
+ * tRPC layer can pass it through without reshaping.
153
+ */
154
+ var DeviceSummarySchema = /* @__PURE__ */ zod.z.object({
155
+ id: /* @__PURE__ */ zod.z.number(),
156
+ stableId: /* @__PURE__ */ zod.z.string(),
157
+ addonId: /* @__PURE__ */ zod.z.string(),
158
+ type: /* @__PURE__ */ zod.z.string(),
159
+ name: /* @__PURE__ */ zod.z.string(),
160
+ parentDeviceId: /* @__PURE__ */ zod.z.number().nullable(),
161
+ online: /* @__PURE__ */ zod.z.boolean(),
162
+ features: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()),
163
+ config: /* @__PURE__ */ zod.z.record(/* @__PURE__ */ zod.z.string(), /* @__PURE__ */ zod.z.unknown()),
164
+ /** Optional upstream-system identity (dispatch key + system tag).
165
+ * See `SourceInfo`. Present when the device has a non-synthetic
166
+ * source identifier (HA entities, vendor MAC, …); omitted when the
167
+ * synthetic backfill is in effect. */
168
+ sourceInfo: /* @__PURE__ */ require_source_info.SourceInfoSchema.optional()
169
+ });
170
+ /**
171
+ * Result of a live field test (e.g. probing an RTSP URL during device
172
+ * creation). Matches the UI-side `FieldProbeResult` in
173
+ * `interfaces/config-ui.ts` — the admin `FormBuilder` renders the
174
+ * returned `labels` as chips next to the input.
175
+ */
176
+ var FieldProbeResultSchema = /* @__PURE__ */ zod.z.object({
177
+ status: /* @__PURE__ */ zod.z.enum(["ok", "error"]),
178
+ labels: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).optional(),
179
+ error: /* @__PURE__ */ zod.z.string().optional()
180
+ });
181
+ /**
182
+ * The output of `getChildCreationSchema` is a UI schema tree. We store
183
+ * it as `unknown` at the capability layer — the router just passes it
184
+ * through and the admin UI renders it via `FormBuilder`. The actual
185
+ * type is `ConfigUISchema` (see `packages/types/src/interfaces/config-ui.ts`),
186
+ * but we deliberately avoid a Zod mirror because the union is large and
187
+ * not meant for runtime validation at this seam.
188
+ */
189
+ var CreationSchemaOutputSchema = /* @__PURE__ */ zod.z.unknown();
190
+ var deviceProviderCapability = {
191
+ name: "device-provider",
192
+ scope: "system",
193
+ mode: "collection",
194
+ methods: {
195
+ start: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.void(), /* @__PURE__ */ zod.z.void(), { kind: "mutation" }),
196
+ stop: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.void(), /* @__PURE__ */ zod.z.void(), { kind: "mutation" }),
197
+ getStatus: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.void(), ProviderStatusSchema),
198
+ getDevices: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.void(), /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.object({
199
+ id: /* @__PURE__ */ zod.z.string(),
200
+ name: /* @__PURE__ */ zod.z.string(),
201
+ type: /* @__PURE__ */ zod.z.string()
202
+ }))),
203
+ /**
204
+ * Tear down and reconstruct ONE device in place from its persisted rows —
205
+ * touching no other device this provider owns.
206
+ *
207
+ * The primitive `deviceManager.migrateDevice` uses to flush the two
208
+ * migrated numbers: after `swapIds` the runner's live instance still
209
+ * carries the PRE-swap numeric id (baked into the object, its native-cap
210
+ * registrations and its log tags), and a live object cannot be renumbered.
211
+ * Before this method the only flush was restarting the whole owning addon
212
+ * — which took every camera the provider owns down with it (28 devices
213
+ * for one migrated camera, measured 2026-09-04, and the morning of the
214
+ * same day ~27 devices' native caps did not come back on their own).
215
+ *
216
+ * Keyed by `stableId`, deliberately: the numeric id is exactly the thing
217
+ * that changes. The reply carries the id the device answers on NOW.
218
+ * Implemented once in `BaseDeviceProvider` — decommission the live
219
+ * instance (if any), then re-create from the persisted row: the same
220
+ * teardown/rehydrate pair every graceful shutdown + boot already uses.
221
+ * An RPC, never an event: a dropped event would leave the runner writing
222
+ * against the wrong camera (D8).
223
+ *
224
+ * Construction can dial hardware, and the migrated source is
225
+ * characteristically dead — the timeout covers a full activate window
226
+ * rather than the 60 s default.
227
+ */
228
+ reloadDevice: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({ stableId: /* @__PURE__ */ zod.z.string() }), /* @__PURE__ */ zod.z.object({ deviceId: /* @__PURE__ */ zod.z.number() }), {
229
+ kind: "mutation",
230
+ timeoutMs: 3 * 6e4
231
+ }),
232
+ supportsDiscovery: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({}), /* @__PURE__ */ zod.z.boolean()),
233
+ /**
234
+ * Run a network scan. `params` carries optional provider-specific scan
235
+ * inputs (e.g. a broadcast address / subnet for cross-subnet discovery),
236
+ * shaped by `getDiscoveryParamsSchema`. Omitted for the generic scan
237
+ * (provider uses its local-network default).
238
+ */
239
+ discoverDevices: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({ params: /* @__PURE__ */ zod.z.record(/* @__PURE__ */ zod.z.string(), /* @__PURE__ */ zod.z.unknown()).optional() }), /* @__PURE__ */ zod.z.array(DiscoveryCandidateSchema), {
240
+ kind: "mutation",
241
+ auth: "admin"
242
+ }),
243
+ /**
244
+ * How this provider is found on the network. `[]` = the provider has no
245
+ * declarative mode and keeps answering `discoverDevices` itself.
246
+ */
247
+ getDiscoveryModes: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({}), /* @__PURE__ */ zod.z.array(DiscoveryModeSchema)),
248
+ /**
249
+ * Turn the engine's raw hits into candidates. The provider may make
250
+ * follow-up UNICAST requests to a hit host (an authenticated call, an
251
+ * identity check) and never sweeps a subnet. `params` is the per-scan form
252
+ * from `getDiscoveryParamsSchema`.
253
+ */
254
+ classifyDiscoveryHits: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
255
+ hits: /* @__PURE__ */ zod.z.array(DiscoveryHitSchema),
256
+ params: /* @__PURE__ */ zod.z.record(/* @__PURE__ */ zod.z.string(), /* @__PURE__ */ zod.z.unknown()).optional()
257
+ }), /* @__PURE__ */ zod.z.array(DiscoveryCandidateSchema), {
258
+ kind: "mutation",
259
+ auth: "admin"
260
+ }),
261
+ /**
262
+ * Optional form schema (`ConfigUISchema`) for the EXTRA per-scan inputs a
263
+ * provider accepts (e.g. Gree's broadcast address for a different subnet).
264
+ * `null` when the provider takes no extra scan params — the generic
265
+ * aggregated scan never renders this; the per-integration scan does.
266
+ */
267
+ getDiscoveryParamsSchema: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({}), CreationSchemaOutputSchema),
268
+ /**
269
+ * The DeviceType this provider creates via manual add (Camera for
270
+ * Reolink/ONVIF, Container for Gree, Hub for Ecowitt). `null` when the
271
+ * provider does not support manual creation. Lets the Add-Device dialog
272
+ * pick the right type instead of assuming Camera.
273
+ */
274
+ getManualCreationType: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
275
+ /** The integration asked about; a provider whose integrations differ answers per one. */
276
+ integrationId: /* @__PURE__ */ zod.z.string().optional() }), /* @__PURE__ */ zod.z.object({ deviceType: /* @__PURE__ */ zod.z.enum(require_device_type.DeviceType).nullable() })),
277
+ adoptDiscoveredDevice: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
278
+ candidate: DiscoveryCandidateSchema,
279
+ /** The integration the operator adopts into; a provider with several instances needs it. */
280
+ integrationId: /* @__PURE__ */ zod.z.string().optional()
281
+ }), DeviceSummarySchema, {
282
+ kind: "mutation",
283
+ auth: "admin"
284
+ }),
285
+ supportsManualCreation: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({}), /* @__PURE__ */ zod.z.boolean()),
286
+ /**
287
+ * Fetch the creation form schema for a given DeviceType. Returns
288
+ * `null` when the provider does not support manually creating
289
+ * devices of that type. The output is a `ConfigUISchema` — the
290
+ * router type-asserts it at the boundary.
291
+ */
292
+ getChildCreationSchema: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
293
+ type: /* @__PURE__ */ zod.z.enum(require_device_type.DeviceType),
294
+ /** The integration asked about; a provider whose integrations differ answers per one. */
295
+ integrationId: /* @__PURE__ */ zod.z.string().optional()
296
+ }), CreationSchemaOutputSchema),
297
+ createDevice: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
298
+ type: /* @__PURE__ */ zod.z.enum(require_device_type.DeviceType),
299
+ config: /* @__PURE__ */ zod.z.record(/* @__PURE__ */ zod.z.string(), /* @__PURE__ */ zod.z.unknown()),
300
+ /** The integration the operator adds the device to; a provider with several instances needs it. */
301
+ integrationId: /* @__PURE__ */ zod.z.string().optional()
302
+ }), DeviceSummarySchema, {
303
+ kind: "mutation",
304
+ auth: "admin"
305
+ }),
306
+ /**
307
+ * Test a single field in the creation form before the device has
308
+ * been persisted. Typical use: probing an RTSP URL entered by the
309
+ * user. Providers that don't support field probing return
310
+ * `{ success: true, message: 'Field test not supported' }`.
311
+ *
312
+ * `formValues` is the live snapshot of every field in the form at
313
+ * the moment the user clicked Test — useful for probes that depend
314
+ * on multiple fields together (e.g. Reolink autodetect needs host
315
+ * + credentials + UID + transport mode in a single call). Optional
316
+ * for backwards compatibility; providers free to ignore it.
317
+ */
318
+ testCreationField: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
319
+ type: /* @__PURE__ */ zod.z.enum(require_device_type.DeviceType),
320
+ key: /* @__PURE__ */ zod.z.string(),
321
+ value: /* @__PURE__ */ zod.z.unknown(),
322
+ formValues: /* @__PURE__ */ zod.z.record(/* @__PURE__ */ zod.z.string(), /* @__PURE__ */ zod.z.unknown()).optional()
323
+ }), FieldProbeResultSchema, {
324
+ kind: "mutation",
325
+ auth: "admin"
326
+ })
327
+ },
328
+ vocabulary: { notOperatorFacing: require_system_reasons.NOT_A_DEVICE.INTERNAL }
329
+ };
330
+ //#endregion
331
+ Object.defineProperty(exports, "DeviceSummarySchema", {
332
+ enumerable: true,
333
+ get: function() {
334
+ return DeviceSummarySchema;
335
+ }
336
+ });
337
+ Object.defineProperty(exports, "DiscoveryCandidateSchema", {
338
+ enumerable: true,
339
+ get: function() {
340
+ return DiscoveryCandidateSchema;
341
+ }
342
+ });
343
+ Object.defineProperty(exports, "DiscoveryHitSchema", {
344
+ enumerable: true,
345
+ get: function() {
346
+ return DiscoveryHitSchema;
347
+ }
348
+ });
349
+ Object.defineProperty(exports, "DiscoveryModeSchema", {
350
+ enumerable: true,
351
+ get: function() {
352
+ return DiscoveryModeSchema;
353
+ }
354
+ });
355
+ Object.defineProperty(exports, "FieldProbeResultSchema", {
356
+ enumerable: true,
357
+ get: function() {
358
+ return FieldProbeResultSchema;
359
+ }
360
+ });
361
+ Object.defineProperty(exports, "deviceProviderCapability", {
362
+ enumerable: true,
363
+ get: function() {
364
+ return deviceProviderCapability;
365
+ }
366
+ });
@@ -1,4 +1,7 @@
1
- import { Nt as IdentityLinkBodySchema, ct as DiscoveryProposalBodySchema, it as DeviceIdentifiersSchema, lc as canonicalStoredDeviceType, rt as DeviceIdentifierKeySchema, st as DeviceTombstoneSchema, zl as defineRecordKinds } from "./dist-BCHMSqzc.mjs";
1
+ import { s as defineRecordKinds } from "./record-kind-ub6NXqfh.mjs";
2
+ import { c as IdentityLinkBodySchema, n as DeviceTombstoneSchema, o as DiscoveryProposalBodySchema } from "./device-manager.cap-CFZSPfUh.mjs";
3
+ import { n as DeviceIdentifierKeySchema, r as DeviceIdentifiersSchema } from "./device-identifiers-iSuQCKmK.mjs";
4
+ import { t as canonicalStoredDeviceType } from "./device-kind-BJ2pfsjw.mjs";
2
5
  //#region src/builtins/device-manager/migration-refused.ts
3
6
  /**
4
7
  * A migration step that REFUSED with nothing moved.
@@ -1,4 +1,7 @@
1
- const require_dist = require("./dist-BZfvhfS1.js");
1
+ const require_record_kind = require("./record-kind-DoBfYHCs.js");
2
+ const require_device_manager_cap = require("./device-manager.cap-2abwVLCM.js");
3
+ const require_device_identifiers = require("./device-identifiers-BQg9EQi1.js");
4
+ const require_device_kind = require("./device-kind-CsSiv_YF.js");
2
5
  //#region src/builtins/device-manager/migration-refused.ts
3
6
  /**
4
7
  * A migration step that REFUSED with nothing moved.
@@ -26,8 +29,8 @@ var MigrationRefusedError = class extends Error {
26
29
  this.name = "MigrationRefusedError";
27
30
  }
28
31
  };
29
- var DeviceTombstoneBodySchema = require_dist.DeviceTombstoneSchema.omit({ deviceId: true });
30
- var _deviceManagerRecordKinds = require_dist.defineRecordKinds({
32
+ var DeviceTombstoneBodySchema = require_device_manager_cap.DeviceTombstoneSchema.omit({ deviceId: true });
33
+ var _deviceManagerRecordKinds = require_record_kind.defineRecordKinds({
31
34
  tombstones: {
32
35
  schema: DeviceTombstoneBodySchema,
33
36
  class: "ledger",
@@ -44,7 +47,7 @@ var _deviceManagerRecordKinds = require_dist.defineRecordKinds({
44
47
  }
45
48
  },
46
49
  "discovery-proposals": {
47
- schema: require_dist.DiscoveryProposalBodySchema,
50
+ schema: require_device_manager_cap.DiscoveryProposalBodySchema,
48
51
  class: "config",
49
52
  writeTrigger: "the passive listener and the 30-minute sweep of `local-network` re-see a device (`lastSeenAt` and `at` move); `dismissDiscoveryProposal` sets `dismissed`",
50
53
  device: "none",
@@ -59,7 +62,7 @@ var _deviceManagerRecordKinds = require_dist.defineRecordKinds({
59
62
  }
60
63
  },
61
64
  "identity-links": {
62
- schema: require_dist.IdentityLinkBodySchema,
65
+ schema: require_device_manager_cap.IdentityLinkBodySchema,
63
66
  class: "config",
64
67
  writeTrigger: "the identity-link reconciler sees a candidate appear, upgrade or lose its evidence; the operator confirms, dismisses or unlinks (D1063)",
65
68
  device: "none",
@@ -513,7 +516,7 @@ function decodeDeviceRow(data) {
513
516
  const addonId = readString(data["addonId"]);
514
517
  const stableId = readString(data["stableId"]);
515
518
  const storedType = readString(data["type"]);
516
- const type = storedType === void 0 ? void 0 : require_dist.canonicalStoredDeviceType(storedType);
519
+ const type = storedType === void 0 ? void 0 : require_device_kind.canonicalStoredDeviceType(storedType);
517
520
  const name = readString(data["name"]);
518
521
  if (deviceId === void 0 || addonId === void 0 || stableId === void 0 || type === void 0 || name === void 0) return null;
519
522
  const location = readString(data["location"]);
@@ -531,9 +534,9 @@ function decodeDeviceRow(data) {
531
534
  const primaryChildPreference = readStringArray(data["primaryChildPreference"]);
532
535
  const rawDisplay = data["display"];
533
536
  const rawMetadata = data["metadata"];
534
- const identifiers = require_dist.DeviceIdentifiersSchema.safeParse(data["identifiers"]);
535
- const attachedIdentifiers = require_dist.DeviceIdentifiersSchema.safeParse(data["attachedIdentifiers"]);
536
- const attachedRetained = require_dist.DeviceIdentifierKeySchema.array().min(1).safeParse(data["attachedRetained"]);
537
+ const identifiers = require_device_identifiers.DeviceIdentifiersSchema.safeParse(data["identifiers"]);
538
+ const attachedIdentifiers = require_device_identifiers.DeviceIdentifiersSchema.safeParse(data["attachedIdentifiers"]);
539
+ const attachedRetained = require_device_identifiers.DeviceIdentifierKeySchema.array().min(1).safeParse(data["attachedRetained"]);
537
540
  return {
538
541
  meta: {
539
542
  id: deviceId,