@camstack/server 1.2.927 → 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 (235) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.json +11 -14
  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-widgets.cap-C4jxflbF.js +200 -0
  10. package/system/dist/addon-widgets.cap-D9m48X78.mjs +183 -0
  11. package/system/dist/base-addon-DD5dIfcZ.js +4624 -0
  12. package/system/dist/base-addon-Md14i7pe.mjs +4505 -0
  13. package/system/dist/base-device-2sL1DMm1.js +1103 -0
  14. package/system/dist/base-device-IuM1AwXZ.mjs +1098 -0
  15. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +8 -6
  16. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +3 -1
  17. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +8 -6
  18. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +3 -1
  19. package/system/dist/builtins/alerts/alerts.addon.js +113 -56
  20. package/system/dist/builtins/alerts/alerts.addon.mjs +58 -1
  21. package/system/dist/builtins/autotrack/index.js +21 -17
  22. package/system/dist/builtins/autotrack/index.mjs +5 -1
  23. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +14 -11
  24. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +5 -2
  25. package/system/dist/builtins/calendars/calendars.addon.js +8 -6
  26. package/system/dist/builtins/calendars/calendars.addon.mjs +3 -1
  27. package/system/dist/builtins/camera-grid/index.js +615 -58
  28. package/system/dist/builtins/camera-grid/index.mjs +558 -1
  29. package/system/dist/builtins/composer/composer.addon.js +788 -209
  30. package/system/dist/builtins/composer/composer.addon.mjs +583 -4
  31. package/system/dist/builtins/console-logging/index.js +4 -3
  32. package/system/dist/builtins/console-logging/index.mjs +2 -1
  33. package/system/dist/builtins/core-blocks/core-blocks.addon.js +7887 -381
  34. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +7511 -5
  35. package/system/dist/builtins/core-notifier/core-notifier.addon.js +731 -21
  36. package/system/dist/builtins/core-notifier/core-notifier.addon.mjs +711 -1
  37. package/system/dist/builtins/device-history/device-history.addon.js +110 -31
  38. package/system/dist/builtins/device-history/device-history.addon.mjs +81 -2
  39. package/system/dist/builtins/device-manager/device-manager.addon.js +12806 -227
  40. package/system/dist/builtins/device-manager/device-manager.addon.mjs +12583 -5
  41. package/system/dist/builtins/hub-forwarder/index.js +4 -3
  42. package/system/dist/builtins/hub-forwarder/index.mjs +2 -1
  43. package/system/dist/builtins/keychain/index.js +31 -28
  44. package/system/dist/builtins/keychain/index.mjs +7 -4
  45. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +15 -12
  46. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +4 -1
  47. package/system/dist/builtins/local-auth/local-auth.addon.js +140 -39
  48. package/system/dist/builtins/local-auth/local-auth.addon.mjs +103 -3
  49. package/system/dist/builtins/local-network/local-network.addon.js +43 -39
  50. package/system/dist/builtins/local-network/local-network.addon.mjs +7 -3
  51. package/system/dist/builtins/loki-logging/index.js +23 -17
  52. package/system/dist/builtins/loki-logging/index.mjs +7 -1
  53. package/system/dist/builtins/native-metrics/native-metrics.addon.js +156 -15
  54. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +142 -1
  55. package/system/dist/builtins/platform-probe/index.js +25 -23
  56. package/system/dist/builtins/platform-probe/index.mjs +4 -2
  57. package/system/dist/builtins/record-entries/index.js +9 -7
  58. package/system/dist/builtins/record-entries/index.mjs +3 -1
  59. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +4 -4
  60. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  61. package/system/dist/builtins/snapshot/index.js +97 -44
  62. package/system/dist/builtins/snapshot/index.mjs +54 -1
  63. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +5 -4
  64. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +2 -1
  65. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  66. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  67. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +87 -61
  68. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +29 -3
  69. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +81 -72
  70. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +10 -1
  71. package/system/dist/builtins/system-config/system-config.addon.js +17 -14
  72. package/system/dist/builtins/system-config/system-config.addon.mjs +6 -3
  73. package/system/dist/builtins/winston-logging/index.js +7 -5
  74. package/system/dist/builtins/winston-logging/index.mjs +3 -1
  75. package/system/dist/calendars.cap-CaFlShS9.js +155 -0
  76. package/system/dist/calendars.cap-_C4eD4fi.mjs +138 -0
  77. package/system/dist/camstack-error-DJ-TUAi1.js +23 -0
  78. package/system/dist/camstack-error-viZYfcj9.mjs +18 -0
  79. package/system/dist/cap-call-context-Bd76CbOW.js +95 -0
  80. package/system/dist/cap-call-context-DNwdgGSQ.mjs +78 -0
  81. package/system/dist/capability-definition-C2rJdVeX.mjs +177 -0
  82. package/system/dist/capability-definition-HCmTem8c.js +242 -0
  83. package/system/dist/{capture-engine-BcuwOSXv.js → capture-engine-DZ0LIUqA.js} +5 -4
  84. package/system/dist/{capture-engine-Bz7eXFjT.mjs → capture-engine-DiwbjoWp.mjs} +2 -1
  85. package/system/dist/command-origin-claim-Cief660O.js +35 -0
  86. package/system/dist/command-origin-claim-D1Wy7Qld.mjs +24 -0
  87. package/system/dist/composition-sources-Caqv7O7z.mjs +391 -0
  88. package/system/dist/composition-sources-CgnHjm8Q.js +408 -0
  89. package/system/dist/{constants-D2etJ02O.js → constants-Ba3FTIHl.js} +1 -1
  90. package/system/dist/constants-C860Y6U4.js +26 -0
  91. package/system/dist/{constants-BcUTQd1M.mjs → constants-DB4piTD5.mjs} +1 -1
  92. package/system/dist/constants-DCLpoF4L.mjs +21 -0
  93. package/system/dist/coral-accelerators-7o8hqvcN.js +564 -0
  94. package/system/dist/coral-accelerators-BKcXP59c.mjs +521 -0
  95. package/system/dist/core-blocks.cap-C6iKAZ-x.mjs +17986 -0
  96. package/system/dist/core-blocks.cap-LEMqVwxO.js +18705 -0
  97. package/system/dist/custom-actions-BFUSalC9.mjs +25 -0
  98. package/system/dist/custom-actions-D92NRi2c.js +36 -0
  99. package/system/dist/database-snapshot.cap-DF38e-0P.js +162 -0
  100. package/system/dist/database-snapshot.cap-dhrc9xnY.mjs +133 -0
  101. package/system/dist/declared-device-BWphj9WE.js +303 -0
  102. package/system/dist/declared-device-CKERA1Hi.mjs +286 -0
  103. package/system/dist/{device-ca-ExMN3xW3.mjs → device-ca-BLM6fccc.mjs} +2 -1
  104. package/system/dist/{device-ca-CU8zh9Pi.js → device-ca-C5kJE6mL.js} +7 -6
  105. package/system/dist/device-certificate-Cddm4Idn.mjs +91 -0
  106. package/system/dist/device-certificate-CguVACQO.js +162 -0
  107. package/system/dist/device-identifiers-BQg9EQi1.js +600 -0
  108. package/system/dist/device-identifiers-iSuQCKmK.mjs +529 -0
  109. package/system/dist/device-kind-BJ2pfsjw.mjs +78 -0
  110. package/system/dist/device-kind-CsSiv_YF.js +101 -0
  111. package/system/dist/device-manager.cap-2abwVLCM.js +2874 -0
  112. package/system/dist/device-manager.cap-CFZSPfUh.mjs +2749 -0
  113. package/system/dist/device-provider.cap-3Uvk6f5-.mjs +331 -0
  114. package/system/dist/device-provider.cap-D7TV2kVH.js +366 -0
  115. package/system/dist/{device-row-store-CeW_GWh9.mjs → device-row-store-YF3jtmkk.mjs} +4 -1
  116. package/system/dist/{device-row-store-BMIR-n3m.js → device-row-store-doTfMOqn.js} +12 -9
  117. package/system/dist/device-transitions.cap-B5w5PYU_.js +860 -0
  118. package/system/dist/device-transitions.cap-DojcwEuX.mjs +819 -0
  119. package/system/dist/device-type-CbQsnFdC.js +477 -0
  120. package/system/dist/device-type-DgEvK3ch.mjs +454 -0
  121. package/system/dist/entry-kind-D9MuVJCK.mjs +44 -0
  122. package/system/dist/entry-kind-cq90c--V.js +55 -0
  123. package/system/dist/error.cap-CSM_SRfR.mjs +3423 -0
  124. package/system/dist/error.cap-DBhgPeWK.js +3848 -0
  125. package/system/dist/file-host-worker.js +1 -1
  126. package/system/dist/file-host-worker.mjs +1 -1
  127. package/system/dist/history-catalog-BKRarIL_.js +831 -0
  128. package/system/dist/history-catalog-BwTeQ4Mr.mjs +802 -0
  129. package/system/dist/{hub-identity-Csxx2Q8k.js → hub-identity-BMdR3Mw9.js} +2 -2
  130. package/system/dist/{hub-identity-BBXzP6Ve.mjs → hub-identity-DjMN9Ac2.mjs} +1 -1
  131. package/system/dist/{hub-mdns-ciao-By5577HM.js → hub-mdns-ciao--0v1TKME.js} +5 -5
  132. package/system/dist/{hub-mdns-ciao-DG17NbGU.mjs → hub-mdns-ciao-DBrtHOcc.mjs} +2 -2
  133. package/system/dist/index.js +763 -151
  134. package/system/dist/index.mjs +624 -12
  135. package/system/dist/integration-instances.cap-Cl9O-k4h.mjs +538 -0
  136. package/system/dist/integration-instances.cap-dJIxg2_s.js +549 -0
  137. package/system/dist/keychain-admin.cap-Db_oFX4H.js +425 -0
  138. package/system/dist/keychain-admin.cap-GtM7gVGG.mjs +396 -0
  139. package/system/dist/l10n-Bu6aUvSY.mjs +10 -0
  140. package/system/dist/l10n-CGMvp7NF.js +15 -0
  141. package/system/dist/labels-DX5S8deC.js +81 -0
  142. package/system/dist/labels-DsBcU7md.mjs +64 -0
  143. package/system/dist/{legacy-integration-rows-door-CVwOo5aq.js → legacy-integration-rows-door-B1nzxxr5.js} +2 -2
  144. package/system/dist/{legacy-integration-rows-door-D9tQOUzh.mjs → legacy-integration-rows-door-nTvo_6jQ.mjs} +1 -1
  145. package/system/dist/log-destination.cap-CxZzAVaR.mjs +143 -0
  146. package/system/dist/log-destination.cap-DELPJkZ0.js +148 -0
  147. package/system/dist/low-power-sleep.cap-7lfVU41N.js +103 -0
  148. package/system/dist/low-power-sleep.cap-tGPmaZ_V.mjs +92 -0
  149. package/system/dist/mask-shape-Ci8Co9w0.mjs +57 -0
  150. package/system/dist/mask-shape-CmPA2fst.js +92 -0
  151. package/system/dist/metrics-provider.cap-BNmcHDkQ.mjs +405 -0
  152. package/system/dist/metrics-provider.cap-BcmQUt6l.js +410 -0
  153. package/system/dist/migration-BMjgkyG2.js +380 -0
  154. package/system/dist/migration-DRJAtdy7.mjs +321 -0
  155. package/system/dist/network-access.cap-B5TWLDCC.js +1099 -0
  156. package/system/dist/network-access.cap-BJnGbE6n.mjs +1004 -0
  157. package/system/dist/notification-rules.cap-B__YBgnG.js +3422 -0
  158. package/system/dist/notification-rules.cap-D9ArZlwx.mjs +3357 -0
  159. package/system/dist/ops-log-CB4pIdqi.mjs +64 -0
  160. package/system/dist/ops-log-pxt9176Z.js +81 -0
  161. package/system/dist/pinned-binary-BOhOSNff.js +28 -0
  162. package/system/dist/pinned-binary-CrIRAi4G.mjs +23 -0
  163. package/system/dist/platform-probe.cap-1WrMhWHx.js +250 -0
  164. package/system/dist/platform-probe.cap-BFeqFLtQ.mjs +233 -0
  165. package/system/dist/prefix-walk-B4b2-9aK.mjs +790 -0
  166. package/system/dist/prefix-walk-DC0ljmbB.js +843 -0
  167. package/system/dist/ptz-autotrack.cap-BW7w0zHD.js +229 -0
  168. package/system/dist/ptz-autotrack.cap-DT2GypXw.mjs +224 -0
  169. package/system/dist/quantity-D3g5SxsZ.mjs +114 -0
  170. package/system/dist/quantity-lY1KiTSZ.js +143 -0
  171. package/system/dist/raw-secret-migration-DxuBFtvi.js +50 -0
  172. package/system/dist/raw-secret-migration-iv88mLoc.mjs +39 -0
  173. package/system/dist/record-entries.cap-sMUhTvTU.mjs +75 -0
  174. package/system/dist/record-entries.cap-ti1C046R.js +80 -0
  175. package/system/dist/record-kind-DoBfYHCs.js +203 -0
  176. package/system/dist/record-kind-ub6NXqfh.mjs +162 -0
  177. package/system/dist/recording-archive.cap-7OrIn9e5.mjs +1299 -0
  178. package/system/dist/recording-archive.cap-D7bo-QSM.js +1328 -0
  179. package/system/dist/records.cap-ClcWV64i.js +329 -0
  180. package/system/dist/records.cap-CwLT2ByG.mjs +294 -0
  181. package/system/dist/relocate-CdVQAk-w.js +804 -0
  182. package/system/dist/relocate-CoZZTui1.mjs +661 -0
  183. package/system/dist/rename-composition-block-7WIICIDq.mjs +33525 -0
  184. package/system/dist/rename-composition-block-CcWLwVhG.js +34692 -0
  185. package/system/dist/{restore-archive-kwtBd00M.mjs → restore-archive-CjAyKpgX.mjs} +3 -1
  186. package/system/dist/{restore-archive-CIFvqOze.js → restore-archive-CkTkv3Ss.js} +6 -4
  187. package/system/dist/scoped-settings-CylSSq_8.js +955 -0
  188. package/system/dist/scoped-settings-DVWUIP7Z.mjs +650 -0
  189. package/system/dist/server-name-BIhLuHvX.mjs +35 -0
  190. package/system/dist/server-name-OALNvpqC.js +52 -0
  191. package/system/dist/settings-store.cap-Ci4F2zul.mjs +569 -0
  192. package/system/dist/settings-store.cap-wlJhCspr.js +640 -0
  193. package/system/dist/snapshot.cap-3suPdBHV.js +250 -0
  194. package/system/dist/snapshot.cap-Bs8Oyaqh.mjs +245 -0
  195. package/system/dist/source-info-DGB7SdB_.mjs +190 -0
  196. package/system/dist/source-info-DtWf4k2j.js +225 -0
  197. package/system/dist/storage-admin.cap-BSv1NjKJ.mjs +883 -0
  198. package/system/dist/storage-admin.cap-he0OqvVM.js +906 -0
  199. package/system/dist/storage-location-CBT8GCD6.mjs +163 -0
  200. package/system/dist/storage-location-CTweDMZf.js +198 -0
  201. package/system/dist/storage-location-mode-B21UVRRX.mjs +167 -0
  202. package/system/dist/storage-location-mode-CS4sMzo-.js +232 -0
  203. package/system/dist/storage-migration.cap-CyyATY_p.js +330 -0
  204. package/system/dist/storage-migration.cap-D7QqGobp.mjs +313 -0
  205. package/system/dist/storage-occupancy.cap-2rmnS58Z.js +622 -0
  206. package/system/dist/storage-occupancy.cap-CqBztTl9.mjs +611 -0
  207. package/system/dist/storage-provider.cap-Bw0CfxVc.js +213 -0
  208. package/system/dist/storage-provider.cap-CMeck2w4.mjs +202 -0
  209. package/system/dist/stream-catalog.cap-Bp7SkgIf.mjs +6560 -0
  210. package/system/dist/stream-catalog.cap-D3uwePiA.js +6763 -0
  211. package/system/dist/streaming-shared-B8cXatuU.mjs +431 -0
  212. package/system/dist/streaming-shared-DQwFZOSi.js +526 -0
  213. package/system/dist/system-reasons-Be_k1W8g.js +25 -0
  214. package/system/dist/system-reasons-CYj4qwyS.mjs +20 -0
  215. package/system/dist/tag-BxLazvVb.js +2138 -0
  216. package/system/dist/tag-uZBAq6ox.mjs +2073 -0
  217. package/system/dist/user-management.cap-B9QDu8NE.js +825 -0
  218. package/system/dist/user-management.cap-DBIi77sB.mjs +766 -0
  219. package/system/dist/vector-store.cap-DnyfrYDn.js +330 -0
  220. package/system/dist/vector-store.cap-h2GHWQ1t.mjs +319 -0
  221. package/system/dist/{wal-maintenance-CTrCPzds.mjs → wal-maintenance-BG01rOn9.mjs} +0 -0
  222. package/system/dist/{wal-maintenance-dq7T3quB.js → wal-maintenance-DyrebYKF.js} +0 -0
  223. package/system/dist/zod-secret-DS7mj1bk.js +78 -0
  224. package/system/dist/zod-secret-zY4nM61M.mjs +73 -0
  225. package/system/package.json +1 -1
  226. package/system/dist/composition-sources-BI614LJx.mjs +0 -141
  227. package/system/dist/composition-sources-v_kkb8A9.js +0 -152
  228. package/system/dist/coral-accelerators-BSVsBVzt.js +0 -250
  229. package/system/dist/coral-accelerators-DBlgWB8k.mjs +0 -231
  230. package/system/dist/dist-BCHMSqzc.mjs +0 -143467
  231. package/system/dist/dist-BZfvhfS1.js +0 -146970
  232. package/system/dist/prefix-walk-DAOBSyH1.mjs +0 -88
  233. package/system/dist/prefix-walk-Dv6MLZlM.js +0 -99
  234. package/system/dist/rename-composition-block-C9HuBrKS.js +0 -112
  235. package/system/dist/rename-composition-block-DtaYmYAR.mjs +0 -101
@@ -0,0 +1,1328 @@
1
+ const require_streaming_shared = require("./streaming-shared-DQwFZOSi.js");
2
+ const require_capability_definition = require("./capability-definition-HCmTem8c.js");
3
+ const require_system_reasons = require("./system-reasons-Be_k1W8g.js");
4
+ const require_ops_log = require("./ops-log-pxt9176Z.js");
5
+ const require_labels = require("./labels-DX5S8deC.js");
6
+ const require_relocate = require("./relocate-CdVQAk-w.js");
7
+ const require_device_type = require("./device-type-CbQsnFdC.js");
8
+ const require_l10n = require("./l10n-CGMvp7NF.js");
9
+ let zod = require("zod");
10
+ //#region ../types/dist/esm/interfaces/recording-config.mjs
11
+ /**
12
+ * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
13
+ * Named `RecordingWeekday` to avoid collision with the string-union
14
+ * `Weekday` exported from `interfaces/timezones.ts`.
15
+ */
16
+ var RecordingWeekdaySchema = /* @__PURE__ */ zod.z.number().int().min(0).max(6);
17
+ var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
18
+ /**
19
+ * DERIVED per-camera storage summary — the single field cheap consumers read
20
+ * (the viewer's status dot, the camera list) instead of walking `bands`:
21
+ * - `off` — no band covers the camera (or it is disabled).
22
+ * - `events` — every band records around triggers only.
23
+ * - `continuous` — at least one band records continuously.
24
+ * - `on-device-decision`— the DEVICE decides: recording runs for as long as the
25
+ * camera raises its own `recording-signal` level (a robot that cleans). There
26
+ * is no schedule to author, because there is no hour to program — see
27
+ * {@link RecordingConfigSchema}`.deviceDecision`.
28
+ *
29
+ * NEVER authored: the recorder stamps it from the authoritative intent
30
+ * (`bands` + `deviceDecision`) on every save (`activeModeForConfig`). Writing it
31
+ * has no effect.
32
+ *
33
+ * `on-device-decision` is named for WHO decides, not for how the recording is
34
+ * requested. `on-demand` was rejected: in this repo's vocabulary a "demand" is
35
+ * something the operator makes (the live gate is the recorder's own "demand
36
+ * window"), and a knob whose name suggests the operator starts it while the
37
+ * device actually does is the D62 shape — a control nobody can predict.
38
+ */
39
+ var RecordingStorageModeSchema = /* @__PURE__ */ zod.z.enum([
40
+ "off",
41
+ "events",
42
+ "continuous",
43
+ "on-device-decision"
44
+ ]);
45
+ /**
46
+ * The macro classes that can open a recording window — the same
47
+ * three offered by the `object-detection` step, from ONE list
48
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
49
+ */
50
+ var RecordingObjectTriggerClassSchema = /* @__PURE__ */ zod.z.enum(require_labels.FIRST_LEVEL_MACRO_CLASSES);
51
+ /**
52
+ * True when `values` does not repeat an element.
53
+ *
54
+ * A duplicate is not harmless: every entry of `objectClasses` / `sensorDeviceIds`
55
+ * becomes a SOURCE in `bandTriggerSources`, and the same source twice
56
+ * would count its windows twice in `segmentMissedByMs`.
57
+ */
58
+ var noDuplicates = (values) => new Set(values).size === values.length;
59
+ /** Which detectors trigger an `events`-mode band. */
60
+ var RecordingTriggersSchema = /* @__PURE__ */ zod.z.object({
61
+ motion: /* @__PURE__ */ zod.z.boolean().optional(),
62
+ audioThresholdDbfs: /* @__PURE__ */ zod.z.number().optional(),
63
+ /**
64
+ * The macro classes whose detection opens a window. ABSENT = the source
65
+ * is not listened to; an EMPTY array is rejected, because "events band, object
66
+ * trigger on, no class" is the same shape "enabled and records
67
+ * nothing, forever" that `eventsBandCanEverDemand` is written against.
68
+ *
69
+ * The signal read is ALREADY FILTERED: only `source: 'pipeline'` detections, i.e.
70
+ * those that went through `enabledMacroClasses`, the
71
+ * `minConfidence<Macro>` and the full-frame guard. The camera's onboard AI
72
+ * (`source: 'onboard'`) goes through none of those gates and does NOT open
73
+ * windows — see `recorder/object-trigger.ts`.
74
+ */
75
+ objectClasses: /* @__PURE__ */ zod.z.array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
76
+ /**
77
+ * The LINKED devices whose RISING EDGE opens a window. Absent = the source
78
+ * is not listened to; an empty array is rejected for the same reason as
79
+ * `objectClasses`.
80
+ *
81
+ * These are SOURCE device ids, not cameras: the band names them, so the
82
+ * hot path (`DeviceStateChanged`, at bus rate across the whole fleet)
83
+ * does no RPC. The OFFER from which the operator picks them is another question, and
84
+ * is resolved with `deviceManager.getLinkedDevices` + `getBindingsBatch` per
85
+ * device (D12) — never a global list of caps.
86
+ *
87
+ * What "high" means depends on the device TYPE and is not decided here:
88
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) is THE table,
89
+ * the same one as the composite doorbell (D671). And it is the EDGE, not
90
+ * the level: a contact found already open at runner restart does not
91
+ * record.
92
+ */
93
+ sensorDeviceIds: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
94
+ });
95
+ /**
96
+ * Mode of a single recording band — the recorder per-band vocabulary.
97
+ *
98
+ * Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
99
+ * only ever `continuous` or `events`; "off" is expressed by the absence of a
100
+ * covering band, not by a band value.
101
+ */
102
+ var RecordingBandModeSchema = /* @__PURE__ */ zod.z.enum(["continuous", "events"]);
103
+ /**
104
+ * Triggers for an `events`-mode band. Identical shape to
105
+ * `RecordingTriggersSchema` — reuse that schema as the band trigger type so the
106
+ * two never drift.
107
+ */
108
+ var RecordingBandTriggersSchema = RecordingTriggersSchema;
109
+ /**
110
+ * A single mode-per-band window — the canonical recorder band shape, the
111
+ * single source of truth re-used by `addon-pipeline/recorder`.
112
+ *
113
+ * `days` lists the weekdays the band covers (empty = every day, matching the
114
+ * band engine's `applies` rule). `start`/`end` are `HH:MM`; an `end <= start`
115
+ * span wraps past midnight (handled by the band engine).
116
+ */
117
+ /**
118
+ * Whether a band's footage carries sound.
119
+ *
120
+ * The recorder has always attached with `audio: 'aac'`, so every band of every
121
+ * camera recorded sound whether anyone wanted it or not. The broker already
122
+ * serves the other answer — `audio: 'none'` takes the video-only `/muted`
123
+ * restream — so this was a choice the product could always have offered.
124
+ *
125
+ * It belongs on the BAND rather than the camera because one camera can want
126
+ * both: silent across the shop floor during opening hours, sound overnight.
127
+ * And it applies to BOTH modes — an events band firing on motion has the same
128
+ * question to answer as a continuous one.
129
+ */
130
+ var RecordingBandAudioSchema = /* @__PURE__ */ zod.z.enum(["on", "muted"]);
131
+ /**
132
+ * A battery condition on a band: the band covers a charge level only when
133
+ * `min <= level < max` (half-open; a missing bound is unbounded). OPTIONAL —
134
+ * an absent key means "any charge", which is what every config written before
135
+ * it meant. A band WITH a condition is never met while the charge is unknown.
136
+ */
137
+ var RecordingBandBatterySchema = /* @__PURE__ */ zod.z.object({
138
+ min: /* @__PURE__ */ zod.z.number().min(0).max(100).optional(),
139
+ max: /* @__PURE__ */ zod.z.number().min(0).max(100).optional()
140
+ });
141
+ var RecordingBandSchema = /* @__PURE__ */ zod.z.object({
142
+ days: /* @__PURE__ */ zod.z.array(RecordingWeekdaySchema),
143
+ start: /* @__PURE__ */ zod.z.string().regex(HHMM),
144
+ end: /* @__PURE__ */ zod.z.string().regex(HHMM),
145
+ mode: RecordingBandModeSchema,
146
+ /**
147
+ * Sound, or silence. OPTIONAL and absent-means-`on`: every recording
148
+ * written before this existed carried sound, and a band whose key is
149
+ * missing must keep meaning what it meant. See {@link RecordingBandAudioSchema}.
150
+ */
151
+ audio: /* @__PURE__ */ RecordingBandAudioSchema.optional(),
152
+ battery: /* @__PURE__ */ RecordingBandBatterySchema.optional(),
153
+ triggers: /* @__PURE__ */ RecordingBandTriggersSchema.optional(),
154
+ /**
155
+ * RETIRED (D381). A band no longer carries a pre-buffer of its own.
156
+ *
157
+ * It was the retroactive KEEP bound — which already-written segments survive
158
+ * a trigger — and it had to be at least as wide as the widest pre-roll the
159
+ * broker could serve, or the gate would delete the seconds the ring had just
160
+ * handed the writer. That "at least as wide as" is the tell: it was a second
161
+ * expression of the broker's retention, in different units, in a different
162
+ * addon, with an invariant the operator had to maintain by hand. The keep
163
+ * bound is now derived from the one prebuffer ceiling and there is nothing
164
+ * left to configure here.
165
+ *
166
+ * The key survives in the SHAPE so a config written before that record still
167
+ * parses and can be migrated deliberately — `RecordingBandSchema` is not
168
+ * strict, so simply deleting it would strip an operator's value in silence on
169
+ * the next save (the failure D380 came one commit from shipping). Nothing
170
+ * reads it: {@link stripRetiredBandPreBufferSec} removes it on load.
171
+ */
172
+ preBufferSec: /* @__PURE__ */ zod.z.number().min(0).optional(),
173
+ postBufferSec: /* @__PURE__ */ zod.z.number().min(0).optional()
174
+ });
175
+ ({ postBufferSec: 30 }).postBufferSec * 1e3;
176
+ /**
177
+ * Per-device retention overrides. Every field is optional; an unset or `0`
178
+ * value inherits the node-wide recorder default. Only footage-lifetime limits
179
+ * live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
180
+ * (when the volume is too full to keep recording) is NOT a per-camera concern —
181
+ * it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
182
+ * shared by every camera writing to that volume.
183
+ */
184
+ var RecordingRetentionSchema = /* @__PURE__ */ zod.z.object({
185
+ maxAgeDays: /* @__PURE__ */ zod.z.number().min(0).optional(),
186
+ maxSizeGb: /* @__PURE__ */ zod.z.number().min(0).optional()
187
+ });
188
+ /**
189
+ * The full per-camera recording intent — the wire shape of a RecordingTarget.
190
+ *
191
+ * `bands` is the ONLY authored recording intent: what to record, when, and on
192
+ * which trigger. `mode` is a derived summary the recorder stamps on save; every
193
+ * other field is a storage knob (profiles, segment length, retention, scrub).
194
+ *
195
+ * STRICT on purpose: the legacy authoring surface (`schedule`/`schedules`/
196
+ * `triggers`/`preBufferSec`/`postBufferSec`/`rules`) was retired 2026-07-30,
197
+ * and `scrubThumbnails` — a five-step fidelity knob for a sprite tier that was
198
+ * deleted on 2026-07-24 and had ZERO consumers in the recorder — on 2026-08-25
199
+ * (D62: a switch that writes a store nobody reads is worse than no switch).
200
+ * Stored rows keep loading: the READ schema is `.strip()` (config-store.ts).
201
+ * A stale caller must fail loudly — silently stripping its legacy intent would
202
+ * persist a band-less config, i.e. silently stop recording the camera.
203
+ */
204
+ var RecordingConfigSchema = /* @__PURE__ */ zod.z.object({
205
+ enabled: /* @__PURE__ */ zod.z.boolean(),
206
+ /** DERIVED summary of `bands`, stamped by the recorder on every save.
207
+ * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
208
+ mode: /* @__PURE__ */ RecordingStorageModeSchema.optional(),
209
+ /**
210
+ * Which assigned broker slots to record. Absent / empty = {@link
211
+ * DEFAULT_RECORDING_PROFILES} (`high`+`low`) intersected with the
212
+ * camera's currently assigned slots — never `mid` unless the operator
213
+ * picks it, and never a slot the broker has not assigned.
214
+ */
215
+ profiles: /* @__PURE__ */ zod.z.array(require_streaming_shared.CamProfileSchema).optional(),
216
+ segmentSeconds: /* @__PURE__ */ zod.z.number().int().positive().optional(),
217
+ /**
218
+ * AUTHORITATIVE mode-per-band recording model — the single source of truth
219
+ * the recorder's band engine consumes. An empty array = record nothing;
220
+ * "off" is the absence of a covering band, never a band value.
221
+ */
222
+ bands: /* @__PURE__ */ zod.z.array(RecordingBandSchema).default([]),
223
+ /**
224
+ * THE device-decided intent: record for as long as the camera itself raises
225
+ * `recording-signal` (`active: true` while the device is in function — a
226
+ * robot that cleans). AUTHORED, unlike `mode`, and the only authored
227
+ * recording intent that is not a band.
228
+ *
229
+ * It carries NO schedule on purpose. A band is an HOUR, and this feature has
230
+ * no hour to program: the device decides. What it costs the operator is one
231
+ * flag — "this camera can record on its own" — and what it buys is the same
232
+ * hold/release the recorder already implements (D371, `holdTrigger` /
233
+ * `releaseTrigger`): the window opens on the rise, stays open for the whole
234
+ * job however long it is, and closes one pad after the fall.
235
+ *
236
+ * EXCLUSIVE with `bands` (below): two authorities deciding when the same
237
+ * camera records is the D62 failure. `off` remains `enabled: false`, so an
238
+ * operator switching this camera off is REPORTED off, never as broken.
239
+ */
240
+ deviceDecision: /* @__PURE__ */ zod.z.boolean().optional(),
241
+ retention: /* @__PURE__ */ RecordingRetentionSchema.optional()
242
+ }).strict().refine((config) => config.deviceDecision !== true || config.bands.length === 0, {
243
+ message: "deviceDecision is a whole-config mode and carries no schedule: it cannot be combined with bands",
244
+ path: ["bands"]
245
+ });
246
+ //#endregion
247
+ //#region ../types/dist/esm/capabilities/recording.cap.mjs
248
+ /** The one addon allowed to serve {@link RECORDING_SOURCE_CAMSTACK}: the
249
+ * recorder, which is the addon that writes the footage (D560). */
250
+ var RECORDING_SOURCE_CAMSTACK_ADDON = "recorder";
251
+ var RecordingRangeSchema = /* @__PURE__ */ zod.z.object({
252
+ profile: /* @__PURE__ */ zod.z.string(),
253
+ startMs: /* @__PURE__ */ zod.z.number(),
254
+ endMs: /* @__PURE__ */ zod.z.number()
255
+ });
256
+ /**
257
+ * How a source ANSWERED, on every singular read of this cap.
258
+ *
259
+ * `'read'` — it looked. `ranges: []` / `days: []` is then a real claim: this
260
+ * source has no coverage in the window. `'unreadable'` — nobody could look
261
+ * (the camera was unreachable, the calendar rung threw, the location is
262
+ * unmounted, the node is still on the old build), and the emptiness beside it
263
+ * means NOTHING.
264
+ *
265
+ * The batch rows have carried this since the grid existed; the SINGULAR
266
+ * answers gained it with the collection (D625 §10.4), because they are the
267
+ * ones the single-camera picker uses and because a half-converted fleet makes
268
+ * "nobody looked" common for the length of a deploy. Without it the timeline
269
+ * has no vocabulary for it, and `(data ?? [])` in a viewer turns a rollout into
270
+ * a fleet of cameras that appear to have lost their recordings (D315, D393).
271
+ */
272
+ var RecordingReadSchema = /* @__PURE__ */ zod.z.enum(["read", "unreadable"]);
273
+ var RecordingAvailabilitySchema = /* @__PURE__ */ zod.z.object({
274
+ deviceId: /* @__PURE__ */ zod.z.number(),
275
+ /** See {@link RecordingReadSchema}. An `'unreadable'` answer carries an empty
276
+ * `ranges` that means nothing — never draw it as "no footage". */
277
+ read: RecordingReadSchema,
278
+ ranges: /* @__PURE__ */ zod.z.array(RecordingRangeSchema),
279
+ /**
280
+ * Every profile this camera has footage in AT THIS SOURCE — not only the one
281
+ * `ranges` describes (D433).
282
+ *
283
+ * `ranges` answers for ONE profile by design: the timeline is a single bar,
284
+ * and enumerating all of them triples the directory reads for a bar that
285
+ * would look identical. But the answer used to say nothing about that, so a
286
+ * caller asking "what can I export?" read the single preferred profile as
287
+ * the only one that exists — on this deployment every camera records `high`
288
+ * AND `low`, the low tree holding 14 GB for camera 101 alone, and the export
289
+ * UI could not see it.
290
+ *
291
+ * Cheap: it is the same shallow directory read the profile CHOICE already
292
+ * makes. Ask for a specific profile's ranges with the `profile` input.
293
+ */
294
+ profilesWithFootage: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string())
295
+ });
296
+ var RecordingDaysSchema = /* @__PURE__ */ zod.z.object({
297
+ deviceId: /* @__PURE__ */ zod.z.number(),
298
+ /** See {@link RecordingReadSchema}. `days: []` on an `'unreadable'` answer is
299
+ * "nobody could look", and the date-picker must not spell it the same as
300
+ * "no footage this month". */
301
+ read: RecordingReadSchema,
302
+ /** Local-midnight epochs (UTC ms) of days that have ≥1 recorded segment. */
303
+ days: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.number())
304
+ });
305
+ var RecordingManifestSchema = /* @__PURE__ */ zod.z.object({
306
+ deviceId: /* @__PURE__ */ zod.z.number(),
307
+ /** Local filesystem path to the master playlist; null when no recording exists for the requested range. */
308
+ localMasterPath: /* @__PURE__ */ zod.z.string().nullable(),
309
+ /** HTTP(S) URL to the master playlist on the recording node's playback server
310
+ * (the PRIMARY candidate); null when no recording / server. Carries the
311
+ * scoped playback token in its path. */
312
+ playbackUrl: /* @__PURE__ */ zod.z.string().nullable(),
313
+ /**
314
+ * Candidate master-playlist URLs the client tries in order (LAN first, then
315
+ * remote — Tailscale/Cloudflare if the operator configured extra hosts), each
316
+ * carrying the same scoped token. `playbackUrl` is the first entry. Empty when
317
+ * there is no recording / server.
318
+ */
319
+ playbackEndpoints: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string())
320
+ });
321
+ var RecordingSourceAvailabilitySchema = /* @__PURE__ */ zod.z.object({
322
+ state: /* @__PURE__ */ zod.z.enum([
323
+ "ok",
324
+ "sleeping",
325
+ "unreachable",
326
+ "no-storage",
327
+ "index-empty"
328
+ ]),
329
+ /** Free text, shown verbatim. Names the camera's own refusal when there is one. */
330
+ reason: /* @__PURE__ */ zod.z.string().optional(),
331
+ /** When this source's coverage was last CONFIRMED. A cached answer is never
332
+ * drawn as current: the surface shows the age whenever it is older than the
333
+ * refresh interval. The clip catalog's `catalogAsOf`, under the name the
334
+ * timeline uses for it. */
335
+ coverageAsOf: /* @__PURE__ */ zod.z.number().optional()
336
+ });
337
+ /**
338
+ * One SOURCE of recorded coverage for a camera — a row of the picker.
339
+ *
340
+ * A provider lists the sources IT serves for that device, and answers for each
341
+ * of them whether it can answer at all. A provider with nothing to offer on a
342
+ * camera returns `[]` — it is not that camera's business. The five availability
343
+ * states are `ClipSourceAvailability`'s verbatim: they mean exactly the same
344
+ * things about a coverage index as about a clip catalog, and `sleeping` in
345
+ * particular is what stops a battery camera being woken to paint a bar.
346
+ */
347
+ var RecordingSourceSchema = /* @__PURE__ */ zod.z.object({
348
+ /** The source id. {@link RECORDING_SOURCE_CAMSTACK} for ours (RESERVED), a
349
+ * vendor namespace (`native:reolink:onboard`, …) for a camera's own store. */
350
+ source: /* @__PURE__ */ zod.z.string(),
351
+ /** Operator-facing name of the source ("CamStack recordings", "SD card"). */
352
+ label: /* @__PURE__ */ zod.z.string(),
353
+ /**
354
+ * The addon that SERVES this row, and the value a later call passes as
355
+ * `provider`.
356
+ *
357
+ * Optional for version skew only. The collection dispatcher stamps it from
358
+ * the registry, so a row that travelled through the fan-out carries the
359
+ * authoritative id whatever the provider filled in (D557 §4).
360
+ */
361
+ addonId: /* @__PURE__ */ zod.z.string().optional(),
362
+ availability: RecordingSourceAvailabilitySchema
363
+ });
364
+ /**
365
+ * What a surface may DRAW for this (camera, source) — D612's rule applied to a
366
+ * timeline: **the source declares what it can do, and the surface draws what
367
+ * was declared. It never assumes, and never offers a gesture it will then
368
+ * refuse.** D612 exists because `8` and `16` were offered as clip rates, the
369
+ * broker clamped them to `4`, and no line anywhere said so.
370
+ *
371
+ * Asked once per (camera, source) before anything is drawn — never replaced by
372
+ * a constant the surface keeps, which is the second authority D612 ends.
373
+ */
374
+ var RecordingSourceOptionsSchema = /* @__PURE__ */ zod.z.object({
375
+ /** How this source's media reaches the player.
376
+ * `archive` = our own indexed segment tree; `stream` = the provider's
377
+ * forward-only fMP4 (D597); `realtime` = a replay bound to wall clock. */
378
+ transport: /* @__PURE__ */ zod.z.enum([
379
+ "archive",
380
+ "stream",
381
+ "realtime"
382
+ ]),
383
+ /** What the BAR means. `continuous` = gaps are holes in a recording;
384
+ * `sparse` = gaps are the absence of one, and must be drawn as such.
385
+ *
386
+ * Not an onboard-only concession: measured 2026-09-24, OUR bar covers 98.8 %
387
+ * of 107's day and 1.2 % of 1436's. It is a fact about a (source, camera)
388
+ * pair, and ours answers it per camera from `deriveRecordingMode`. */
389
+ coverage: /* @__PURE__ */ zod.z.enum(["continuous", "sparse"]),
390
+ /** Where the playhead may be put.
391
+ * `free` — anywhere, to the frame.
392
+ * `forward` — only ahead of the current position.
393
+ * `segment` — a position SNAPS to the head of the covering segment; a finer
394
+ * ask is accepted by the camera and SILENTLY IGNORED. Measured
395
+ * on 1436 (Hikvision V5.7.1, 2026-09-23): a window-narrowed
396
+ * `ContentMgmt/search` returns a row and a `playbackURI`, the
397
+ * replay opens 200 and delivers media — and the burned-in OSD of
398
+ * the first frame reads the SEGMENT HEAD every time. Calling
399
+ * that `forward` would tell the surface it may move the playhead
400
+ * ahead within a loaded segment, which it may not. */
401
+ seek: /* @__PURE__ */ zod.z.enum([
402
+ "free",
403
+ "forward",
404
+ "segment"
405
+ ]),
406
+ /** Frame-step BACKWARD is meaningful. */
407
+ stepBack: /* @__PURE__ */ zod.z.boolean(),
408
+ /** Whether the drag-scrub gesture is served, as opposed to refused by name. */
409
+ scrub: /* @__PURE__ */ zod.z.boolean(),
410
+ /** Deliverable rates, ascending, always containing `1`. The surface draws its
411
+ * picker from this and from NOTHING else (D612, D620, D621). `0` is not a
412
+ * member: pause is the absence of a rate. */
413
+ rates: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.number().positive()).min(1).readonly(),
414
+ /** TRUE when a read of this source HOLDS the camera's only playback session.
415
+ * A surface with this set makes at most ONE read at a time and draws no
416
+ * scrub-thumbnail strip, no hover preview, no prefetch and no background
417
+ * refresh. The precedent is exact and expensive: filling one screen of
418
+ * Hikvision thumbnails at 1.01× realtime consumed fifteen minutes of that
419
+ * camera's only playback session (1.2.126, reported within minutes), and a
420
+ * timeline is a screenful of reads by construction. */
421
+ exclusive: /* @__PURE__ */ zod.z.boolean()
422
+ });
423
+ /**
424
+ * How to PLAY the instant that was asked for, from the chosen source.
425
+ *
426
+ * No new media transport is built for onboard sources: the `clip` arm is a
427
+ * DELEGATION to the `videoclips` transport that vendor already has (D597 /
428
+ * D616 / D617). The onboard half of this collection is a PROJECTION of
429
+ * `videoclips` for coverage and a delegation to it for bytes.
430
+ */
431
+ var RecordingPlaybackSchema = /* @__PURE__ */ zod.z.discriminatedUnion("kind", [
432
+ /* @__PURE__ */ zod.z.object({
433
+ kind: /* @__PURE__ */ zod.z.literal("hls"),
434
+ manifest: RecordingManifestSchema
435
+ }),
436
+ /* @__PURE__ */ zod.z.object({
437
+ kind: /* @__PURE__ */ zod.z.literal("clip"),
438
+ /** The `videoclips` source namespace this clip id belongs to. */
439
+ source: /* @__PURE__ */ zod.z.string(),
440
+ clipId: /* @__PURE__ */ zod.z.string(),
441
+ /** Where this clip actually STARTS. On a `seek: 'segment'` source the
442
+ * playhead lands here, not at the requested instant — the surface must be
443
+ * TOLD, not left to discover it from a burned-in OSD. */
444
+ startsAtMs: /* @__PURE__ */ zod.z.number()
445
+ }),
446
+ /* @__PURE__ */ zod.z.object({
447
+ kind: /* @__PURE__ */ zod.z.literal("none"),
448
+ reason: /* @__PURE__ */ zod.z.string()
449
+ })
450
+ ]);
451
+ var recordingCapability = {
452
+ name: "recording",
453
+ scope: "device",
454
+ /** Several sources per camera, listed beside each other. The mount stays
455
+ * `device-scoped` — see `resolveCapMount`'s ordering and D554: per-device
456
+ * wins over the global collection fan-out. */
457
+ mode: "collection",
458
+ kind: "wrapper",
459
+ defaultActive: true,
460
+ /** Recorded coverage is a property of a camera — the cap is meaningless on a
461
+ * sensor, a button or an event emitter, and the `defaultActive` auto-bind
462
+ * reads this to decide which devices it may claim. */
463
+ deviceTypes: [require_device_type.DeviceType.Camera],
464
+ methods: {
465
+ /**
466
+ * The sources this camera has, WITH the reason any of them cannot answer.
467
+ *
468
+ * Asked separately from `getAvailability` because an empty bar is
469
+ * ambiguous and this is the only place the ambiguity is resolved: every
470
+ * bound provider contributes its own rows, and a provider that could not be
471
+ * reached at all still produces one row saying so. A surface that draws "no
472
+ * recordings" without reading this is drawing a guess.
473
+ *
474
+ * The ONLY method here without a `provider` — it is the call that tells the
475
+ * caller what to put there.
476
+ */
477
+ listSources: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({ deviceId: /* @__PURE__ */ zod.z.number() }), /* @__PURE__ */ zod.z.array(RecordingSourceSchema).readonly(), {
478
+ kind: "query",
479
+ auth: "protected"
480
+ }),
481
+ /**
482
+ * Recorded coverage of `[fromMs, toMs)` at ONE source — the timeline bar.
483
+ *
484
+ * `protected`, not `admin`: a per-camera read is exactly what a camera
485
+ * viewer is FOR, and the device-scoped mount routes through
486
+ * `getProviderForDevice`, so a camera outside the caller's scope is refused
487
+ * before a provider is reached.
488
+ */
489
+ getAvailability: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
490
+ deviceId: /* @__PURE__ */ zod.z.number(),
491
+ /**
492
+ * WHICH provider to ask — the `addonId` a {@link RecordingSourceSchema}
493
+ * row carries, never a source id and never a list. **REQUIRED**, in the
494
+ * schema, where the generated types make it unomittable rather than
495
+ * merely discouraged (D554 amended).
496
+ *
497
+ * It was learned the expensive way on `videoclips.listClips`: measured
498
+ * on the live hub 2026-09-20, device 107 bound to `recorder` AND
499
+ * `provider-reolink`, a bare call with `limit: 3` answered SIX rows,
500
+ * three from each source, merged — `device-collection-dispatch.ts`
501
+ * leaves an unpinned fan-out un-narrowed, so absence buys the union the
502
+ * method exists not to be. An un-narrowed `getAvailability` would do
503
+ * that to a TIMELINE: our ranges and the card's clips unioned into one
504
+ * bar, which is "two sources are never drawn together" broken in the
505
+ * one place it matters most.
506
+ *
507
+ * A provider the device is not bound to is refused BY NAME (D552's
508
+ * `rejectUnresolvedAddonPin`), never answered by another one.
509
+ */
510
+ provider: /* @__PURE__ */ zod.z.string().min(1),
511
+ fromMs: /* @__PURE__ */ zod.z.number(),
512
+ toMs: /* @__PURE__ */ zod.z.number(),
513
+ /**
514
+ * Answer for THIS profile instead of the source's preferred one (D433).
515
+ * Absent keeps the timeline's behaviour — one bar, one profile, one set
516
+ * of reads. `profilesWithFootage` on the answer says what may be asked
517
+ * for.
518
+ */
519
+ profile: /* @__PURE__ */ zod.z.string().optional()
520
+ }), RecordingAvailabilitySchema, {
521
+ kind: "query",
522
+ auth: "protected"
523
+ }),
524
+ /** Which calendar days in [fromMs,toMs) this source has ≥1 recording in,
525
+ * bucketed by the client's local day (`tzOffsetMinutes` = minutes to add
526
+ * to UTC). Drives the theater date-picker's day dots. `provider` is
527
+ * REQUIRED for the reason `getAvailability` states. */
528
+ getDaysWithRecordings: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
529
+ deviceId: /* @__PURE__ */ zod.z.number(),
530
+ provider: /* @__PURE__ */ zod.z.string().min(1),
531
+ fromMs: /* @__PURE__ */ zod.z.number(),
532
+ toMs: /* @__PURE__ */ zod.z.number(),
533
+ tzOffsetMinutes: /* @__PURE__ */ zod.z.number()
534
+ }), RecordingDaysSchema, {
535
+ kind: "query",
536
+ auth: "protected"
537
+ }),
538
+ /**
539
+ * How to PLAY `[fromMs, toMs)` at this source.
540
+ *
541
+ * It was `getPlaybackManifest`, and the rename is not cosmetic: a
542
+ * "manifest" is an HLS master playlist, which is a property of OUR recorder
543
+ * and of nothing else. Keeping the name would make every onboard
544
+ * implementation a lie in its signature. The old shape survives verbatim
545
+ * inside the union's `hls` arm, so the recorder's implementation is
546
+ * unchanged behind it.
547
+ */
548
+ getPlayback: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
549
+ deviceId: /* @__PURE__ */ zod.z.number(),
550
+ provider: /* @__PURE__ */ zod.z.string().min(1),
551
+ fromMs: /* @__PURE__ */ zod.z.number(),
552
+ toMs: /* @__PURE__ */ zod.z.number(),
553
+ profile: /* @__PURE__ */ require_streaming_shared.CamProfileSchema.optional()
554
+ }), RecordingPlaybackSchema, {
555
+ kind: "query",
556
+ auth: "protected"
557
+ }),
558
+ /**
559
+ * What this (camera, source) can actually DO — asked before anything is
560
+ * drawn. See {@link RecordingSourceOptionsSchema}; a constant the surface
561
+ * keeps instead is the second authority D612 exists to end.
562
+ */
563
+ getPlaybackOptions: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
564
+ deviceId: /* @__PURE__ */ zod.z.number(),
565
+ provider: /* @__PURE__ */ zod.z.string().min(1)
566
+ }), RecordingSourceOptionsSchema, {
567
+ kind: "query",
568
+ auth: "protected"
569
+ })
570
+ },
571
+ vocabulary: {
572
+ noun: /* @__PURE__ */ require_l10n.t("Recording", "Registrazione"),
573
+ order: 3250
574
+ }
575
+ };
576
+ //#endregion
577
+ //#region ../types/dist/esm/capabilities/recording-archive.cap.mjs
578
+ /**
579
+ * `recording-archive` — OUR archive, and the intent that fills it.
580
+ *
581
+ * The system-singleton half of the 2026-09-24 cut (D625). `recording` used to
582
+ * be one 33-method system singleton holding two unrelated subjects: three
583
+ * per-camera READS about coverage and playback, and everything else — storage
584
+ * locations, retention, relocation, rebalance, the ops log, the placement
585
+ * table and the byte-plane primitives our scrub and export are built on.
586
+ *
587
+ * The reads became a device-scoped COLLECTION, so a camera's own card can be a
588
+ * source beside ours (`recording.cap.ts`). Everything that is about OUR store,
589
+ * or unimplementable by a camera, stayed here.
590
+ *
591
+ * ## On the name
592
+ *
593
+ * `recording-storage` was the obvious choice and is wrong: this cap also holds
594
+ * `getDeviceConfig`/`setDeviceConfig`, which are recording INTENT — bands,
595
+ * retention, the D62 switch authority — and a name that says "storage" invites
596
+ * the next reader to move them out again. An archive is a thing we keep, and
597
+ * what we keep it under is a policy; the name covers both halves honestly and
598
+ * sits in the existing family (`recording-onboard`, `recording-export`,
599
+ * `recording-signal`).
600
+ *
601
+ * ## What must NOT happen to it
602
+ *
603
+ * It stays a SINGLETON. It is registered by `recorder`, which is
604
+ * `placement: 'any-node'` and runs on every recording node; the hub dispatches
605
+ * to one of them. Putting the ledger, the placement table or the relocation
606
+ * jobs behind a fan-out is the one genuinely dangerous move in this cut.
607
+ *
608
+ * `getDeviceConfig` / `setDeviceConfig` in particular are the D62 recording
609
+ * authority (`CameraSwitch.authority`). If a write reached a different provider
610
+ * than the read — which a collection fan-out permits — two authorities would
611
+ * decide when one camera records, and the symptom (recording silently off, or
612
+ * a `bands` array clobbered by a partial write) is durable and silent. Keeping
613
+ * them here means the worst case during a rollout is a 412: the switch refuses
614
+ * to flip and SAYS so. **Do not move them into the collection, at any point,
615
+ * for any reason.**
616
+ *
617
+ * ## The two batch reads
618
+ *
619
+ * `getAvailabilityBatch` / `getDaysWithRecordingsBatch` take `deviceIds:
620
+ * number[]` with no single `deviceId`, and a device-scoped mount routes
621
+ * through `getProviderForDevice(deviceId)` — there is nothing for it to route
622
+ * on. They stay here, and on this cap the batch is explicitly OURS: a grid has
623
+ * no per-camera picker, and a caller that wants another source's coverage asks
624
+ * `recording.getAvailability` per device with that source's `provider`.
625
+ */
626
+ var RecordingStatusSchema = /* @__PURE__ */ zod.z.object({
627
+ deviceId: /* @__PURE__ */ zod.z.number(),
628
+ enabled: /* @__PURE__ */ zod.z.boolean(),
629
+ /** THE derived storage mode, from the one definition
630
+ * (`deriveRecordingMode`) — never a second enum. A duplicated list is how
631
+ * `on-device-decision` could have reached the recorder and not the status. */
632
+ activeMode: RecordingStorageModeSchema,
633
+ nodeId: /* @__PURE__ */ zod.z.string(),
634
+ storageBytes: /* @__PURE__ */ zod.z.number()
635
+ });
636
+ /**
637
+ * One camera's row in a `getAvailabilityBatch` answer.
638
+ *
639
+ * `ranges` is EXACTLY what `recording.getAvailability` returns for that camera
640
+ * at OUR source — the batch collapses the transport, not the work — plus the
641
+ * `read` mark the singular answer now carries too (D625):
642
+ *
643
+ * - `read: 'read'` — answered. `ranges: []` means "read, and this camera has
644
+ * no footage in the window", which is a real claim.
645
+ * - `read: 'unreadable'` — the recorder could not answer for this camera (its
646
+ * calendar rung threw, its location is unmounted). `ranges` is empty and
647
+ * that emptiness means NOTHING.
648
+ *
649
+ * A timeline that renders the second as the first tells an operator there is no
650
+ * footage when the truth is that nobody looked.
651
+ */
652
+ var RecordingAvailabilityForDeviceSchema = /* @__PURE__ */ zod.z.object({
653
+ deviceId: /* @__PURE__ */ zod.z.number(),
654
+ read: /* @__PURE__ */ zod.z.enum(["read", "unreadable"]),
655
+ ranges: /* @__PURE__ */ zod.z.array(RecordingRangeSchema).readonly(),
656
+ /** Same field, same meaning, as the singular answer (D433). A row that
657
+ * dropped it would tell a grid caller the archive holds one profile.
658
+ * Empty on an `'unreadable'` row: nobody looked. */
659
+ profilesWithFootage: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).readonly()
660
+ });
661
+ /**
662
+ * One camera's row in a `getDaysWithRecordingsBatch` answer. Same rule as
663
+ * {@link RecordingAvailabilityForDeviceSchema}: `days: []` on a `'read'` row is
664
+ * "no footage in this month", `read: 'unreadable'` is "nobody could look", and
665
+ * the date-picker's day dots must not spell them the same.
666
+ */
667
+ var RecordingDaysForDeviceSchema = /* @__PURE__ */ zod.z.object({
668
+ deviceId: /* @__PURE__ */ zod.z.number(),
669
+ read: /* @__PURE__ */ zod.z.enum(["read", "unreadable"]),
670
+ /** Local-midnight epochs (UTC ms) of days that have ≥1 recorded segment. */
671
+ days: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.number()).readonly()
672
+ });
673
+ /**
674
+ * Recording storage usage for one camera — what the ARCHIVE holds for it,
675
+ * across every profile and every resolvable location on this node.
676
+ *
677
+ * ## Archive vs residency, which is the whole point of this shape (D418)
678
+ *
679
+ * `usedBytes` / `oldestMs` / `segments` are the durable hour ledger's numbers:
680
+ * the same quantity `RecordingLocationUsage.usedBytes` reports for the volume
681
+ * this camera writes to, so the two can be added up and compared.
682
+ *
683
+ * They were not always. Until D418 this row came from the recorder's in-RAM
684
+ * `RecordingIndex`, which since D287 holds only the live tail plus the hours
685
+ * somebody hydrated — so a hub with 1.9 TB and 3.3 days of footage reported
686
+ * 60.5 GB and "oldest: three hours ago" on the same page as the volume row
687
+ * that said otherwise, and two people read it as retention eating recent
688
+ * footage. Residency is still reported, under `residentBytes` /
689
+ * `residentOldestMs`, which answer a different question and say so.
690
+ */
691
+ var RecordingDeviceUsageSchema = /* @__PURE__ */ zod.z.object({
692
+ deviceId: /* @__PURE__ */ zod.z.number(),
693
+ /** Bytes the ARCHIVE holds for this camera on this node's resolvable
694
+ * recordings locations. */
695
+ usedBytes: /* @__PURE__ */ zod.z.number(),
696
+ /**
697
+ * Start of this camera's OLDEST ARCHIVED segment, across every profile and
698
+ * location — the "Oldest footage" column in Recordings → Storage, and the
699
+ * only honest answer to "is retention actually holding?" per camera.
700
+ *
701
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
702
+ * predates this field omits it entirely, and a hub whose types carry the
703
+ * field must keep validating that older provider's payload: the framework
704
+ * (types) and the addon ship on different trains, and the addon is usually
705
+ * the later of the two.
706
+ */
707
+ oldestMs: /* @__PURE__ */ zod.z.number().nullable().optional(),
708
+ /** Segments the archive holds for this camera — the "M" beside `usedBytes`.
709
+ * OPTIONAL for the same train-skew reason as `oldestMs`. */
710
+ segments: /* @__PURE__ */ zod.z.number().optional(),
711
+ /**
712
+ * RESIDENCY, not the archive: bytes the recorder process currently holds in
713
+ * its RAM index — the live tail plus the hours a reader hydrated.
714
+ *
715
+ * It answers "what can be served without touching the disk", never "how much
716
+ * footage this camera has". A UI that renders it must label it as such, and
717
+ * must never total it as storage. OPTIONAL: a recorder predating D418 omits
718
+ * it, and so does a node whose ledger could not answer.
719
+ */
720
+ residentBytes: /* @__PURE__ */ zod.z.number().optional(),
721
+ /** The residency counterpart of `oldestMs` — the oldest segment currently in
722
+ * RAM, which on a healthy recorder is minutes ago and means nothing about
723
+ * retention. `null` = nothing resident. */
724
+ residentOldestMs: /* @__PURE__ */ zod.z.number().nullable().optional()
725
+ });
726
+ /** Recording storage usage + capacity for one storage location. */
727
+ var RecordingLocationUsageSchema = /* @__PURE__ */ zod.z.object({
728
+ /** StorageLocation id; null for the legacy/degraded single-root fallback. */
729
+ locationId: /* @__PURE__ */ zod.z.string().nullable(),
730
+ /** Every location id sharing this row's PHYSICAL volume (aliases). One row
731
+ * is emitted per physical disk (2026-07-29): two locations on one root
732
+ * previously rendered as two identical "disks" with a nonsensical used
733
+ * split — hydrate attribution across aliases is arbitrary by nature. */
734
+ locationIds: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).optional(),
735
+ /**
736
+ * Filesystem root of the physical volume this row accounts — the only
737
+ * operator-legible identity when a location has no `displayName` yet, and
738
+ * what a "which disk is full" alert has to name. OPTIONAL for the same
739
+ * train-skew reason as `oldestMs`: a recorder that predates the field omits
740
+ * it, and this schema must keep validating that older provider's payload.
741
+ */
742
+ root: /* @__PURE__ */ zod.z.string().optional(),
743
+ /** Bytes of recordings stored on this PHYSICAL volume (all aliases). This is
744
+ * the footage's SHARE of the volume, not how full the volume is — the disk
745
+ * also holds everything that is not recordings. Volume fill is
746
+ * `(totalBytes - availableBytes) / totalBytes`. */
747
+ usedBytes: /* @__PURE__ */ zod.z.number(),
748
+ /** Free bytes on the location's volume; null when capacity is unknown
749
+ * (remote/unstattable — the recorder logs the statfs failure with the root). */
750
+ availableBytes: /* @__PURE__ */ zod.z.number().nullable(),
751
+ /** Total bytes of the location's volume; null when unknown. */
752
+ totalBytes: /* @__PURE__ */ zod.z.number().nullable()
753
+ });
754
+ /** Aggregate recordings storage usage for a node: global total + per-camera +
755
+ * per-location used/available. Stat-based (accurate even for detached cameras),
756
+ * computed on demand — not from the name-only playback index. */
757
+ var RecordingStorageUsageSchema = /* @__PURE__ */ zod.z.object({
758
+ nodeId: /* @__PURE__ */ zod.z.string(),
759
+ totalUsedBytes: /* @__PURE__ */ zod.z.number(),
760
+ devices: /* @__PURE__ */ zod.z.array(RecordingDeviceUsageSchema),
761
+ /**
762
+ * WHERE `devices[]` came from, so an empty table is never mistaken for empty
763
+ * disks (D418).
764
+ *
765
+ * `archive` = the durable hour ledger answered. `unavailable` = this node
766
+ * declared no ledger and the recorder REFUSED rather than answering the
767
+ * question with the resident index (D295 rule 3) — the rows are UNKNOWN, not
768
+ * zero, and a UI must say so. OPTIONAL: a recorder predating D418 omits it,
769
+ * and its rows are residency.
770
+ */
771
+ devicesRead: /* @__PURE__ */ zod.z.enum(["archive", "unavailable"]).optional(),
772
+ /**
773
+ * Is the `archive` answer WHOLE (D674): the hour ledger loaded without
774
+ * hitting its row cap, and at least one location resolved? Only then may a
775
+ * camera ABSENT from `devices[]` be read as "no footage" — and only then is a
776
+ * row's `oldestMs` the archive's oldest rather than the oldest of a fraction.
777
+ * OPTIONAL: a recorder predating D674 omits it, and a consumer must read the
778
+ * absence as `false`. A retention floor is a delete; it never guesses.
779
+ */
780
+ complete: /* @__PURE__ */ zod.z.boolean().optional(),
781
+ /**
782
+ * Per-physical-volume capacity. OPTIONAL, and consumers must render the rest
783
+ * of the payload without it: a recorder that could not build it omits it. A
784
+ * UI that dereferences it unconditionally crashes the whole Storage page over
785
+ * a missing disk bar. (The hub's cap routers pass output through unvalidated
786
+ * since 2026-07-11 — `cap-router-builder.ts` — so a newer recorder's fields
787
+ * are not stripped by an older hub.)
788
+ */
789
+ locations: /* @__PURE__ */ zod.z.array(RecordingLocationUsageSchema).optional()
790
+ });
791
+ /**
792
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
793
+ *
794
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
795
+ * is the operator asking for the EXISTING archive to be brought into line with
796
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
797
+ * location, run FIFO behind the single-flight mover.
798
+ *
799
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
800
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
801
+ * (empty on the plan).
802
+ */
803
+ var RecordingRebalanceMoveSchema = /* @__PURE__ */ zod.z.object({
804
+ deviceId: /* @__PURE__ */ zod.z.number(),
805
+ profile: /* @__PURE__ */ zod.z.string(),
806
+ fromLocationId: /* @__PURE__ */ zod.z.string(),
807
+ toLocationId: /* @__PURE__ */ zod.z.string(),
808
+ bytes: /* @__PURE__ */ zod.z.number(),
809
+ files: /* @__PURE__ */ zod.z.number().int()
810
+ });
811
+ /** Why a pile that is out of place is staying there. Every refusal is
812
+ * reported: a rebalance that silently drops a camera reads exactly like one
813
+ * that had nothing to do. */
814
+ var RecordingRebalanceSkipReasonSchema = /* @__PURE__ */ zod.z.enum([
815
+ "unassigned",
816
+ "target-not-writable",
817
+ "below-threshold",
818
+ "no-headroom"
819
+ ]);
820
+ var RecordingRebalanceSkipSchema = /* @__PURE__ */ zod.z.object({
821
+ deviceId: /* @__PURE__ */ zod.z.number(),
822
+ profile: /* @__PURE__ */ zod.z.string(),
823
+ fromLocationId: /* @__PURE__ */ zod.z.string(),
824
+ /** The location the plan wants; null when the camera has no assignment. */
825
+ toLocationId: /* @__PURE__ */ zod.z.string().nullable(),
826
+ bytes: /* @__PURE__ */ zod.z.number(),
827
+ reason: RecordingRebalanceSkipReasonSchema
828
+ });
829
+ var RecordingRebalancePlanSchema = /* @__PURE__ */ zod.z.object({
830
+ moves: /* @__PURE__ */ zod.z.array(RecordingRebalanceMoveSchema),
831
+ skipped: /* @__PURE__ */ zod.z.array(RecordingRebalanceSkipSchema),
832
+ bytesToMove: /* @__PURE__ */ zod.z.number(),
833
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
834
+ jobIds: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string())
835
+ });
836
+ var RecordingRebalanceInputSchema = /* @__PURE__ */ zod.z.object({
837
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
838
+ throttleMbps: /* @__PURE__ */ zod.z.number().min(1).max(1e3).optional(),
839
+ /** Ignore piles smaller than this (default 1 GB). */
840
+ minMoveGb: /* @__PURE__ */ zod.z.number().min(0).optional()
841
+ });
842
+ /**
843
+ * Operator-facing placement of one camera onto a recordings location.
844
+ *
845
+ * `pinLocationId` is the operator instruction: a location id, or `null` for
846
+ * Auto (the planner may move this camera). `locationId` is where high/mid
847
+ * currently write — the plan, which may disagree with the pin when Auto.
848
+ */
849
+ var RecordingDevicePlacementSchema = /* @__PURE__ */ zod.z.object({
850
+ deviceId: /* @__PURE__ */ zod.z.number().int(),
851
+ profile: /* @__PURE__ */ zod.z.string(),
852
+ locationId: /* @__PURE__ */ zod.z.string()
853
+ });
854
+ var RecordingDevicePinSchema = /* @__PURE__ */ zod.z.object({
855
+ deviceId: /* @__PURE__ */ zod.z.number().int(),
856
+ /** Recordings-class location this camera is pinned to. */
857
+ locationId: /* @__PURE__ */ zod.z.string()
858
+ });
859
+ var RecordingPlacementViewSchema = /* @__PURE__ */ zod.z.object({
860
+ assignments: /* @__PURE__ */ zod.z.array(RecordingDevicePlacementSchema),
861
+ pins: /* @__PURE__ */ zod.z.array(RecordingDevicePinSchema),
862
+ defaultLocations: /* @__PURE__ */ zod.z.record(/* @__PURE__ */ zod.z.string(), /* @__PURE__ */ zod.z.string())
863
+ });
864
+ var RecordingSetDevicePlacementInputSchema = /* @__PURE__ */ zod.z.object({
865
+ deviceId: /* @__PURE__ */ zod.z.number().int(),
866
+ /** `null` = Auto. Otherwise a `recordings:*` location id. */
867
+ locationId: /* @__PURE__ */ zod.z.string().nullable()
868
+ });
869
+ /**
870
+ * Result of locating footage at a wall-clock instant for one device/profile.
871
+ * `segment` carries the covering segment's window; `gap` reports the forward
872
+ * nearest covered edge (`null` past the end of footage / when none exists)
873
+ * and the backward covered edge `prevEndMs` (exclusive end of the nearest
874
+ * footage behind the epoch; `null` when none — optional so older providers
875
+ * that omit it stay valid). `prevEndMs` lets a backward frame-step hop the
876
+ * small inter-segment cracks (durMs under-covers the span to the next
877
+ * startMs by ~11-17 ms) instead of no-opping at a segment head.
878
+ */
879
+ var LocateSegmentResultSchema = /* @__PURE__ */ zod.z.discriminatedUnion("kind", [/* @__PURE__ */ zod.z.object({
880
+ kind: /* @__PURE__ */ zod.z.literal("segment"),
881
+ startMs: /* @__PURE__ */ zod.z.number(),
882
+ durMs: /* @__PURE__ */ zod.z.number(),
883
+ bytes: /* @__PURE__ */ zod.z.number()
884
+ }), /* @__PURE__ */ zod.z.object({
885
+ kind: /* @__PURE__ */ zod.z.literal("gap"),
886
+ nearestEdgeMs: /* @__PURE__ */ zod.z.number().nullable(),
887
+ prevEndMs: /* @__PURE__ */ zod.z.number().nullable().optional()
888
+ })]);
889
+ /** Raw bytes of one finalized footage segment (read off disk on the recording node). */
890
+ var ReadSegmentBytesResultSchema = /* @__PURE__ */ zod.z.object({ data: /* @__PURE__ */ zod.z.instanceof(Uint8Array) });
891
+ /**
892
+ * One GOP of a finalized segment, cut by byte range through the segment's own
893
+ * `mfra` (D31 on the D42 feeder path). `data` is the `ftyp`+`moov` head plus
894
+ * the single `moof`+`mdat` covering the requested instant — standalone-
895
+ * demuxable, never the whole file. When the segment's index cannot be parsed
896
+ * the provider degrades INSIDE the mechanism to the whole segment (still one
897
+ * `data`, `gopStartMs` = the segment start) — a worse read, not another path.
898
+ */
899
+ var ReadGopBytesResultSchema = /* @__PURE__ */ zod.z.object({
900
+ data: /* @__PURE__ */ zod.z.instanceof(Uint8Array),
901
+ /** Absolute epoch ms of the returned fragment's first sample. */
902
+ gopStartMs: /* @__PURE__ */ zod.z.number(),
903
+ /** Media ms the returned fragment covers. */
904
+ gopDurMs: /* @__PURE__ */ zod.z.number()
905
+ });
906
+ /**
907
+ * A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
908
+ * twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
909
+ * replay clip's `recording` source (`docs/design/plans/2026-08-26-clip-replay-on-pipeline.md`):
910
+ * a replay needs several seconds of native pixels, not one frame.
911
+ *
912
+ * `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
913
+ * is `false` when the returned bytes were cut short by the read's own safety
914
+ * byte cap before covering `[fromMs, toMs)` — a truncation, reported, not a
915
+ * silently shorter answer. `spans-multiple-segments` is a REFUSAL, not a
916
+ * degradation: a window whose end falls past the covering segment would need
917
+ * bytes stitched from a second segment file (its own `ftyp`+`moov`), which is
918
+ * not one standalone-demuxable stream — the caller's answer is to request a
919
+ * shorter window or one aligned to a single segment, not to receive spliced
920
+ * bytes nothing has proven decodable.
921
+ */
922
+ var ReadWindowBytesResultSchema = /* @__PURE__ */ zod.z.discriminatedUnion("kind", [/* @__PURE__ */ zod.z.object({
923
+ kind: /* @__PURE__ */ zod.z.literal("ok"),
924
+ data: /* @__PURE__ */ zod.z.instanceof(Uint8Array),
925
+ /** Absolute epoch ms of the returned bytes' first sample — at or before
926
+ * the requested `fromMs` (anchored on the nearest keyframe). */
927
+ gopStartMs: /* @__PURE__ */ zod.z.number(),
928
+ /** Media ms the returned bytes cover, from `gopStartMs`. */
929
+ gopDurMs: /* @__PURE__ */ zod.z.number(),
930
+ /** `false` ⇒ the safety byte cap cut the read short before it reached
931
+ * the requested `toMs`; the caller got fewer frames than asked for. */
932
+ reachesRequestedEnd: /* @__PURE__ */ zod.z.boolean()
933
+ }), /* @__PURE__ */ zod.z.object({
934
+ kind: /* @__PURE__ */ zod.z.literal("spans-multiple-segments"),
935
+ /** Where the covering segment's own footage runs out — informational,
936
+ * not a retry hint (retrying the same window would refuse again). */
937
+ segmentEndMs: /* @__PURE__ */ zod.z.number()
938
+ })]);
939
+ var recordingArchiveCapability = {
940
+ name: "recording-archive",
941
+ scope: "system",
942
+ mode: "singleton",
943
+ /** Moves here with the config pair — the derived Recording settings
944
+ * section is a view over `getDeviceConfig`/`setDeviceConfig` (D14), and
945
+ * those did not move (D625). */
946
+ exposesDeviceSettings: true,
947
+ status: {
948
+ schema: RecordingStatusSchema,
949
+ kind: "command-driven"
950
+ },
951
+ methods: {
952
+ /**
953
+ * `recording.getAvailability` for a SET of cameras, in one round trip, at
954
+ * OUR source.
955
+ *
956
+ * A multi-camera timeline re-asks availability for every camera in the grid
957
+ * on every day change; fanned out that is one request per camera for N
958
+ * independent calendar walks. The per-camera work is IDENTICAL (the same
959
+ * `availabilityProfileFor` + `rangesIn`, run concurrently inside the
960
+ * recorder) — only the transport collapses.
961
+ *
962
+ * It lives on the ARCHIVE, not on the `recording` collection, because it
963
+ * takes `deviceIds` with no single `deviceId` and a device-scoped mount has
964
+ * nothing to route on (D625 §10.2). The consequence is stated rather than
965
+ * hidden: the batch answers for OURS. A caller that needs another source's
966
+ * coverage asks `recording.getAvailability` per device, naming that
967
+ * source's provider.
968
+ *
969
+ * `protected` for the same reason the singular method is: every id in
970
+ * `deviceIds` is a device reference, so the F1 #3 gate refuses any camera
971
+ * outside the caller's scope — one id out of scope refuses the CALL, it
972
+ * does not quietly drop a row.
973
+ *
974
+ * Every requested id gets a row, marked — see
975
+ * {@link RecordingAvailabilityForDeviceSchema}. `deviceIds` is capped at
976
+ * {@link RECORDING_TIMELINE_BATCH_MAX} and an over-cap ask is refused.
977
+ */
978
+ getAvailabilityBatch: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
979
+ deviceIds: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.number()).min(1).max(200),
980
+ fromMs: /* @__PURE__ */ zod.z.number(),
981
+ toMs: /* @__PURE__ */ zod.z.number()
982
+ }), /* @__PURE__ */ zod.z.array(RecordingAvailabilityForDeviceSchema).readonly(), {
983
+ role: "viewer",
984
+ kind: "query",
985
+ auth: "protected"
986
+ }),
987
+ /**
988
+ * `recording.getDaysWithRecordings` for a SET of cameras, in one round
989
+ * trip, at OUR source. Same placement argument as
990
+ * {@link getAvailabilityBatch}.
991
+ *
992
+ * The cheapest question in the product, asked once per camera per month
993
+ * change. One directory read per day per camera at the owner, unchanged;
994
+ * what collapses is the N requests it took to ask.
995
+ *
996
+ * Every requested id gets a row, marked — see
997
+ * {@link RecordingDaysForDeviceSchema}. `deviceIds` is capped at
998
+ * {@link RECORDING_TIMELINE_BATCH_MAX} and an over-cap ask is refused.
999
+ */
1000
+ getDaysWithRecordingsBatch: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
1001
+ deviceIds: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.number()).min(1).max(200),
1002
+ fromMs: /* @__PURE__ */ zod.z.number(),
1003
+ toMs: /* @__PURE__ */ zod.z.number(),
1004
+ tzOffsetMinutes: /* @__PURE__ */ zod.z.number()
1005
+ }), /* @__PURE__ */ zod.z.array(RecordingDaysForDeviceSchema).readonly(), {
1006
+ role: "viewer",
1007
+ kind: "query",
1008
+ auth: "protected"
1009
+ }),
1010
+ getStorageUsage: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({}), RecordingStorageUsageSchema, {
1011
+ kind: "query",
1012
+ auth: "admin"
1013
+ }),
1014
+ /**
1015
+ * READ the camera's recording intent.
1016
+ *
1017
+ * `protected`, not `admin`, since 2026-09-21. It is the only per-camera
1018
+ * source of the recording mode the viewer has, and the camera status dot
1019
+ * asks for it on a screen every read-only user sees. As `admin` it answered
1020
+ * FORBIDDEN, the viewer collapsed that to `null` and `null` to `'off'`, and
1021
+ * a recording camera was drawn GREEN — a failed measurement rendered as a
1022
+ * value (D315, D393, D590). It carries schedules and retention, no secret,
1023
+ * and the per-device gate in `scope-access.ts` still applies; `setDeviceConfig`
1024
+ * stays `admin`.
1025
+ *
1026
+ * It is a SINGLETON method and stays one (D625 §16.2): it is the D62
1027
+ * recording authority, and an authority that several providers could answer
1028
+ * is the "two knobs over one decision" D62 forbids.
1029
+ */
1030
+ getDeviceConfig: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({ deviceId: /* @__PURE__ */ zod.z.number() }), RecordingConfigSchema, {
1031
+ role: "viewer",
1032
+ kind: "query",
1033
+ auth: "protected"
1034
+ }),
1035
+ /** Locate footage at a wall-clock instant: the covering segment's window,
1036
+ * or a gap with the forward nearest covered edge. Used by a feeder running
1037
+ * in another addon process to seek recorded footage over tRPC.
1038
+ *
1039
+ * BYTE PLANE: defined by `mfra` byte ranges over OUR own MP4 segment tree.
1040
+ * There is no vendor-neutral statement of it, its only callers are feeders
1041
+ * in other addon processes (the stream broker, the replay-clip source),
1042
+ * and an onboard source that ever needs bytes delegates to the
1043
+ * `videoclips` transport its vendor already has (D625 §9.3, §10.5). */
1044
+ locateSegment: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
1045
+ deviceId: /* @__PURE__ */ zod.z.number(),
1046
+ profile: /* @__PURE__ */ zod.z.string(),
1047
+ epochMs: /* @__PURE__ */ zod.z.number()
1048
+ }), LocateSegmentResultSchema, {
1049
+ kind: "query",
1050
+ auth: "admin"
1051
+ }),
1052
+ /** Read one finalized segment's raw bytes by its exact `startMs`. Used by a
1053
+ * feeder running in another addon process to pull recorded footage over tRPC. */
1054
+ readSegmentBytes: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
1055
+ deviceId: /* @__PURE__ */ zod.z.number(),
1056
+ profile: /* @__PURE__ */ zod.z.string(),
1057
+ startMs: /* @__PURE__ */ zod.z.number()
1058
+ }), ReadSegmentBytesResultSchema, {
1059
+ kind: "query",
1060
+ auth: "admin"
1061
+ }),
1062
+ /** Read the single GOP of segment `startMs` covering `epochMs`, by mfra
1063
+ * byte range — the scrub-granular read (D31 letter on the feeder path).
1064
+ * See {@link ReadGopBytesResultSchema} for the degradation contract. */
1065
+ readGopBytes: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
1066
+ deviceId: /* @__PURE__ */ zod.z.number(),
1067
+ profile: /* @__PURE__ */ zod.z.string(),
1068
+ startMs: /* @__PURE__ */ zod.z.number(),
1069
+ epochMs: /* @__PURE__ */ zod.z.number()
1070
+ }), ReadGopBytesResultSchema, {
1071
+ kind: "query",
1072
+ auth: "admin"
1073
+ }),
1074
+ /** Read a WINDOW `[fromMs, toMs)` of segment `startMs`, by mfra byte
1075
+ * range — the multi-GOP twin of `readGopBytes`. Refuses (does not
1076
+ * degrade) when the window runs past the covering segment. Used by the
1077
+ * replay clip's `recording` source to fetch several seconds of native
1078
+ * footage for its single ffmpeg decode pass. */
1079
+ readWindowBytes: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
1080
+ deviceId: /* @__PURE__ */ zod.z.number(),
1081
+ profile: /* @__PURE__ */ zod.z.string(),
1082
+ startMs: /* @__PURE__ */ zod.z.number(),
1083
+ fromMs: /* @__PURE__ */ zod.z.number(),
1084
+ toMs: /* @__PURE__ */ zod.z.number()
1085
+ }), ReadWindowBytesResultSchema, {
1086
+ kind: "query",
1087
+ auth: "admin"
1088
+ }),
1089
+ setDeviceConfig: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
1090
+ deviceId: /* @__PURE__ */ zod.z.number(),
1091
+ config: RecordingConfigSchema
1092
+ }), RecordingConfigSchema, {
1093
+ kind: "mutation",
1094
+ auth: "admin"
1095
+ }),
1096
+ /** Re-scan this device's footage from disk (stat sizes) and reseed the
1097
+ * index, then return the fresh status. */
1098
+ rescanStorage: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({ deviceId: /* @__PURE__ */ zod.z.number() }), RecordingStatusSchema, {
1099
+ kind: "mutation",
1100
+ auth: "admin"
1101
+ }),
1102
+ /** Apply this device's retention policy to footage now; returns the oldest
1103
+ * surviving footage start (the retention floor) or null if no footage. The
1104
+ * prune is logged to the recordings ops-log with `reason` (default
1105
+ * `'retention'` — the policy-driven prune; `'quota'` when disk-pressure
1106
+ * triggered). */
1107
+ pruneFootage: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
1108
+ deviceId: /* @__PURE__ */ zod.z.number(),
1109
+ reason: /* @__PURE__ */ require_ops_log.OpsLogReasonSchema.optional()
1110
+ }), /* @__PURE__ */ zod.z.object({
1111
+ floorMs: /* @__PURE__ */ zod.z.number().nullable(),
1112
+ deletedBuckets: /* @__PURE__ */ zod.z.number().int(),
1113
+ reclaimedBytes: /* @__PURE__ */ zod.z.number().int()
1114
+ }), {
1115
+ kind: "mutation",
1116
+ auth: "admin"
1117
+ }),
1118
+ /**
1119
+ * Manually delete a camera's footage — the whole footprint, or a
1120
+ * `[fromMs, toMs)` window when either bound is given. Logged to the
1121
+ * recordings ops-log as `op:'manual-delete', reason:'manual'`. Destructive:
1122
+ * the admin UI guards it behind a confirm.
1123
+ */
1124
+ deleteFootprint: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
1125
+ deviceId: /* @__PURE__ */ zod.z.number(),
1126
+ fromMs: /* @__PURE__ */ zod.z.number().optional(),
1127
+ toMs: /* @__PURE__ */ zod.z.number().optional()
1128
+ }), /* @__PURE__ */ zod.z.object({
1129
+ deletedBuckets: /* @__PURE__ */ zod.z.number().int(),
1130
+ reclaimedBytes: /* @__PURE__ */ zod.z.number().int()
1131
+ }), {
1132
+ kind: "mutation",
1133
+ auth: "admin"
1134
+ }),
1135
+ /** The recordings ops-log rows (newest-first), optionally scoped to one
1136
+ * camera. Backed by the recorder's bounded DurableState ring. */
1137
+ listOpsLog: /* @__PURE__ */ require_capability_definition.method(require_ops_log.OpsLogQueryInputSchema, /* @__PURE__ */ zod.z.array(require_ops_log.OpsLogEntrySchema).readonly(), {
1138
+ kind: "query",
1139
+ auth: "admin"
1140
+ }),
1141
+ /**
1142
+ * Render a short GIF from recorded footage around `aroundMs` (low profile,
1143
+ * palette-free ffmpeg gif). Synchronous — the window is a few seconds of
1144
+ * `low`, rendering in ~1-2s. Built for notification attachments: the
1145
+ * caller gets bytes, nothing persists. Fails when no footage covers the
1146
+ * window (camera not recording → caller skips the attachment).
1147
+ */
1148
+ renderGif: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
1149
+ deviceId: /* @__PURE__ */ zod.z.number(),
1150
+ aroundMs: /* @__PURE__ */ zod.z.number(),
1151
+ preRollSec: /* @__PURE__ */ zod.z.number().min(0).max(30).default(2),
1152
+ postRollSec: /* @__PURE__ */ zod.z.number().min(0).max(30).default(5),
1153
+ maxWidth: /* @__PURE__ */ zod.z.number().int().min(120).max(1280).default(480),
1154
+ fps: /* @__PURE__ */ zod.z.number().int().min(1).max(15).default(5)
1155
+ }), /* @__PURE__ */ zod.z.object({
1156
+ gifBase64: /* @__PURE__ */ zod.z.string(),
1157
+ fromMs: /* @__PURE__ */ zod.z.number(),
1158
+ toMs: /* @__PURE__ */ zod.z.number()
1159
+ }), {
1160
+ kind: "mutation",
1161
+ auth: "admin"
1162
+ }),
1163
+ /**
1164
+ * Render a short MP4 clip from recorded footage around `aroundMs` — the
1165
+ * "send a clip, not a gif" notification attachment. Same window, source
1166
+ * and fail-closed contract as {@link renderGif}: no footage covering the
1167
+ * window ⇒ it throws and the caller ships no attachment. Re-encoded (never
1168
+ * stream-copied) so a concat across segments with different encoder
1169
+ * parameters still plays. Silent by contract.
1170
+ *
1171
+ * The returned window is SEGMENT-GRANULAR: the source playlist is built
1172
+ * from whole segments, so the clip starts at or before `fromMs` and ends
1173
+ * at or after `toMs` — overshoot bounded by one segment per side (an 8 s
1174
+ * ask over 4 s segments measured 12 s). `fromMs`/`toMs` report the window
1175
+ * ASKED for, not the encoded duration.
1176
+ */
1177
+ renderClip: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({
1178
+ deviceId: /* @__PURE__ */ zod.z.number(),
1179
+ aroundMs: /* @__PURE__ */ zod.z.number(),
1180
+ preRollSec: /* @__PURE__ */ zod.z.number().min(0).max(30).default(3),
1181
+ postRollSec: /* @__PURE__ */ zod.z.number().min(0).max(30).default(7),
1182
+ maxWidth: /* @__PURE__ */ zod.z.number().int().min(160).max(1920).default(640)
1183
+ }), /* @__PURE__ */ zod.z.object({
1184
+ clipBase64: /* @__PURE__ */ zod.z.string(),
1185
+ mime: /* @__PURE__ */ zod.z.string(),
1186
+ fromMs: /* @__PURE__ */ zod.z.number(),
1187
+ toMs: /* @__PURE__ */ zod.z.number(),
1188
+ bytes: /* @__PURE__ */ zod.z.number().int()
1189
+ }), {
1190
+ kind: "mutation",
1191
+ auth: "admin"
1192
+ }),
1193
+ /** Internal migration-participant lease. Blocks new recorder attaches and
1194
+ * waits for writers to exit while their watchers index final segments. */
1195
+ pauseForStorageMigration: /* @__PURE__ */ require_capability_definition.method(require_relocate.StorageMigrationLeaseInputSchema, /* @__PURE__ */ zod.z.object({ paused: /* @__PURE__ */ zod.z.literal(true) }), {
1196
+ kind: "mutation",
1197
+ auth: "admin"
1198
+ }),
1199
+ resumeForStorageMigration: /* @__PURE__ */ require_capability_definition.method(require_relocate.StorageMigrationLeaseInputSchema, /* @__PURE__ */ zod.z.object({ resumed: /* @__PURE__ */ zod.z.literal(true) }), {
1200
+ kind: "mutation",
1201
+ auth: "admin"
1202
+ }),
1203
+ /** Re-resolve location roots after the coordinator changes defaults. */
1204
+ refreshStorageLocationsForMigration: /* @__PURE__ */ require_capability_definition.method(require_relocate.StorageMigrationLeaseInputSchema, /* @__PURE__ */ zod.z.object({ refreshed: /* @__PURE__ */ zod.z.literal(true) }), {
1205
+ kind: "mutation",
1206
+ auth: "admin"
1207
+ }),
1208
+ /** Internal mover, callable only by the storage-migration coordinator. */
1209
+ startStorageMigrationMove: /* @__PURE__ */ require_capability_definition.method(require_relocate.StorageMigrationFootageMoveInputSchema, /* @__PURE__ */ zod.z.object({ jobId: /* @__PURE__ */ zod.z.string() }), {
1210
+ kind: "mutation",
1211
+ auth: "admin"
1212
+ }),
1213
+ getStorageMigrationMoveStatus: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({ jobId: /* @__PURE__ */ zod.z.string() }), /* @__PURE__ */ require_relocate.RelocateJobSchema.nullable(), { auth: "admin" }),
1214
+ cancelStorageMigrationMove: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({ jobId: /* @__PURE__ */ zod.z.string() }), /* @__PURE__ */ zod.z.object({ cancelled: /* @__PURE__ */ zod.z.boolean() }), {
1215
+ kind: "mutation",
1216
+ auth: "admin"
1217
+ }),
1218
+ /**
1219
+ * Move footage between locations — the OPERATOR's mover, scoped to one
1220
+ * camera (and optionally to specific profiles) rather than a whole disk.
1221
+ * Queued FIFO behind the single-flight engine, so arming several is safe.
1222
+ */
1223
+ relocateFootage: /* @__PURE__ */ require_capability_definition.method(require_relocate.RelocateFootageInputSchema, /* @__PURE__ */ zod.z.object({ jobId: /* @__PURE__ */ zod.z.string() }), {
1224
+ kind: "mutation",
1225
+ auth: "admin"
1226
+ }),
1227
+ /** Every relocate job this recorder knows about, newest first (in RAM: the
1228
+ * move is resumable, so a lost list costs nothing but the display). */
1229
+ listRelocateJobs: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({}), /* @__PURE__ */ zod.z.array(require_relocate.RelocateJobSchema).readonly(), {
1230
+ kind: "query",
1231
+ auth: "admin"
1232
+ }),
1233
+ /**
1234
+ * What a location STILL holds, asked of the durable hour ledger.
1235
+ *
1236
+ * The number behind "drain remaining": segments and bytes that would still
1237
+ * have to move off `fromLocationId`. It is a ledger aggregate — the archive
1238
+ * — because the resident index is not the archive (D295), and a drain sized
1239
+ * off the index is exactly what reported `done` over 80.3 GB on 2026-08-29.
1240
+ * `null` means the archive could not be asked (no ledger on this node, or
1241
+ * the aggregate failed) and is never conflated with an empty source.
1242
+ */
1243
+ getRelocateResidue: /* @__PURE__ */ require_capability_definition.method(require_relocate.RelocateResidueInputSchema, require_relocate.RelocateResidueSchema, {
1244
+ kind: "query",
1245
+ auth: "admin"
1246
+ }),
1247
+ /**
1248
+ * Does this location's LEDGER tell the truth about its disk? (D319)
1249
+ *
1250
+ * One `readdir` per claimed hour, diffed both ways: durable rows whose file
1251
+ * is not there, and files no durable row names. `apply` defaults to FALSE —
1252
+ * the report is the product, and the dry run is how an operator
1253
+ * sanity-checks the destructive run before authorising it.
1254
+ *
1255
+ * REFUSES a source that is still a write target: a listing of a live
1256
+ * location is a lower bound, which is not the strong evidence that lets
1257
+ * this pass forget without a budget. A live location is reconciled by the
1258
+ * mover, under D318's bound.
1259
+ */
1260
+ reconcileLedgerAgainstDisk: /* @__PURE__ */ require_capability_definition.method(require_relocate.LedgerWalkInputSchema, require_relocate.LedgerWalkReportSchema, {
1261
+ kind: "mutation",
1262
+ auth: "admin"
1263
+ }),
1264
+ /** Cancel a running or queued relocate job. A queued job never runs. */
1265
+ cancelRelocateJob: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({ jobId: /* @__PURE__ */ zod.z.string() }), /* @__PURE__ */ zod.z.object({ cancelled: /* @__PURE__ */ zod.z.boolean() }), {
1266
+ kind: "mutation",
1267
+ auth: "admin"
1268
+ }),
1269
+ /** What a rebalance WOULD move, and what it would refuse. Moves nothing. */
1270
+ planStorageRebalance: /* @__PURE__ */ require_capability_definition.method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
1271
+ kind: "query",
1272
+ auth: "admin"
1273
+ }),
1274
+ /** Arm the rebalance: enqueue one relocate job per planned move. */
1275
+ startStorageRebalance: /* @__PURE__ */ require_capability_definition.method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
1276
+ kind: "mutation",
1277
+ auth: "admin"
1278
+ }),
1279
+ /**
1280
+ * The placement plan in force plus operator pins. Drives the Locations
1281
+ * admin page: Auto vs a named recordings location, per camera.
1282
+ */
1283
+ getPlacement: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({}), RecordingPlacementViewSchema, {
1284
+ kind: "query",
1285
+ auth: "admin"
1286
+ }),
1287
+ /**
1288
+ * Pin a camera to a recordings location, or clear the pin (Auto). High and
1289
+ * mid follow the pin; low stays with the recordingsLow planner.
1290
+ */
1291
+ setDevicePlacement: /* @__PURE__ */ require_capability_definition.method(RecordingSetDevicePlacementInputSchema, /* @__PURE__ */ zod.z.object({ ok: /* @__PURE__ */ zod.z.literal(true) }), {
1292
+ kind: "mutation",
1293
+ auth: "admin"
1294
+ })
1295
+ },
1296
+ vocabulary: { notOperatorFacing: require_system_reasons.NOT_A_DEVICE.STORAGE }
1297
+ };
1298
+ //#endregion
1299
+ Object.defineProperty(exports, "RECORDING_SOURCE_CAMSTACK_ADDON", {
1300
+ enumerable: true,
1301
+ get: function() {
1302
+ return RECORDING_SOURCE_CAMSTACK_ADDON;
1303
+ }
1304
+ });
1305
+ Object.defineProperty(exports, "RecordingStatusSchema", {
1306
+ enumerable: true,
1307
+ get: function() {
1308
+ return RecordingStatusSchema;
1309
+ }
1310
+ });
1311
+ Object.defineProperty(exports, "RecordingStorageModeSchema", {
1312
+ enumerable: true,
1313
+ get: function() {
1314
+ return RecordingStorageModeSchema;
1315
+ }
1316
+ });
1317
+ Object.defineProperty(exports, "recordingArchiveCapability", {
1318
+ enumerable: true,
1319
+ get: function() {
1320
+ return recordingArchiveCapability;
1321
+ }
1322
+ });
1323
+ Object.defineProperty(exports, "recordingCapability", {
1324
+ enumerable: true,
1325
+ get: function() {
1326
+ return recordingCapability;
1327
+ }
1328
+ });