@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,431 @@
1
+ import { a as readingMeta } from "./quantity-D3g5SxsZ.mjs";
2
+ import { z } from "zod";
3
+ //#region ../types/dist/esm/audio/audio-chunk-format.mjs
4
+ /**
5
+ * The audio chunk plane's byte format, and the ONE expansion from a coded
6
+ * window to float samples (D455).
7
+ *
8
+ * ## Why a format at all
9
+ *
10
+ * D450 took the plane off its 8 → 16 kHz upsample: it carries the SOURCE
11
+ * RATE, and the one consumer that needs 16 kHz resamples next to the model.
12
+ * It left the FORMAT alone — the broker still turned each G.711 byte into a
13
+ * 4-byte f32le sample before the bytes entered the transport, so every leg of
14
+ * the plane carried four times the source. The plane crosses hub-main twice on
15
+ * the way to the analyzer, and the fleet's G.711 cameras are ~79 % of it.
16
+ *
17
+ * So the plane carries the source BYTES too, and whoever needs floats expands
18
+ * them where it needs them. That is the same argument D450 made for the rate,
19
+ * one step further along the same wire.
20
+ *
21
+ * ## Why the expansion lives here
22
+ *
23
+ * Two packages need it and they must never disagree: `addon-pipeline`'s broker
24
+ * (which still has to serve a subscriber that did NOT ask for coded bytes —
25
+ * `AudioChunkPlane` expands per subscription) and
26
+ * `addon-pipeline-orchestrator`'s `AudioWindowAccumulator` (which flushes an
27
+ * f32le window to the analyzer cap, whose `AudioChunkInput` contract is
28
+ * unchanged and stays f32le). Both bundle the bare `@camstack/types` entry
29
+ * into their own dist (`self-contained` externals), so this travels with a
30
+ * `camstack deploy` and needs no published server.
31
+ *
32
+ * A second μ-law table anywhere else is the defect this module exists to
33
+ * prevent. (`stream-broker.ts`'s `mulawToPcm` / `alawToPcm` are the ENCODE
34
+ * direction for the WebRTC egress — a different transform, not a copy.)
35
+ *
36
+ * ## Absent means f32le
37
+ *
38
+ * `format` is optional on the wire and its absence means `f32le` — today's
39
+ * bytes, byte for byte. A peer that never heard of the field is served what it
40
+ * has always been served, because the broker only emits a coded window to a
41
+ * subscription that DECLARED it accepts one (`AudioSubscribeOptions.accept`).
42
+ * That is the D448 `rawForward` negotiation, and it is what makes this
43
+ * deployable one addon at a time across three nodes.
44
+ */
45
+ /** Every byte format the audio chunk plane can carry. `f32le` is the default. */
46
+ var AUDIO_CHUNK_FORMATS = [
47
+ "f32le",
48
+ "pcmu",
49
+ "pcma"
50
+ ];
51
+ //#endregion
52
+ //#region ../types/dist/esm/capabilities/schemas/streaming-shared.mjs
53
+ /** Shared Zod schemas used across streaming capabilities. */
54
+ var CamProfileSchema = /* @__PURE__ */ z.enum([
55
+ "high",
56
+ "mid",
57
+ "low"
58
+ ]);
59
+ /**
60
+ * Which rung a per-camera consumer listens on: an explicit profile, or `auto`.
61
+ *
62
+ * `auto` is a REAL value, not an absent one — it means "resolve it by the rule
63
+ * that consumer owns". It lives beside `CamProfile` because a rung is the only
64
+ * operator-facing way to name a stream: a cam-stream id is broker-internal and
65
+ * moves when a slot is reassigned, so a stored id silently stops meaning what
66
+ * the operator picked. Today's one user is the audio analyser, whose rule is
67
+ * "the lowest AVAILABLE native rung" (D537).
68
+ */
69
+ var AudioStreamPickSchema = /* @__PURE__ */ z.union([CamProfileSchema, /* @__PURE__ */ z.literal("auto")]);
70
+ var CamStreamKindSchema = /* @__PURE__ */ z.enum([
71
+ "pull-rtsp",
72
+ "pull-rtmp",
73
+ "pull-http",
74
+ "pull-flv",
75
+ "pull-rfc4571",
76
+ "push-annexb",
77
+ "derived"
78
+ ]);
79
+ var CamStreamResolutionSchema = /* @__PURE__ */ z.object({
80
+ width: /* @__PURE__ */ z.number().int().positive().meta(/* @__PURE__ */ readingMeta("none")),
81
+ height: /* @__PURE__ */ z.number().int().positive().meta(/* @__PURE__ */ readingMeta("none"))
82
+ });
83
+ var CameraStreamSchema = /* @__PURE__ */ z.object({
84
+ /** Stable, provider-assigned id unique within the (deviceId) scope. */
85
+ camStreamId: /* @__PURE__ */ z.string().min(1),
86
+ deviceId: /* @__PURE__ */ z.number().int().nonnegative(),
87
+ kind: CamStreamKindSchema,
88
+ /** Required for pull-* kinds. Ignored for push-annexb. */
89
+ url: /* @__PURE__ */ z.string().optional(),
90
+ codec: /* @__PURE__ */ z.string().optional(),
91
+ resolution: /* @__PURE__ */ CamStreamResolutionSchema.optional(),
92
+ fps: /* @__PURE__ */ z.number().positive().optional(),
93
+ /** Human label surfaced in the Admin UI "Camera Stream" dropdown. */
94
+ label: /* @__PURE__ */ z.string().optional(),
95
+ /**
96
+ * Device-level features the publisher advertised (e.g. `battery-operated`).
97
+ * The broker, snapshot orchestrator, and prebuffer manager all consult
98
+ * this list to derive policy — relaxed stall watchdog for battery
99
+ * cams, prebuffer off by default, longer snapshot rate-limit, etc.
100
+ *
101
+ * Single source of truth replacing per-stream flags like the
102
+ * historical `allowStall`: if the publisher knows the camera is
103
+ * battery-powered, every downstream service derives the right policy
104
+ * from this list.
105
+ */
106
+ deviceFeatures: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).optional(),
107
+ /**
108
+ * Whether this stream participates in the broker's automatic profile
109
+ * assignment (`computeInitialAssignment`). Defaults to `true`. Publishers
110
+ * use `false` when they want a stream to be SELECTABLE in the UI but not
111
+ * picked by default — e.g. Reolink publishes its native Baichuan streams
112
+ * as `autoEligible: true` (the recommended path) and its RTSP / RTMP
113
+ * mirrors as `autoEligible: false` (still pickable per slot, just not
114
+ * the auto choice). Manual `assignProfile` calls remain valid for
115
+ * non-eligible streams.
116
+ */
117
+ autoEligible: /* @__PURE__ */ z.boolean().optional(),
118
+ /**
119
+ * The longest continuous session the SOURCE will keep open, in ms, declared by
120
+ * the provider that knows it (a hub that cuts every child's session on a
121
+ * timer). Absent = no limit. The broker re-dials a live source a little
122
+ * BEFORE this elapses, on its own terms and announced to consumers, so the
123
+ * source's cut never lands mid-recording. Declare slightly under what was
124
+ * observed.
125
+ */
126
+ maxSessionMs: /* @__PURE__ */ z.number().int().positive().optional(),
127
+ /**
128
+ * The profile slot the PUBLISHER says this stream is: `low` for a stream
129
+ * whose only sensible role is the low-bandwidth one, `high` for a main
130
+ * stream. Consulted by the broker's automatic ranking
131
+ * (`rankInitialAssignment`) BEFORE the pixel-count heuristic, and only there:
132
+ * an operator's manual assignment still wins, and an absent hint is the
133
+ * pixel-ranked default every camera had before this field existed.
134
+ *
135
+ * Why it exists: a camera with ONE stream ranked to `mid` — the slot no
136
+ * storage class is written for on its own (`recordings` is high|mid,
137
+ * `recordingsLow` is low) and the one profile scrub does not read. The robot
138
+ * camera's single 720p relay is a `low` in every respect except the slot the
139
+ * heuristic put it in.
140
+ */
141
+ profileHint: /* @__PURE__ */ CamProfileSchema.optional(),
142
+ /**
143
+ * Transport-specific opaque metadata. The broker passes it through to
144
+ * the source reader without inspecting it. Currently used by
145
+ * `pull-rfc4571` streams to carry the upstream SDP (so the reader can
146
+ * route RTP packets to the right depacketizer without an in-band
147
+ * DESCRIBE phase). Other kinds typically leave it undefined.
148
+ */
149
+ metadata: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.unknown()).optional()
150
+ });
151
+ var ProfileSlotStatusSchema = /* @__PURE__ */ z.enum([
152
+ "unassigned",
153
+ "idle",
154
+ "connecting",
155
+ "streaming",
156
+ "error"
157
+ ]);
158
+ var ProfileSlotSchema = /* @__PURE__ */ z.object({
159
+ deviceId: /* @__PURE__ */ z.number().int().nonnegative(),
160
+ profile: CamProfileSchema,
161
+ /** Broker id the rest of the system addresses: `${deviceId}/${profile}`. */
162
+ brokerId: /* @__PURE__ */ z.string(),
163
+ /** `null` when the profile is unassigned. */
164
+ sourceCamStreamId: /* @__PURE__ */ z.string().nullable(),
165
+ status: ProfileSlotStatusSchema,
166
+ resolution: /* @__PURE__ */ CamStreamResolutionSchema.optional(),
167
+ codec: /* @__PURE__ */ z.string().optional(),
168
+ preBufferSec: /* @__PURE__ */ z.number().nonnegative().optional(),
169
+ errorMessage: /* @__PURE__ */ z.string().optional()
170
+ });
171
+ /**
172
+ * Zod schema for StreamSourceEntry — the canonical stream descriptor
173
+ * exposed by ICameraDevice.getStreamSources() and consumed by the broker.
174
+ */
175
+ var StreamSourceEntrySchema = /* @__PURE__ */ z.object({
176
+ id: /* @__PURE__ */ z.string(),
177
+ label: /* @__PURE__ */ z.string(),
178
+ protocol: /* @__PURE__ */ z.enum([
179
+ "rtsp",
180
+ "rtmp",
181
+ "annexb",
182
+ "http-mjpeg",
183
+ "webrtc",
184
+ "custom"
185
+ ]),
186
+ url: /* @__PURE__ */ z.string().optional(),
187
+ resolution: /* @__PURE__ */ z.object({
188
+ width: /* @__PURE__ */ z.number(),
189
+ height: /* @__PURE__ */ z.number()
190
+ }).readonly().optional(),
191
+ fps: /* @__PURE__ */ z.number().optional(),
192
+ bitrate: /* @__PURE__ */ z.number().optional(),
193
+ codec: /* @__PURE__ */ z.string().optional(),
194
+ profileHint: /* @__PURE__ */ CamProfileSchema.optional()
195
+ });
196
+ /**
197
+ * Wire schema for `FrameHandle` — a zero-pixel, serialisable reference to a
198
+ * frame in a shared-memory ring (Phase 5 / D9). Mirrors the `FrameHandle` TS
199
+ * interface in `interfaces/frame-handle.ts` field-for-field so a cap method
200
+ * (the runner's native-crop and pipeline-executor inputs) can carry handles
201
+ * over tRPC / Moleculer.
202
+ *
203
+ * The `satisfies` assertion below pins this schema to the interface: if a
204
+ * field is added to / removed from `FrameHandle` without a matching schema
205
+ * edit, `z.infer<typeof FrameHandleSchema>` stops being assignable to
206
+ * `FrameHandle` and the build fails — no silent drift.
207
+ */
208
+ var FrameHandleSchema = /* @__PURE__ */ z.object({
209
+ shmId: /* @__PURE__ */ z.string(),
210
+ slot: /* @__PURE__ */ z.number().int().nonnegative(),
211
+ seq: /* @__PURE__ */ z.number().int().nonnegative(),
212
+ width: /* @__PURE__ */ z.number().int().positive(),
213
+ height: /* @__PURE__ */ z.number().int().positive(),
214
+ format: /* @__PURE__ */ z.enum([
215
+ "jpeg",
216
+ "rgb",
217
+ "bgr",
218
+ "yuv420",
219
+ "gray"
220
+ ]),
221
+ pts: /* @__PURE__ */ z.number(),
222
+ byteLength: /* @__PURE__ */ z.number().int().nonnegative(),
223
+ nodeId: /* @__PURE__ */ z.string(),
224
+ slotCount: /* @__PURE__ */ z.number().int().positive()
225
+ });
226
+ /**
227
+ * Wire schema for a decoded audio chunk (Phase 5 / D9). Mirrors the
228
+ * `DecodedAudioChunk` TS interface in `interfaces/stream-broker.ts`: PCM
229
+ * sample bytes plus the track parameters a consumer needs to interpret them.
230
+ *
231
+ * Audio chunks are tiny (a ~500ms AudioCodecSession window is a few KB of
232
+ * Float32 PCM), so unlike video frames they ship their bytes INLINE over
233
+ * tRPC / Moleculer — no shared-memory plane. `data` is typed `Uint8Array`
234
+ * (the wire-serialisable supertype of `Buffer`); a `Buffer` is assignable to
235
+ * it.
236
+ */
237
+ var AudioChunkFormatSchema = /* @__PURE__ */ z.enum(AUDIO_CHUNK_FORMATS);
238
+ var DecodedAudioChunkSchema = /* @__PURE__ */ z.object({
239
+ data: /* @__PURE__ */ z.instanceof(Uint8Array),
240
+ sampleRate: /* @__PURE__ */ z.number().int().positive(),
241
+ channels: /* @__PURE__ */ z.number().int().positive(),
242
+ timestamp: /* @__PURE__ */ z.number(),
243
+ /**
244
+ * Byte format of `data`. ABSENT MEANS `f32le` — today's bytes, byte for
245
+ * byte, for any peer that never heard of this field. A coded window
246
+ * (`pcmu` / `pcma`, one byte per sample) is only ever emitted to a
247
+ * subscription that DECLARED it accepts one, so absence can never mean
248
+ * "coded bytes a consumer will read as floats" (D455).
249
+ */
250
+ format: /* @__PURE__ */ AudioChunkFormatSchema.optional()
251
+ });
252
+ /**
253
+ * Input for `stream-broker.subscribeAudioChunks` (Phase 5 / D9). Audio ships
254
+ * its bytes inline: a consumer asks the broker for the decoded audio-chunk
255
+ * stream of one broker; the broker keeps a per-subscription bounded FIFO queue
256
+ * the consumer drains via `pullAudioChunks`.
257
+ */
258
+ var SubscribeAudioChunksInputSchema = /* @__PURE__ */ z.object({
259
+ brokerId: /* @__PURE__ */ z.string(),
260
+ /** Short caller-identity tag (`audio-analyzer`, …) for `listClients`. */
261
+ tag: /* @__PURE__ */ z.string().optional(),
262
+ /**
263
+ * Byte formats this subscriber can READ, best first. The broker serves the
264
+ * chunk's own format when it is in this list and expands to `f32le`
265
+ * otherwise, so a subscriber is never handed bytes it cannot interpret.
266
+ *
267
+ * Absent (or without the source format) means `f32le` — the behaviour every
268
+ * subscriber had before D455, unchanged. This is the negotiation half of
269
+ * the source-bytes lever: it is what lets the broker and its consumers
270
+ * deploy one at a time across three nodes.
271
+ */
272
+ accept: /* @__PURE__ */ z.array(AudioChunkFormatSchema).readonly().optional()
273
+ });
274
+ /** Result of `stream-broker.subscribeAudioChunks`. */
275
+ var SubscribeAudioChunksResultSchema = /* @__PURE__ */ z.object({
276
+ /** Opaque id passed to `pullAudioChunks` / `unsubscribeAudioChunks`. */
277
+ subscriptionId: /* @__PURE__ */ z.string() });
278
+ var BrokerStatusSchema = /* @__PURE__ */ z.enum([
279
+ "idle",
280
+ "connecting",
281
+ "streaming",
282
+ "error",
283
+ "stopped"
284
+ ]);
285
+ /**
286
+ * The encode a derived stream's feeder was last spawned with — the read-only
287
+ * "effective encode". Read off the ffmpeg argv that runs, so it cannot drift
288
+ * from what the operator's profile and the carrier's rules resolved to.
289
+ */
290
+ var DerivedEffectiveEncodeSchema = /* @__PURE__ */ z.object({
291
+ /** `-c:v` of the argv (`libx264`, a hardware encoder, `copy`); null when absent. */
292
+ encoder: /* @__PURE__ */ z.string().nullable(),
293
+ /** Output frame rate; null when the source cadence passes through unmeasured. */
294
+ fps: /* @__PURE__ */ z.number().nullable(),
295
+ gopFrames: /* @__PURE__ */ z.number(),
296
+ /** ABR target (`-b:v`), kbps. */
297
+ targetKbps: /* @__PURE__ */ z.number().nullable(),
298
+ /** Ceiling (`-maxrate`), kbps. */
299
+ capKbps: /* @__PURE__ */ z.number().nullable(),
300
+ bufsizeKbps: /* @__PURE__ */ z.number().nullable(),
301
+ /**
302
+ * `copy` = source audio untouched, `aac` = re-encoded, `profile` = operator's
303
+ * encode, `none` = the operator dropped the track.
304
+ */
305
+ audio: /* @__PURE__ */ z.enum([
306
+ "copy",
307
+ "aac",
308
+ "profile",
309
+ "none"
310
+ ])
311
+ });
312
+ /**
313
+ * A derived stream's source: a **profile** slot (follows whatever physical
314
+ * stream that profile is assigned to) or a **camStream** (pinned to one
315
+ * physical stream regardless of assignment).
316
+ */
317
+ var DerivedSourceRefSchema = /* @__PURE__ */ z.union([/* @__PURE__ */ z.object({
318
+ kind: /* @__PURE__ */ z.literal("profile"),
319
+ profile: /* @__PURE__ */ z.enum([
320
+ "high",
321
+ "mid",
322
+ "low"
323
+ ])
324
+ }), /* @__PURE__ */ z.object({
325
+ kind: /* @__PURE__ */ z.literal("camStream"),
326
+ camStreamId: /* @__PURE__ */ z.string()
327
+ })]);
328
+ /**
329
+ * The full effective encode of a derived-stream profile: the stats the broker
330
+ * publishes in `getBrokerStats.derivedEncode` plus the resolved geometry, the
331
+ * flags that say WHY a number differs from the request, and the ffmpeg output
332
+ * argv. One function (`computeDerivedEncode`) produces it for both the
333
+ * broker's start path and `previewDerivedEncode`.
334
+ */
335
+ var DerivedEncodePreviewSchema = /* @__PURE__ */ DerivedEffectiveEncodeSchema.extend({
336
+ /** Final picture size; `null` when neither the profile nor the source names it. */
337
+ width: /* @__PURE__ */ z.number().nullable(),
338
+ height: /* @__PURE__ */ z.number().nullable(),
339
+ /** `h264` / `h265` re-encode, `copy` remux; `null` is never returned (the encoder always resolves). */
340
+ videoCodec: /* @__PURE__ */ z.enum([
341
+ "h264",
342
+ "h265",
343
+ "copy"
344
+ ]),
345
+ requestedFps: /* @__PURE__ */ z.number().nullable(),
346
+ /** The requested fps exceeded the source and the source cadence won. */
347
+ fpsClampedToSource: /* @__PURE__ */ z.boolean(),
348
+ /** Lowest bitrate accepted for this geometry x fps; `null` when unknown. */
349
+ floorKbps: /* @__PURE__ */ z.number().nullable(),
350
+ /** The explicit bitrate was below the floor and was raised to it. */
351
+ raisedToFloor: /* @__PURE__ */ z.boolean(),
352
+ /** What the profile asked for when it was raised; `null` otherwise. */
353
+ requestedKbps: /* @__PURE__ */ z.number().nullable(),
354
+ /** Seconds between keyframes; `null` when the output cadence is unknown. */
355
+ keyframeIntervalSec: /* @__PURE__ */ z.number().nullable(),
356
+ /** The ffmpeg argv, with the source loopback URL in `-i`. */
357
+ args: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string())
358
+ });
359
+ /** Result of `previewDerivedEncode`: a plan, or the reason there is none. */
360
+ var PreviewDerivedEncodeResultSchema = /* @__PURE__ */ z.discriminatedUnion("kind", [/* @__PURE__ */ z.object({
361
+ kind: /* @__PURE__ */ z.literal("preview"),
362
+ preview: DerivedEncodePreviewSchema
363
+ }), /* @__PURE__ */ z.object({ kind: /* @__PURE__ */ z.literal("no-source") })]);
364
+ var BrokerStatsSchema = /* @__PURE__ */ z.object({
365
+ status: BrokerStatusSchema,
366
+ inputFps: /* @__PURE__ */ z.number(),
367
+ encodedSubscribers: /* @__PURE__ */ z.number(),
368
+ uptimeMs: /* @__PURE__ */ z.number(),
369
+ bitrateKbps: /* @__PURE__ */ z.number(),
370
+ idrIntervalMs: /* @__PURE__ */ z.number(),
371
+ codec: /* @__PURE__ */ z.string().optional(),
372
+ totalBytes: /* @__PURE__ */ z.number(),
373
+ packetCount: /* @__PURE__ */ z.number(),
374
+ rtspClients: /* @__PURE__ */ z.number(),
375
+ pipeClients: /* @__PURE__ */ z.number(),
376
+ preBufferSec: /* @__PURE__ */ z.number(),
377
+ preBufferMs: /* @__PURE__ */ z.number(),
378
+ preBufferPackets: /* @__PURE__ */ z.number(),
379
+ /**
380
+ * Detected audio track parameters from the RTSP DESCRIBE / SDP. `null`
381
+ * when the stream has no audio track or the broker is in cold start.
382
+ * `supported = false` means the codec was detected but the local
383
+ * decoder pipeline cannot produce PCM chunks (e.g. AAC without the
384
+ * AAC pipeline wired). Surfaced in the UI device-overview so operators
385
+ * can pre-pick the audio-analysis model that matches the codec.
386
+ */
387
+ audio: /* @__PURE__ */ z.object({
388
+ codec: /* @__PURE__ */ z.string(),
389
+ sampleRate: /* @__PURE__ */ z.number(),
390
+ channels: /* @__PURE__ */ z.number(),
391
+ supported: /* @__PURE__ */ z.boolean()
392
+ }).nullable().optional(),
393
+ /**
394
+ * BROKER-SIDE AUDIO MUTE (D83). `true` = this broker is deliberately
395
+ * distributing none of the device's audio, on live or recording.
396
+ *
397
+ * Present so a silent camera can be told apart from a broken one on the
398
+ * stream panel itself, without cross-referencing the switch group: a
399
+ * broker holding an `audio` track descriptor while `audioMuted` is true is
400
+ * working exactly as asked. `audioMutedDropped` counts the audio units
401
+ * thrown away since the current dial — it is how you confirm from stats
402
+ * alone that the mute is on the packet path and not merely persisted.
403
+ */
404
+ audioMuted: /* @__PURE__ */ z.boolean().optional(),
405
+ audioMutedDropped: /* @__PURE__ */ z.number().optional(),
406
+ /** Present for a derived broker once its feeder has spawned at least once. */
407
+ derivedEncode: /* @__PURE__ */ DerivedEffectiveEncodeSchema.optional()
408
+ });
409
+ /**
410
+ * Exporter-facing "profile restream" entry. Returned by
411
+ * `cameraStreams.getProfileRtspEntries` — one per ASSIGNED profile slot
412
+ * (high/mid/low). `brokerId` is the PROFILE-keyed broker id
413
+ * (`${deviceId}/${profile}`, e.g. `15/high`); its `url` is a broker
414
+ * RTSP restream that aliases the profile's assigned source broker, so
415
+ * every consumer dialling a profile converges on the same single pull.
416
+ * `codec`/`resolution` describe the assigned SOURCE camStream (for the
417
+ * `auto` resolution-closest pick). Distinct from `RtspRestreamEntry`
418
+ * (raw per-camStream, live-view only).
419
+ */
420
+ var ProfileRtspEntrySchema = /* @__PURE__ */ z.object({
421
+ profile: CamProfileSchema,
422
+ /** Profile-keyed broker id, format `${deviceId}/${profile}` (e.g. `"15/high"`). */
423
+ brokerId: /* @__PURE__ */ z.string(),
424
+ url: /* @__PURE__ */ z.string(),
425
+ mutedUrl: /* @__PURE__ */ z.string(),
426
+ enabled: /* @__PURE__ */ z.boolean(),
427
+ codec: /* @__PURE__ */ z.string().optional(),
428
+ resolution: /* @__PURE__ */ CamStreamResolutionSchema.optional()
429
+ });
430
+ //#endregion
431
+ export { CamStreamResolutionSchema as a, DerivedSourceRefSchema as c, ProfileRtspEntrySchema as d, ProfileSlotSchema as f, SubscribeAudioChunksResultSchema as g, SubscribeAudioChunksInputSchema as h, CamStreamKindSchema as i, FrameHandleSchema as l, StreamSourceEntrySchema as m, BrokerStatsSchema as n, CameraStreamSchema as o, ProfileSlotStatusSchema as p, CamProfileSchema as r, DecodedAudioChunkSchema as s, AudioStreamPickSchema as t, PreviewDerivedEncodeResultSchema as u };