@camstack/core 0.1.15 → 0.1.16

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 +102 -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 +404 -0
  124. package/dist/builtins/local-network/local-network.addon.js.map +1 -0
  125. package/dist/builtins/local-network/local-network.addon.mjs +392 -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
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/builtins/console-logging/index.ts","../../../src/builtins/console-logging/console-logging.addon.ts","../../../src/logging/formatter.ts","../../../src/builtins/console-logging/console-destination.ts"],"sourcesContent":["export { ConsoleLoggingAddon } from './console-logging.addon.js'\nexport { ConsoleDestination } from './console-destination.js'\nexport { ConsoleLoggingAddon as default } from './console-logging.addon.js'\n","import type { ProviderRegistration } from '@camstack/types'\nimport { BaseAddon, logDestinationCapability } from '@camstack/types'\nimport { ConsoleDestination } from './console-destination.js'\n\ninterface ConsoleConfig {\n readonly level: 'debug' | 'info' | 'warn' | 'error'\n}\n\n/**\n * Console logging addon — zero-dependency stdout/stderr sink that\n * produces the same canonical line format as the Winston built-in.\n * Registers as a `log-destination` capability provider so the shared\n * LogManager fans every entry to both sinks when both are active.\n *\n * Settings live under Cluster → NodeDetail → Settings alongside the\n * Winston addon. Disable one without disabling the other — the\n * LogManager keeps working as long as at least one destination is\n * registered.\n */\nexport class ConsoleLoggingAddon extends BaseAddon<ConsoleConfig> {\n private destination: ConsoleDestination | null = null\n\n constructor() {\n super({ level: 'info' })\n }\n\n protected async onInitialize(): Promise<ProviderRegistration[]> {\n this.destination = new ConsoleDestination()\n await this.destination.initialize({ level: this.config.level })\n this.ctx.logger.info('Console logging initialized')\n return [{ capability: logDestinationCapability, provider: this.destination }]\n }\n\n protected async onShutdown(): Promise<void> {\n await this.destination?.shutdown()\n }\n\n getDestination(): ConsoleDestination {\n if (!this.destination) throw new Error('Console logging not initialized')\n return this.destination\n }\n\n protected globalSettingsSchema() {\n return this.schema({\n sections: [\n {\n id: 'console-logging',\n title: 'Console Logging',\n description: 'Minimum log level to emit on stdout/stderr. Independent from the rotated-file (Winston) destination.',\n columns: 2,\n fields: [\n this.field({\n type: 'select',\n key: 'level',\n label: 'Log Level',\n default: 'info',\n options: [\n { value: 'debug', label: 'Debug' },\n { value: 'info', label: 'Info' },\n { value: 'warn', label: 'Warn' },\n { value: 'error', label: 'Error' },\n ],\n }),\n ],\n },\n ],\n })\n }\n}\n","/**\n * Canonical single-line formatter for every `LogEntry` that reaches a\n * console transport — hub-side `WinstonDestination` +\n * `ConsoleDestination`, agent-side `HubForwarderDestination`. One\n * definition so the three paths can't drift.\n *\n * Layout mirrors NestJS `ConsoleLogger` output:\n *\n * [Nest] 54994 - 04/20/2026, 12:45:53 AM LOG [InstanceLoader] TrpcModule dependencies initialized +0ms\n *\n * Mapping for camstack — cluster-aware:\n * - `[Nest]` (brand bracket) → `[<agent>/<addonId>]` so operators see\n * at a glance which node emitted the line\n * (matches the cluster topology)\n * - `54994` (pid) → `process.pid`\n * - `<timestamp>` → `M/D/YYYY, H:MM:SS AM`\n * - `LOG` / `WARN` / `ERROR` → `entry.level` upper-cased, colour per level\n * - `[InstanceLoader]` (ctx) → `[<device>]` — shown only when a device\n * tag is present; omitted otherwise\n * - `<message>` → `entry.message`\n * - trailing `+Nms` → we don't compute timing yet; omitted\n *\n * Rendered examples:\n * [hub/winston-logging] 71184 - 04/20/2026, 12:45:53 AM INFO Winston logging initialized\n * [hub/provider-rtsp] 71184 - 04/20/2026, 12:46:01 AM WARN [salone] probe failed {err=\"timeout\"}\n * [dev-agent-0/detection] 12345 - 04/20/2026, 12:47:15 AM ERROR [cortile] no detector {codec=av1}\n */\nimport type { LogEntry, LogTags } from '@camstack/types'\n\n// Emit ANSI colour codes when the runtime supports them. Heuristic\n// follows npm ecosystem convention so log-consumers can override:\n// - `NO_COLOR` env present → OFF (https://no-color.org/)\n// - `FORCE_COLOR=0` → OFF\n// - `FORCE_COLOR` truthy (1/2/3/true) → ON (forces even when piped)\n// - stdout.isTTY → ON\n// - else → OFF\n// Rationale: running via `concurrently` / `npm run dev` often pipes\n// stdout and strips `isTTY`, making colours disappear. Dev sets\n// `FORCE_COLOR=1` in the shell to opt back in; CI / file-piping\n// pipelines set `NO_COLOR=1` to strip.\n//\n// Destinations that always render for console (ConsoleDestination,\n// HubForwarderDestination) pass `colorize: true` explicitly — still\n// gated by NO_COLOR. File sinks (Winston JSON) pass `colorize: false`\n// so log files stay plain text regardless of the shell environment.\nconst USE_COLOR = (() => {\n try {\n if (typeof process === 'undefined') return false\n const env = process.env ?? {}\n if (env['NO_COLOR']) return false\n const force = env['FORCE_COLOR']\n if (force !== undefined) return force !== '' && force !== '0' && force !== 'false'\n return Boolean((process.stdout as { isTTY?: boolean })?.isTTY)\n } catch { return false }\n})()\n\n/** True when `NO_COLOR` is set — destinations that force colour on still honour this. */\nconst NO_COLOR = (() => {\n try { return Boolean(process?.env?.['NO_COLOR']) } catch { return false }\n})()\n\nconst RESET = '\\x1b[0m'\nconst ANSI = {\n green: '\\x1b[32m',\n yellow: '\\x1b[33m',\n red: '\\x1b[31m',\n cyan: '\\x1b[36m',\n gray: '\\x1b[90m',\n} as const\n\nconst COLOR_BY_LEVEL: Readonly<Record<string, string>> = {\n debug: ANSI.gray,\n info: ANSI.green,\n warn: ANSI.yellow,\n error: ANSI.red,\n}\n\nfunction paint(color: string, text: string, enabled: boolean): string {\n return enabled ? `${color}${text}${RESET}` : text\n}\n\nfunction colorizeLevel(level: string, text: string, enabled: boolean): string {\n if (!enabled) return text\n const code = COLOR_BY_LEVEL[level]\n return code ? `${code}${text}${RESET}` : text\n}\n\n/** Right-pad `value` to exactly `width` characters. */\nfunction padRight(value: string, width: number): string {\n if (value.length >= width) return value.slice(0, width)\n return value + ' '.repeat(width - value.length)\n}\n\n/** Derive the agent — the top-level cluster node, never the forked-worker suffix. */\nfunction resolveAgent(tags: LogTags | undefined): string | null {\n const agentId = tags?.agentId\n if (typeof agentId === 'string' && agentId.length > 0) return agentId\n const nodeId = tags?.nodeId\n if (typeof nodeId === 'string' && nodeId.length > 0) {\n return nodeId.includes('/') ? nodeId.split('/')[0]! : nodeId\n }\n return null\n}\n\n/** Derive the addon — `tags.addonId` first; `system` when the tag is missing\n * (scope is no longer a fallback — it's a sub-component label, not identity). */\nfunction resolveAddon(entry: Pick<LogEntry, 'tags'>): string {\n const addonId = entry.tags?.addonId\n if (typeof addonId === 'string' && addonId.length > 0) return addonId\n return 'system'\n}\n\n/** Device name (or `#id` fallback) — used inside the context bracket when present. */\nfunction resolveDevice(tags: LogTags | undefined): string | null {\n const name = tags?.deviceName\n if (typeof name === 'string' && name.length > 0) return name\n const id = tags?.deviceId\n if (typeof id === 'number' && Number.isFinite(id)) return `#${id}`\n return null\n}\n\n/**\n * Build the brand bracket content — `<agent>/<addonId>`. Agent is\n * always shown (even `hub`) so operators never have to guess which\n * node emitted a line. Falls back to `?/<addon>` when tags don't\n * carry an agent id (pre-boot logs, test harnesses).\n */\nfunction buildBrand(entry: Pick<LogEntry, 'tags'>): string {\n const agent = resolveAgent(entry.tags) ?? '?'\n const addon = resolveAddon(entry)\n return `${agent}/${addon}`\n}\n\n/**\n * Build the optional device-context bracket. Returns `null` when the\n * line doesn't carry a device tag — renders as just the brand + message\n * without the second bracket. With a device tag: `salone` / `#42`.\n */\nfunction buildDeviceContext(entry: Pick<LogEntry, 'tags'>): string | null {\n return resolveDevice(entry.tags)\n}\n\n/**\n * NestJS-style locale timestamp: `M/D/YYYY, H:MM:SS AM`. Built with\n * `toLocaleString('en-US')` to match the default NestJS format that\n * operators are used to from Nest boot output.\n */\nfunction formatTimestamp(value: unknown): string {\n const date = value instanceof Date ? value : new Date(typeof value === 'string' ? value : Date.now())\n return date.toLocaleString('en-US', {\n month: 'numeric',\n day: 'numeric',\n year: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n second: '2-digit',\n hour12: true,\n })\n}\n\n/** Compact `{key=value key=\"with space\"}` rendering of an arbitrary object. Empty → ''. */\nfunction formatMeta(meta: Record<string, unknown> | undefined): string {\n if (!meta) return ''\n const keys = Object.keys(meta)\n if (keys.length === 0) return ''\n const parts: string[] = []\n for (const key of keys) {\n const value = meta[key]\n parts.push(`${key}=${formatMetaValue(value)}`)\n }\n return `{${parts.join(' ')}}`\n}\n\nfunction formatMetaValue(value: unknown): string {\n if (value === null) return 'null'\n if (value === undefined) return 'undefined'\n if (typeof value === 'string') {\n return /\\s|\"/.test(value) ? JSON.stringify(value) : value\n }\n if (typeof value === 'number' || typeof value === 'boolean') return String(value)\n if (value instanceof Error) return JSON.stringify(value.message)\n try { return JSON.stringify(value) } catch { return String(value) }\n}\n\n/** Cached renderer PID — fallback when the entry doesn't carry its own `tags.pid`. */\nconst PID = typeof process !== 'undefined' && typeof process.pid === 'number' ? String(process.pid) : '?'\n\n/** Options for `formatLogLine`. */\nexport interface FormatLogLineOptions {\n /**\n * Emit ANSI colour codes. When omitted, falls back to the shell-env\n * heuristic (`NO_COLOR`/`FORCE_COLOR`/`isTTY`). Destinations that\n * always target a console (ConsoleDestination, HubForwarderDestination)\n * pass `true`; file sinks (Winston JSON) pass `false` so logs on disk\n * stay plain text regardless of the shell env.\n *\n * `NO_COLOR=1` in the environment still wins — consumer opt-in beats\n * producer opt-in, matching the https://no-color.org/ convention.\n */\n readonly colorize?: boolean\n}\n\n/**\n * Render a `LogEntry` as one complete console line — no trailing newline.\n * Caller appends `\\n` (file sinks) or relies on `console.log` (stdout sink).\n *\n * PID column prefers `entry.tags.pid` when set (so forked-worker entries\n * carry the worker's OS pid even when the hub renders them), falling back\n * to the renderer's own `process.pid`.\n *\n * Colours (when enabled) follow the NestJS convention: the level token\n * AND the message body share the level colour (green/yellow/red/gray for\n * info/warn/error/debug). Brand, device context, scope and meta keep\n * their fixed hues so the structural fields stay visually distinct from\n * the message content.\n */\nexport function formatLogLine(entry: LogEntry, options?: FormatLogLineOptions): string {\n const wantsColor = options?.colorize ?? USE_COLOR\n const colorize = wantsColor && !NO_COLOR\n const levelColor = COLOR_BY_LEVEL[entry.level]\n\n const brand = paint(ANSI.green, `[${buildBrand(entry)}]`, colorize)\n const entryPid = entry.tags?.pid\n const pid = typeof entryPid === 'number' ? String(entryPid) : PID\n const timestamp = formatTimestamp(entry.timestamp)\n // Right-pad level to 5 chars (matches NestJS) so the context/message\n // column aligns across different levels without fixed-width hacks\n // on the surrounding fields.\n const level = colorizeLevel(entry.level, padRight(entry.level.toUpperCase(), 5), colorize)\n const device = buildDeviceContext(entry)\n const ctxPart = device ? ' ' + paint(ANSI.yellow, `[${device}]`, colorize) : ''\n const scope = typeof entry.scope === 'string' && entry.scope.length > 0 ? entry.scope : null\n const scopePart = scope ? ' ' + paint(ANSI.cyan, `(${scope})`, colorize) : ''\n const metaText = formatMeta(entry.meta)\n const metaPart = metaText ? ' ' + paint(ANSI.gray, metaText, colorize) : ''\n // NestJS layout: `[<agent>/<addon>] <pid> - <timestamp> <LEVEL> [<device>] (<scope>) <message>`\n // Message body is tinted by level colour so `error`/`warn` stand out at a glance.\n const message = colorize && levelColor\n ? `${levelColor}${entry.message}${RESET}`\n : entry.message\n return `${brand} ${pid} - ${timestamp} ${level}${ctxPart}${scopePart} ${message}${metaPart}`\n}\n","/**\n * Zero-dependency log destination that writes every entry to stdout /\n * stderr via the shared `formatLogLine` formatter. Same surface as\n * `WinstonDestination` (full `ILogDestination` contract) but without\n * the rotating-file transport — ideal fallback when the Winston addon\n * is disabled or unavailable (e.g. bare-bones agents, tests).\n */\nimport type { ILogDestination, LogEntry, LogFilter } from '@camstack/types'\nimport { formatLogLine } from '../../logging/formatter.js'\n\ninterface ConsoleConfig {\n /** Minimum log level to emit. Entries below this level are dropped. */\n readonly level?: 'debug' | 'info' | 'warn' | 'error'\n}\n\nconst LEVEL_RANK: Readonly<Record<string, number>> = {\n debug: 0, info: 1, warn: 2, error: 3,\n}\n\nexport class ConsoleDestination implements ILogDestination {\n private minLevel = 0\n\n async initialize(config?: ConsoleConfig): Promise<void> {\n this.minLevel = LEVEL_RANK[config?.level ?? 'info'] ?? 1\n }\n\n write(entry: LogEntry): void {\n const rank = LEVEL_RANK[entry.level] ?? 1\n if (rank < this.minLevel) return\n // Always request ANSI colours for the console sink. The formatter still\n // respects `NO_COLOR` so operators can opt out globally.\n const line = formatLogLine(entry, { colorize: true })\n if (entry.level === 'error') console.error(line)\n else if (entry.level === 'warn') console.warn(line)\n else console.log(line)\n }\n\n async query(_filter: LogFilter): Promise<readonly LogEntry[]> {\n // Console has no persistence — queries are served by other destinations.\n return []\n }\n\n async shutdown(): Promise<void> {\n // Nothing to flush — stdout/stderr are process-owned.\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,mBAAoD;;;AC4CpD,IAAM,aAAa,MAAM;AACvB,MAAI;AACF,QAAI,OAAO,YAAY,YAAa,QAAO;AAC3C,UAAM,MAAM,QAAQ,OAAO,CAAC;AAC5B,QAAI,IAAI,UAAU,EAAG,QAAO;AAC5B,UAAM,QAAQ,IAAI,aAAa;AAC/B,QAAI,UAAU,OAAW,QAAO,UAAU,MAAM,UAAU,OAAO,UAAU;AAC3E,WAAO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Aa,SAAS;AAAA,EACnC;AAAA,EAEA,iBAAqC;AACnC,QAAI,CAAC,KAAK,YAAa,OAAM,IAAI,MAAM,iCAAiC;AACxE,WAAO,KAAK;AAAA,EACd;AAAA,EAEU,uBAAuB;AAC/B,WAAO,KAAK,OAAO;AAAA,MACjB,UAAU;AAAA,QACR;AAAA,UACE,IAAI;AAAA,UACJ,OAAO;AAAA,UACP,aAAa;AAAA,UACb,SAAS;AAAA,UACT,QAAQ;AAAA,YACN,KAAK,MAAM;AAAA,cACT,MAAM;AAAA,cACN,KAAK;AAAA,cACL,OAAO;AAAA,cACP,SAAS;AAAA,cACT,SAAS;AAAA,gBACP,EAAE,OAAO,SAAS,OAAO,QAAQ;AAAA,gBACjC,EAAE,OAAO,QAAQ,OAAO,OAAO;AAAA,gBAC/B,EAAE,OAAO,QAAQ,OAAO,OAAO;AAAA,gBAC/B,EAAE,OAAO,SAAS,OAAO,QAAQ;AAAA,cACnC;AAAA,YACF,CAAC;AAAA,UACH;AAAA,QACF;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACF;","names":[]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/builtins/console-logging/console-destination.ts","../../../src/builtins/console-logging/console-logging.addon.ts"],"sourcesContent":["/**\n * Zero-dependency log destination that writes every entry to stdout /\n * stderr via the shared `formatLogLine` formatter. Same surface as\n * `WinstonDestination` (full `ILogDestination` contract) but without\n * the rotating-file transport — ideal fallback when the Winston addon\n * is disabled or unavailable (e.g. bare-bones agents, tests).\n */\nimport type { ILogDestination, LogEntry, LogFilter } from '@camstack/types'\nimport { formatLogLine } from '../../logging/formatter.js'\n\ninterface ConsoleConfig {\n /** Minimum log level to emit. Entries below this level are dropped. */\n readonly level?: 'debug' | 'info' | 'warn' | 'error'\n}\n\nconst LEVEL_RANK: Readonly<Record<string, number>> = {\n debug: 0, info: 1, warn: 2, error: 3,\n}\n\nexport class ConsoleDestination implements ILogDestination {\n private minLevel = 0\n\n async initialize(config?: ConsoleConfig): Promise<void> {\n this.minLevel = LEVEL_RANK[config?.level ?? 'info'] ?? 1\n }\n\n write(entry: LogEntry): void {\n const rank = LEVEL_RANK[entry.level] ?? 1\n if (rank < this.minLevel) return\n // Always request ANSI colours for the console sink. The formatter still\n // respects `NO_COLOR` so operators can opt out globally.\n const line = formatLogLine(entry, { colorize: true })\n if (entry.level === 'error') console.error(line)\n else if (entry.level === 'warn') console.warn(line)\n else console.log(line)\n }\n\n async query(_filter: LogFilter): Promise<readonly LogEntry[]> {\n // Console has no persistence — queries are served by other destinations.\n return []\n }\n\n async shutdown(): Promise<void> {\n // Nothing to flush — stdout/stderr are process-owned.\n }\n}\n","import type { ProviderRegistration } from '@camstack/types'\nimport { BaseAddon, logDestinationCapability } from '@camstack/types'\nimport { ConsoleDestination } from './console-destination.js'\n\ninterface ConsoleConfig {\n readonly level: 'debug' | 'info' | 'warn' | 'error'\n}\n\n/**\n * Console logging addon — zero-dependency stdout/stderr sink that\n * produces the same canonical line format as the Winston built-in.\n * Registers as a `log-destination` capability provider so the shared\n * LogManager fans every entry to both sinks when both are active.\n *\n * Settings live under Cluster → NodeDetail → Settings alongside the\n * Winston addon. Disable one without disabling the other — the\n * LogManager keeps working as long as at least one destination is\n * registered.\n */\nexport class ConsoleLoggingAddon extends BaseAddon<ConsoleConfig> {\n private destination: ConsoleDestination | null = null\n\n constructor() {\n super({ level: 'info' })\n }\n\n protected async onInitialize(): Promise<ProviderRegistration[]> {\n this.destination = new ConsoleDestination()\n await this.destination.initialize({ level: this.config.level })\n this.ctx.logger.info('Console logging initialized')\n return [{ capability: logDestinationCapability, provider: this.destination }]\n }\n\n protected async onShutdown(): Promise<void> {\n await this.destination?.shutdown()\n }\n\n getDestination(): ConsoleDestination {\n if (!this.destination) throw new Error('Console logging not initialized')\n return this.destination\n }\n\n protected globalSettingsSchema() {\n return this.schema({\n sections: [\n {\n id: 'console-logging',\n title: 'Console Logging',\n description: 'Minimum log level to emit on stdout/stderr. Independent from the rotated-file (Winston) destination.',\n columns: 2,\n fields: [\n this.field({\n type: 'select',\n key: 'level',\n label: 'Log Level',\n default: 'info',\n options: [\n { value: 'debug', label: 'Debug' },\n { value: 'info', label: 'Info' },\n { value: 'warn', label: 'Warn' },\n { value: 'error', label: 'Error' },\n ],\n }),\n ],\n },\n ],\n })\n }\n}\n"],"mappings":";;;;;;;;AAeA,IAAM,aAA+C;CACnD,OAAO;CAAG,MAAM;CAAG,MAAM;CAAG,OAAO;CACpC;AAED,IAAa,qBAAb,MAA2D;CACzD,WAAmB;CAEnB,MAAM,WAAW,QAAuC;EACtD,KAAK,WAAW,WAAW,QAAQ,SAAS,WAAW;;CAGzD,MAAM,OAAuB;EAE3B,KADa,WAAW,MAAM,UAAU,KAC7B,KAAK,UAAU;EAG1B,MAAM,OAAO,kBAAA,cAAc,OAAO,EAAE,UAAU,MAAM,CAAC;EACrD,IAAI,MAAM,UAAU,SAAS,QAAQ,MAAM,KAAK;OAC3C,IAAI,MAAM,UAAU,QAAQ,QAAQ,KAAK,KAAK;OAC9C,QAAQ,IAAI,KAAK;;CAGxB,MAAM,MAAM,SAAkD;EAE5D,OAAO,EAAE;;CAGX,MAAM,WAA0B;;;;;;;;;;;;;;;ACvBlC,IAAa,sBAAb,cAAyC,gBAAA,UAAyB;CAChE,cAAiD;CAEjD,cAAc;EACZ,MAAM,EAAE,OAAO,QAAQ,CAAC;;CAG1B,MAAgB,eAAgD;EAC9D,KAAK,cAAc,IAAI,oBAAoB;EAC3C,MAAM,KAAK,YAAY,WAAW,EAAE,OAAO,KAAK,OAAO,OAAO,CAAC;EAC/D,KAAK,IAAI,OAAO,KAAK,8BAA8B;EACnD,OAAO,CAAC;GAAE,YAAY,gBAAA;GAA0B,UAAU,KAAK;GAAa,CAAC;;CAG/E,MAAgB,aAA4B;EAC1C,MAAM,KAAK,aAAa,UAAU;;CAGpC,iBAAqC;EACnC,IAAI,CAAC,KAAK,aAAa,MAAM,IAAI,MAAM,kCAAkC;EACzE,OAAO,KAAK;;CAGd,uBAAiC;EAC/B,OAAO,KAAK,OAAO,EACjB,UAAU,CACR;GACE,IAAI;GACJ,OAAO;GACP,aAAa;GACb,SAAS;GACT,QAAQ,CACN,KAAK,MAAM;IACT,MAAM;IACN,KAAK;IACL,OAAO;IACP,SAAS;IACT,SAAS;KACP;MAAE,OAAO;MAAS,OAAO;MAAS;KAClC;MAAE,OAAO;MAAQ,OAAO;MAAQ;KAChC;MAAE,OAAO;MAAQ,OAAO;MAAQ;KAChC;MAAE,OAAO;MAAS,OAAO;MAAS;KACnC;IACF,CAAC,CACH;GACF,CACF,EACF,CAAC"}
@@ -1,11 +1,97 @@
1
- import {
2
- ConsoleDestination,
3
- ConsoleLoggingAddon
4
- } from "../../chunk-TB562PZX.mjs";
5
- import "../../chunk-2F76X6NL.mjs";
6
- export {
7
- ConsoleDestination,
8
- ConsoleLoggingAddon,
9
- ConsoleLoggingAddon as default
1
+ import { t as formatLogLine } from "../../formatter-C-5An4Bl.mjs";
2
+ import { BaseAddon, logDestinationCapability } from "@camstack/types";
3
+ //#region src/builtins/console-logging/console-destination.ts
4
+ var LEVEL_RANK = {
5
+ debug: 0,
6
+ info: 1,
7
+ warn: 2,
8
+ error: 3
10
9
  };
10
+ var ConsoleDestination = class {
11
+ minLevel = 0;
12
+ async initialize(config) {
13
+ this.minLevel = LEVEL_RANK[config?.level ?? "info"] ?? 1;
14
+ }
15
+ write(entry) {
16
+ if ((LEVEL_RANK[entry.level] ?? 1) < this.minLevel) return;
17
+ const line = formatLogLine(entry, { colorize: true });
18
+ if (entry.level === "error") console.error(line);
19
+ else if (entry.level === "warn") console.warn(line);
20
+ else console.log(line);
21
+ }
22
+ async query(_filter) {
23
+ return [];
24
+ }
25
+ async shutdown() {}
26
+ };
27
+ //#endregion
28
+ //#region src/builtins/console-logging/console-logging.addon.ts
29
+ /**
30
+ * Console logging addon — zero-dependency stdout/stderr sink that
31
+ * produces the same canonical line format as the Winston built-in.
32
+ * Registers as a `log-destination` capability provider so the shared
33
+ * LogManager fans every entry to both sinks when both are active.
34
+ *
35
+ * Settings live under Cluster → NodeDetail → Settings alongside the
36
+ * Winston addon. Disable one without disabling the other — the
37
+ * LogManager keeps working as long as at least one destination is
38
+ * registered.
39
+ */
40
+ var ConsoleLoggingAddon = class extends BaseAddon {
41
+ destination = null;
42
+ constructor() {
43
+ super({ level: "info" });
44
+ }
45
+ async onInitialize() {
46
+ this.destination = new ConsoleDestination();
47
+ await this.destination.initialize({ level: this.config.level });
48
+ this.ctx.logger.info("Console logging initialized");
49
+ return [{
50
+ capability: logDestinationCapability,
51
+ provider: this.destination
52
+ }];
53
+ }
54
+ async onShutdown() {
55
+ await this.destination?.shutdown();
56
+ }
57
+ getDestination() {
58
+ if (!this.destination) throw new Error("Console logging not initialized");
59
+ return this.destination;
60
+ }
61
+ globalSettingsSchema() {
62
+ return this.schema({ sections: [{
63
+ id: "console-logging",
64
+ title: "Console Logging",
65
+ description: "Minimum log level to emit on stdout/stderr. Independent from the rotated-file (Winston) destination.",
66
+ columns: 2,
67
+ fields: [this.field({
68
+ type: "select",
69
+ key: "level",
70
+ label: "Log Level",
71
+ default: "info",
72
+ options: [
73
+ {
74
+ value: "debug",
75
+ label: "Debug"
76
+ },
77
+ {
78
+ value: "info",
79
+ label: "Info"
80
+ },
81
+ {
82
+ value: "warn",
83
+ label: "Warn"
84
+ },
85
+ {
86
+ value: "error",
87
+ label: "Error"
88
+ }
89
+ ]
90
+ })]
91
+ }] });
92
+ }
93
+ };
94
+ //#endregion
95
+ export { ConsoleDestination, ConsoleLoggingAddon, ConsoleLoggingAddon as default };
96
+
11
97
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/builtins/console-logging/console-destination.ts","../../../src/builtins/console-logging/console-logging.addon.ts"],"sourcesContent":["/**\n * Zero-dependency log destination that writes every entry to stdout /\n * stderr via the shared `formatLogLine` formatter. Same surface as\n * `WinstonDestination` (full `ILogDestination` contract) but without\n * the rotating-file transport — ideal fallback when the Winston addon\n * is disabled or unavailable (e.g. bare-bones agents, tests).\n */\nimport type { ILogDestination, LogEntry, LogFilter } from '@camstack/types'\nimport { formatLogLine } from '../../logging/formatter.js'\n\ninterface ConsoleConfig {\n /** Minimum log level to emit. Entries below this level are dropped. */\n readonly level?: 'debug' | 'info' | 'warn' | 'error'\n}\n\nconst LEVEL_RANK: Readonly<Record<string, number>> = {\n debug: 0, info: 1, warn: 2, error: 3,\n}\n\nexport class ConsoleDestination implements ILogDestination {\n private minLevel = 0\n\n async initialize(config?: ConsoleConfig): Promise<void> {\n this.minLevel = LEVEL_RANK[config?.level ?? 'info'] ?? 1\n }\n\n write(entry: LogEntry): void {\n const rank = LEVEL_RANK[entry.level] ?? 1\n if (rank < this.minLevel) return\n // Always request ANSI colours for the console sink. The formatter still\n // respects `NO_COLOR` so operators can opt out globally.\n const line = formatLogLine(entry, { colorize: true })\n if (entry.level === 'error') console.error(line)\n else if (entry.level === 'warn') console.warn(line)\n else console.log(line)\n }\n\n async query(_filter: LogFilter): Promise<readonly LogEntry[]> {\n // Console has no persistence — queries are served by other destinations.\n return []\n }\n\n async shutdown(): Promise<void> {\n // Nothing to flush — stdout/stderr are process-owned.\n }\n}\n","import type { ProviderRegistration } from '@camstack/types'\nimport { BaseAddon, logDestinationCapability } from '@camstack/types'\nimport { ConsoleDestination } from './console-destination.js'\n\ninterface ConsoleConfig {\n readonly level: 'debug' | 'info' | 'warn' | 'error'\n}\n\n/**\n * Console logging addon — zero-dependency stdout/stderr sink that\n * produces the same canonical line format as the Winston built-in.\n * Registers as a `log-destination` capability provider so the shared\n * LogManager fans every entry to both sinks when both are active.\n *\n * Settings live under Cluster → NodeDetail → Settings alongside the\n * Winston addon. Disable one without disabling the other — the\n * LogManager keeps working as long as at least one destination is\n * registered.\n */\nexport class ConsoleLoggingAddon extends BaseAddon<ConsoleConfig> {\n private destination: ConsoleDestination | null = null\n\n constructor() {\n super({ level: 'info' })\n }\n\n protected async onInitialize(): Promise<ProviderRegistration[]> {\n this.destination = new ConsoleDestination()\n await this.destination.initialize({ level: this.config.level })\n this.ctx.logger.info('Console logging initialized')\n return [{ capability: logDestinationCapability, provider: this.destination }]\n }\n\n protected async onShutdown(): Promise<void> {\n await this.destination?.shutdown()\n }\n\n getDestination(): ConsoleDestination {\n if (!this.destination) throw new Error('Console logging not initialized')\n return this.destination\n }\n\n protected globalSettingsSchema() {\n return this.schema({\n sections: [\n {\n id: 'console-logging',\n title: 'Console Logging',\n description: 'Minimum log level to emit on stdout/stderr. Independent from the rotated-file (Winston) destination.',\n columns: 2,\n fields: [\n this.field({\n type: 'select',\n key: 'level',\n label: 'Log Level',\n default: 'info',\n options: [\n { value: 'debug', label: 'Debug' },\n { value: 'info', label: 'Info' },\n { value: 'warn', label: 'Warn' },\n { value: 'error', label: 'Error' },\n ],\n }),\n ],\n },\n ],\n })\n }\n}\n"],"mappings":";;;AAeA,IAAM,aAA+C;CACnD,OAAO;CAAG,MAAM;CAAG,MAAM;CAAG,OAAO;CACpC;AAED,IAAa,qBAAb,MAA2D;CACzD,WAAmB;CAEnB,MAAM,WAAW,QAAuC;EACtD,KAAK,WAAW,WAAW,QAAQ,SAAS,WAAW;;CAGzD,MAAM,OAAuB;EAE3B,KADa,WAAW,MAAM,UAAU,KAC7B,KAAK,UAAU;EAG1B,MAAM,OAAO,cAAc,OAAO,EAAE,UAAU,MAAM,CAAC;EACrD,IAAI,MAAM,UAAU,SAAS,QAAQ,MAAM,KAAK;OAC3C,IAAI,MAAM,UAAU,QAAQ,QAAQ,KAAK,KAAK;OAC9C,QAAQ,IAAI,KAAK;;CAGxB,MAAM,MAAM,SAAkD;EAE5D,OAAO,EAAE;;CAGX,MAAM,WAA0B;;;;;;;;;;;;;;;ACvBlC,IAAa,sBAAb,cAAyC,UAAyB;CAChE,cAAiD;CAEjD,cAAc;EACZ,MAAM,EAAE,OAAO,QAAQ,CAAC;;CAG1B,MAAgB,eAAgD;EAC9D,KAAK,cAAc,IAAI,oBAAoB;EAC3C,MAAM,KAAK,YAAY,WAAW,EAAE,OAAO,KAAK,OAAO,OAAO,CAAC;EAC/D,KAAK,IAAI,OAAO,KAAK,8BAA8B;EACnD,OAAO,CAAC;GAAE,YAAY;GAA0B,UAAU,KAAK;GAAa,CAAC;;CAG/E,MAAgB,aAA4B;EAC1C,MAAM,KAAK,aAAa,UAAU;;CAGpC,iBAAqC;EACnC,IAAI,CAAC,KAAK,aAAa,MAAM,IAAI,MAAM,kCAAkC;EACzE,OAAO,KAAK;;CAGd,uBAAiC;EAC/B,OAAO,KAAK,OAAO,EACjB,UAAU,CACR;GACE,IAAI;GACJ,OAAO;GACP,aAAa;GACb,SAAS;GACT,QAAQ,CACN,KAAK,MAAM;IACT,MAAM;IACN,KAAK;IACL,OAAO;IACP,SAAS;IACT,SAAS;KACP;MAAE,OAAO;MAAS,OAAO;MAAS;KAClC;MAAE,OAAO;MAAQ,OAAO;MAAQ;KAChC;MAAE,OAAO;MAAQ,OAAO;MAAQ;KAChC;MAAE,OAAO;MAAS,OAAO;MAAS;KACnC;IACF,CAAC,CACH;GACF,CACF,EACF,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { IEventBus, SystemEvent } from '@camstack/types';
2
+ export interface DeviceEventPropagatorOptions {
3
+ readonly eventBus: IEventBus;
4
+ /**
5
+ * Resolve the numeric parent id of a device, or `null` when the
6
+ * device has no parent (or was deleted). The propagator injects a
7
+ * closure over the hub's `DeviceRegistry` so the lookup is in-
8
+ * process and O(1) per call.
9
+ */
10
+ readonly getParentOf: (deviceId: number) => number | null;
11
+ /** Structured logger for anti-cycle + anti-loop diagnostics. */
12
+ readonly logger: {
13
+ warn: (msg: string, meta?: Record<string, unknown>) => void;
14
+ debug: (msg: string, meta?: Record<string, unknown>) => void;
15
+ };
16
+ }
17
+ export declare class DeviceEventPropagator {
18
+ private readonly opts;
19
+ private unsubscribe;
20
+ constructor(opts: DeviceEventPropagatorOptions);
21
+ start(): void;
22
+ stop(): void;
23
+ /** Exposed for tests — lets them inject events without the full bus. */
24
+ handle(ev: SystemEvent): void;
25
+ private resolveParentChain;
26
+ }
27
+ //# sourceMappingURL=device-event-propagator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-event-propagator.d.ts","sourceRoot":"","sources":["../../../src/builtins/device-manager/device-event-propagator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAe,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAqC1E,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;IAC5B;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAA;IACzD,gEAAgE;IAChE,QAAQ,CAAC,MAAM,EAAE;QACf,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;QAC3D,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;KAC7D,CAAA;CACF;AAED,qBAAa,qBAAqB;IAGpB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAFjC,OAAO,CAAC,WAAW,CAA4B;gBAElB,IAAI,EAAE,4BAA4B;IAE/D,KAAK,IAAI,IAAI;IASb,IAAI,IAAI,IAAI;IAMZ,wEAAwE;IACxE,MAAM,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI;IAyB7B,OAAO,CAAC,kBAAkB;CAyB3B"}
@@ -0,0 +1,259 @@
1
+ import { ProviderRegistration, BaseAddon, DeviceBindingEntry } from '@camstack/types';
2
+ /**
3
+ * Wire shape matching `z.infer<typeof SettingsSchemaWithValuesSchema>` —
4
+ * duplicated as a plain interface because importing the Zod schema across
5
+ * package boundaries confuses `tsc` when the types package pins a
6
+ * different `zod` minor than the core package. Keeping the shape local
7
+ * keeps the addon decoupled from the schema's internal type encoding.
8
+ */
9
+ interface ContributionShape {
10
+ tabs?: Array<{
11
+ id: string;
12
+ label: string;
13
+ icon: string;
14
+ order?: number;
15
+ }>;
16
+ sections: Array<{
17
+ id: string;
18
+ title: string;
19
+ description?: string;
20
+ style?: 'card' | 'accordion';
21
+ defaultCollapsed?: boolean;
22
+ columns?: 1 | 2 | 3 | 4;
23
+ tab?: string;
24
+ /** Where the section renders. Default 'settings' (Config tab); 'top-tab' hoists into the device-detail tab bar via DeviceDetail discovery. */
25
+ location?: 'settings' | 'top-tab';
26
+ order?: number;
27
+ fields: unknown[];
28
+ }>;
29
+ }
30
+ export declare class DeviceManagerAddon extends BaseAddon {
31
+ constructor();
32
+ /** Shorthand for the kernel-injected capability registry. */
33
+ private get capabilityRegistry();
34
+ /**
35
+ * Parent-chain event propagator. Started in `onInitialize` once the
36
+ * hub's `deviceRegistry` is available; listens to every device-sourced
37
+ * event and re-emits a copy on each ancestor scope with `via[]`
38
+ * populated. Stopped in `onShutdown`.
39
+ */
40
+ private propagator;
41
+ /**
42
+ * Hub-side mirror of every device's cap-keyed runtime state.
43
+ * Populated whenever any caller writes via `deviceState.setCapSlice`
44
+ * (the canonical cross-layer write entrypoint) and on first load
45
+ * via `loadRuntimeState`. Cross-process consumers reach the mirror
46
+ * through the `deviceState` cap router; per-cap event subscribers
47
+ * (e.g. `battery.onStatusChanged`) get the same data via
48
+ * cap-specific events still emitted by the owning device.
49
+ *
50
+ * Key: deviceId. Value: per-cap slice map. Empty by default —
51
+ * slices show up as `setCapSlice` calls trickle in.
52
+ */
53
+ private readonly stateMirror;
54
+ /**
55
+ * Per-device disk-write debouncer for runtime-state. `setCapSlice`
56
+ * updates the in-memory mirror synchronously and emits the change
57
+ * event immediately, but the disk write is coalesced — frequent
58
+ * back-to-back writes (motion phase transitions, battery pushes,
59
+ * etc.) collapse to one `writeDeviceRuntimeState` per
60
+ * `RUNTIME_STATE_DEBOUNCE_MS` window. `flushRuntimeStateWrites`
61
+ * awaits any in-flight write + scheduled flush so shutdown is
62
+ * lossless.
63
+ */
64
+ private readonly runtimeStateDebounce;
65
+ private static readonly RUNTIME_STATE_DEBOUNCE_MS;
66
+ /**
67
+ * Cross-process native-provider cache: deviceId (numeric) → capName → { addonId, nodeId }.
68
+ * Kept in sync with `device.bindings-changed` events emitted by forked
69
+ * workers. Union'd into `getBindings` so hub-side consumers see every
70
+ * native cap regardless of which process owns the IDevice. No persistence
71
+ * — entries re-register when the worker restarts. Purged on
72
+ * `$node.disconnected` to avoid stale routing after a worker crash.
73
+ */
74
+ private remoteNativeCaps;
75
+ /** Wait for a device-provider by addonId, returning null on timeout. */
76
+ private waitDeviceProvider;
77
+ /** Require a device-provider by addonId — throws if not found. */
78
+ private requireDeviceProvider;
79
+ private readBindingsStore;
80
+ private writeBindingsStore;
81
+ private resolveWrapperNodeId;
82
+ /**
83
+ * Active discovery of native caps registered on a worker node.
84
+ * Called from the `$node.connected` handler to recover from lost
85
+ * `DeviceBindingsChanged` broadcasts after worker restart.
86
+ *
87
+ * Iterates the broker's service registry, picks
88
+ * `<addonId>.native-provider.<capName>` services owned by the
89
+ * connected node, calls each service's `$listDeviceIds` action to
90
+ * fetch the deviceIds the worker has registered that cap on, then
91
+ * writes entries into `remoteNativeCaps`.
92
+ *
93
+ * Best-effort: per-service failures are logged and swallowed so a
94
+ * single bad service doesn't abort the whole rebuild.
95
+ */
96
+ private discoverWorkerNativeCaps;
97
+ getBindings(input: {
98
+ deviceId: number;
99
+ }): Promise<{
100
+ deviceId: number;
101
+ entries: DeviceBindingEntry[];
102
+ }>;
103
+ /**
104
+ * Whole-fleet binding dump. Iterates every device known to the
105
+ * deviceRegistry and reuses the per-device `getBindings` resolver
106
+ * for each — same routing rules, single round-trip. Used by
107
+ * `SystemManager.init()` for warm-boot.
108
+ *
109
+ * Bindings change rarely (wrapper toggle, device add/remove) so
110
+ * clients invalidate via the existing
111
+ * `capability.binding-changed` event rather than re-fetching this
112
+ * payload periodically.
113
+ */
114
+ getAllBindings(): Promise<Array<{
115
+ deviceId: number;
116
+ entries: DeviceBindingEntry[];
117
+ }>>;
118
+ /**
119
+ * Resolve a numeric deviceId to a stableId via persisted meta.
120
+ * Used only by the device-identity section of the device-details
121
+ * aggregator (see `buildBaseDeviceSection`) to surface the stableId as
122
+ * a readonly display field. All runtime/registry lookups are keyed by
123
+ * numeric deviceId; this helper is display-only.
124
+ */
125
+ private lookupPersistedStableId;
126
+ getDeviceAggregate(deviceId: number, kind: 'settings' | 'live'): Promise<ContributionShape | null>;
127
+ /**
128
+ * Build the device-manager's own contribution to the aggregator — the
129
+ * device identity (id, stableId, addonId, type, online) + the
130
+ * driver-specific config exposed by the device class via
131
+ * `zodEntriesToConfigUI`.
132
+ *
133
+ * Two paths, deliberately symmetric with `getSettingsSchema`:
134
+ *
135
+ * - Hub-local: device's IDevice instance lives in this process'
136
+ * DeviceRegistry, we read config + schema directly by reference.
137
+ * - Cross-process: device lives in a forked worker (RtspCamera on
138
+ * provider-rtsp, ONVIF on provider-onvif, …). We ask the worker's
139
+ * `device-ops.getSettingsSchema` native provider for a wire-
140
+ * serializable ConfigUISchema and merge it in under the same
141
+ * "Driver Config" section, so the UI sees the same shape regardless
142
+ * of where the IDevice physically runs.
143
+ *
144
+ * Returns `null` only when the device genuinely doesn't exist anywhere
145
+ * (no hub-local, no persisted ownership, no device-ops native). The
146
+ * aggregator falls back to contributor sections only in that case.
147
+ */
148
+ private buildBaseDeviceSection;
149
+ /**
150
+ * Lookup the native owner for `device-ops` on `deviceId` — the native-cap
151
+ * registry (hub-local and remote) is keyed by numeric id.
152
+ */
153
+ private resolveNativeDeviceOwner;
154
+ /**
155
+ * Aggregate `status` across every registered cap for a device.
156
+ *
157
+ * Walks the supplied cap list (or `CAP_NAMES_WITH_STATUS` when
158
+ * omitted), looks up a native provider per cap via the capability
159
+ * registry, calls `provider.getStatus({ deviceId })`, and validates
160
+ * the return against the cap's own `status.schema`. Validation
161
+ * failures log a warning and yield `null` for that cap so the
162
+ * overall aggregate stays usable — a single misbehaving provider
163
+ * must not blank out a device's entire status view.
164
+ *
165
+ * Returned shape is `Record<capName, unknown | null>`; the client-
166
+ * side hook tightens this to `CapStatusTypeMap` via the generated
167
+ * `cap-status-types.ts`.
168
+ */
169
+ private getDeviceStatusAggregate;
170
+ /**
171
+ * Return the driver-specific device-settings contribution. Hub-local
172
+ * devices call `getSettingsUISchema()` directly; forked-worker devices
173
+ * go through the `device-ops.getSettingsSchema` cap method on the
174
+ * numeric-id-keyed native registry.
175
+ */
176
+ private resolveDriverConfigSchema;
177
+ updateDeviceField(input: {
178
+ deviceId: number;
179
+ writerCapName: string;
180
+ writerAddonId: string;
181
+ key: string;
182
+ value: unknown;
183
+ }): Promise<{
184
+ success: true;
185
+ }>;
186
+ /**
187
+ * Batched counterpart of `updateDeviceField`. Groups changes by
188
+ * `(writerCapName, writerAddonId)` so each contributor receives a
189
+ * single `applyDeviceSettingsPatch` with all of its updates merged —
190
+ * avoids N round-trips for simultaneous edits in the same save.
191
+ *
192
+ * Per-provider failures are captured in the `failures[]` output so the
193
+ * admin UI can highlight which sections didn't persist; a failure on
194
+ * one provider does NOT abort the others.
195
+ */
196
+ updateDeviceFieldsBatch(input: {
197
+ deviceId: number;
198
+ changes: ReadonlyArray<{
199
+ writerCapName: string;
200
+ writerAddonId: string;
201
+ key: string;
202
+ value: unknown;
203
+ }>;
204
+ }): Promise<{
205
+ success: true;
206
+ failures: {
207
+ writerCapName: string;
208
+ writerAddonId: string;
209
+ error: string;
210
+ }[];
211
+ }>;
212
+ /** Apply a single grouped patch to the appropriate provider. Mirrors
213
+ * `updateDeviceField` routing (special-case device-manager, else
214
+ * registry lookup). Used by `updateDeviceFieldsBatch`. */
215
+ private applyGroupPatch;
216
+ listWrappersForCap(input: {
217
+ capName: string;
218
+ }): Promise<string[]>;
219
+ listBindableCapsForDeviceType(input: {
220
+ deviceType: string;
221
+ }): Promise<Array<{
222
+ capName: string;
223
+ wrappers: string[];
224
+ }>>;
225
+ setWrapperActive(input: {
226
+ deviceId: number;
227
+ capName: string;
228
+ wrapperAddonId: string;
229
+ active: boolean;
230
+ }): Promise<void>;
231
+ protected onInitialize(): Promise<ProviderRegistration[] | void>;
232
+ /**
233
+ * Single-cap mirror update — diff against the current mirror,
234
+ * persist the new slice in-memory, emit `DeviceStateChanged` for
235
+ * this cap. No-op on identical writes (both same shape and same
236
+ * values). Called by `setCapSlice` provider.
237
+ */
238
+ private applySingleCapUpdate;
239
+ /**
240
+ * Debounced disk writer. Coalesces frequent writes (motion phase
241
+ * transitions, battery pushes) into one `writeDeviceRuntimeState`
242
+ * per `RUNTIME_STATE_DEBOUNCE_MS` window. Reads the per-device
243
+ * blob from the live mirror at flush time so the disk picture is
244
+ * always the latest state — no risk of writing a stale snapshot.
245
+ */
246
+ private scheduleRuntimeStateDiskWrite;
247
+ /**
248
+ * One-shot mirror seed used by `loadRuntimeState` at boot so the
249
+ * hub knows about every persisted slice without waiting for the
250
+ * first `setCapSlice` call. No events emitted — this is
251
+ * initial-state population, not a transition.
252
+ */
253
+ private seedMirror;
254
+ private snapshotForDevice;
255
+ private emitStateChanged;
256
+ protected onShutdown(): Promise<void>;
257
+ }
258
+ export default DeviceManagerAddon;
259
+ //# sourceMappingURL=device-manager.addon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-manager.addon.d.ts","sourceRoot":"","sources":["../../../src/builtins/device-manager/device-manager.addon.ts"],"names":[],"mappings":"AAyBA,OAAO,EACL,oBAAoB,EACpB,SAAS,EAIV,MAAM,iBAAiB,CAAA;AAYxB;;;;;;GAMG;AACH,UAAU,iBAAiB;IACzB,IAAI,CAAC,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC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