@camstack/core 0.1.15 → 0.1.17

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 (382) hide show
  1. package/dist/addon/addon-api-factory.d.ts +36 -0
  2. package/dist/addon/addon-api-factory.d.ts.map +1 -0
  3. package/dist/addon-routes/addon-route-registry.d.ts +38 -0
  4. package/dist/addon-routes/addon-route-registry.d.ts.map +1 -0
  5. package/dist/auth/api-key-manager.d.ts +27 -0
  6. package/dist/auth/api-key-manager.d.ts.map +1 -0
  7. package/dist/auth/auth-manager.d.ts +47 -0
  8. package/dist/auth/auth-manager.d.ts.map +1 -0
  9. package/dist/auth/parse-record.d.ts +19 -0
  10. package/dist/auth/parse-record.d.ts.map +1 -0
  11. package/dist/auth/scoped-token-manager.d.ts +18 -0
  12. package/dist/auth/scoped-token-manager.d.ts.map +1 -0
  13. package/dist/auth/user-manager.d.ts +34 -0
  14. package/dist/auth/user-manager.d.ts.map +1 -0
  15. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.d.ts +54 -0
  16. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.d.ts.map +1 -0
  17. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +223 -217
  18. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js.map +1 -1
  19. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +216 -7
  20. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs.map +1 -1
  21. package/dist/builtins/addon-pages-aggregator/index.d.ts +2 -0
  22. package/dist/builtins/addon-pages-aggregator/index.d.ts.map +1 -0
  23. package/dist/builtins/addon-pages-aggregator/index.js +6 -221
  24. package/dist/builtins/addon-pages-aggregator/index.mjs +2 -9
  25. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.d.ts +33 -0
  26. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.d.ts.map +1 -0
  27. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +199 -197
  28. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js.map +1 -1
  29. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +192 -7
  30. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs.map +1 -1
  31. package/dist/builtins/addon-widgets-aggregator/index.d.ts +2 -0
  32. package/dist/builtins/addon-widgets-aggregator/index.d.ts.map +1 -0
  33. package/dist/builtins/addon-widgets-aggregator/index.js +6 -201
  34. package/dist/builtins/addon-widgets-aggregator/index.mjs +2 -9
  35. package/dist/builtins/alerts/alerts.addon.d.ts +82 -0
  36. package/dist/builtins/alerts/alerts.addon.d.ts.map +1 -0
  37. package/dist/builtins/alerts/alerts.addon.js +590 -430
  38. package/dist/builtins/alerts/alerts.addon.js.map +1 -1
  39. package/dist/builtins/alerts/alerts.addon.mjs +595 -7
  40. package/dist/builtins/alerts/alerts.addon.mjs.map +1 -1
  41. package/dist/builtins/alerts/index.d.ts +2 -0
  42. package/dist/builtins/alerts/index.d.ts.map +1 -0
  43. package/dist/builtins/alerts/index.js +3 -443
  44. package/dist/builtins/alerts/index.mjs +2 -8
  45. package/dist/builtins/auth-orchestrator/auth-orchestrator.addon.d.ts +8 -0
  46. package/dist/builtins/auth-orchestrator/auth-orchestrator.addon.d.ts.map +1 -0
  47. package/dist/builtins/auth-orchestrator/auth-orchestrator.addon.js +56 -0
  48. package/dist/builtins/auth-orchestrator/auth-orchestrator.addon.js.map +1 -0
  49. package/dist/builtins/auth-orchestrator/auth-orchestrator.addon.mjs +50 -0
  50. package/dist/builtins/auth-orchestrator/auth-orchestrator.addon.mjs.map +1 -0
  51. package/dist/builtins/auth-orchestrator/index.d.ts +2 -0
  52. package/dist/builtins/auth-orchestrator/index.d.ts.map +1 -0
  53. package/dist/builtins/auth-orchestrator/index.js +7 -0
  54. package/dist/builtins/auth-orchestrator/index.mjs +2 -0
  55. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.d.ts +148 -0
  56. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.d.ts.map +1 -0
  57. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +7639 -0
  58. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js.map +1 -0
  59. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +7627 -0
  60. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs.map +1 -0
  61. package/dist/builtins/backup-orchestrator/cron-helpers.d.ts +24 -0
  62. package/dist/builtins/backup-orchestrator/cron-helpers.d.ts.map +1 -0
  63. package/dist/builtins/backup-orchestrator/destination-policy.d.ts +73 -0
  64. package/dist/builtins/backup-orchestrator/destination-policy.d.ts.map +1 -0
  65. package/dist/builtins/backup-orchestrator/download-helpers.d.ts +13 -0
  66. package/dist/builtins/backup-orchestrator/download-helpers.d.ts.map +1 -0
  67. package/dist/builtins/backup-orchestrator/index.d.ts +3 -0
  68. package/dist/builtins/backup-orchestrator/index.d.ts.map +1 -0
  69. package/dist/builtins/backup-orchestrator/index.js +7 -0
  70. package/dist/builtins/backup-orchestrator/index.mjs +2 -0
  71. package/dist/builtins/backup-orchestrator/manifest-store.d.ts +78 -0
  72. package/dist/builtins/backup-orchestrator/manifest-store.d.ts.map +1 -0
  73. package/dist/builtins/console-logging/console-destination.d.ts +14 -0
  74. package/dist/builtins/console-logging/console-destination.d.ts.map +1 -0
  75. package/dist/builtins/console-logging/console-logging.addon.d.ts +26 -0
  76. package/dist/builtins/console-logging/console-logging.addon.d.ts.map +1 -0
  77. package/dist/builtins/console-logging/index.d.ts +4 -0
  78. package/dist/builtins/console-logging/index.d.ts.map +1 -0
  79. package/dist/builtins/console-logging/index.js +99 -235
  80. package/dist/builtins/console-logging/index.js.map +1 -1
  81. package/dist/builtins/console-logging/index.mjs +95 -9
  82. package/dist/builtins/console-logging/index.mjs.map +1 -1
  83. package/dist/builtins/device-manager/device-event-propagator.d.ts +27 -0
  84. package/dist/builtins/device-manager/device-event-propagator.d.ts.map +1 -0
  85. package/dist/builtins/device-manager/device-manager.addon.d.ts +259 -0
  86. package/dist/builtins/device-manager/device-manager.addon.d.ts.map +1 -0
  87. package/dist/builtins/device-manager/device-manager.addon.js +2125 -2127
  88. package/dist/builtins/device-manager/device-manager.addon.js.map +1 -1
  89. package/dist/builtins/device-manager/device-manager.addon.mjs +2145 -7
  90. package/dist/builtins/device-manager/device-manager.addon.mjs.map +1 -1
  91. package/dist/builtins/device-manager/index.d.ts +3 -0
  92. package/dist/builtins/device-manager/index.d.ts.map +1 -0
  93. package/dist/builtins/device-manager/index.js +6 -2156
  94. package/dist/builtins/device-manager/index.mjs +2 -10
  95. package/dist/builtins/hub-forwarder/hub-forwarder-destination.d.ts +45 -0
  96. package/dist/builtins/hub-forwarder/hub-forwarder-destination.d.ts.map +1 -0
  97. package/dist/builtins/hub-forwarder/hub-forwarder.addon.d.ts +16 -0
  98. package/dist/builtins/hub-forwarder/hub-forwarder.addon.d.ts.map +1 -0
  99. package/dist/builtins/hub-forwarder/index.d.ts +4 -0
  100. package/dist/builtins/hub-forwarder/index.d.ts.map +1 -0
  101. package/dist/builtins/hub-forwarder/index.js +150 -291
  102. package/dist/builtins/hub-forwarder/index.js.map +1 -1
  103. package/dist/builtins/hub-forwarder/index.mjs +145 -9
  104. package/dist/builtins/hub-forwarder/index.mjs.map +1 -1
  105. package/dist/builtins/local-auth/auth-schema.d.ts +12 -0
  106. package/dist/builtins/local-auth/auth-schema.d.ts.map +1 -0
  107. package/dist/builtins/local-auth/index.d.ts +2 -0
  108. package/dist/builtins/local-auth/index.d.ts.map +1 -0
  109. package/dist/builtins/local-auth/index.js +3 -623
  110. package/dist/builtins/local-auth/index.mjs +2 -8
  111. package/dist/builtins/local-auth/local-auth.addon.d.ts +17 -0
  112. package/dist/builtins/local-auth/local-auth.addon.d.ts.map +1 -0
  113. package/dist/builtins/local-auth/local-auth.addon.js +6861 -589
  114. package/dist/builtins/local-auth/local-auth.addon.js.map +1 -1
  115. package/dist/builtins/local-auth/local-auth.addon.mjs +6883 -7
  116. package/dist/builtins/local-auth/local-auth.addon.mjs.map +1 -1
  117. package/dist/builtins/local-network/index.d.ts +3 -0
  118. package/dist/builtins/local-network/index.d.ts.map +1 -0
  119. package/dist/builtins/local-network/index.js +9 -0
  120. package/dist/builtins/local-network/index.mjs +2 -0
  121. package/dist/builtins/local-network/local-network.addon.d.ts +110 -0
  122. package/dist/builtins/local-network/local-network.addon.d.ts.map +1 -0
  123. package/dist/builtins/local-network/local-network.addon.js +399 -0
  124. package/dist/builtins/local-network/local-network.addon.js.map +1 -0
  125. package/dist/builtins/local-network/local-network.addon.mjs +387 -0
  126. package/dist/builtins/local-network/local-network.addon.mjs.map +1 -0
  127. package/dist/builtins/mesh-orchestrator/index.d.ts +2 -0
  128. package/dist/builtins/mesh-orchestrator/index.d.ts.map +1 -0
  129. package/dist/builtins/mesh-orchestrator/index.js +7 -0
  130. package/dist/builtins/mesh-orchestrator/index.mjs +2 -0
  131. package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.d.ts +9 -0
  132. package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.d.ts.map +1 -0
  133. package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.js +83 -0
  134. package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.js.map +1 -0
  135. package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.mjs +77 -0
  136. package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.mjs.map +1 -0
  137. package/dist/builtins/native-metrics/index.d.ts +3 -0
  138. package/dist/builtins/native-metrics/index.d.ts.map +1 -0
  139. package/dist/builtins/native-metrics/native-metrics-provider.d.ts +49 -0
  140. package/dist/builtins/native-metrics/native-metrics-provider.d.ts.map +1 -0
  141. package/dist/builtins/native-metrics/native-metrics.addon.d.ts +74 -0
  142. package/dist/builtins/native-metrics/native-metrics.addon.d.ts.map +1 -0
  143. package/dist/builtins/native-metrics/native-metrics.addon.js +887 -861
  144. package/dist/builtins/native-metrics/native-metrics.addon.js.map +1 -1
  145. package/dist/builtins/native-metrics/native-metrics.addon.mjs +914 -5
  146. package/dist/builtins/native-metrics/native-metrics.addon.mjs.map +1 -1
  147. package/dist/builtins/platform-probe/index.d.ts +12 -0
  148. package/dist/builtins/platform-probe/index.d.ts.map +1 -0
  149. package/dist/builtins/platform-probe/index.js +539 -0
  150. package/dist/builtins/platform-probe/index.js.map +1 -0
  151. package/dist/builtins/platform-probe/index.mjs +530 -0
  152. package/dist/builtins/platform-probe/index.mjs.map +1 -0
  153. package/dist/builtins/platform-probe/inference-config-resolver.d.ts +30 -0
  154. package/dist/builtins/platform-probe/inference-config-resolver.d.ts.map +1 -0
  155. package/dist/builtins/platform-probe/platform-scorer.d.ts +22 -0
  156. package/dist/builtins/platform-probe/platform-scorer.d.ts.map +1 -0
  157. package/dist/builtins/remote-access-orchestrator/index.d.ts +2 -0
  158. package/dist/builtins/remote-access-orchestrator/index.d.ts.map +1 -0
  159. package/dist/builtins/remote-access-orchestrator/index.js +7 -0
  160. package/dist/builtins/remote-access-orchestrator/index.mjs +2 -0
  161. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.d.ts +9 -0
  162. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.d.ts.map +1 -0
  163. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +72 -0
  164. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js.map +1 -0
  165. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +66 -0
  166. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs.map +1 -0
  167. package/dist/builtins/snapshot/index.d.ts +3 -0
  168. package/dist/builtins/snapshot/index.d.ts.map +1 -0
  169. package/dist/builtins/snapshot/index.js +481 -491
  170. package/dist/builtins/snapshot/index.js.map +1 -1
  171. package/dist/builtins/snapshot/index.mjs +475 -464
  172. package/dist/builtins/snapshot/index.mjs.map +1 -1
  173. package/dist/builtins/snapshot/snapshot.addon.d.ts +121 -0
  174. package/dist/builtins/snapshot/snapshot.addon.d.ts.map +1 -0
  175. package/dist/builtins/sqlite-storage/config-store.d.ts +9 -0
  176. package/dist/builtins/sqlite-storage/config-store.d.ts.map +1 -0
  177. package/dist/builtins/sqlite-storage/device-store.d.ts +24 -0
  178. package/dist/builtins/sqlite-storage/device-store.d.ts.map +1 -0
  179. package/dist/builtins/sqlite-storage/filesystem-storage-provider.d.ts +87 -0
  180. package/dist/builtins/sqlite-storage/filesystem-storage-provider.d.ts.map +1 -0
  181. package/dist/builtins/sqlite-storage/filesystem-storage.addon.d.ts +32 -0
  182. package/dist/builtins/sqlite-storage/filesystem-storage.addon.d.ts.map +1 -0
  183. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +312 -56
  184. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js.map +1 -1
  185. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +305 -7
  186. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs.map +1 -1
  187. package/dist/builtins/sqlite-storage/index.d.ts +12 -0
  188. package/dist/builtins/sqlite-storage/index.d.ts.map +1 -0
  189. package/dist/builtins/sqlite-storage/index.js +229 -1001
  190. package/dist/builtins/sqlite-storage/index.js.map +1 -1
  191. package/dist/builtins/sqlite-storage/index.mjs +268 -26
  192. package/dist/builtins/sqlite-storage/index.mjs.map +1 -1
  193. package/dist/builtins/sqlite-storage/integration-registry.d.ts +28 -0
  194. package/dist/builtins/sqlite-storage/integration-registry.d.ts.map +1 -0
  195. package/dist/builtins/sqlite-storage/settings-store.d.ts +40 -0
  196. package/dist/builtins/sqlite-storage/settings-store.d.ts.map +1 -0
  197. package/dist/builtins/sqlite-storage/sql-schema.d.ts +33 -0
  198. package/dist/builtins/sqlite-storage/sql-schema.d.ts.map +1 -0
  199. package/dist/builtins/sqlite-storage/sqlite-settings-backend.d.ts +94 -0
  200. package/dist/builtins/sqlite-storage/sqlite-settings-backend.d.ts.map +1 -0
  201. package/dist/builtins/sqlite-storage/sqlite-settings.addon.d.ts +15 -0
  202. package/dist/builtins/sqlite-storage/sqlite-settings.addon.d.ts.map +1 -0
  203. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +586 -653
  204. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js.map +1 -1
  205. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +582 -7
  206. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs.map +1 -1
  207. package/dist/builtins/storage-orchestrator/index.d.ts +7 -0
  208. package/dist/builtins/storage-orchestrator/index.d.ts.map +1 -0
  209. package/dist/builtins/storage-orchestrator/index.js +9 -0
  210. package/dist/builtins/storage-orchestrator/index.mjs +2 -0
  211. package/dist/builtins/storage-orchestrator/location-store.d.ts +50 -0
  212. package/dist/builtins/storage-orchestrator/location-store.d.ts.map +1 -0
  213. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.d.ts +60 -0
  214. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.d.ts.map +1 -0
  215. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +755 -0
  216. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js.map +1 -0
  217. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +746 -0
  218. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs.map +1 -0
  219. package/dist/builtins/storage-orchestrator/storage-orchestrator.service.d.ts +121 -0
  220. package/dist/builtins/storage-orchestrator/storage-orchestrator.service.d.ts.map +1 -0
  221. package/dist/builtins/system-backup/system-backup.service.d.ts +138 -0
  222. package/dist/builtins/system-backup/system-backup.service.d.ts.map +1 -0
  223. package/dist/builtins/system-config/index.d.ts +2 -0
  224. package/dist/builtins/system-config/index.d.ts.map +1 -0
  225. package/dist/builtins/system-config/index.js +6 -188
  226. package/dist/builtins/system-config/index.mjs +2 -10
  227. package/dist/builtins/system-config/system-config.addon.d.ts +11 -0
  228. package/dist/builtins/system-config/system-config.addon.d.ts.map +1 -0
  229. package/dist/builtins/system-config/system-config.addon.js +227 -180
  230. package/dist/builtins/system-config/system-config.addon.js.map +1 -1
  231. package/dist/builtins/system-config/system-config.addon.mjs +226 -7
  232. package/dist/builtins/system-config/system-config.addon.mjs.map +1 -1
  233. package/dist/builtins/turn-orchestrator/index.d.ts +2 -0
  234. package/dist/builtins/turn-orchestrator/index.d.ts.map +1 -0
  235. package/dist/builtins/turn-orchestrator/index.js +7 -0
  236. package/dist/builtins/turn-orchestrator/index.mjs +2 -0
  237. package/dist/builtins/turn-orchestrator/turn-orchestrator.addon.d.ts +10 -0
  238. package/dist/builtins/turn-orchestrator/turn-orchestrator.addon.d.ts.map +1 -0
  239. package/dist/builtins/turn-orchestrator/turn-orchestrator.addon.js +78 -0
  240. package/dist/builtins/turn-orchestrator/turn-orchestrator.addon.js.map +1 -0
  241. package/dist/builtins/turn-orchestrator/turn-orchestrator.addon.mjs +72 -0
  242. package/dist/builtins/turn-orchestrator/turn-orchestrator.addon.mjs.map +1 -0
  243. package/dist/builtins/winston-logging/index.d.ts +4 -0
  244. package/dist/builtins/winston-logging/index.d.ts.map +1 -0
  245. package/dist/builtins/winston-logging/index.js +153 -300
  246. package/dist/builtins/winston-logging/index.js.map +1 -1
  247. package/dist/builtins/winston-logging/index.mjs +144 -9
  248. package/dist/builtins/winston-logging/index.mjs.map +1 -1
  249. package/dist/builtins/winston-logging/winston-destination.d.ts +22 -0
  250. package/dist/builtins/winston-logging/winston-destination.d.ts.map +1 -0
  251. package/dist/builtins/winston-logging/winston-logging.addon.d.ts +20 -0
  252. package/dist/builtins/winston-logging/winston-logging.addon.d.ts.map +1 -0
  253. package/dist/chunk-C13QxCFV.js +50 -0
  254. package/dist/chunk-hT5z_Zn9.mjs +35 -0
  255. package/dist/download/model-download-service.d.ts +42 -0
  256. package/dist/download/model-download-service.d.ts.map +1 -0
  257. package/dist/download/model-downloader.d.ts +32 -0
  258. package/dist/download/model-downloader.d.ts.map +1 -0
  259. package/dist/events/event-bus.d.ts +11 -0
  260. package/dist/events/event-bus.d.ts.map +1 -0
  261. package/dist/events/system-event-bus.d.ts +15 -0
  262. package/dist/events/system-event-bus.d.ts.map +1 -0
  263. package/dist/feature/feature-manager.d.ts +12 -0
  264. package/dist/feature/feature-manager.d.ts.map +1 -0
  265. package/dist/formatter-C-5An4Bl.mjs +164 -0
  266. package/dist/formatter-C-5An4Bl.mjs.map +1 -0
  267. package/dist/formatter-Dr_6NNZc.js +169 -0
  268. package/dist/formatter-Dr_6NNZc.js.map +1 -0
  269. package/dist/index.d.ts +76 -1696
  270. package/dist/index.d.ts.map +1 -0
  271. package/dist/index.js +7780 -8035
  272. package/dist/index.js.map +1 -1
  273. package/dist/index.mjs +7707 -2148
  274. package/dist/index.mjs.map +1 -1
  275. package/dist/lifecycle/lifecycle-state-machine.d.ts +29 -0
  276. package/dist/lifecycle/lifecycle-state-machine.d.ts.map +1 -0
  277. package/dist/logging/formatter.d.ts +31 -0
  278. package/dist/logging/formatter.d.ts.map +1 -0
  279. package/dist/logging/log-manager.d.ts +52 -0
  280. package/dist/logging/log-manager.d.ts.map +1 -0
  281. package/dist/logging/log-ring-buffer.d.ts +48 -0
  282. package/dist/logging/log-ring-buffer.d.ts.map +1 -0
  283. package/dist/logging/scoped-logger.d.ts +18 -0
  284. package/dist/logging/scoped-logger.d.ts.map +1 -0
  285. package/dist/network/network-quality.d.ts +12 -0
  286. package/dist/network/network-quality.d.ts.map +1 -0
  287. package/dist/notification/notification-service.d.ts +38 -0
  288. package/dist/notification/notification-service.d.ts.map +1 -0
  289. package/dist/notification/toast-service.d.ts +23 -0
  290. package/dist/notification/toast-service.d.ts.map +1 -0
  291. package/dist/pipeline/engine-manager-resolver.d.ts +16 -0
  292. package/dist/pipeline/engine-manager-resolver.d.ts.map +1 -0
  293. package/dist/pipeline/pipeline-runner.d.ts +9 -0
  294. package/dist/pipeline/pipeline-runner.d.ts.map +1 -0
  295. package/dist/pipeline/pipeline-validator.d.ts +14 -0
  296. package/dist/pipeline/pipeline-validator.d.ts.map +1 -0
  297. package/dist/process/resource-monitor.d.ts +12 -0
  298. package/dist/process/resource-monitor.d.ts.map +1 -0
  299. package/dist/python/python-env-manager.d.ts +13 -0
  300. package/dist/python/python-env-manager.d.ts.map +1 -0
  301. package/dist/repl/interfaces.d.ts +32 -0
  302. package/dist/repl/interfaces.d.ts.map +1 -0
  303. package/dist/repl/repl-engine.d.ts +9 -0
  304. package/dist/repl/repl-engine.d.ts.map +1 -0
  305. package/dist/resource-monitor-CmuWlmap.js +76 -0
  306. package/dist/resource-monitor-CmuWlmap.js.map +1 -0
  307. package/dist/resource-monitor-DcQdKGYU.mjs +59 -0
  308. package/dist/resource-monitor-DcQdKGYU.mjs.map +1 -0
  309. package/dist/storage/fs-storage-backend.d.ts +41 -0
  310. package/dist/storage/fs-storage-backend.d.ts.map +1 -0
  311. package/dist/storage/storage-location-manager.d.ts +24 -0
  312. package/dist/storage/storage-location-manager.d.ts.map +1 -0
  313. package/dist/storage/storage-manager.d.ts +77 -0
  314. package/dist/storage/storage-manager.d.ts.map +1 -0
  315. package/dist/tls/cert-manager.d.ts +27 -0
  316. package/dist/tls/cert-manager.d.ts.map +1 -0
  317. package/dist/tls/index.d.ts +2 -0
  318. package/dist/tls/index.d.ts.map +1 -0
  319. package/package.json +119 -23
  320. package/dist/builtins/addon-pages-aggregator/index.js.map +0 -1
  321. package/dist/builtins/addon-pages-aggregator/index.mjs.map +0 -1
  322. package/dist/builtins/addon-widgets-aggregator/index.js.map +0 -1
  323. package/dist/builtins/addon-widgets-aggregator/index.mjs.map +0 -1
  324. package/dist/builtins/alerts/index.js.map +0 -1
  325. package/dist/builtins/alerts/index.mjs.map +0 -1
  326. package/dist/builtins/device-manager/index.js.map +0 -1
  327. package/dist/builtins/device-manager/index.mjs.map +0 -1
  328. package/dist/builtins/local-auth/index.js.map +0 -1
  329. package/dist/builtins/local-auth/index.mjs.map +0 -1
  330. package/dist/builtins/local-backup/index.js +0 -173
  331. package/dist/builtins/local-backup/index.js.map +0 -1
  332. package/dist/builtins/local-backup/index.mjs +0 -10
  333. package/dist/builtins/local-backup/index.mjs.map +0 -1
  334. package/dist/builtins/system-config/index.js.map +0 -1
  335. package/dist/builtins/system-config/index.mjs.map +0 -1
  336. package/dist/chunk-2CIYKDRN.mjs +0 -1
  337. package/dist/chunk-2CIYKDRN.mjs.map +0 -1
  338. package/dist/chunk-2F76X6NL.mjs +0 -136
  339. package/dist/chunk-2F76X6NL.mjs.map +0 -1
  340. package/dist/chunk-2QUFBZ7M.mjs +0 -1
  341. package/dist/chunk-2QUFBZ7M.mjs.map +0 -1
  342. package/dist/chunk-3BK2Y7GY.mjs +0 -593
  343. package/dist/chunk-3BK2Y7GY.mjs.map +0 -1
  344. package/dist/chunk-4OOHFJHT.mjs +0 -421
  345. package/dist/chunk-4OOHFJHT.mjs.map +0 -1
  346. package/dist/chunk-4XHB7IHT.mjs +0 -809
  347. package/dist/chunk-4XHB7IHT.mjs.map +0 -1
  348. package/dist/chunk-6M2HSSTQ.mjs +0 -98
  349. package/dist/chunk-6M2HSSTQ.mjs.map +0 -1
  350. package/dist/chunk-7FI7SQS7.mjs +0 -135
  351. package/dist/chunk-7FI7SQS7.mjs.map +0 -1
  352. package/dist/chunk-ED57RCQE.mjs +0 -171
  353. package/dist/chunk-ED57RCQE.mjs.map +0 -1
  354. package/dist/chunk-FZN56HGQ.mjs +0 -626
  355. package/dist/chunk-FZN56HGQ.mjs.map +0 -1
  356. package/dist/chunk-GL4OOB25.mjs +0 -51
  357. package/dist/chunk-GL4OOB25.mjs.map +0 -1
  358. package/dist/chunk-KDG2NTDB.mjs +0 -137
  359. package/dist/chunk-KDG2NTDB.mjs.map +0 -1
  360. package/dist/chunk-NRBQWBDM.mjs +0 -191
  361. package/dist/chunk-NRBQWBDM.mjs.map +0 -1
  362. package/dist/chunk-O4V246GG.mjs +0 -2137
  363. package/dist/chunk-O4V246GG.mjs.map +0 -1
  364. package/dist/chunk-QT57H266.mjs +0 -163
  365. package/dist/chunk-QT57H266.mjs.map +0 -1
  366. package/dist/chunk-QX4RH25I.mjs +0 -141
  367. package/dist/chunk-QX4RH25I.mjs.map +0 -1
  368. package/dist/chunk-TB562PZX.mjs +0 -86
  369. package/dist/chunk-TB562PZX.mjs.map +0 -1
  370. package/dist/chunk-TDYPZXK5.mjs +0 -1
  371. package/dist/chunk-TDYPZXK5.mjs.map +0 -1
  372. package/dist/chunk-UJI4LN5P.mjs +0 -36
  373. package/dist/chunk-UJI4LN5P.mjs.map +0 -1
  374. package/dist/chunk-W6RTHQGP.mjs +0 -1
  375. package/dist/chunk-W6RTHQGP.mjs.map +0 -1
  376. package/dist/chunk-ZELBCPDC.mjs +0 -369
  377. package/dist/chunk-ZELBCPDC.mjs.map +0 -1
  378. package/dist/index.d.mts +0 -1696
  379. package/dist/resource-monitor-UZUGPIAU.mjs +0 -9
  380. package/dist/resource-monitor-UZUGPIAU.mjs.map +0 -1
  381. package/dist/storage-location-manager-HFNB3PCS.mjs +0 -7
  382. package/dist/storage-location-manager-HFNB3PCS.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-orchestrator.addon.mjs","names":[],"sources":["../../../src/builtins/storage-orchestrator/storage-orchestrator.service.ts","../../../src/builtins/storage-orchestrator/location-store.ts","../../../src/builtins/storage-orchestrator/storage-orchestrator.addon.ts"],"sourcesContent":["/**\n * Routing core for the `storage-orchestrator` builtin.\n *\n * Owns the in-memory `locationId → StorageLocation` map and the\n * `providerId → IStorageProviderImpl` lookup. Every consumer-facing\n * `storage` cap call lands here:\n * 1. `resolveRef(ref)` — bare type or fully-qualified id → concrete location\n * 2. `getProviderFor(location)` — match `location.providerId` against the\n * live set of `storage-provider` collection providers\n *\n * The provider lookup is injected (`getProviders`) so unit tests can\n * pass fixtures without booting a real CapabilityRegistry. The addon\n * wires the production lookup to\n * `ctx.kernel.capabilityRegistry?.getCollection<IStorageProviderImpl>('storage-provider')`.\n *\n * Task 5 adds first-boot seeding of default locations from each\n * `storage-provider`'s `getProviderInfo().supportedLocationTypes`.\n * Task 6 adds an optional `ILocationStore` for SQLite persistence —\n * `initialize()` hydrates the in-memory map from the store, and every\n * `upsertLocation` / `deleteLocation` mirrors the change to the store.\n * Tests pass `null` (or a fake `ILocationStore`) for in-memory-only\n * operation; production wires `SqliteLocationStore`.\n */\nimport type {\n IScopedLogger,\n IStorageProviderImpl,\n StorageLocation,\n StorageLocationRef,\n StorageLocationType,\n} from '@camstack/types'\nimport {\n StorageLocationTypeSchema,\n DEFAULT_LOCATION_SUBDIRS,\n STORAGE_LOCATION_CARDINALITY,\n} from '@camstack/types'\nimport * as path from 'node:path'\nimport type { ILocationStore } from './location-store.js'\n\nexport interface ListLocationsFilter {\n readonly type?: StorageLocationType\n}\n\n/**\n * Provider lookup callback. Returns the live set of `storage-provider`\n * registrants. Called per-dispatch (cheap registry scan) so newly\n * loaded addons surface immediately.\n */\nexport type StorageProviderLookup = () => readonly IStorageProviderImpl[]\n\nexport class StorageOrchestratorService {\n private readonly locations: Map<string, StorageLocation> = new Map()\n\n constructor(\n private readonly logger: IScopedLogger,\n private readonly getProviders: StorageProviderLookup,\n /**\n * Optional persistence backend. When supplied, `initialize()`\n * hydrates the in-memory map from the store, and every mutation\n * (upsert/delete) mirrors to it. When `null` / `undefined`, the\n * service is in-memory only — the contract used by the existing\n * routing tests, where re-creating the service deliberately\n * forgets every location.\n */\n private readonly locationStore: ILocationStore | null = null,\n ) {}\n\n /**\n * Hydrate the in-memory map from the persistence layer. Called once\n * by the addon during `onInitialize`, before the eager seed pass.\n * Idempotent — running it twice with the same store contents\n * produces the same map. No-op when the service was constructed\n * without a store.\n *\n * Errors loading individual rows are tolerated: the bad row is\n * skipped and logged so a single corrupted record doesn't lock the\n * whole orchestrator out of boot. (The store-side validation pass\n * before insert means only schema-invalid SQL state can produce\n * such a row.)\n */\n async initialize(): Promise<void> {\n if (!this.locationStore) return\n const rows = await this.locationStore.loadAll()\n let upgraded = 0\n for (const loc of rows) {\n // One-shot upgrade for legacy rows seeded before the `isSystem`\n // column existed: seed-shaped ids (`<type>:default`) are always\n // system-protected. Without this, a fresh-from-old-DB boot would\n // expose the bootstrap defaults to operator deletion.\n if (!loc.isSystem && loc.id === `${loc.type}:default`) {\n const upgradedLoc: StorageLocation = { ...loc, isSystem: true }\n this.locations.set(upgradedLoc.id, upgradedLoc)\n // Persist the upgrade so subsequent boots skip the rewrite.\n const store = this.locationStore\n void store.upsert(upgradedLoc).catch((err) => {\n this.logger.warn('storage-orchestrator: isSystem upgrade persist failed', {\n meta: { id: upgradedLoc.id, error: err instanceof Error ? err.message : String(err) },\n })\n })\n upgraded++\n } else {\n this.locations.set(loc.id, loc)\n }\n }\n this.logger.info('storage-orchestrator: hydrated locations from store', {\n meta: { loaded: this.locations.size, isSystemUpgraded: upgraded },\n })\n }\n\n // ── Location CRUD ─────────────────────────────────────────────────────\n\n listLocations(filter?: ListLocationsFilter): readonly StorageLocation[] {\n const all = [...this.locations.values()]\n return filter?.type ? all.filter(l => l.type === filter.type) : all\n }\n\n getDefaultLocation(type: StorageLocationType): StorageLocation | null {\n for (const loc of this.locations.values()) {\n if (loc.type === type && loc.isDefault) return loc\n }\n return null\n }\n\n /**\n * Insert or update a location. If `isDefault: true`, atomically\n * demotes any other default for the same type — operators always see\n * exactly one default per type.\n *\n * When a persistence store is wired (Task 6), the new record AND any\n * implicitly-demoted siblings are persisted before the in-memory map\n * mutation returns. Persistence errors propagate to the caller.\n */\n upsertLocation(input: Omit<StorageLocation, 'createdAt' | 'updatedAt'>): StorageLocation {\n const now = Date.now()\n const existing = this.locations.get(input.id)\n\n // Cardinality guard — singleton types reject \"Add\" attempts (an\n // upsert with no matching `id` already in the map). Editing the\n // existing singleton is fine; adding a parallel one would split\n // state in a way consumers can't reconcile (two `addons-data`\n // roots, two `data` paths for sqlite, …).\n if (!existing) {\n const cardinality = STORAGE_LOCATION_CARDINALITY[input.type]\n if (cardinality === 'singleton') {\n const already = [...this.locations.values()].find(l => l.type === input.type)\n if (already) {\n throw new Error(\n `Storage type \"${input.type}\" is singleton — only one location allowed (existing: \"${already.id}\"). Edit it instead of adding a new one.`,\n )\n }\n }\n }\n // System-protected fields cannot be flipped by the operator. Once\n // a location is seeded as `isSystem: true`, edits preserve that\n // flag — the addon owns the lifecycle, not the operator.\n if (existing?.isSystem === true) {\n input = { ...input, isSystem: true }\n }\n\n const next: StorageLocation = {\n ...input,\n createdAt: existing?.createdAt ?? now,\n updatedAt: now,\n }\n const demoted: StorageLocation[] = []\n if (next.isDefault) {\n for (const [otherId, otherLoc] of this.locations) {\n if (otherLoc.type === next.type && otherLoc.id !== next.id && otherLoc.isDefault) {\n const updated: StorageLocation = { ...otherLoc, isDefault: false, updatedAt: now }\n this.locations.set(otherId, updated)\n demoted.push(updated)\n }\n }\n }\n this.locations.set(next.id, next)\n this.logger.debug('storage-orchestrator: upsertLocation', {\n meta: { id: next.id, type: next.type, providerId: next.providerId, isDefault: next.isDefault },\n })\n // Persistence is best-effort fire-and-forget on the upsert path —\n // the service stays sync (the cap surface awaits provider methods,\n // not the orchestrator's own writes). Errors are surfaced to the\n // logger so an SQLite hiccup doesn't silently desync.\n if (this.locationStore) {\n const store = this.locationStore\n void (async () => {\n try {\n for (const d of demoted) await store.upsert(d)\n await store.upsert(next)\n } catch (err) {\n this.logger.error('storage-orchestrator: upsert persistence failed', {\n meta: { id: next.id, error: err instanceof Error ? err.message : String(err) },\n })\n }\n })()\n }\n return next\n }\n\n /**\n * Remove a location. Refuses to remove the default of a type unless a\n * sibling default exists (defensive — `upsertLocation` already ensures\n * at most one default per type, but the logic guards against future\n * bypass paths e.g. SQLite migration that imports two defaults).\n *\n * Persistence (Task 6) mirrors the delete asynchronously, with errors\n * routed to the logger — see `upsertLocation` for the rationale.\n */\n deleteLocation(id: string): void {\n const loc = this.locations.get(id)\n if (!loc) {\n throw new Error(`Storage location \"${id}\" not found`)\n }\n if (loc.isSystem) {\n throw new Error(\n `Storage location \"${id}\" is system-managed and cannot be deleted. Edit its config (path / providerId) instead.`,\n )\n }\n if (loc.isDefault) {\n const otherDefault = [...this.locations.values()].find(\n l => l.type === loc.type && l.id !== id && l.isDefault,\n )\n if (!otherDefault) {\n throw new Error(\n `Cannot delete default location \"${id}\" for type \"${loc.type}\" — promote another location to default first`,\n )\n }\n }\n this.locations.delete(id)\n if (this.locationStore) {\n const store = this.locationStore\n void store.delete(id).catch((err) => {\n this.logger.error('storage-orchestrator: delete persistence failed', {\n meta: { id, error: err instanceof Error ? err.message : String(err) },\n })\n })\n }\n }\n\n // ── Ref resolution ────────────────────────────────────────────────────\n\n /**\n * Resolve a `StorageLocationRef` to a concrete `StorageLocation`.\n * - bare type (e.g. `'backups'`) → default location of that type\n * - fully-qualified id (e.g. `'backups:nas-01'`) → that exact instance\n *\n * Throws an actionable error when nothing matches — every consumer of\n * the singleton `storage` cap funnels through here, so the error\n * message is what operators see when the orchestrator's view of the\n * world doesn't match expectations.\n */\n resolveRef(ref: StorageLocationRef): StorageLocation {\n if (ref.includes(':')) {\n const loc = this.locations.get(ref)\n if (!loc) {\n throw new Error(`Storage location \"${ref}\" not found`)\n }\n return loc\n }\n // Bare-type form — must match one of the closed enum values.\n const parsed = StorageLocationTypeSchema.safeParse(ref)\n if (!parsed.success) {\n throw new Error(\n `Invalid storage location ref \"${ref}\" — expected a StorageLocationType or a fully-qualified id (\\`<type>:<slug>\\`)`,\n )\n }\n const def = this.getDefaultLocation(parsed.data)\n if (!def) {\n throw new Error(\n `No default storage location configured for type \"${parsed.data}\" — register one or pass a fully-qualified id (\\`<type>:<slug>\\`)`,\n )\n }\n return def\n }\n\n // ── Provider lookup ───────────────────────────────────────────────────\n\n /**\n * Find the storage-provider that backs a given location. Lookup is by\n * `location.providerId` against `getProviderInfo().providerId` from\n * each registered collection provider. Throws with both the missing\n * providerId and the offending location id so the operator can pick\n * the right place to fix the config.\n */\n async getProviderFor(location: StorageLocation): Promise<IStorageProviderImpl> {\n const providers = this.getProviders()\n for (const p of providers) {\n const info = await p.getProviderInfo()\n if (info.providerId === location.providerId) return p\n }\n throw new Error(\n `No storage-provider registered for providerId \"${location.providerId}\" (location \"${location.id}\")`,\n )\n }\n\n /** Convenience: lookup by id (returns `undefined` if not found). */\n getLocationById(id: string): StorageLocation | undefined {\n return this.locations.get(id)\n }\n\n // ── First-boot seeding (Task 5) ───────────────────────────────────────\n\n /**\n * Seed one default `StorageLocation` per `supportedTypes` entry that\n * doesn't already have one. Idempotent — re-running with the same\n * provider info on a populated map is a no-op (each entry already\n * resolves on `id === <type>:default`).\n *\n * Convention: the bare-type ref `'backups'` resolves via\n * `getDefaultLocation('backups')` (walks `isDefault === true`); the\n * actual stored `id` is `'backups:default'` so it satisfies the\n * `^[a-z][a-z0-9-]*:[a-z0-9-]+$` regex on `StorageLocationSchema.id`.\n *\n * `basePath` is the provider's storage root (e.g. the filesystem\n * provider's `<CAMSTACK_DATA>` dir). Each location's `config.basePath`\n * is set to `<basePath>/<DEFAULT_LOCATION_SUBDIRS[type]>` — except\n * when the subdir is already absolute (today only `cache` →\n * `/tmp/camstack-cache`), in which case it's used verbatim. The\n * filesystem provider re-derives the same path on its own — this\n * config field is purely an operator-visible record of what was\n * provisioned. Task 7 will refactor providers to honour the\n * location's `config.basePath` directly.\n */\n seedDefaults(input: {\n readonly providerId: string\n readonly supportedTypes: readonly StorageLocationType[]\n readonly basePath: string\n }): void {\n let added = 0\n for (const type of input.supportedTypes) {\n // Skip types already covered for any provider — first wins.\n if (this.hasAnyLocationOfType(type)) continue\n const subdir = DEFAULT_LOCATION_SUBDIRS[type]\n const fullPath = path.isAbsolute(subdir) ? subdir : path.join(input.basePath, subdir)\n const id = `${type}:default`\n this.upsertLocation({\n id,\n type,\n displayName: DEFAULT_DISPLAY_NAMES[type],\n providerId: input.providerId,\n config: { basePath: fullPath },\n isDefault: true,\n // Seeded defaults are system-protected — operators can edit\n // the config (e.g. relocate the path) but cannot delete them\n // outright. Without the seed, consumers (sqlite-settings,\n // backup-orchestrator, recordings, …) lose their target.\n isSystem: true,\n })\n added++\n }\n if (added > 0) {\n this.logger.info('storage-orchestrator: seeded default locations', {\n meta: { providerId: input.providerId, added, basePath: input.basePath },\n })\n }\n }\n\n /** Internal: check whether any location of the given type exists. */\n private hasAnyLocationOfType(type: StorageLocationType): boolean {\n for (const loc of this.locations.values()) {\n if (loc.type === type) return true\n }\n return false\n }\n}\n\n/**\n * Operator-facing names for the default seeded location of each\n * `StorageLocationType`. Kept in this module (not in `interfaces/`)\n * because they're a concern of the orchestrator's seed step — operator\n * UI reads `location.displayName` after seeding.\n */\nconst DEFAULT_DISPLAY_NAMES: Readonly<Record<StorageLocationType, string>> = {\n 'data': 'Local Data',\n 'media': 'Local Media',\n 'recordings': 'Local Recordings',\n 'recordings-high': 'Local Recordings (High)',\n 'recordings-low': 'Local Recordings (Low)',\n 'recordings-clips': 'Local Recordings (Clips)',\n 'event-images': 'Local Event Images',\n 'models': 'Local Models',\n 'addons-data': 'Local Addons Data',\n 'cache': 'Local Cache',\n 'logs': 'Local Logs',\n 'backups': 'Local Backups',\n}\n","/**\n * Persistence layer for the storage-orchestrator's `StorageLocation`\n * map (Task 6 of the storage-unification refactor).\n *\n * The service depends only on the abstract `ILocationStore` —\n * production wires `SqliteLocationStore` (settings-backend-backed),\n * tests pass a fake (in-memory `Map`-backed) implementation. Same\n * pattern as `IntegrationRegistry` in `sqlite-storage/`.\n */\nimport type {\n ISettingsBackend,\n StorageLocation,\n StorageLocationType,\n TableSchema,\n} from '@camstack/types'\nimport { StorageLocationTypeSchema, parseJsonObject } from '@camstack/types'\n\n/**\n * Abstract storage interface for `StorageLocation` records. Methods are\n * async because production-side implementations hit SQLite — but the\n * orchestrator's mutation paths fire-and-forget the writes so a slow\n * disk doesn't block the cap surface.\n */\nexport interface ILocationStore {\n /** Read every persisted location. Called once at boot. */\n loadAll(): Promise<readonly StorageLocation[]>\n /** Insert or replace a single location by id. */\n upsert(loc: StorageLocation): Promise<void>\n /** Remove a location by id. */\n delete(id: string): Promise<void>\n}\n\nconst STORAGE_LOCATIONS_TABLE = 'storage_locations'\n\nconst STORAGE_LOCATIONS_SCHEMA: TableSchema = {\n columns: [\n { name: 'id', type: 'TEXT', primaryKey: true },\n { name: 'type', type: 'TEXT', notNull: true },\n { name: 'display_name', type: 'TEXT', notNull: true },\n { name: 'provider_id', type: 'TEXT', notNull: true },\n { name: 'config', type: 'TEXT', notNull: true, defaultValue: '{}' },\n { name: 'is_default', type: 'INTEGER', notNull: true, defaultValue: 0 },\n { name: 'is_system', type: 'INTEGER', notNull: true, defaultValue: 0 },\n { name: 'created_at', type: 'INTEGER', notNull: true },\n { name: 'updated_at', type: 'INTEGER', notNull: true },\n ],\n indexes: [\n { name: 'idx_storage_locations_type', columns: ['type'] },\n ],\n}\n\n/**\n * SQLite-backed implementation of `ILocationStore` — uses the\n * `settings-store` cap's structured-table surface (`ensureTable` /\n * `tableInsert` / `tableUpdate` / `tableDelete` / `tableQuery`). Wired\n * to the live `ISettingsBackend` provider obtained from\n * `kernel.capabilityRegistry.getSingleton('settings-store')`.\n *\n * The cap-router surface (`ctx.api.settingsStore.*`) does NOT expose\n * the `tableXxx` methods — they're only on the raw `ISettingsBackend`.\n * Same constraint that drives `IntegrationRegistry` to take a direct\n * provider reference instead of going through the cap.\n */\nexport class SqliteLocationStore implements ILocationStore {\n private tableEnsured = false\n\n constructor(private readonly backend: ISettingsBackend) {}\n\n /**\n * Lazy `ensureTable` — keeps the constructor cheap and async-free.\n * Called from every mutation/read path; the backend's `ensureTable`\n * is itself idempotent (additive migration), so repeated calls are\n * effectively no-ops after the first.\n */\n private async ensureTable(): Promise<void> {\n if (this.tableEnsured) return\n if (!this.backend.ensureTable) {\n throw new Error(\n 'SqliteLocationStore: settings backend does not implement ensureTable — ' +\n 'expected the SQLite settings backend, got a backend without structured-table support',\n )\n }\n await this.backend.ensureTable(STORAGE_LOCATIONS_TABLE, STORAGE_LOCATIONS_SCHEMA)\n this.tableEnsured = true\n }\n\n async loadAll(): Promise<readonly StorageLocation[]> {\n await this.ensureTable()\n if (!this.backend.tableQuery) return []\n const rows = await this.backend.tableQuery(STORAGE_LOCATIONS_TABLE, {\n orderBy: { field: 'created_at', direction: 'asc' },\n })\n const out: StorageLocation[] = []\n for (const row of rows) {\n const mapped = mapRowToLocation(row)\n if (mapped) out.push(mapped)\n }\n return out\n }\n\n /**\n * Replace-or-insert. Implemented as `delete` + `insert` rather than\n * the conditional `tableUpdate` path because the orchestrator\n * serializes every mutation through the in-memory map before\n * dispatching to the store — there's no contention to lose, and the\n * delete-then-insert path is unconditionally simpler.\n */\n async upsert(loc: StorageLocation): Promise<void> {\n await this.ensureTable()\n if (!this.backend.tableDelete || !this.backend.tableInsert) {\n throw new Error('SqliteLocationStore: backend missing tableDelete/tableInsert')\n }\n await this.backend.tableDelete(STORAGE_LOCATIONS_TABLE, { id: loc.id })\n await this.backend.tableInsert(STORAGE_LOCATIONS_TABLE, mapLocationToRow(loc))\n }\n\n async delete(id: string): Promise<void> {\n await this.ensureTable()\n if (!this.backend.tableDelete) {\n throw new Error('SqliteLocationStore: backend missing tableDelete')\n }\n await this.backend.tableDelete(STORAGE_LOCATIONS_TABLE, { id })\n }\n}\n\n// ── Row ↔ record mapping ──────────────────────────────────────────────\n\nfunction mapLocationToRow(loc: StorageLocation): Record<string, unknown> {\n return {\n id: loc.id,\n type: loc.type,\n display_name: loc.displayName,\n provider_id: loc.providerId,\n config: JSON.stringify(loc.config),\n is_default: loc.isDefault ? 1 : 0,\n is_system: loc.isSystem ? 1 : 0,\n created_at: loc.createdAt,\n updated_at: loc.updatedAt,\n }\n}\n\n/**\n * Decode a row read from the structured table. Returns `null` when the\n * row's `type` doesn't parse against the Zod enum — the caller skips\n * the row and logs. Defensive against schema drift across upgrades\n * (e.g. an older build wrote a since-removed `recordings-archive`\n * type and the new build no longer recognises it).\n */\nfunction mapRowToLocation(row: Record<string, unknown>): StorageLocation | null {\n const typeRaw = row['type']\n const parsedType = StorageLocationTypeSchema.safeParse(typeRaw)\n if (!parsedType.success) return null\n const type: StorageLocationType = parsedType.data\n\n const id = String(row['id'] ?? '')\n if (!id) return null\n\n // Defensive JSON parse: corrupt rows (hand-edited, written by an\n // older build, partial migration, …) shouldn't lock the\n // orchestrator out of boot — fall back to an empty config and let\n // the location be served with whatever the provider's defaults are.\n const configRaw = row['config']\n const config: Record<string, unknown> = typeof configRaw === 'string' && configRaw.length > 0\n ? (parseJsonObject(configRaw) ?? {})\n : {}\n\n return {\n id,\n type,\n displayName: String(row['display_name'] ?? ''),\n providerId: String(row['provider_id'] ?? ''),\n config,\n isDefault: row['is_default'] === 1 || row['is_default'] === true,\n isSystem: row['is_system'] === 1 || row['is_system'] === true,\n createdAt: Number(row['created_at'] ?? 0),\n updatedAt: Number(row['updated_at'] ?? 0),\n }\n}\n","/**\n * `storage-orchestrator` builtin — singleton owner of the consumer-\n * facing `storage` cap.\n *\n * Responsibilities:\n * - Hold the `locationId → StorageLocation` map (in-memory; Task 6\n * adds persistence).\n * - Resolve `StorageLocationRef` → concrete `StorageLocation`.\n * - Dispatch every cap method to the right `storage-provider`\n * (collection cap, registered by `filesystem-storage` and future\n * SFTP / S3 / WebDAV addons).\n * - Track ownership of upload / download sessions so chunked I/O\n * (which carries no `location` after the first hop) can route\n * subsequent chunks to the same provider.\n * - First-boot seed defaults from each provider's\n * `getProviderInfo().supportedLocationTypes` (Task 5). Re-runs on\n * every `capability:provider-registered` event so providers that\n * register after the orchestrator boots also get seeded — the\n * `hasAnyLocationOfType` guard makes the operation idempotent.\n *\n * Task 6 will plug a persistence backend in front of the in-memory map.\n * Task 7 will migrate consumers off the legacy storage shim.\n */\nimport { BaseAddon, storageCapability } from '@camstack/types'\nimport type {\n IStorageCapProvider,\n IStorageProviderImpl,\n ISettingsBackend,\n ProviderRegistration,\n StorageLocation,\n StorageLocationType,\n IEventBus,\n} from '@camstack/types'\nimport * as path from 'node:path'\nimport { StorageOrchestratorService } from './storage-orchestrator.service.js'\nimport { SqliteLocationStore, type ILocationStore } from './location-store.js'\n\nconst STORAGE_PROVIDER_CAP_NAME = 'storage-provider'\n\n/**\n * Raw event category emitted by `CapabilityRegistry.registerProvider` —\n * not in the typed `EventCategory` enum because it lives in the kernel\n * infra layer (every cap-bound event is a custom-shape payload).\n */\nconst CAP_PROVIDER_REGISTERED_CATEGORY = 'capability:provider-registered'\n\ninterface StorageOrchestratorConfig extends Record<string, unknown> {}\n\nexport class StorageOrchestratorAddon extends BaseAddon<StorageOrchestratorConfig> {\n private service: StorageOrchestratorService | null = null\n\n /**\n * `uploadId` → providerId. Populated on `beginUpload`, consulted on\n * every subsequent `writeChunk` / `finalizeUpload` / `abortUpload`,\n * cleared on terminal calls. The provider holds the actual session\n * state (open file descriptor, buffered offsets, …) — we just\n * remember which provider owns it.\n */\n private readonly uploadOwners: Map<string, string> = new Map()\n /** Symmetric to `uploadOwners` for download sessions. */\n private readonly downloadOwners: Map<string, string> = new Map()\n\n /**\n * Disposers run on `onShutdown` — currently the eventBus subscription\n * for `capability:provider-registered` events used by the lazy seed\n * fallback. Stored separately from the `BaseAddon` disposer chain so\n * it can be inspected in tests.\n */\n private readonly seedSubscriptionDisposers: Array<() => void> = []\n\n constructor() {\n super({})\n }\n\n protected async onInitialize(): Promise<ProviderRegistration[]> {\n const getProviders = (): readonly IStorageProviderImpl[] => {\n const reg = this.ctx.kernel.capabilityRegistry\n if (!reg) return []\n return reg.getCollection<IStorageProviderImpl>(STORAGE_PROVIDER_CAP_NAME)\n }\n\n // Wire the persistence backend (Task 6). Skipped if the\n // settings-store cap hasn't registered a provider yet (e.g. early\n // boot tests, or a deployment without the sqlite-settings builtin\n // mounted) — the service falls back to in-memory only.\n const locationStore = this.resolveLocationStore()\n\n const service = new StorageOrchestratorService(\n this.ctx.logger,\n getProviders,\n locationStore,\n )\n this.service = service\n\n // Hydrate persisted locations BEFORE seeding so re-seeds skip\n // already-persisted defaults (the seed step's\n // `hasAnyLocationOfType` gate looks at the in-memory map).\n await service.initialize()\n\n const provider: IStorageCapProvider = {\n // ── Location management ─────────────────────────────────────────\n listLocations: async ({ type }) => {\n return type !== undefined\n ? service.listLocations({ type })\n : service.listLocations()\n },\n getDefaultLocation: async ({ type }) => service.getDefaultLocation(type),\n upsertLocation: async (input) => service.upsertLocation(input),\n deleteLocation: async ({ id }) => {\n service.deleteLocation(id)\n },\n testLocation: async ({ id }) => {\n const loc = service.getLocationById(id)\n if (!loc) return { ok: false, error: `Location \"${id}\" not found` }\n try {\n const p = await service.getProviderFor(loc)\n return p.testLocation({ config: loc.config })\n } catch (err) {\n return { ok: false, error: err instanceof Error ? err.message : String(err) }\n }\n },\n\n // ── Provider discovery ──────────────────────────────────────────\n // Walk every registered `storage-provider`, collect each one's\n // `getProviderInfo()` blob. Used by the admin-UI \"Add location\"\n // wizard. Errors from individual providers are isolated — a\n // single misbehaving driver shouldn't deny the whole list.\n listProviders: async () => {\n const providers = getProviders()\n const out: Array<{\n providerId: string\n displayName: string\n supportedLocationTypes: readonly StorageLocationType[]\n configSchema: unknown\n }> = []\n for (const p of providers) {\n try {\n const info = await p.getProviderInfo()\n out.push({\n providerId: info.providerId,\n displayName: info.displayName,\n supportedLocationTypes: info.supportedLocationTypes,\n configSchema: info.configSchema,\n })\n } catch (err) {\n this.ctx.logger.warn('storage-orchestrator: getProviderInfo failed', {\n meta: { error: err instanceof Error ? err.message : String(err) },\n })\n }\n }\n return out\n },\n\n // Probe a candidate config against a specific provider WITHOUT\n // persisting. Lets the wizard preflight credentials (SFTP / S3\n // / WebDAV) before the operator commits. Validation errors are\n // returned in `error`; transport errors are caught + reported.\n testConfig: async ({ providerId, config }) => {\n const providers = getProviders()\n for (const p of providers) {\n try {\n const info = await p.getProviderInfo()\n if (info.providerId !== providerId) continue\n return p.testLocation({ config })\n } catch (err) {\n return { ok: false, error: err instanceof Error ? err.message : String(err) }\n }\n }\n return { ok: false, error: `No storage-provider registered for providerId \"${providerId}\"` }\n },\n\n // ── Small-file primitives — every method resolves the ref then\n // dispatches the inline-location form to the provider. ──────────\n resolve: async ({ location, relativePath }) => {\n const loc = service.resolveRef(location)\n const p = await service.getProviderFor(loc)\n return p.resolve({ location: loc, relativePath })\n },\n write: async ({ location, relativePath, data }) => {\n const loc = service.resolveRef(location)\n const p = await service.getProviderFor(loc)\n return p.write({ location: loc, relativePath, data })\n },\n read: async ({ location, relativePath }) => {\n const loc = service.resolveRef(location)\n const p = await service.getProviderFor(loc)\n return p.read({ location: loc, relativePath })\n },\n exists: async ({ location, relativePath }) => {\n const loc = service.resolveRef(location)\n const p = await service.getProviderFor(loc)\n return p.exists({ location: loc, relativePath })\n },\n list: async ({ location, prefix }) => {\n const loc = service.resolveRef(location)\n const p = await service.getProviderFor(loc)\n return prefix !== undefined\n ? p.list({ location: loc, prefix })\n : p.list({ location: loc })\n },\n delete: async ({ location, relativePath }) => {\n const loc = service.resolveRef(location)\n const p = await service.getProviderFor(loc)\n return p.delete({ location: loc, relativePath })\n },\n getAvailableSpace: async ({ location }) => {\n const loc = service.resolveRef(location)\n const p = await service.getProviderFor(loc)\n return p.getAvailableSpace({ location: loc })\n },\n\n // ── Chunked upload — first call records ownership, subsequent\n // calls look it up. Cleanup happens in finalize/abort. ──────────\n beginUpload: async ({ location, relativePath, sizeBytes }) => {\n const loc = service.resolveRef(location)\n const p = await service.getProviderFor(loc)\n const result = sizeBytes !== undefined\n ? await p.beginUpload({ location: loc, relativePath, sizeBytes })\n : await p.beginUpload({ location: loc, relativePath })\n this.uploadOwners.set(result.uploadId, loc.providerId)\n return result\n },\n writeChunk: async (input) => {\n const p = await this.resolveByUploadId(input.uploadId)\n return p.writeChunk(input)\n },\n finalizeUpload: async (input) => {\n const p = await this.resolveByUploadId(input.uploadId)\n try {\n return await p.finalizeUpload(input)\n } finally {\n this.uploadOwners.delete(input.uploadId)\n }\n },\n abortUpload: async (input) => {\n const p = await this.resolveByUploadId(input.uploadId)\n try {\n return await p.abortUpload(input)\n } finally {\n this.uploadOwners.delete(input.uploadId)\n }\n },\n\n // ── Chunked download (symmetric to upload) ──────────────────────\n beginDownload: async ({ location, relativePath }) => {\n const loc = service.resolveRef(location)\n const p = await service.getProviderFor(loc)\n const result = await p.beginDownload({ location: loc, relativePath })\n this.downloadOwners.set(result.downloadId, loc.providerId)\n return result\n },\n readChunk: async (input) => {\n const p = await this.resolveByDownloadId(input.downloadId)\n return p.readChunk(input)\n },\n endDownload: async (input) => {\n const p = await this.resolveByDownloadId(input.downloadId)\n try {\n return await p.endDownload(input)\n } finally {\n this.downloadOwners.delete(input.downloadId)\n }\n },\n }\n\n // Eager seed pass — covers the case where filesystem-storage (or\n // any other storage-provider) already registered before the\n // orchestrator booted. Lazy pass below catches providers that\n // register later.\n await this.seedFromAllProviders()\n\n // Lazy pass — `CapabilityRegistry.registerProvider` emits\n // `capability:provider-registered` on the kernel event bus; we\n // re-run the seed step every time the storage-provider collection\n // grows. `hasAnyLocationOfType` keeps the operation idempotent.\n const eventBus = this.ctx.eventBus as IEventBus | undefined\n if (eventBus) {\n const unsub = eventBus.subscribe(\n { category: CAP_PROVIDER_REGISTERED_CATEGORY },\n (event) => {\n const data = event.data as { capability?: string } | undefined\n if (data?.capability !== STORAGE_PROVIDER_CAP_NAME) return\n // Fire-and-forget: providers register synchronously but\n // `getProviderInfo()` is async. Errors are scoped to the\n // logger inside `seedFromAllProviders`.\n void this.seedFromAllProviders()\n },\n )\n this.seedSubscriptionDisposers.push(unsub)\n }\n\n this.ctx.logger.info('Storage orchestrator initialized')\n return [{ capability: storageCapability, provider }]\n }\n\n protected async onShutdown(): Promise<void> {\n for (const dispose of this.seedSubscriptionDisposers) {\n try { dispose() } catch { /* noop */ }\n }\n this.seedSubscriptionDisposers.length = 0\n this.uploadOwners.clear()\n this.downloadOwners.clear()\n this.service = null\n }\n\n // ── Persistence wiring (Task 6) ─────────────────────────────────────\n\n /**\n * Resolve the live `ISettingsBackend` from the capability registry\n * and wrap it in a `SqliteLocationStore`. Returns `null` when the\n * settings-store cap isn't registered yet — the service falls back\n * to in-memory only. Production boot order (sqlite-settings runs\n * before the orchestrator) makes this the rare path.\n */\n private resolveLocationStore(): ILocationStore | null {\n const reg = this.ctx.kernel.capabilityRegistry\n if (!reg) return null\n const backend = reg.getSingleton<ISettingsBackend>('settings-store')\n if (!backend) {\n this.ctx.logger.warn(\n 'storage-orchestrator: no settings-store provider — running in-memory only',\n )\n return null\n }\n if (!backend.ensureTable || !backend.tableInsert) {\n this.ctx.logger.warn(\n 'storage-orchestrator: settings backend lacks structured-table support — running in-memory only',\n )\n return null\n }\n return new SqliteLocationStore(backend)\n }\n\n // ── Seeding helpers (Task 5) ────────────────────────────────────────\n\n /**\n * Walk every registered `storage-provider` collection provider and\n * call `service.seedDefaults` for each. Idempotent — re-running on\n * a populated map is a no-op (each location's `id` is already in the\n * service's map).\n *\n * `basePath` is derived per-call:\n * - Filesystem providers (and any provider whose `getProviderInfo`\n * doesn't include a `basePath` field) fall back to\n * `process.env.CAMSTACK_DATA ?? path.resolve(process.cwd(), 'camstack-data')`.\n * - Future remote providers (SFTP/S3/WebDAV) will report their own\n * base path through the wizard config — they're not relevant for\n * first-boot seeding (operators add them through the admin UI).\n */\n private async seedFromAllProviders(): Promise<void> {\n if (!this.service) return\n const reg = this.ctx.kernel.capabilityRegistry\n if (!reg) return\n\n const providers = reg.getCollection<IStorageProviderImpl>(STORAGE_PROVIDER_CAP_NAME)\n if (providers.length === 0) return\n\n const basePath = process.env['CAMSTACK_DATA'] ?? path.resolve(process.cwd(), 'camstack-data')\n\n for (const p of providers) {\n try {\n const info = await p.getProviderInfo()\n this.service.seedDefaults({\n providerId: info.providerId,\n supportedTypes: info.supportedLocationTypes,\n basePath,\n })\n } catch (err) {\n this.ctx.logger.warn('storage-orchestrator: seed failed for provider', {\n meta: { error: err instanceof Error ? err.message : String(err) },\n })\n }\n }\n }\n\n // ── Session ownership helpers ─────────────────────────────────────────\n\n private async resolveByUploadId(uploadId: string): Promise<IStorageProviderImpl> {\n const providerId = this.uploadOwners.get(uploadId)\n if (!providerId) {\n throw new Error(`Unknown uploadId \"${uploadId}\" — orchestrator has no record of beginUpload`)\n }\n return this.providerByProviderId(providerId, `uploadId \"${uploadId}\"`)\n }\n\n private async resolveByDownloadId(downloadId: string): Promise<IStorageProviderImpl> {\n const providerId = this.downloadOwners.get(downloadId)\n if (!providerId) {\n throw new Error(`Unknown downloadId \"${downloadId}\" — orchestrator has no record of beginDownload`)\n }\n return this.providerByProviderId(providerId, `downloadId \"${downloadId}\"`)\n }\n\n /**\n * Look up a `storage-provider` by `providerId` only — used for\n * upload / download dispatch where the original `StorageLocation` is\n * no longer in scope. Throws if the provider has gone away (e.g.\n * addon unloaded mid-session).\n */\n private async providerByProviderId(providerId: string, sessionDescriptor: string): Promise<IStorageProviderImpl> {\n if (!this.service) throw new Error('storage-orchestrator: service not initialized')\n // Synthesize a minimal `StorageLocation`-shaped probe — the service\n // only reads `providerId` + `id` for the lookup error message.\n const probe: StorageLocation = {\n id: `__session:${sessionDescriptor}`,\n type: 'data',\n displayName: sessionDescriptor,\n providerId,\n config: {},\n isDefault: false,\n isSystem: false,\n createdAt: 0,\n updatedAt: 0,\n }\n return this.service.getProviderFor(probe)\n }\n}\n\nexport default StorageOrchestratorAddon\n"],"mappings":";;;AAiDA,IAAa,6BAAb,MAAwC;CACtC,4BAA2D,IAAI,KAAK;CAEpE,YACE,QACA,cASA,gBAAwD,MACxD;EAXiB,KAAA,SAAA;EACA,KAAA,eAAA;EASA,KAAA,gBAAA;;;;;;;;;;;;;;;CAgBnB,MAAM,aAA4B;EAChC,IAAI,CAAC,KAAK,eAAe;EACzB,MAAM,OAAO,MAAM,KAAK,cAAc,SAAS;EAC/C,IAAI,WAAW;EACf,KAAK,MAAM,OAAO,MAKhB,IAAI,CAAC,IAAI,YAAY,IAAI,OAAO,GAAG,IAAI,KAAK,WAAW;GACrD,MAAM,cAA+B;IAAE,GAAG;IAAK,U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KAAK;GACZ,KAAK,IAAI,OAAO,KAAK,kDAAkD,EACrE,MAAM,EAAE,OAAO,eAAe,QAAQ,IAAI,UAAU,OAAO,IAAI,EAAE,EAClE,CAAC;;;CAOR,MAAc,kBAAkB,UAAiD;EAC/E,MAAM,aAAa,KAAK,aAAa,IAAI,SAAS;EAClD,IAAI,CAAC,YACH,MAAM,IAAI,MAAM,qBAAqB,SAAS,+CAA+C;EAE/F,OAAO,KAAK,qBAAqB,YAAY,aAAa,SAAS,GAAG;;CAGxE,MAAc,oBAAoB,YAAmD;EACnF,MAAM,aAAa,KAAK,eAAe,IAAI,WAAW;EACtD,IAAI,CAAC,YACH,MAAM,IAAI,MAAM,uBAAuB,WAAW,iDAAiD;EAErG,OAAO,KAAK,qBAAqB,YAAY,eAAe,WAAW,GAAG;;;;;;;;CAS5E,MAAc,qBAAqB,YAAoB,mBAA0D;EAC/G,IAAI,CAAC,KAAK,SAAS,MAAM,IAAI,MAAM,gDAAgD;EAGnF,MAAM,QAAyB;GAC7B,IAAI,aAAa;GACjB,MAAM;GACN,aAAa;GACb;GACA,QAAQ,EAAE;GACV,WAAW;GACX,UAAU;GACV,WAAW;GACX,WAAW;GACZ;EACD,OAAO,KAAK,QAAQ,eAAe,MAAM"}
@@ -0,0 +1,121 @@
1
+ import { IScopedLogger, IStorageProviderImpl, StorageLocation, StorageLocationRef, StorageLocationType } from '@camstack/types';
2
+ import { ILocationStore } from './location-store.js';
3
+ export interface ListLocationsFilter {
4
+ readonly type?: StorageLocationType;
5
+ }
6
+ /**
7
+ * Provider lookup callback. Returns the live set of `storage-provider`
8
+ * registrants. Called per-dispatch (cheap registry scan) so newly
9
+ * loaded addons surface immediately.
10
+ */
11
+ export type StorageProviderLookup = () => readonly IStorageProviderImpl[];
12
+ export declare class StorageOrchestratorService {
13
+ private readonly logger;
14
+ private readonly getProviders;
15
+ /**
16
+ * Optional persistence backend. When supplied, `initialize()`
17
+ * hydrates the in-memory map from the store, and every mutation
18
+ * (upsert/delete) mirrors to it. When `null` / `undefined`, the
19
+ * service is in-memory only — the contract used by the existing
20
+ * routing tests, where re-creating the service deliberately
21
+ * forgets every location.
22
+ */
23
+ private readonly locationStore;
24
+ private readonly locations;
25
+ constructor(logger: IScopedLogger, getProviders: StorageProviderLookup,
26
+ /**
27
+ * Optional persistence backend. When supplied, `initialize()`
28
+ * hydrates the in-memory map from the store, and every mutation
29
+ * (upsert/delete) mirrors to it. When `null` / `undefined`, the
30
+ * service is in-memory only — the contract used by the existing
31
+ * routing tests, where re-creating the service deliberately
32
+ * forgets every location.
33
+ */
34
+ locationStore?: ILocationStore | null);
35
+ /**
36
+ * Hydrate the in-memory map from the persistence layer. Called once
37
+ * by the addon during `onInitialize`, before the eager seed pass.
38
+ * Idempotent — running it twice with the same store contents
39
+ * produces the same map. No-op when the service was constructed
40
+ * without a store.
41
+ *
42
+ * Errors loading individual rows are tolerated: the bad row is
43
+ * skipped and logged so a single corrupted record doesn't lock the
44
+ * whole orchestrator out of boot. (The store-side validation pass
45
+ * before insert means only schema-invalid SQL state can produce
46
+ * such a row.)
47
+ */
48
+ initialize(): Promise<void>;
49
+ listLocations(filter?: ListLocationsFilter): readonly StorageLocation[];
50
+ getDefaultLocation(type: StorageLocationType): StorageLocation | null;
51
+ /**
52
+ * Insert or update a location. If `isDefault: true`, atomically
53
+ * demotes any other default for the same type — operators always see
54
+ * exactly one default per type.
55
+ *
56
+ * When a persistence store is wired (Task 6), the new record AND any
57
+ * implicitly-demoted siblings are persisted before the in-memory map
58
+ * mutation returns. Persistence errors propagate to the caller.
59
+ */
60
+ upsertLocation(input: Omit<StorageLocation, 'createdAt' | 'updatedAt'>): StorageLocation;
61
+ /**
62
+ * Remove a location. Refuses to remove the default of a type unless a
63
+ * sibling default exists (defensive — `upsertLocation` already ensures
64
+ * at most one default per type, but the logic guards against future
65
+ * bypass paths e.g. SQLite migration that imports two defaults).
66
+ *
67
+ * Persistence (Task 6) mirrors the delete asynchronously, with errors
68
+ * routed to the logger — see `upsertLocation` for the rationale.
69
+ */
70
+ deleteLocation(id: string): void;
71
+ /**
72
+ * Resolve a `StorageLocationRef` to a concrete `StorageLocation`.
73
+ * - bare type (e.g. `'backups'`) → default location of that type
74
+ * - fully-qualified id (e.g. `'backups:nas-01'`) → that exact instance
75
+ *
76
+ * Throws an actionable error when nothing matches — every consumer of
77
+ * the singleton `storage` cap funnels through here, so the error
78
+ * message is what operators see when the orchestrator's view of the
79
+ * world doesn't match expectations.
80
+ */
81
+ resolveRef(ref: StorageLocationRef): StorageLocation;
82
+ /**
83
+ * Find the storage-provider that backs a given location. Lookup is by
84
+ * `location.providerId` against `getProviderInfo().providerId` from
85
+ * each registered collection provider. Throws with both the missing
86
+ * providerId and the offending location id so the operator can pick
87
+ * the right place to fix the config.
88
+ */
89
+ getProviderFor(location: StorageLocation): Promise<IStorageProviderImpl>;
90
+ /** Convenience: lookup by id (returns `undefined` if not found). */
91
+ getLocationById(id: string): StorageLocation | undefined;
92
+ /**
93
+ * Seed one default `StorageLocation` per `supportedTypes` entry that
94
+ * doesn't already have one. Idempotent — re-running with the same
95
+ * provider info on a populated map is a no-op (each entry already
96
+ * resolves on `id === <type>:default`).
97
+ *
98
+ * Convention: the bare-type ref `'backups'` resolves via
99
+ * `getDefaultLocation('backups')` (walks `isDefault === true`); the
100
+ * actual stored `id` is `'backups:default'` so it satisfies the
101
+ * `^[a-z][a-z0-9-]*:[a-z0-9-]+$` regex on `StorageLocationSchema.id`.
102
+ *
103
+ * `basePath` is the provider's storage root (e.g. the filesystem
104
+ * provider's `<CAMSTACK_DATA>` dir). Each location's `config.basePath`
105
+ * is set to `<basePath>/<DEFAULT_LOCATION_SUBDIRS[type]>` — except
106
+ * when the subdir is already absolute (today only `cache` →
107
+ * `/tmp/camstack-cache`), in which case it's used verbatim. The
108
+ * filesystem provider re-derives the same path on its own — this
109
+ * config field is purely an operator-visible record of what was
110
+ * provisioned. Task 7 will refactor providers to honour the
111
+ * location's `config.basePath` directly.
112
+ */
113
+ seedDefaults(input: {
114
+ readonly providerId: string;
115
+ readonly supportedTypes: readonly StorageLocationType[];
116
+ readonly basePath: string;
117
+ }): void;
118
+ /** Internal: check whether any location of the given type exists. */
119
+ private hasAnyLocationOfType;
120
+ }
121
+ //# sourceMappingURL=storage-orchestrator.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-orchestrator.service.d.ts","sourceRoot":"","sources":["../../../src/builtins/storage-orchestrator/storage-orchestrator.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,iBAAiB,CAAA;AAOxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,CAAC,EAAE,mBAAmB,CAAA;CACpC;AAED;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,SAAS,oBAAoB,EAAE,CAAA;AAEzE,qBAAa,0BAA0B;IAInC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B;;;;;;;OAOG;IACH,OAAO,CAAC,QAAQ,CAAC,aAAa;IAbhC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA0C;gBAGjD,MAAM,EAAE,aAAa,EACrB,YAAY,EAAE,qBAAqB;IACpD;;;;;;;OAOG;IACc,aAAa,GAAE,cAAc,GAAG,IAAW;IAG9D;;;;;;;;;;;;OAYG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IA+BjC,aAAa,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,SAAS,eAAe,EAAE;IAKvE,kBAAkB,CAAC,IAAI,EAAE,mBAAmB,GAAG,eAAe,GAAG,IAAI;IAOrE;;;;;;;;OAQG;IACH,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,WAAW,GAAG,WAAW,CAAC,GAAG,eAAe;IAkExF;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAiChC;;;;;;;;;OASG;IACH,UAAU,CAAC,GAAG,EAAE,kBAAkB,GAAG,eAAe;IA0BpD;;;;;;OAMG;IACG,cAAc,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAW9E,oEAAoE;IACpE,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAMxD;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,YAAY,CAAC,KAAK,EAAE;QAClB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;QAC3B,QAAQ,CAAC,cAAc,EAAE,SAAS,mBAAmB,EAAE,CAAA;QACvD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;KAC1B,GAAG,IAAI;IA8BR,qEAAqE;IACrE,OAAO,CAAC,oBAAoB;CAM7B"}
@@ -0,0 +1,138 @@
1
+ import { IScopedLogger } from '@camstack/types';
2
+ /**
3
+ * Default set of paths considered part of a "system backup". Includes
4
+ * everything that isn't pure backend code — config, sqlite, addons
5
+ * (runtime overlay), addons-data (per-addon private dir), TLS certs,
6
+ * auto-update marker.
7
+ *
8
+ * Excluded by default: recordings/, media/, models/, logs/, cache/
9
+ * (too large or fully recreatable).
10
+ */
11
+ export declare const DEFAULT_BACKUP_LOCATIONS: readonly ["config.yaml", "addons", "addons-data", "tls", "auto-update.json"];
12
+ /** Path of the manifest file embedded inside every archive. */
13
+ export declare const ARCHIVE_MANIFEST_NAME = ".camstack-backup-manifest.json";
14
+ export type ArchiveEntryKind = 'file' | 'dir' | 'symlink';
15
+ export interface ArchiveEntry {
16
+ /** Path relative to the archive root (== relative to dataDir). */
17
+ readonly path: string;
18
+ readonly kind: ArchiveEntryKind;
19
+ /** Content bytes. 0 for dirs / symlinks. */
20
+ readonly sizeBytes: number;
21
+ /** ms epoch from filesystem mtime. */
22
+ readonly mtime: number;
23
+ }
24
+ export interface ArchiveManifest {
25
+ archiveVersion: 1;
26
+ createdAt: number;
27
+ dataDir: string;
28
+ /**
29
+ * Mutable arrays — same shape as the zod-inferred type returned by
30
+ * `ArchiveManifestSchema.parse()`. `BaseAddon` providers receive
31
+ * this exact type via cap inputs, so making the interface readonly
32
+ * here would force callers to clone before forwarding.
33
+ */
34
+ locations: string[];
35
+ entries: ArchiveEntry[];
36
+ /** Sum of file `sizeBytes` (uncompressed). */
37
+ totalBytes: number;
38
+ totalFiles: number;
39
+ }
40
+ export interface CreateArchiveResult {
41
+ archivePath: string;
42
+ includedLocations: readonly string[];
43
+ /** Archive size in bytes (compressed, on disk). */
44
+ sizeBytes: number;
45
+ /** Embedded manifest — same shape as `getArchiveManifest()`. */
46
+ manifest: ArchiveManifest;
47
+ }
48
+ export interface RestoreMarker {
49
+ archivePath: string;
50
+ requestedAt: number;
51
+ /** Caller-supplied identifier (e.g. backup id) for traceability. */
52
+ source: string;
53
+ /**
54
+ * Optional whitelist of top-level locations to restore from the
55
+ * archive. When omitted the boot-time hook applies everything in
56
+ * the archive (full restore — same as the legacy behavior).
57
+ */
58
+ locations?: readonly string[];
59
+ }
60
+ export interface LocationStat {
61
+ readonly name: string;
62
+ readonly sizeBytes: number;
63
+ readonly fileCount: number;
64
+ /** False when the location doesn't exist under dataDir. */
65
+ readonly present: boolean;
66
+ }
67
+ /**
68
+ * System-level archive primitives. Construct one per server boot;
69
+ * methods are pure I/O.
70
+ */
71
+ export declare class SystemBackupService {
72
+ private readonly dataDir;
73
+ private readonly logger;
74
+ constructor(dataDir: string, logger: IScopedLogger);
75
+ /**
76
+ * Snapshot the current size + file count of each well-known
77
+ * location. Used by the admin UI to render an opt-in checklist
78
+ * before triggering a backup, and by `createArchive` to derive the
79
+ * embedded manifest.
80
+ */
81
+ statLocations(locations?: readonly string[]): readonly LocationStat[];
82
+ /**
83
+ * Create a tar.gz of the given locations. Uses the `tar` npm package
84
+ * (used by npm itself) instead of shelling out — gives us:
85
+ *
86
+ * - Symlink dereference (`follow: true`) so dev mode's
87
+ * `addons/<name> → packages/<name>` overlay archives content,
88
+ * not just link stubs.
89
+ * - Programmatic walk → we build a manifest of every entry while
90
+ * copying so the archive can self-describe.
91
+ *
92
+ * Locations that don't exist are silently skipped. Throws if zero
93
+ * locations would be included.
94
+ */
95
+ createArchive(opts: {
96
+ archivePath: string;
97
+ locations?: readonly string[];
98
+ }): Promise<CreateArchiveResult>;
99
+ /**
100
+ * Read the embedded manifest from a previously-created archive
101
+ * without extracting payload files. Streams the tar.gz, parses the
102
+ * one entry we care about, then aborts.
103
+ */
104
+ readArchiveManifest(archivePath: string): Promise<ArchiveManifest | null>;
105
+ /**
106
+ * Extract a previously-created archive over `targetDir`. Used at boot
107
+ * by the restore hook — never call from a running server (would
108
+ * corrupt sqlite mid-run).
109
+ *
110
+ * `locations` is an optional whitelist: only entries whose path
111
+ * starts with one of the locations get extracted. Used by the
112
+ * partial-restore flow where the operator picks a subset of the
113
+ * archive contents to apply (e.g. "restore my devices but keep
114
+ * my current TLS certs").
115
+ */
116
+ extractArchive(opts: {
117
+ archivePath: string;
118
+ targetDir: string;
119
+ locations?: readonly string[];
120
+ }): Promise<void>;
121
+ /**
122
+ * Schedule a restore for the next boot by writing a marker file.
123
+ * `locations` (optional) carries through to the boot-time
124
+ * extractArchive call so the operator's "restore only X and Y"
125
+ * choice survives the process restart.
126
+ */
127
+ scheduleRestoreMarker(opts: {
128
+ archivePath: string;
129
+ source: string;
130
+ locations?: readonly string[];
131
+ }): string;
132
+ /** Read the pending-restore marker if one is present. */
133
+ readPendingMarker(): RestoreMarker | null;
134
+ /** Drop the marker after a successful boot-time restore. */
135
+ clearPendingMarker(): void;
136
+ private getRestoreMarkerPath;
137
+ }
138
+ //# sourceMappingURL=system-backup.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"system-backup.service.d.ts","sourceR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,oBAAoB;CAG7B"}
@@ -0,0 +1,2 @@
1
+ export { SystemConfigAddon, default } from './system-config.addon.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/builtins/system-config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA"}
@@ -1,189 +1,7 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/builtins/system-config/index.ts
21
- var system_config_exports = {};
22
- __export(system_config_exports, {
23
- SystemConfigAddon: () => SystemConfigAddon,
24
- default: () => system_config_addon_default
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
25
4
  });
26
- module.exports = __toCommonJS(system_config_exports);
27
-
28
- // src/builtins/system-config/system-config.addon.ts
29
- var import_types = require("@camstack/types");
30
- var SECTION_TITLES = {
31
- server: "Server",
32
- auth: "Authentication",
33
- ffmpeg: "FFmpeg"
34
- };
35
- var KEY_TO_SECTION = {
36
- // server (read-only)
37
- port: "server",
38
- host: "server",
39
- dataPath: "server",
40
- // auth
41
- tokenExpiry: "auth",
42
- // ffmpeg
43
- binaryPath: "ffmpeg",
44
- hwAccel: "ffmpeg",
45
- threadCount: "ffmpeg"
46
- };
47
- var SystemConfigAddon = class extends import_types.BaseAddon {
48
- id = "system-config";
49
- constructor() {
50
- super({});
51
- }
52
- async onInitialize() {
53
- this.ctx.logger.info("Initialized \u2014 exposes yml-backed sections via getGlobalSettings");
54
- }
55
- // ── Three-level settings API (only `getGlobalSettings` is implemented) ──
56
- buildGlobalSchema() {
57
- return {
58
- sections: [
59
- {
60
- id: "system-config-server",
61
- title: SECTION_TITLES["server"],
62
- description: "Core server connection settings \u2014 read-only, loaded from config.yaml at bootstrap.",
63
- columns: 2,
64
- fields: [
65
- {
66
- type: "info",
67
- key: "server-restart-note",
68
- label: "Restart required",
69
- content: "Server settings are read-only. Change them in config.yaml and restart.",
70
- variant: "warning"
71
- },
72
- { type: "text", key: "port", label: "Port", description: "Listening port", disabled: true },
73
- { type: "text", key: "host", label: "Host", description: "Bind address", disabled: true },
74
- { type: "text", key: "dataPath", label: "Data Path", description: "Root data directory", disabled: true, span: 2 }
75
- ]
76
- },
77
- {
78
- id: "system-config-auth",
79
- title: SECTION_TITLES["auth"],
80
- description: "Token and session settings.",
81
- columns: 1,
82
- fields: [
83
- {
84
- type: "text",
85
- key: "tokenExpiry",
86
- label: "Token Expiry",
87
- description: "JWT token lifetime (e.g. 24h, 7d, 1h)",
88
- placeholder: "24h",
89
- default: "24h"
90
- }
91
- ]
92
- },
93
- {
94
- id: "system-config-ffmpeg",
95
- title: SECTION_TITLES["ffmpeg"],
96
- description: "FFmpeg binary and hardware acceleration settings.",
97
- columns: 2,
98
- fields: [
99
- {
100
- type: "text",
101
- key: "binaryPath",
102
- label: "Binary Path",
103
- description: "Path to ffmpeg executable",
104
- placeholder: "ffmpeg",
105
- default: "ffmpeg",
106
- span: 2
107
- },
108
- {
109
- type: "select",
110
- key: "hwAccel",
111
- label: "Hardware Acceleration",
112
- description: "GPU decoding/encoding backend",
113
- default: "auto",
114
- options: [
115
- { value: "auto", label: "Auto-detect" },
116
- { value: "none", label: "None (CPU only)" },
117
- { value: "videotoolbox", label: "VideoToolbox (macOS)" },
118
- { value: "vaapi", label: "VA-API (Linux Intel/AMD)" },
119
- { value: "qsv", label: "QSV (Intel Quick Sync)" },
120
- { value: "cuda", label: "CUDA (NVIDIA)" }
121
- ]
122
- },
123
- {
124
- type: "number",
125
- key: "threadCount",
126
- label: "Thread Count",
127
- description: "0 = auto (let FFmpeg decide)",
128
- min: 0,
129
- max: 16,
130
- step: 1,
131
- default: 0
132
- }
133
- ]
134
- }
135
- ]
136
- };
137
- }
138
- async getGlobalSettings() {
139
- const schema = this.buildGlobalSchema();
140
- if (!this.ctx.settings) {
141
- return (0, import_types.hydrateSchema)(schema, {});
142
- }
143
- const sectionNames = Object.keys(SECTION_TITLES);
144
- const merged = {};
145
- for (const section of sectionNames) {
146
- try {
147
- const values = await this.ctx.settings.getSection(section);
148
- Object.assign(merged, values);
149
- } catch (err) {
150
- const msg = (0, import_types.errMsg)(err);
151
- this.ctx.logger.debug("Failed to read section", { meta: { section, error: msg } });
152
- }
153
- }
154
- return (0, import_types.hydrateSchema)(schema, merged);
155
- }
156
- async updateGlobalSettings(patch) {
157
- if (!this.ctx.settings) {
158
- throw new Error("system-config: ctx.settings not available \u2014 cannot write sections");
159
- }
160
- const perSection = /* @__PURE__ */ new Map();
161
- for (const [key, value] of Object.entries(patch)) {
162
- const section = KEY_TO_SECTION[key];
163
- if (section === void 0) {
164
- this.ctx.logger.warn("update ignored unknown key (not mapped to any section)", { meta: { key } });
165
- continue;
166
- }
167
- if (section === "server") {
168
- this.ctx.logger.warn("update ignored read-only server-section key", { meta: { key } });
169
- continue;
170
- }
171
- let bucket = perSection.get(section);
172
- if (!bucket) {
173
- bucket = {};
174
- perSection.set(section, bucket);
175
- }
176
- bucket[key] = value;
177
- }
178
- for (const [section, sectionPatch] of perSection) {
179
- await this.ctx.settings.setSection(section, sectionPatch);
180
- this.ctx.logger.info("Wrote keys to section", { meta: { section, keyCount: Object.keys(sectionPatch).length } });
181
- }
182
- }
183
- };
184
- var system_config_addon_default = SystemConfigAddon;
185
- // Annotate the CommonJS export names for ESM import in node:
186
- 0 && (module.exports = {
187
- SystemConfigAddon
188
- });
189
- //# sourceMappingURL=index.js.map
5
+ const require_builtins_system_config_system_config_addon = require("./system-config.addon.js");
6
+ exports.SystemConfigAddon = require_builtins_system_config_system_config_addon.SystemConfigAddon;
7
+ exports.default = require_builtins_system_config_system_config_addon.SystemConfigAddon;
@@ -1,10 +1,2 @@
1
- import "../../chunk-W6RTHQGP.mjs";
2
- import {
3
- SystemConfigAddon,
4
- system_config_addon_default
5
- } from "../../chunk-QT57H266.mjs";
6
- export {
7
- SystemConfigAddon,
8
- system_config_addon_default as default
9
- };
10
- //# sourceMappingURL=index.mjs.map
1
+ import { SystemConfigAddon } from "./system-config.addon.mjs";
2
+ export { SystemConfigAddon, SystemConfigAddon as default };
@@ -0,0 +1,11 @@
1
+ import { ConfigUISchemaWithValues, BaseAddon } from '@camstack/types';
2
+ export declare class SystemConfigAddon extends BaseAddon {
3
+ readonly id = "system-config";
4
+ constructor();
5
+ protected onInitialize(): Promise<void>;
6
+ private buildGlobalSchema;
7
+ getGlobalSettings(): Promise<ConfigUISchemaWithValues>;
8
+ updateGlobalSettings(patch: Record<string, unknown>): Promise<void>;
9
+ }
10
+ export default SystemConfigAddon;
11
+ //# sourceMappingURL=system-config.addon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"system-config.addon.d.ts","sourceRoot":"","sources":["../../../src/builtins/system-config/system-config.addon.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,wBAAwB,EACzB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,SAAS,EAA0B,MAAM,iBAAiB,CAAA;AA6DnE,qBAAa,iBAAkB,SAAQ,SAAS;IAC9C,QAAQ,CAAC,EAAE,mBAAkB;;cAIb,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAM7C,OAAO,CAAC,iBAAiB;IAmFnB,iBAAiB,IAAI,OAAO,CAAC,wBAAwB,CAAC;IAwBtD,oBAAoB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAiC1E;AAED,eAAe,iBAAiB,CAAA"}