@kosdev-code/kos-ui-sdk 0.1.0-next.944 → 0.1.0-next.958

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 (320) hide show
  1. package/.kos.json +2 -1
  2. package/common/events/async-event-bus.d.ts +2 -11
  3. package/common/events/async-event-bus.d.ts.map +1 -1
  4. package/common/events/eventBus.d.ts +1 -18
  5. package/common/events/eventBus.d.ts.map +1 -1
  6. package/core/core/decorators/kos-child.d.ts +2 -3
  7. package/core/core/decorators/kos-child.d.ts.map +1 -1
  8. package/core/core/decorators/kos-companion.d.ts +25 -87
  9. package/core/core/decorators/kos-companion.d.ts.map +1 -1
  10. package/core/core/decorators/kos-container-aware-reconcile.test-d.d.ts +2 -0
  11. package/core/core/decorators/kos-container-aware-reconcile.test-d.d.ts.map +1 -0
  12. package/core/core/decorators/kos-container-aware.d.ts +191 -420
  13. package/core/core/decorators/kos-container-aware.d.ts.map +1 -1
  14. package/core/core/decorators/kos-execute-service-request.d.ts +7 -11
  15. package/core/core/decorators/kos-execute-service-request.d.ts.map +1 -1
  16. package/core/core/decorators/kos-execution-context.d.ts +14 -31
  17. package/core/core/decorators/kos-execution-context.d.ts.map +1 -1
  18. package/core/core/decorators/kos-future-aware.d.ts +21 -74
  19. package/core/core/decorators/kos-future-aware.d.ts.map +1 -1
  20. package/core/core/decorators/kos-http-decorators.d.ts +18 -62
  21. package/core/core/decorators/kos-http-decorators.d.ts.map +1 -1
  22. package/core/core/decorators/kos-logger-aware.d.ts +10 -60
  23. package/core/core/decorators/kos-logger-aware.d.ts.map +1 -1
  24. package/core/core/decorators/kos-model-effect.d.ts +10 -9
  25. package/core/core/decorators/kos-model-effect.d.ts.map +1 -1
  26. package/core/core/decorators/kos-multiple-future-aware.d.ts +21 -94
  27. package/core/core/decorators/kos-multiple-future-aware.d.ts.map +1 -1
  28. package/core/core/decorators/kos-reload-aware.d.ts +14 -16
  29. package/core/core/decorators/kos-reload-aware.d.ts.map +1 -1
  30. package/core/core/decorators/kos-service-request.d.ts +80 -238
  31. package/core/core/decorators/kos-service-request.d.ts.map +1 -1
  32. package/core/core/decorators/kos-state-machine.d.ts +35 -275
  33. package/core/core/decorators/kos-state-machine.d.ts.map +1 -1
  34. package/core/core/decorators/kos-trouble-aware.d.ts +9 -43
  35. package/core/core/decorators/kos-trouble-aware.d.ts.map +1 -1
  36. package/core/core/decorators/kos-view-model.d.ts +20 -100
  37. package/core/core/decorators/kos-view-model.d.ts.map +1 -1
  38. package/core/core/decorators/kosModel.d.ts.map +1 -1
  39. package/core/core/decorators/kosTopicHandler.d.ts +28 -89
  40. package/core/core/decorators/kosTopicHandler.d.ts.map +1 -1
  41. package/core/core/indexing/index.d.ts +2 -4
  42. package/core/core/indexing/index.d.ts.map +1 -1
  43. package/core/core/indexing/kos-container-index-aware.d.ts +17 -48
  44. package/core/core/indexing/kos-container-index-aware.d.ts.map +1 -1
  45. package/core/core/indexing/kos-index-aware.d.ts +11 -37
  46. package/core/core/indexing/kos-index-aware.d.ts.map +1 -1
  47. package/core/core/kos-container-model.d.ts +11 -32
  48. package/core/core/kos-container-model.d.ts.map +1 -1
  49. package/core/core/kos-data-container.d.ts +6 -6
  50. package/core/core/kos-data-container.d.ts.map +1 -1
  51. package/core/core/kosCore.d.ts +7 -4
  52. package/core/core/kosCore.d.ts.map +1 -1
  53. package/core/core/kosModel.d.ts +16 -8
  54. package/core/core/kosModel.d.ts.map +1 -1
  55. package/core/core/kosModelManager.d.ts +2 -3
  56. package/core/core/kosModelManager.d.ts.map +1 -1
  57. package/core/core/lifecycle/constants.d.ts +6 -2
  58. package/core/core/lifecycle/constants.d.ts.map +1 -1
  59. package/core/core/lifecycle/kosCoreLifecycle.d.ts +11 -1
  60. package/core/core/lifecycle/kosCoreLifecycle.d.ts.map +1 -1
  61. package/core/core/lifecycle/kosModelLifecycle.d.ts +6 -0
  62. package/core/core/lifecycle/kosModelLifecycle.d.ts.map +1 -1
  63. package/core/core/lifecycle/model-machine.d.ts +6 -0
  64. package/core/core/lifecycle/model-machine.d.ts.map +1 -1
  65. package/core/core/model/kos-fsm-manager.d.ts +6 -0
  66. package/core/core/model/kos-fsm-manager.d.ts.map +1 -1
  67. package/core/core/model/kos-offline-queue.d.ts +1 -1
  68. package/core/core/model/service-response-store.d.ts +2 -15
  69. package/core/core/model/service-response-store.d.ts.map +1 -1
  70. package/core/core/reconnect/reconnect-fixture.d.ts +17 -0
  71. package/core/core/reconnect/reconnect-fixture.d.ts.map +1 -0
  72. package/core/core/services/app-startup-service.d.ts +5 -13
  73. package/core/core/services/app-startup-service.d.ts.map +1 -1
  74. package/core/core/services/intent-service.d.ts +3 -12
  75. package/core/core/services/intent-service.d.ts.map +1 -1
  76. package/core/core/transport/mock/mock-frames.d.ts +3 -3
  77. package/core/core/transport/transport.d.ts +1 -1
  78. package/core/core/transport/transport.d.ts.map +1 -1
  79. package/core/core/transport/webSocketTransport.d.ts +10 -0
  80. package/core/core/transport/webSocketTransport.d.ts.map +1 -1
  81. package/core/types/model.d.ts +4 -8
  82. package/core/types/model.d.ts.map +1 -1
  83. package/core/types/service-response-store.d.ts +3 -11
  84. package/core/types/service-response-store.d.ts.map +1 -1
  85. package/core/types/utils/kos-fetch.d.ts +25 -37
  86. package/core/types/utils/kos-fetch.d.ts.map +1 -1
  87. package/core/util/abortable-when.d.ts +5 -6
  88. package/core/util/abortable-when.d.ts.map +1 -1
  89. package/core/util/ancestor-path-visitor.d.ts +14 -20
  90. package/core/util/ancestor-path-visitor.d.ts.map +1 -1
  91. package/core/util/container-utils.d.ts +26 -159
  92. package/core/util/container-utils.d.ts.map +1 -1
  93. package/core/util/date-utils.d.ts +9 -58
  94. package/core/util/date-utils.d.ts.map +1 -1
  95. package/core/util/debounce.d.ts +1 -8
  96. package/core/util/debounce.d.ts.map +1 -1
  97. package/core/util/kos-fetch.d.ts +1 -1
  98. package/core/util/kos-fetch.d.ts.map +1 -1
  99. package/core/util/kos-model-utils.d.ts +10 -11
  100. package/core/util/kos-model-utils.d.ts.map +1 -1
  101. package/core/util/model-attribute-utils.d.ts +5 -22
  102. package/core/util/model-attribute-utils.d.ts.map +1 -1
  103. package/core/util/promise-utils.d.ts +1 -26
  104. package/core/util/promise-utils.d.ts.map +1 -1
  105. package/core/util/service-factory.d.ts +5 -23
  106. package/core/util/service-factory.d.ts.map +1 -1
  107. package/core/util/service-request-error.d.ts +3 -5
  108. package/core/util/service-request-error.d.ts.map +1 -1
  109. package/core/util/service-response.d.ts +12 -67
  110. package/core/util/service-response.d.ts.map +1 -1
  111. package/core/util/transport-not-ready-error.d.ts +11 -13
  112. package/core/util/transport-not-ready-error.d.ts.map +1 -1
  113. package/core/util/when-ready.d.ts +1 -8
  114. package/core/util/when-ready.d.ts.map +1 -1
  115. package/index.cjs +144 -109
  116. package/index.cjs.map +1 -1
  117. package/index.js +173 -138
  118. package/index.js.map +1 -1
  119. package/models/decorators/future-service.d.ts +7 -7
  120. package/models/models/browser-router/browser-router-model.d.ts +10 -39
  121. package/models/models/browser-router/browser-router-model.d.ts.map +1 -1
  122. package/models/models/browser-router/browser-router-registration.d.ts +5 -77
  123. package/models/models/browser-router/browser-router-registration.d.ts.map +1 -1
  124. package/models/models/browser-router/types/index.d.ts +2 -16
  125. package/models/models/canvas-dispatcher/canvas-dispatcher-registration.d.ts +5 -77
  126. package/models/models/canvas-dispatcher/canvas-dispatcher-registration.d.ts.map +1 -1
  127. package/models/models/canvas-renderer/canvas-renderer-registration.d.ts +5 -75
  128. package/models/models/canvas-renderer/canvas-renderer-registration.d.ts.map +1 -1
  129. package/models/models/config-bean/config-bean-model-builder.d.ts +4 -11
  130. package/models/models/config-bean/config-bean-model-builder.d.ts.map +1 -1
  131. package/models/models/config-bean/config-bean-model.d.ts +23 -66
  132. package/models/models/config-bean/config-bean-model.d.ts.map +1 -1
  133. package/models/models/config-bean-prop/config-bean-prop-model.d.ts +15 -62
  134. package/models/models/config-bean-prop/config-bean-prop-model.d.ts.map +1 -1
  135. package/models/models/config-bean-prop/types/index.d.ts +34 -215
  136. package/models/models/device/device-model.d.ts +20 -199
  137. package/models/models/device/device-model.d.ts.map +1 -1
  138. package/models/models/device/device-registration.d.ts +7 -87
  139. package/models/models/device/device-registration.d.ts.map +1 -1
  140. package/models/models/device/types/index.d.ts +5 -34
  141. package/models/models/future/future-aware.d.ts +7 -71
  142. package/models/models/future/future-aware.d.ts.map +1 -1
  143. package/models/models/future/future-model-builder.d.ts +2 -2
  144. package/models/models/future/future-model.d.ts +3 -23
  145. package/models/models/future/future-model.d.ts.map +1 -1
  146. package/models/models/future/future-types.d.ts +28 -145
  147. package/models/models/future/future-types.d.ts.map +1 -1
  148. package/models/models/gpio-chip/gpio-chip-builders.d.ts +14 -0
  149. package/models/models/gpio-chip/gpio-chip-builders.d.ts.map +1 -0
  150. package/models/models/gpio-chip/gpio-chip-container-model.d.ts +2 -1
  151. package/models/models/gpio-chip/gpio-chip-container-model.d.ts.map +1 -1
  152. package/models/models/key-value/key-value-model.d.ts +12 -72
  153. package/models/models/key-value/key-value-model.d.ts.map +1 -1
  154. package/models/models/key-value/key-value-registration.d.ts +5 -77
  155. package/models/models/key-value/key-value-registration.d.ts.map +1 -1
  156. package/models/models/key-value/services/key-value-services.d.ts +13 -72
  157. package/models/models/key-value/services/key-value-services.d.ts.map +1 -1
  158. package/models/models/key-value/types/index.d.ts +3 -46
  159. package/models/models/kos-expression-evaluator/kos-expression-evaluator-model.d.ts +32 -99
  160. package/models/models/kos-expression-evaluator/kos-expression-evaluator-model.d.ts.map +1 -1
  161. package/models/models/kos-expression-evaluator/services/kos-expression-evaluator-services.d.ts +2 -12
  162. package/models/models/kos-expression-evaluator/services/kos-expression-evaluator-services.d.ts.map +1 -1
  163. package/models/models/kos-log-manager/kos-log-manager-model.d.ts +7 -46
  164. package/models/models/kos-log-manager/kos-log-manager-model.d.ts.map +1 -1
  165. package/models/models/kos-log-manager/kos-log-manager-registration.d.ts +5 -80
  166. package/models/models/kos-log-manager/kos-log-manager-registration.d.ts.map +1 -1
  167. package/models/models/kos-log-manager/types/index.d.ts +13 -156
  168. package/models/models/kos-time/kos-time-model.d.ts +8 -39
  169. package/models/models/kos-time/kos-time-model.d.ts.map +1 -1
  170. package/models/models/kos-time/kos-time-registration.d.ts +6 -73
  171. package/models/models/kos-time/kos-time-registration.d.ts.map +1 -1
  172. package/models/models/kos-time/types/index.d.ts +3 -58
  173. package/models/models/log-block/log-block-container-model.d.ts +2 -118
  174. package/models/models/log-block/log-block-container-model.d.ts.map +1 -1
  175. package/models/models/log-block/log-block-container-registration.d.ts +5 -75
  176. package/models/models/log-block/log-block-container-registration.d.ts.map +1 -1
  177. package/models/models/log-block/log-block-model.d.ts +5 -168
  178. package/models/models/log-block/log-block-model.d.ts.map +1 -1
  179. package/models/models/log-block/log-block-registration.d.ts +5 -75
  180. package/models/models/log-block/log-block-registration.d.ts.map +1 -1
  181. package/models/models/log-block/types/index.d.ts +14 -81
  182. package/models/models/log-stream/log-stream-container-model.d.ts +8 -35
  183. package/models/models/log-stream/log-stream-container-model.d.ts.map +1 -1
  184. package/models/models/log-stream/log-stream-container-registration.d.ts +5 -75
  185. package/models/models/log-stream/log-stream-container-registration.d.ts.map +1 -1
  186. package/models/models/log-stream/log-stream-model.d.ts +8 -29
  187. package/models/models/log-stream/log-stream-model.d.ts.map +1 -1
  188. package/models/models/log-stream/log-stream-registration.d.ts +5 -75
  189. package/models/models/log-stream/log-stream-registration.d.ts.map +1 -1
  190. package/models/models/log-stream/types/index.d.ts +5 -60
  191. package/models/models/network-interface/network-interface-container-model.d.ts +6 -35
  192. package/models/models/network-interface/network-interface-container-model.d.ts.map +1 -1
  193. package/models/models/network-interface/network-interface-container-registration.d.ts +5 -73
  194. package/models/models/network-interface/network-interface-container-registration.d.ts.map +1 -1
  195. package/models/models/network-interface/network-interface-model.d.ts +5 -43
  196. package/models/models/network-interface/network-interface-model.d.ts.map +1 -1
  197. package/models/models/network-interface/network-interface-registration.d.ts +5 -73
  198. package/models/models/network-interface/network-interface-registration.d.ts.map +1 -1
  199. package/models/models/network-interface/types/index.d.ts +2 -16
  200. package/models/models/ota/ota-model.d.ts +11 -39
  201. package/models/models/ota/ota-model.d.ts.map +1 -1
  202. package/models/models/ota/ota-registration.d.ts +5 -77
  203. package/models/models/ota/ota-registration.d.ts.map +1 -1
  204. package/models/models/ota/types/index.d.ts +2 -141
  205. package/models/models/region-info/types/index.d.ts +19 -99
  206. package/models/models/region-info/types/index.d.ts.map +1 -1
  207. package/models/models/software-info/services/software-info-services.d.ts +2 -14
  208. package/models/models/software-info/services/software-info-services.d.ts.map +1 -1
  209. package/models/models/software-info/software-info-model.d.ts +3 -39
  210. package/models/models/software-info/software-info-model.d.ts.map +1 -1
  211. package/models/models/software-info/software-info-registration.d.ts +6 -73
  212. package/models/models/software-info/software-info-registration.d.ts.map +1 -1
  213. package/models/models/software-info/types/index.d.ts +6 -20
  214. package/models/models/state-bean/state-bean-model.d.ts +10 -41
  215. package/models/models/state-bean/state-bean-model.d.ts.map +1 -1
  216. package/models/models/state-bean/state-bean-registration.d.ts +6 -73
  217. package/models/models/state-bean/state-bean-registration.d.ts.map +1 -1
  218. package/models/models/state-bean/types/index.d.ts +4 -84
  219. package/models/models/state-prop/state-prop-model.d.ts +6 -40
  220. package/models/models/state-prop/state-prop-model.d.ts.map +1 -1
  221. package/models/models/state-prop/state-prop-registration.d.ts +6 -73
  222. package/models/models/state-prop/state-prop-registration.d.ts.map +1 -1
  223. package/models/models/state-prop/types/index.d.ts +5 -37
  224. package/models/models/storage-device/storage-device-container-model.d.ts +7 -273
  225. package/models/models/storage-device/storage-device-container-model.d.ts.map +1 -1
  226. package/models/models/storage-device/storage-device-container-registration.d.ts +5 -75
  227. package/models/models/storage-device/storage-device-container-registration.d.ts.map +1 -1
  228. package/models/models/storage-device/storage-device-model.d.ts +3 -49
  229. package/models/models/storage-device/storage-device-model.d.ts.map +1 -1
  230. package/models/models/storage-device/storage-device-registration.d.ts +5 -75
  231. package/models/models/storage-device/storage-device-registration.d.ts.map +1 -1
  232. package/models/models/storage-device/types/index.d.ts +13 -82
  233. package/models/models/studio-properties/studio-properties-model.d.ts +13 -36
  234. package/models/models/studio-properties/studio-properties-model.d.ts.map +1 -1
  235. package/models/models/studio-properties/studio-properties-registration.d.ts +5 -75
  236. package/models/models/studio-properties/studio-properties-registration.d.ts.map +1 -1
  237. package/models/models/studio-properties/types/index.d.ts +2 -24
  238. package/models/models/translation/descriptor-merge.d.ts +13 -17
  239. package/models/models/translation/descriptor-merge.d.ts.map +1 -1
  240. package/models/models/translation/services/translation-services.d.ts +19 -77
  241. package/models/models/translation/services/translation-services.d.ts.map +1 -1
  242. package/models/models/translation/test-harness.d.ts +6 -8
  243. package/models/models/translation/test-harness.d.ts.map +1 -1
  244. package/models/models/translation/translation-container-model.d.ts +7 -59
  245. package/models/models/translation/translation-container-model.d.ts.map +1 -1
  246. package/models/models/translation/translation-container-registration.d.ts +6 -73
  247. package/models/models/translation/translation-container-registration.d.ts.map +1 -1
  248. package/models/models/translation/translation-model.d.ts +17 -50
  249. package/models/models/translation/translation-model.d.ts.map +1 -1
  250. package/models/models/translation/translation-registration.d.ts +6 -73
  251. package/models/models/translation/translation-registration.d.ts.map +1 -1
  252. package/models/models/translation/types/index.d.ts +51 -276
  253. package/models/models/trouble/trouble-registration.d.ts +6 -73
  254. package/models/models/trouble/trouble-registration.d.ts.map +1 -1
  255. package/models/models/trouble/types/index.d.ts +17 -188
  256. package/models/models/trouble/utils/is-trouble-aware.d.ts +4 -85
  257. package/models/models/trouble/utils/is-trouble-aware.d.ts.map +1 -1
  258. package/models/models/trouble-container/trouble-builders.d.ts +11 -0
  259. package/models/models/trouble-container/trouble-builders.d.ts.map +1 -0
  260. package/models/models/trouble-container/trouble-container-model.d.ts +2 -1
  261. package/models/models/trouble-container/trouble-container-model.d.ts.map +1 -1
  262. package/models/models/usb-update/usb-update-container-registration.d.ts +5 -75
  263. package/models/models/usb-update/usb-update-container-registration.d.ts.map +1 -1
  264. package/models/models/usb-update/usb-update-registration.d.ts +5 -75
  265. package/models/models/usb-update/usb-update-registration.d.ts.map +1 -1
  266. package/models/types/cancellable-promise.d.ts +6 -9
  267. package/models/types/cancellable-promise.d.ts.map +1 -1
  268. package/models/utils/await-future-call.d.ts +9 -21
  269. package/models/utils/await-future-call.d.ts.map +1 -1
  270. package/models/utils/cancellable-future-call.d.ts +8 -19
  271. package/models/utils/cancellable-future-call.d.ts.map +1 -1
  272. package/models/utils/cancellable-service.d.ts +14 -23
  273. package/models/utils/cancellable-service.d.ts.map +1 -1
  274. package/models/utils/conversion-utils.d.ts +8 -48
  275. package/models/utils/conversion-utils.d.ts.map +1 -1
  276. package/models/utils/persistence-store.d.ts +1 -1
  277. package/models/utils/service.d.ts +14 -48
  278. package/models/utils/service.d.ts.map +1 -1
  279. package/models/utils/services/kos/daily/service.d.ts +4 -4
  280. package/models/utils/services/vfs/daily/service.d.ts +4 -4
  281. package/models/utils/timer-manager.d.ts.map +1 -1
  282. package/package.json +3 -3
  283. package/{software-info-registration-CKlTQPet.js → software-info-registration-C8kf-pBB.js} +551 -530
  284. package/software-info-registration-C8kf-pBB.js.map +1 -0
  285. package/{software-info-registration-GUbTY4KD.cjs → software-info-registration-Y1iADHWT.cjs} +522 -501
  286. package/software-info-registration-Y1iADHWT.cjs.map +1 -0
  287. package/testing/index.d.ts +28 -33
  288. package/testing/index.d.ts.map +1 -1
  289. package/testing.cjs +1 -1
  290. package/testing.cjs.map +1 -1
  291. package/testing.js +1 -1
  292. package/testing.js.map +1 -1
  293. package/ui/components/connection-dev-button/connection-dev-button-styles.d.ts +9 -0
  294. package/ui/components/connection-dev-button/connection-dev-button-styles.d.ts.map +1 -0
  295. package/ui/components/connection-dev-button/index.d.ts +36 -0
  296. package/ui/components/connection-dev-button/index.d.ts.map +1 -0
  297. package/ui/components/connection-dev-button/use-connection-dev-state.d.ts +29 -0
  298. package/ui/components/connection-dev-button/use-connection-dev-state.d.ts.map +1 -0
  299. package/ui/components/index.d.ts +1 -0
  300. package/ui/components/index.d.ts.map +1 -1
  301. package/ui/features/canvas/hooks/use-image-renderer.d.ts +5 -4
  302. package/ui/features/canvas/hooks/use-image-renderer.d.ts.map +1 -1
  303. package/ui/hooks/use-function-warmup.d.ts +4 -14
  304. package/ui/hooks/use-function-warmup.d.ts.map +1 -1
  305. package/ui/hooks/use-kos-date-formats.d.ts +15 -29
  306. package/ui/hooks/use-kos-date-formats.d.ts.map +1 -1
  307. package/ui/hooks/use-kos-region-timezones.d.ts +4 -55
  308. package/ui/hooks/use-kos-region-timezones.d.ts.map +1 -1
  309. package/ui/hooks/use-kos-regions.d.ts +11 -23
  310. package/ui/hooks/use-kos-regions.d.ts.map +1 -1
  311. package/ui/hooks/use-kos-time-formats.d.ts +16 -31
  312. package/ui/hooks/use-kos-time-formats.d.ts.map +1 -1
  313. package/ui/hooks/use-kos-unit-systems.d.ts +13 -27
  314. package/ui/hooks/use-kos-unit-systems.d.ts.map +1 -1
  315. package/ui/hooks/view-model/use-view-model.d.ts +6 -31
  316. package/ui/hooks/view-model/use-view-model.d.ts.map +1 -1
  317. package/ui/policies/reload-on-disconnect-policy.d.ts +5 -6
  318. package/ui/policies/reload-on-disconnect-policy.d.ts.map +1 -1
  319. package/software-info-registration-CKlTQPet.js.map +0 -1
  320. package/software-info-registration-GUbTY4KD.cjs.map +0 -1
@@ -12,25 +12,19 @@ export interface FutureDelegate<T extends {} = Record<string, unknown>> {
12
12
  future?: IFutureModel<T>;
13
13
  }
14
14
  /**
15
- * Container pattern for managing multiple Future operations in KOS models.
15
+ * A model that tracks Futures through a `futureHandler`. `@kosFutureAware` and
16
+ * `@kosMultipleFutureAware` add the handler, and `@kosFuture` methods register
17
+ * each Future they start with it. The handler calls `onFutureUpdate`, when
18
+ * defined, as a Future progresses or ends.
16
19
  *
17
- * Provides comprehensive Future management capabilities for models that handle
18
- * multiple concurrent long-running operations with centralized lifecycle management.
19
- *
20
- * @example Basic Future Container
20
+ * @example
21
21
  * ```typescript
22
- * @kosModel("device-operations-model")
23
- * export class DeviceOperationsModel implements FutureContainer {
24
- * futureHandler: FutureAwareContainer;
25
- *
26
- * constructor(modelId: string, options: any, context: KosCreationContext) {
27
- * this.id = modelId;
28
- * this.futureHandler = new FutureHandler(this);
29
- * }
30
- *
31
- * onFutureUpdate(future: IFutureModel, alias?: string): void {
32
- * // Handle progress updates from any managed Future
33
- * console.log(`Operation ${alias || future.id}: ${future.progress}%`);
22
+ * @kosModel(MODEL_TYPE)
23
+ * @kosFutureAware()
24
+ * class PumpModelImpl {
25
+ * @kosFuture()
26
+ * async calibrate(tracker?: string) {
27
+ * return calibratePump(this.path, tracker);
34
28
  * }
35
29
  * }
36
30
  * ```
@@ -45,7 +39,7 @@ export interface FutureContainer<T extends {} = Record<string, unknown>> {
45
39
  onFutureUpdate?: (future: IFutureModel<T>, alias?: string) => void;
46
40
  }
47
41
  /**
48
- * Advanced pattern for models managing multiple named Future operations.
42
+ * A Future handler that keeps several Futures, keyed by alias.
49
43
  *
50
44
  * @kosService core.future-aware
51
45
  * @group KOS Model
@@ -56,26 +50,8 @@ export interface MultiFutureAware<T extends {} = Record<string, unknown>> {
56
50
  futureMap: Map<string, IFutureModel<T>>;
57
51
  }
58
52
  /**
59
- * Container interface providing comprehensive Future lifecycle management.
60
- *
61
- * Handles multiple concurrent Futures with operations for adding, removing,
62
- * and querying Future instances. Essential for complex models that coordinate
63
- * multiple device operations simultaneously.
64
- *
65
- * @example Future Container Operations
66
- * ```typescript
67
- * // Add new Future with optional alias
68
- * container.addFuture(calibrationFuture, 'pump-calibration');
69
- *
70
- * // Query specific Future
71
- * const future = container.getFuture('pump-calibration');
72
- *
73
- * // Remove completed Future
74
- * container.removeFuture('pump-calibration');
75
- *
76
- * // Get all active Futures
77
- * const activeFutures = container.allFutures;
78
- * ```
53
+ * Tracks the Futures of a {@link FutureContainer}. `alias` names a Future when
54
+ * the handler keeps several; a single-Future handler ignores it.
79
55
  *
80
56
  * @kosService core.future-aware
81
57
  * @group KOS Model
@@ -90,27 +66,7 @@ export interface FutureAwareContainer<T extends {} = Record<string, unknown>> ex
90
66
  onFutureUpdate?: (future: IFutureModel<T>, alias?: string) => void;
91
67
  }
92
68
  /**
93
- * Simplified interface for models that need basic Future awareness.
94
- *
95
- * Provides essential Future status information without full container complexity.
96
- * Ideal for models that typically handle single operations or need simple
97
- * Future integration.
98
- *
99
- * @example Basic Future Awareness
100
- * ```typescript
101
- * function OperationStatus({ model }: { model: FutureAware }) {
102
- * return (
103
- * <div>
104
- * <p>Status: {model.status}</p>
105
- * <progress value={model.progress} max={100} />
106
- * <p>Time remaining: {model.timeRemaining}</p>
107
- * {model.status === 'IN_PROGRESS' && (
108
- * <button onClick={() => model.cancel()}>Cancel</button>
109
- * )}
110
- * </div>
111
- * );
112
- * }
113
- * ```
69
+ * Status of a model's current Future, flattened onto the model for display.
114
70
  *
115
71
  * @kosService core.future-aware
116
72
  * @group KOS Model
@@ -125,30 +81,12 @@ export interface FutureAware {
125
81
  cancel: () => Promise<void>;
126
82
  }
127
83
  /**
128
- * Configuration options for Future model instances.
129
- *
130
- * Defines the initial state and parameters for Future operations including
131
- * progress tracking, client data attachment, and namespace configuration.
84
+ * Initial state of a Future model, normally mapped from the backend's future
85
+ * response.
132
86
  *
133
87
  * @remarks
134
- * Used to identify additional data that can be set on the model during
135
- * instantiation. It is expected that implementers will set these properties
136
- * in the constructor. The value <strong>might</strong> be overridden by
137
- * subsequent lifecycle methods or updates.
138
- *
139
- * @example Basic Future Options
140
- * ```typescript
141
- * const futureOptions: IFutureModelOptions = {
142
- * id: 'calibration-123',
143
- * namespace: 'kos',
144
- * progress: 0,
145
- * clientData: { deviceId: 'pump-S4', targetRate: 1.2 }
146
- * };
147
- *
148
- * const future = FutureFactory.instance('my-future')
149
- * .options(futureOptions)
150
- * .build();
151
- * ```
88
+ * The constructor copies these properties onto the model; later topic updates
89
+ * can overwrite them.
152
90
  *
153
91
  * @kosService core.future-aware
154
92
  * @group KOS Model
@@ -177,72 +115,17 @@ export interface IFutureModelOptions<T extends {} = Record<string, unknown>> {
177
115
  note?: string;
178
116
  }
179
117
  /**
180
- * Future - Reactive long-running operation management for KOS devices and applications.
181
- *
182
- * The Future model provides comprehensive tracking and management of asynchronous operations
183
- * with real-time progress updates, cancellation support, and automatic lifecycle management.
184
- * Essential for building responsive user interfaces that handle time-consuming operations.
185
- *
186
- * ## Key Features
187
- * - **Real-Time Progress Tracking** - Live updates via WebSocket topics with percentage completion
188
- * - **Cancellation Support** - Ability to cancel in-progress operations safely
189
- * - **Automatic Cleanup** - Models self-destruct when operations complete or fail
190
- * - **Status Management** - Clear status reporting (NOT_ACTIVE, IN_PROGRESS, Success, Fail)
191
- * - **Time Estimation** - Remaining time calculations with localized formatting
192
- * - **Client Data Attachment** - Associate custom data with future operations
193
- * - **Namespace Support** - Separate futures for different services (kos, studio, etc.)
194
- *
195
- * ## Operation Lifecycle
196
- * Futures progress through distinct states with automatic status management:
197
- * - **NOT_ACTIVE** - Operation not yet started or queued
198
- * - **IN_PROGRESS** - Operation actively executing with progress updates
199
- * - **Success** - Operation completed successfully (triggers automatic cleanup)
200
- * - **Fail** - Operation failed with error details (triggers automatic cleanup)
201
- *
202
- * ## Common Use Cases
203
- * - **Device Operations** - Track pump calibration, system diagnostics, configuration updates
204
- * - **File Transfers** - Monitor upload/download progress with cancellation support
205
- * - **System Updates** - Track firmware updates, package installations, system maintenance
206
- * - **Data Processing** - Monitor analysis operations, report generation, bulk operations
207
- * - **VM Management** - Track VM creation, deployment, and lifecycle operations
118
+ * A long-running backend operation. The model updates from `kos.future/{id}`
119
+ * topic events and destroys itself when the operation ends in success or
120
+ * failure.
208
121
  *
209
- * @example Basic Future Tracking
210
- * ```typescript
211
- * const calibrationFuture = FutureFactory.instance('calibration-op')
212
- * .options({
213
- * id: 'pump-cal-123',
214
- * namespace: 'kos',
215
- * clientData: { pumpId: 'S4', targetRate: 0.9 }
216
- * })
217
- * .build();
218
- *
219
- * // Monitor progress
220
- * console.log(`Status: ${calibrationFuture.status}`);
221
- * console.log(`Progress: ${calibrationFuture.progress}%`);
222
- * console.log(`Time remaining: ${calibrationFuture.timeRemaining}`);
223
- *
224
- * // Cancel if needed
225
- * await calibrationFuture.cancelFuture();
226
- * ```
122
+ * `status` is the `endState` once the operation ends (`SUCCESS`, `FAIL`, `ABORT`
123
+ * or `CANCEL`), otherwise `IN_PROGRESS` while progress is reported and
124
+ * `NOT_ACTIVE` before. `timeRemaining` formats `remainingTimeMs` as text such as
125
+ * `"5 minutes"`. `cancelFuture` asks the backend to cancel the operation.
227
126
  *
228
- * @example React Integration
229
- * ```typescript
230
- * function CalibrationProgress({ futureId }: { futureId: string }) {
231
- * const future = useFuture(futureId);
232
- *
233
- * return (
234
- * <div>
235
- * <progress value={future.progress} max={100} />
236
- * <p>{future.timeRemaining} remaining</p>
237
- * {future.status === 'IN_PROGRESS' && (
238
- * <button onClick={() => future.cancelFuture()}>
239
- * Cancel Operation
240
- * </button>
241
- * )}
242
- * </div>
243
- * );
244
- * }
245
- * ```
127
+ * Futures are usually started by a `@kosFuture` method and read through the
128
+ * model's `futureHandler`.
246
129
  *
247
130
  * @interface
248
131
  * @kosService core.future-aware
@@ -1 +1 @@
1
- {"version":3,"file":"future-types.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/future/future-types.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"future-types.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/future/future-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACpE,MAAM,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACrE,aAAa,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC;IACvC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACpE;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACtE,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;CACzC;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAC1E,SAAQ,cAAc,CAAC,CAAC,CAAC;IACzB,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,SAAS,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACvD,SAAS,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzD,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9B,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACpE;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACzE,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EACP;QACE,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,GACD;QACE,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAChB,GACD;QACE,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAChB,EAAE,CAAC;IACR,UAAU,CAAC,EAAE,CAAC,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAClE,SAAQ,aAAa,EACnB,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EACP;QACE,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAChB,GACD;QACE,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAChB,EAAE,CAAC;IACR,UAAU,CAAC,EAAE,CAAC,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,aAAa,EAAE,MAAM,CAAC;CACvB"}
@@ -0,0 +1,14 @@
1
+ import { GpioChipModel } from './gpio-chip-model';
2
+ import { GpioChipContainerResponse } from './services';
3
+ import { GpioChipOptions } from './types';
4
+ export type GpioChipResponse = GpioChipContainerResponse[number];
5
+ export interface GpioChipDto extends GpioChipOptions {
6
+ id: string;
7
+ }
8
+ export declare function mapGpioChipToOptions(dto: GpioChipDto): GpioChipOptions;
9
+ export declare function createGpioChipModel(dto: GpioChipDto): GpioChipModel;
10
+ export declare function updateGpioChipModel(dto: GpioChipDto, model: GpioChipModel): void;
11
+ export declare function filterGpioChipDto(chip: GpioChipResponse): boolean;
12
+ export declare function mapGpioChipId(chip: GpioChipResponse): GpioChipDto;
13
+ export declare function afterGpioChipCreated(model: GpioChipModel, dto: GpioChipDto): void;
14
+ //# sourceMappingURL=gpio-chip-builders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gpio-chip-builders.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/gpio-chip/gpio-chip-builders.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,MAAM,gBAAgB,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;AAEjE,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,WAAW,GAAG,eAAe,CAEtE;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,WAAW,GAAG,aAAa,CAEnE;AAED,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,aAAa,GACnB,IAAI,CAEN;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAEjE;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,gBAAgB,GAAG,WAAW,CASjE;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,aAAa,EACpB,GAAG,EAAE,WAAW,GACf,IAAI,CAWN"}
@@ -6,9 +6,10 @@ import { PublicModelInterface } from '../../../core/types';
6
6
  import { GpioChipModel } from './gpio-chip-model';
7
7
  import { GpioChipContainerResponse } from './services';
8
8
  import { GpioChipContainerOptions } from './types';
9
+ import { GpioChipResponse } from './gpio-chip-builders';
9
10
  export declare const MODEL_TYPE = "gpio-chip-container-model";
10
11
  export type GpioChipContainerModel = PublicModelInterface<GpioChipContainerModelImpl>;
11
- export interface GpioChipContainerModelImpl extends KosLoggerAware, KosContainerAware<GpioChipModel> {
12
+ export interface GpioChipContainerModelImpl extends KosLoggerAware, KosContainerAware<GpioChipModel, GpioChipResponse> {
12
13
  }
13
14
  export declare class GpioChipContainerModelImpl implements IKosIdentifiable, IKosDataModel {
14
15
  static Registration: SingletonKosModelRegistrationFactory<GpioChipContainerModel, GpioChipContainerOptions>;
@@ -1 +1 @@
1
- {"version":3,"file":"gpio-chip-container-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/gpio-chip/gpio-chip-container-model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAIL,KAAK,yBAAyB,EAC/B,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAExD,eAAO,MAAM,UAAU,8BAA8B,CAAC;AAEtD,MAAM,MAAM,sBAAsB,GAChC,oBAAoB,CAAC,0BAA0B,CAAC,CAAC;AAGnD,MAAM,WAAW,0BACf,SAAQ,cAAc,EACpB,iBAAiB,CAAC,aAAa,CAAC;CAAG;AAEvC,qBAOa,0BACX,YAAW,gBAAgB,EAAE,aAAa;IAG1C,MAAM,CAAC,YAAY,EAAE,oCAAoC,CACvD,sBAAsB,EACtB,wBAAwB,CACzB,CAAC;IAEF,EAAE,EAAE,MAAM,CAAC;IACX,kBAAkB,EAAE,MAAM,CAAC;gBAEf,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,wBAAwB;IAK9D,WAAW,CAAC,QAAQ,EAAE,wBAAwB,GAAG,IAAI;IAoB/C,kBAAkB,CACtB,MAAM,EAAE,KAAK,EACb,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,GAClD,OAAO,CAAC,IAAI,CAAC;IAiFV,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAG5B;AACD,eAAO,MAAM,iBAAiB,wFAA0C,CAAC"}
1
+ {"version":3,"file":"gpio-chip-container-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/gpio-chip/gpio-chip-container-model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAIL,KAAK,yBAAyB,EAC/B,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAML,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,UAAU,8BAA8B,CAAC;AAEtD,MAAM,MAAM,sBAAsB,GAChC,oBAAoB,CAAC,0BAA0B,CAAC,CAAC;AAGnD,MAAM,WAAW,0BACf,SAAQ,cAAc,EACpB,iBAAiB,CAAC,aAAa,EAAE,gBAAgB,CAAC;CAAG;AAEzD,qBAca,0BACX,YAAW,gBAAgB,EAAE,aAAa;IAG1C,MAAM,CAAC,YAAY,EAAE,oCAAoC,CACvD,sBAAsB,EACtB,wBAAwB,CACzB,CAAC;IAEF,EAAE,EAAE,MAAM,CAAC;IACX,kBAAkB,EAAE,MAAM,CAAC;gBAEf,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,wBAAwB;IAK9D,WAAW,CAAC,QAAQ,EAAE,wBAAwB,GAAG,IAAI;IAoB/C,kBAAkB,CACtB,MAAM,EAAE,KAAK,EACb,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,GAClD,OAAO,CAAC,IAAI,CAAC;IAsDV,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAG5B;AACD,eAAO,MAAM,iBAAiB,wFAA0C,CAAC"}
@@ -3,60 +3,18 @@ import { KeyValueUpdate } from './services';
3
3
  import { KeyValueOptions } from './types';
4
4
  export declare const MODEL_TYPE = "key-value-model";
5
5
  /**
6
- * Key-Value Model - Persistent, reactive state storage with real-time synchronization across KOS applications.
7
- *
8
- * This model provides a namespaced key-value store that automatically persists data and synchronizes
9
- * changes across all connected clients in real-time. Perfect for storing user preferences, application
10
- * state, feature flags, or any data that needs to persist between sessions and sync across instances.
11
- *
12
- * ## Key Features
13
- * - **Persistent Storage** - Data survives application restarts and browser refreshes
14
- * - **Real-time Synchronization** - Changes propagate instantly to all connected clients
15
- * - **Namespace Isolation** - Multiple stores can coexist without key collisions
16
- * - **Type-Safe Values** - Supports string, number, boolean, and undefined types
17
- * - **Reactive Updates** - Automatic UI updates when values change (locally or remotely)
18
- * - **Topic-Based Sync** - Uses KOS event system for distributed state management
19
- *
20
- * ## Topic-Based Reactivity
21
- * The model listens to two KOS topics for real-time synchronization:
22
- * - **`/keyVal/set`** - Fired when any key-value pair is updated or added
23
- * - **`/keyVal/remove`** - Fired when a key is deleted from the store
24
- *
25
- * These topics ensure that all instances of the model with the same namespace stay
26
- * synchronized across browser tabs, windows, and even different client applications.
27
- * The model automatically filters events by namespace to ensure isolation.
6
+ * A namespace of the device's persistent key-value store. The model loads the
7
+ * namespace on load, writes changes through `updateState`, and applies the
8
+ * `/keyVal/set` and `/keyVal/remove` topics for its namespace, so every client
9
+ * using the namespace sees the same `data`.
28
10
  *
29
11
  * @interface
30
12
  *
31
- * @example Basic Usage
13
+ * @example
32
14
  * ```typescript
33
- * const preferences = KeyValue.instance('user-prefs')
34
- * .options({ namespace: 'preferences' })
35
- * .build();
36
- *
37
- * // Store values
38
- * await preferences.updateState('theme', 'dark');
39
- * await preferences.updateState('fontSize', 14);
40
- *
41
- * // Access reactive data
42
- * console.log(preferences.data.theme); // 'dark'
43
- * console.log(preferences.data.fontSize); // 14
44
- * ```
45
- *
46
- * @example React Integration
47
- * ```typescript
48
- * const UserSettings: React.FC = kosComponent(() => {
49
- * const settings = useModel(KeyValue, 'app-settings');
50
- *
51
- * return (
52
- * <div>
53
- * <p>Theme: {settings.data.theme || 'light'}</p>
54
- * <button onClick={() => settings.updateState('theme', 'dark')}>
55
- * Set Dark Theme
56
- * </button>
57
- * </div>
58
- * );
59
- * });
15
+ * const prefs = KeyValue.instance("user-prefs").options({ namespace: "preferences" }).build();
16
+ * await prefs.updateState("theme", "dark");
17
+ * prefs.data.theme; // "dark"
60
18
  * ```
61
19
  *
62
20
  * @group KOS Model
@@ -82,23 +40,11 @@ export declare class KeyValueModelImpl implements IKosDataModel, IKosIdentifiabl
82
40
  */
83
41
  init(): Promise<void>;
84
42
  /**
85
- * Update or delete a key-value pair in the store.
86
- *
87
- * Changes are automatically persisted and synchronized across all instances
88
- * with the same namespace via KOS topics.
43
+ * Stores a value under `key`, or deletes the key when `value` is undefined.
89
44
  *
90
45
  * @param key - The key to update or delete
91
- * @param value - The value to set (string | number | boolean), or undefined to delete the key
46
+ * @param value - The value to set, or undefined to delete the key
92
47
  * @returns Promise that resolves when the operation completes
93
- *
94
- * @example
95
- * ```typescript
96
- * // Set a value
97
- * await keyValue.updateState('theme', 'dark');
98
- *
99
- * // Delete a key
100
- * await keyValue.updateState('theme', undefined);
101
- * ```
102
48
  */
103
49
  updateState(key: string, value: string | number | boolean | undefined): Promise<void>;
104
50
  /**
@@ -108,19 +54,13 @@ export declare class KeyValueModelImpl implements IKosDataModel, IKosIdentifiabl
108
54
  */
109
55
  load(): Promise<void>;
110
56
  /**
111
- * Topic handler for `/keyVal/set` events to sync updates across instances.
112
- *
113
- * Automatically called when any KeyValue model instance updates a value,
114
- * ensuring all instances with the same namespace stay synchronized.
57
+ * Applies a `/keyVal/set` event for this namespace.
115
58
  *
116
59
  * @param update - The key-value update event containing namespace, key, and new value
117
60
  */
118
61
  handleStateUpdate(update: KeyValueUpdate): void;
119
62
  /**
120
- * Topic handler for `/keyVal/remove` events to sync deletions across instances.
121
- *
122
- * Automatically called when any KeyValue model instance deletes a key,
123
- * ensuring all instances with the same namespace stay synchronized.
63
+ * Applies a `/keyVal/remove` event for this namespace.
124
64
  *
125
65
  * @param update - The key-value update event containing namespace and deleted key
126
66
  */
@@ -1 +1 @@
1
- {"version":3,"file":"key-value-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/key-value/key-value-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAEhB,kBAAkB,EAClB,OAAO,EACP,oBAAoB,EACrB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,eAAO,MAAM,UAAU,oBAAoB,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,MAAM,MAAM,aAAa,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAEpE;;;GAGG;AACH,qBACa,iBAAkB,YAAW,aAAa,EAAE,gBAAgB;IACvE,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,SAAS,CAAS;IAC1B,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC;gBAEnE,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,kBAAkB;IAQ7B;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B;;;;;;;;;;;;;;;;;;OAkBG;IACG,WAAW,CACf,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAC3C,OAAO,CAAC,IAAI,CAAC;IAUhB;;;;OAIG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAM3B;;;;;;;OAOG;IAEH,iBAAiB,CAAC,MAAM,EAAE,cAAc;IAOxC;;;;;;;OAOG;IAEH,iBAAiB,CAAC,MAAM,EAAE,cAAc;CAMzC"}
1
+ {"version":3,"file":"key-value-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/key-value/key-value-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAEhB,kBAAkB,EAClB,OAAO,EACP,oBAAoB,EACrB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,eAAO,MAAM,UAAU,oBAAoB,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,MAAM,aAAa,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAEpE;;;GAGG;AACH,qBACa,iBAAkB,YAAW,aAAa,EAAE,gBAAgB;IACvE,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,SAAS,CAAS;IAC1B,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC;gBAEnE,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,kBAAkB;IAQ7B;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B;;;;;;OAMG;IACG,WAAW,CACf,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAC3C,OAAO,CAAC,IAAI,CAAC;IAUhB;;;;OAIG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAM3B;;;;OAIG;IAEH,iBAAiB,CAAC,MAAM,EAAE,cAAc;IAOxC;;;;OAIG;IAEH,iBAAiB,CAAC,MAAM,EAAE,cAAc;CAMzC"}
@@ -2,87 +2,15 @@ import { KosModelRegistrationFactory } from '../../../core';
2
2
  import { KeyValueModel } from './key-value-model';
3
3
  import { KeyValueOptions } from './types';
4
4
  /**
5
- * # KeyValue
6
- *
7
- * The registration bean includes convenience methods for creating and working with KeyValueModel instances.
8
- *
9
- * ## type
10
- * The type property is a string that identifies the model type.
11
- * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently
12
- * used when declaring dependencies on models.
13
- *
14
- * @example
15
- * ```typescript
16
- *
17
- * @kosDependency({modelType: KeyValue.type, id: "studioStateId"})
18
- * private studioStateModel: KeyValueModel;
19
- * ```
20
- *
21
- *
22
- * ## factory
23
- *
24
- * The factory method creates a factory function that can be used to create new KeyValueModel instances.
25
- *
26
-
27
- * As this is a singleton model, the factory function accepts the model options as its argument.
28
- *
29
- * If a model with the same model type already exists, the factory function will return the existing model. The options will be ignored
30
- * in this case and the existing model will be returned in its current state.
31
- *
32
- * @example
33
- * ```typescript
34
- * const model = KeyValue.factory({
35
- * // Add option data
36
- * });
37
- * ```
38
-
39
-
40
- *
41
- * ## predicate
42
- *
43
- * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a KeyValueModel.
44
- *
45
- * @example
46
- * ```typescript
47
- *
48
- * const model: IKosDataModel = ...; // some model
49
- *
50
- * if (KeyValue.predicate(model)) {
51
- * // if the function evaluates to true, the model is narrowed down to KeyValueModel
52
- * // and the compiler will know that the model has the KeyValueModel interface
53
- * model.updateAvailability(false);
54
- * }
55
- * ```
56
- *
57
- * ## registration
58
- *
59
- * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object
60
- * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.
5
+ * Registration for {@link KeyValueModel}.
61
6
  *
7
+ * `type` identifies the model in the registry and in `@kosDependency` declarations.
8
+ * `register()` adds the model to the registry. `instance(id)` builds the model, or returns the existing one when the id is already in use.
62
9
  *
63
10
  * @example
64
- *
65
- * In an application registration file you can declare the model registration as follows:
66
- *
67
- * **registration.ts**
68
11
  * ```typescript
69
- * import { KeyValue } from "@kos-ui/project-models";
70
- * import { KosModelRegistry } from "@kosdev-code/kos-dispense-sdk";
71
- *
72
- * import { initKosProvider } from "@kosdev-code/kos-ui-sdk";
73
- *
74
- * KosModelRegistry.dispense
75
- * .models()
76
- * .model(KeyValue);
12
+ * const model = KeyValue.instance("keyValueId").options(options).build();
77
13
  * ```
78
- *
79
- * ## registration.singleton
80
-
81
- * The studioState model is a singleton model. This means that each time the factory function is called , the same instance will be returned.
82
- * If the model does not yet exist, it will be created passing in the provided options to initialize it.
83
- *
84
- * Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.
85
-
86
- * */
14
+ */
87
15
  export declare const KeyValue: KosModelRegistrationFactory<KeyValueModel, KeyValueOptions>;
88
16
  //# sourceMappingURL=key-value-registration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"key-value-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/key-value/key-value-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkFK;AACL,eAAO,MAAM,QAAQ,6DAMnB,CAAC"}
1
+ {"version":3,"file":"key-value-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/key-value/key-value-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,6DAMnB,CAAC"}
@@ -1,17 +1,10 @@
1
1
  /**
2
- * @fileoverview Key-Value service functions for persistent data storage and retrieval.
3
- *
4
- * This module provides service functions for managing key-value pairs in KOS device storage.
5
- * Supports namespaced storage, CRUD operations, and typed value handling for configuration
6
- * data, user preferences, and application state persistence.
2
+ * @fileoverview Service functions for the device's namespaced key-value store.
7
3
  *
8
4
  * @module KeyValueServices
9
5
  */
10
6
  /**
11
- * Response format for key-value data retrieval.
12
- *
13
- * Represents the structure of data returned from key-value service endpoints,
14
- * supporting primitive types commonly used for configuration and state data.
7
+ * Key-value pairs of one namespace.
15
8
  *
16
9
  * @group KOS Model
17
10
  * @category Key-Value Store
@@ -21,11 +14,7 @@ interface KeyValueResponse {
21
14
  [key: string]: string | number | boolean;
22
15
  }
23
16
  /**
24
- * Update request format for key-value operations.
25
- *
26
- * Defines the structure for updating individual key-value pairs within
27
- * specific namespaces, supporting targeted updates without affecting
28
- * other stored data.
17
+ * A single key-value write within a namespace.
29
18
  *
30
19
  * @group KOS Model
31
20
  * @category Key-Value Store
@@ -39,98 +28,50 @@ export interface KeyValueUpdate {
39
28
  value: string;
40
29
  }
41
30
  /**
42
- * Removes a specific key-value pair from storage.
43
- *
44
- * Permanently deletes a key and its associated value from the specified namespace.
45
- * This operation cannot be undone, so use with caution for critical data.
31
+ * Deletes one key from a namespace.
46
32
  *
47
33
  * @param namespace - Namespace containing the key to delete
48
34
  * @param key - Specific key to remove from storage
49
35
  *
50
- * @throws {Error} When deletion request fails or service is unavailable
51
- *
52
- * @example Delete User Preference
53
- * ```typescript
54
- * await deleteKeyValue('user-preferences', 'theme-mode');
55
- * console.log('Theme preference cleared');
56
- * ```
36
+ * @throws {Error} When the deletion request fails
57
37
  *
58
38
  * @group KOS Model
59
39
  * @category Key-Value Store
60
40
  */
61
41
  export declare const deleteKeyValue: (namespace: string, key: string) => Promise<void>;
62
42
  /**
63
- * Creates or updates a key-value pair in persistent storage.
64
- *
65
- * Stores a value under the specified key within the given namespace. If the key
66
- * already exists, its value will be overwritten. Supports primitive types with
67
- * automatic string conversion for API compatibility.
43
+ * Stores a value under a key in a namespace, replacing any existing value. The
44
+ * value is sent as a string.
68
45
  *
69
46
  * @param namespace - Namespace for organizing related key-value pairs
70
47
  * @param key - Unique identifier within the namespace
71
- * @param value - Value to store (primitive types supported)
48
+ * @param value - Value to store
72
49
  * @returns Promise resolving to the stored value
73
50
  *
74
- * @throws {Error} When update request fails or service returns non-200 status
75
- *
76
- * @example Store Configuration Setting
77
- * ```typescript
78
- * await updateKeyValue('device-config', 'maxRetries', 5);
79
- * await updateKeyValue('user-prefs', 'darkMode', true);
80
- * await updateKeyValue('app-state', 'lastLogin', '2024-01-15');
81
- * ```
51
+ * @throws {Error} When the response status is not 200
82
52
  *
83
53
  * @group KOS Model
84
54
  * @category Key-Value Store
85
55
  */
86
56
  export declare const updateKeyValue: (namespace: string, key: string, value: string | number | boolean) => Promise<any>;
87
57
  /**
88
- * Retrieves all key-value pairs from a specified namespace.
89
- *
90
- * Fetches all stored data within the given namespace as a complete object.
91
- * Useful for loading configuration sets, user preferences, or application
92
- * state data in bulk operations.
58
+ * Fetches every key-value pair in a namespace.
93
59
  *
94
60
  * @param namespace - Namespace to retrieve data from (defaults to "studio")
95
61
  * @returns Promise resolving to object containing all key-value pairs in namespace
96
62
  *
97
- * @throws {Error} When retrieval fails or service returns non-200 status
98
- *
99
- * @example Load Application Configuration
100
- * ```typescript
101
- * const appConfig = await getKeyValue('app-config');
102
- * console.log('Max retries:', appConfig.maxRetries);
103
- * console.log('Debug mode:', appConfig.debugMode);
104
- *
105
- * const userPrefs = await getKeyValue('user-preferences');
106
- * const theme = userPrefs.themeMode || 'light';
107
- * ```
63
+ * @throws {Error} When the response status is not 200
108
64
  *
109
65
  * @group KOS Model
110
66
  * @category Key-Value Store
111
67
  */
112
68
  export declare const getKeyValue: (namespace?: string) => Promise<KeyValueResponse>;
113
69
  /**
114
- * Removes an entire namespace and all its key-value pairs.
115
- *
116
- * Permanently deletes all data within the specified namespace. This is a
117
- * destructive operation that cannot be undone. Use with extreme caution
118
- * for critical data or production systems.
70
+ * Deletes a namespace and every key in it.
119
71
  *
120
72
  * @param namespace - Namespace to completely remove from storage
121
73
  *
122
- * @throws {Error} When deletion request fails or service is unavailable
123
- *
124
- * @example Clear All User Preferences
125
- * ```typescript
126
- * // Warning: This removes ALL user preferences permanently
127
- * await deleteKeyValueNamespace('user-preferences');
128
- * console.log('All user preferences cleared');
129
- *
130
- * // Better: Clear specific preferences individually
131
- * await deleteKeyValue('user-preferences', 'theme-mode');
132
- * await deleteKeyValue('user-preferences', 'language');
133
- * ```
74
+ * @throws {Error} When the deletion request fails
134
75
  *
135
76
  * @group KOS Model
136
77
  * @category Key-Value Store
@@ -1 +1 @@
1
- {"version":3,"file":"key-value-services.d.ts","sourceRoot":"","sources":["../../../../../../../packages/kos-ui-sdk/src/models/models/key-value/services/key-value-services.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAkBH;;;;;;;;GAQG;AACH,UAAU,gBAAgB;IACxB,4CAA4C;IAC5C,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CAC1C;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,cAAc;IAC7B,iDAAiD;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,cAAc,GAAU,WAAW,MAAM,EAAE,KAAK,MAAM,kBAKlE,CAAC;AACF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,cAAc,GACzB,WAAW,MAAM,EACjB,KAAK,MAAM,EACX,OAAO,MAAM,GAAG,MAAM,GAAG,OAAO,iBAcjC,CAAC;AACF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,WAAW,GAAU,kBAAoB,8BAarD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,uBAAuB,GAAU,WAAW,MAAM,kBAK9D,CAAC"}
1
+ {"version":3,"file":"key-value-services.d.ts","sourceRoot":"","sources":["../../../../../../../packages/kos-ui-sdk/src/models/models/key-value/services/key-value-services.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkBH;;;;;GAKG;AACH,UAAU,gBAAgB;IACxB,4CAA4C;IAC5C,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CAC1C;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,iDAAiD;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,GAAU,WAAW,MAAM,EAAE,KAAK,MAAM,kBAKlE,CAAC;AACF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,cAAc,GACzB,WAAW,MAAM,EACjB,KAAK,MAAM,EACX,OAAO,MAAM,GAAG,MAAM,GAAG,OAAO,iBAcjC,CAAC;AACF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,GAAU,kBAAoB,8BAarD,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,GAAU,WAAW,MAAM,kBAK9D,CAAC"}