@matter/node 0.18.0 → 0.18.1-alpha.0-20261111-b84c5d1bc

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 (618) hide show
  1. package/dist/cjs/behavior/Behavior.d.ts.map +1 -1
  2. package/dist/cjs/behavior/Behavior.js +2 -0
  3. package/dist/cjs/behavior/Behavior.js.map +1 -1
  4. package/dist/cjs/behavior/Events.d.ts.map +1 -1
  5. package/dist/cjs/behavior/Events.js +4 -2
  6. package/dist/cjs/behavior/Events.js.map +1 -1
  7. package/dist/cjs/behavior/cluster/ClusterBehavior.d.ts +17 -3
  8. package/dist/cjs/behavior/cluster/ClusterBehavior.d.ts.map +1 -1
  9. package/dist/cjs/behavior/cluster/ClusterBehavior.js +2 -20
  10. package/dist/cjs/behavior/cluster/ClusterBehavior.js.map +1 -1
  11. package/dist/cjs/behavior/cluster/ClusterBehaviorType.d.ts.map +1 -1
  12. package/dist/cjs/behavior/cluster/ClusterBehaviorType.js +8 -150
  13. package/dist/cjs/behavior/cluster/ClusterBehaviorType.js.map +1 -1
  14. package/dist/cjs/behavior/context/server/LocalActorContext.d.ts +1 -1
  15. package/dist/cjs/behavior/context/server/LocalActorContext.d.ts.map +1 -1
  16. package/dist/cjs/behavior/internal/BehaviorBacking.d.ts +2 -2
  17. package/dist/cjs/behavior/internal/BehaviorBacking.d.ts.map +1 -1
  18. package/dist/cjs/behavior/internal/BehaviorBacking.js +2 -0
  19. package/dist/cjs/behavior/internal/BehaviorBacking.js.map +1 -1
  20. package/dist/cjs/behavior/internal/ClusterDerivation.d.ts +45 -0
  21. package/dist/cjs/behavior/internal/ClusterDerivation.d.ts.map +1 -0
  22. package/dist/cjs/behavior/internal/ClusterDerivation.js +192 -0
  23. package/dist/cjs/behavior/internal/ClusterDerivation.js.map +6 -0
  24. package/dist/cjs/behavior/internal/ClusterStatics.d.ts +16 -0
  25. package/dist/cjs/behavior/internal/ClusterStatics.d.ts.map +1 -0
  26. package/dist/cjs/behavior/internal/ClusterStatics.js +138 -0
  27. package/dist/cjs/behavior/internal/ClusterStatics.js.map +6 -0
  28. package/dist/cjs/behavior/internal/ModeledState.d.ts +18 -0
  29. package/dist/cjs/behavior/internal/ModeledState.d.ts.map +1 -0
  30. package/dist/cjs/behavior/internal/ModeledState.js +54 -0
  31. package/dist/cjs/behavior/internal/ModeledState.js.map +6 -0
  32. package/dist/cjs/behavior/internal/ServerBehaviorBacking.d.ts +1 -1
  33. package/dist/cjs/behavior/internal/ServerBehaviorBacking.d.ts.map +1 -1
  34. package/dist/cjs/behavior/internal/ServerBehaviorBacking.js +3 -12
  35. package/dist/cjs/behavior/internal/ServerBehaviorBacking.js.map +1 -1
  36. package/dist/cjs/behavior/state/managed/Datasource.d.ts +54 -10
  37. package/dist/cjs/behavior/state/managed/Datasource.d.ts.map +1 -1
  38. package/dist/cjs/behavior/state/managed/Datasource.js +107 -38
  39. package/dist/cjs/behavior/state/managed/Datasource.js.map +1 -1
  40. package/dist/cjs/behavior/state/managed/Internal.d.ts +20 -5
  41. package/dist/cjs/behavior/state/managed/Internal.d.ts.map +1 -1
  42. package/dist/cjs/behavior/state/managed/Internal.js +28 -26
  43. package/dist/cjs/behavior/state/managed/Internal.js.map +1 -1
  44. package/dist/cjs/behavior/state/managed/ManagedReference.d.ts +56 -12
  45. package/dist/cjs/behavior/state/managed/ManagedReference.d.ts.map +1 -1
  46. package/dist/cjs/behavior/state/managed/ManagedReference.js +103 -43
  47. package/dist/cjs/behavior/state/managed/ManagedReference.js.map +1 -1
  48. package/dist/cjs/behavior/state/managed/NameResolver.js +1 -1
  49. package/dist/cjs/behavior/state/managed/NameResolver.js.map +1 -1
  50. package/dist/cjs/behavior/state/managed/ReadOnlyReference.d.ts +33 -0
  51. package/dist/cjs/behavior/state/managed/ReadOnlyReference.d.ts.map +1 -0
  52. package/dist/cjs/behavior/state/{validation/peer-forwarding.js → managed/ReadOnlyReference.js} +36 -17
  53. package/dist/cjs/behavior/state/managed/ReadOnlyReference.js.map +6 -0
  54. package/dist/cjs/behavior/state/managed/ValReference.d.ts +80 -13
  55. package/dist/cjs/behavior/state/managed/ValReference.d.ts.map +1 -1
  56. package/dist/cjs/behavior/state/managed/ValReference.js +32 -0
  57. package/dist/cjs/behavior/state/managed/ValReference.js.map +2 -2
  58. package/dist/cjs/behavior/state/managed/errors.d.ts +25 -0
  59. package/dist/cjs/behavior/state/managed/errors.d.ts.map +1 -0
  60. package/dist/cjs/behavior/state/{validation/FabricIndexSentinel.js → managed/errors.js} +15 -10
  61. package/dist/cjs/behavior/state/managed/errors.js.map +6 -0
  62. package/dist/cjs/behavior/state/managed/index.d.ts +1 -0
  63. package/dist/cjs/behavior/state/managed/index.d.ts.map +1 -1
  64. package/dist/cjs/behavior/state/managed/index.js +1 -0
  65. package/dist/cjs/behavior/state/managed/index.js.map +1 -1
  66. package/dist/cjs/behavior/state/managed/values/BitmapManager.js +5 -20
  67. package/dist/cjs/behavior/state/managed/values/BitmapManager.js.map +1 -1
  68. package/dist/cjs/behavior/state/managed/values/ListManager.d.ts +0 -5
  69. package/dist/cjs/behavior/state/managed/values/ListManager.d.ts.map +1 -1
  70. package/dist/cjs/behavior/state/managed/values/ListManager.js +274 -133
  71. package/dist/cjs/behavior/state/managed/values/ListManager.js.map +2 -2
  72. package/dist/cjs/behavior/state/managed/values/StructManager.d.ts.map +1 -1
  73. package/dist/cjs/behavior/state/managed/values/StructManager.js +30 -35
  74. package/dist/cjs/behavior/state/managed/values/StructManager.js.map +2 -2
  75. package/dist/cjs/behavior/state/managed/values/ValuePatcher.d.ts +8 -0
  76. package/dist/cjs/behavior/state/managed/values/ValuePatcher.d.ts.map +1 -1
  77. package/dist/cjs/behavior/state/managed/values/ValuePatcher.js +13 -2
  78. package/dist/cjs/behavior/state/managed/values/ValuePatcher.js.map +1 -1
  79. package/dist/cjs/behavior/state/validation/FabricIndexField.d.ts +30 -0
  80. package/dist/cjs/behavior/state/validation/FabricIndexField.d.ts.map +1 -0
  81. package/dist/cjs/behavior/state/validation/FabricIndexField.js +53 -0
  82. package/dist/cjs/behavior/state/validation/FabricIndexField.js.map +6 -0
  83. package/dist/cjs/behavior/state/validation/ValueValidator.d.ts.map +1 -1
  84. package/dist/cjs/behavior/state/validation/ValueValidator.js +16 -36
  85. package/dist/cjs/behavior/state/validation/ValueValidator.js.map +1 -1
  86. package/dist/cjs/behavior/state/validation/conformance.d.ts.map +1 -1
  87. package/dist/cjs/behavior/state/validation/conformance.js +6 -5
  88. package/dist/cjs/behavior/state/validation/conformance.js.map +1 -1
  89. package/dist/cjs/behavior/state/validation/constraint.d.ts.map +1 -1
  90. package/dist/cjs/behavior/state/validation/constraint.js +3 -1
  91. package/dist/cjs/behavior/state/validation/constraint.js.map +1 -1
  92. package/dist/cjs/behavior/state/validation/location.d.ts +6 -0
  93. package/dist/cjs/behavior/state/validation/location.d.ts.map +1 -1
  94. package/dist/cjs/behavior/state/validation/remote-validation.d.ts +57 -0
  95. package/dist/cjs/behavior/state/validation/remote-validation.d.ts.map +1 -0
  96. package/dist/cjs/behavior/state/validation/remote-validation.js +63 -0
  97. package/dist/cjs/behavior/state/validation/remote-validation.js.map +6 -0
  98. package/dist/cjs/behavior/supervision/Supervision.d.ts.map +1 -1
  99. package/dist/cjs/behavior/supervision/Supervision.js +1 -1
  100. package/dist/cjs/behavior/supervision/Supervision.js.map +1 -1
  101. package/dist/cjs/behavior/supervision/SupervisionConfig.d.ts.map +1 -1
  102. package/dist/cjs/behavior/supervision/SupervisionConfig.js +1 -1
  103. package/dist/cjs/behavior/supervision/SupervisionConfig.js.map +1 -1
  104. package/dist/cjs/behavior/supervision/ValueSupervisor.d.ts +3 -12
  105. package/dist/cjs/behavior/supervision/ValueSupervisor.d.ts.map +1 -1
  106. package/dist/cjs/behavior/system/commissioning/CommissioningClient.d.ts +57 -6
  107. package/dist/cjs/behavior/system/commissioning/CommissioningClient.d.ts.map +1 -1
  108. package/dist/cjs/behavior/system/commissioning/CommissioningClient.js +86 -0
  109. package/dist/cjs/behavior/system/commissioning/CommissioningClient.js.map +1 -1
  110. package/dist/cjs/behavior/system/commissioning/RemoteDescriptor.d.ts +9 -1
  111. package/dist/cjs/behavior/system/commissioning/RemoteDescriptor.d.ts.map +1 -1
  112. package/dist/cjs/behavior/system/commissioning/RemoteDescriptor.js +9 -0
  113. package/dist/cjs/behavior/system/commissioning/RemoteDescriptor.js.map +1 -1
  114. package/dist/cjs/behavior/system/controller/ControllerBehavior.d.ts +2 -1
  115. package/dist/cjs/behavior/system/controller/ControllerBehavior.d.ts.map +1 -1
  116. package/dist/cjs/behavior/system/controller/ControllerBehavior.js +2 -1
  117. package/dist/cjs/behavior/system/controller/ControllerBehavior.js.map +1 -1
  118. package/dist/cjs/behavior/system/dcl/DclBehavior.d.ts +3 -3
  119. package/dist/cjs/behavior/system/network/ServerGroupNetworking.d.ts +2 -1
  120. package/dist/cjs/behavior/system/network/ServerGroupNetworking.d.ts.map +1 -1
  121. package/dist/cjs/behavior/system/network/ServerGroupNetworking.js.map +1 -1
  122. package/dist/cjs/behavior/system/remote/api/ApiResource.d.ts +14 -0
  123. package/dist/cjs/behavior/system/remote/api/ApiResource.d.ts.map +1 -1
  124. package/dist/cjs/behavior/system/remote/api/ApiResource.js +19 -0
  125. package/dist/cjs/behavior/system/remote/api/ApiResource.js.map +1 -1
  126. package/dist/cjs/behavior/system/remote/api/Envelope.d.ts +4 -2
  127. package/dist/cjs/behavior/system/remote/api/Envelope.d.ts.map +1 -1
  128. package/dist/cjs/behavior/system/remote/api/Envelope.js +7 -5
  129. package/dist/cjs/behavior/system/remote/api/Envelope.js.map +1 -1
  130. package/dist/cjs/behavior/system/remote/api/resources/CommandResource.js +2 -2
  131. package/dist/cjs/behavior/system/remote/api/resources/CommandResource.js.map +1 -1
  132. package/dist/cjs/behavior/system/remote/api/resources/NodeResource.d.ts +1 -0
  133. package/dist/cjs/behavior/system/remote/api/resources/NodeResource.d.ts.map +1 -1
  134. package/dist/cjs/behavior/system/remote/api/resources/NodeResource.js +3 -0
  135. package/dist/cjs/behavior/system/remote/api/resources/NodeResource.js.map +1 -1
  136. package/dist/cjs/behavior/system/remote/api/resources/PropertyResource.d.ts.map +1 -1
  137. package/dist/cjs/behavior/system/remote/api/resources/PropertyResource.js +5 -3
  138. package/dist/cjs/behavior/system/remote/api/resources/PropertyResource.js.map +1 -1
  139. package/dist/cjs/behavior/system/remote/api/resources/ServerNodeResource.d.ts.map +1 -1
  140. package/dist/cjs/behavior/system/remote/api/resources/ServerNodeResource.js +2 -11
  141. package/dist/cjs/behavior/system/remote/api/resources/ServerNodeResource.js.map +1 -1
  142. package/dist/cjs/behavior/system/sessions/SessionsBehavior.d.ts +4 -0
  143. package/dist/cjs/behavior/system/sessions/SessionsBehavior.d.ts.map +1 -1
  144. package/dist/cjs/behavior/system/sessions/SessionsBehavior.js +6 -1
  145. package/dist/cjs/behavior/system/sessions/SessionsBehavior.js.map +1 -1
  146. package/dist/cjs/behavior/system/subscriptions/SubscriptionStore.d.ts +28 -0
  147. package/dist/cjs/behavior/system/subscriptions/SubscriptionStore.d.ts.map +1 -0
  148. package/dist/cjs/behavior/system/subscriptions/SubscriptionStore.js +74 -0
  149. package/dist/cjs/behavior/system/subscriptions/SubscriptionStore.js.map +6 -0
  150. package/dist/cjs/behavior/system/subscriptions/SubscriptionsServer.d.ts +8 -3
  151. package/dist/cjs/behavior/system/subscriptions/SubscriptionsServer.d.ts.map +1 -1
  152. package/dist/cjs/behavior/system/subscriptions/SubscriptionsServer.js +61 -30
  153. package/dist/cjs/behavior/system/subscriptions/SubscriptionsServer.js.map +1 -1
  154. package/dist/cjs/behaviors/access-control/AccessControlServer.d.ts +2 -2
  155. package/dist/cjs/behaviors/access-control/AccessControlServer.d.ts.map +1 -1
  156. package/dist/cjs/behaviors/administrator-commissioning/AdministratorCommissioningServer.d.ts.map +1 -1
  157. package/dist/cjs/behaviors/administrator-commissioning/AdministratorCommissioningServer.js +43 -21
  158. package/dist/cjs/behaviors/administrator-commissioning/AdministratorCommissioningServer.js.map +1 -1
  159. package/dist/cjs/behaviors/general-diagnostics/GeneralDiagnosticsServer.d.ts +29 -23
  160. package/dist/cjs/behaviors/general-diagnostics/GeneralDiagnosticsServer.d.ts.map +1 -1
  161. package/dist/cjs/behaviors/general-diagnostics/GeneralDiagnosticsServer.js +104 -60
  162. package/dist/cjs/behaviors/general-diagnostics/GeneralDiagnosticsServer.js.map +1 -1
  163. package/dist/cjs/behaviors/group-key-management/GroupKeyManagementServer.d.ts +9 -1
  164. package/dist/cjs/behaviors/group-key-management/GroupKeyManagementServer.d.ts.map +1 -1
  165. package/dist/cjs/behaviors/group-key-management/GroupKeyManagementServer.js +11 -7
  166. package/dist/cjs/behaviors/group-key-management/GroupKeyManagementServer.js.map +1 -1
  167. package/dist/cjs/behaviors/groupcast/GroupcastServer.d.ts.map +1 -1
  168. package/dist/cjs/behaviors/groupcast/GroupcastServer.js +41 -25
  169. package/dist/cjs/behaviors/groupcast/GroupcastServer.js.map +2 -2
  170. package/dist/cjs/behaviors/localization-configuration/LocalizationConfigurationServer.d.ts +1 -1
  171. package/dist/cjs/behaviors/localization-configuration/LocalizationConfigurationServer.d.ts.map +1 -1
  172. package/dist/cjs/behaviors/localization-configuration/LocalizationConfigurationServer.js +15 -4
  173. package/dist/cjs/behaviors/localization-configuration/LocalizationConfigurationServer.js.map +2 -2
  174. package/dist/cjs/behaviors/operational-credentials/VendorIdVerification.d.ts +2 -0
  175. package/dist/cjs/behaviors/operational-credentials/VendorIdVerification.d.ts.map +1 -1
  176. package/dist/cjs/behaviors/operational-credentials/VendorIdVerification.js +27 -23
  177. package/dist/cjs/behaviors/operational-credentials/VendorIdVerification.js.map +1 -1
  178. package/dist/cjs/behaviors/thermostat/ThermostatServer.d.ts +15 -4
  179. package/dist/cjs/behaviors/thermostat/ThermostatServer.d.ts.map +1 -1
  180. package/dist/cjs/behaviors/thermostat/ThermostatServer.js +66 -49
  181. package/dist/cjs/behaviors/thermostat/ThermostatServer.js.map +1 -1
  182. package/dist/cjs/behaviors/time-format-localization/TimeFormatLocalizationServer.d.ts +4 -4
  183. package/dist/cjs/behaviors/time-format-localization/TimeFormatLocalizationServer.d.ts.map +1 -1
  184. package/dist/cjs/behaviors/time-format-localization/TimeFormatLocalizationServer.js +19 -5
  185. package/dist/cjs/behaviors/time-format-localization/TimeFormatLocalizationServer.js.map +2 -2
  186. package/dist/cjs/behaviors/unit-localization/UnitLocalizationServer.d.ts.map +1 -1
  187. package/dist/cjs/behaviors/unit-localization/UnitLocalizationServer.js +13 -3
  188. package/dist/cjs/behaviors/unit-localization/UnitLocalizationServer.js.map +1 -1
  189. package/dist/cjs/endpoint/Endpoint.d.ts +5 -9
  190. package/dist/cjs/endpoint/Endpoint.d.ts.map +1 -1
  191. package/dist/cjs/endpoint/Endpoint.js +4 -23
  192. package/dist/cjs/endpoint/Endpoint.js.map +1 -1
  193. package/dist/cjs/endpoint/properties/Behaviors.d.ts.map +1 -1
  194. package/dist/cjs/endpoint/properties/Behaviors.js +5 -1
  195. package/dist/cjs/endpoint/properties/Behaviors.js.map +1 -1
  196. package/dist/cjs/node/ClientNode.d.ts +25 -0
  197. package/dist/cjs/node/ClientNode.d.ts.map +1 -1
  198. package/dist/cjs/node/ClientNode.js +41 -0
  199. package/dist/cjs/node/ClientNode.js.map +1 -1
  200. package/dist/cjs/node/ServerNode.d.ts.map +1 -1
  201. package/dist/cjs/node/ServerNode.js +2 -0
  202. package/dist/cjs/node/ServerNode.js.map +1 -1
  203. package/dist/cjs/node/client/ClientCommandMethod.d.ts.map +1 -1
  204. package/dist/cjs/node/client/ClientCommandMethod.js +3 -15
  205. package/dist/cjs/node/client/ClientCommandMethod.js.map +1 -1
  206. package/dist/cjs/node/client/ClientEventEmitter.d.ts.map +1 -1
  207. package/dist/cjs/node/client/ClientEventEmitter.js +6 -2
  208. package/dist/cjs/node/client/ClientEventEmitter.js.map +1 -1
  209. package/dist/cjs/node/client/ClientStructure.d.ts.map +1 -1
  210. package/dist/cjs/node/client/ClientStructure.js +181 -108
  211. package/dist/cjs/node/client/ClientStructure.js.map +2 -2
  212. package/dist/cjs/node/client/Peers.d.ts +18 -6
  213. package/dist/cjs/node/client/Peers.d.ts.map +1 -1
  214. package/dist/cjs/node/client/Peers.js +29 -13
  215. package/dist/cjs/node/client/Peers.js.map +1 -1
  216. package/dist/cjs/node/integration/ChangeNotificationService.d.ts +14 -3
  217. package/dist/cjs/node/integration/ChangeNotificationService.d.ts.map +1 -1
  218. package/dist/cjs/node/integration/ProtocolService.d.ts.map +1 -1
  219. package/dist/cjs/node/integration/ProtocolService.js +38 -56
  220. package/dist/cjs/node/integration/ProtocolService.js.map +1 -1
  221. package/dist/cjs/node/server/InteractionServer.d.ts.map +1 -1
  222. package/dist/cjs/node/server/InteractionServer.js +28 -24
  223. package/dist/cjs/node/server/InteractionServer.js.map +2 -2
  224. package/dist/cjs/node/server/ServerSubscription.d.ts +7 -2
  225. package/dist/cjs/node/server/ServerSubscription.d.ts.map +1 -1
  226. package/dist/cjs/node/server/ServerSubscription.js +83 -47
  227. package/dist/cjs/node/server/ServerSubscription.js.map +1 -1
  228. package/dist/cjs/storage/EndpointStore.d.ts +1 -1
  229. package/dist/cjs/storage/EndpointStore.js +1 -1
  230. package/dist/cjs/storage/client/ClientEndpointStore.d.ts +2 -2
  231. package/dist/cjs/storage/client/ClientEndpointStore.d.ts.map +1 -1
  232. package/dist/cjs/storage/client/ClientEndpointStore.js +1 -1
  233. package/dist/cjs/storage/client/DatasourceCache.d.ts +5 -3
  234. package/dist/cjs/storage/client/DatasourceCache.d.ts.map +1 -1
  235. package/dist/cjs/storage/client/DatasourceCache.js +68 -71
  236. package/dist/cjs/storage/client/DatasourceCache.js.map +1 -1
  237. package/dist/cjs/storage/client/FabricScopedListWrite.d.ts +73 -0
  238. package/dist/cjs/storage/client/FabricScopedListWrite.d.ts.map +1 -0
  239. package/dist/cjs/storage/client/FabricScopedListWrite.js +168 -0
  240. package/dist/cjs/storage/client/FabricScopedListWrite.js.map +6 -0
  241. package/dist/cjs/storage/client/RemoteWriteParticipant.d.ts +9 -6
  242. package/dist/cjs/storage/client/RemoteWriteParticipant.d.ts.map +1 -1
  243. package/dist/cjs/storage/client/RemoteWriteParticipant.js +11 -15
  244. package/dist/cjs/storage/client/RemoteWriteParticipant.js.map +1 -1
  245. package/dist/cjs/storage/client/RemoteWriter.d.ts +67 -7
  246. package/dist/cjs/storage/client/RemoteWriter.d.ts.map +1 -1
  247. package/dist/cjs/storage/client/RemoteWriter.js +61 -13
  248. package/dist/cjs/storage/client/RemoteWriter.js.map +1 -1
  249. package/dist/cjs/storage/server/DatasourceStore.d.ts +2 -2
  250. package/dist/cjs/storage/server/DatasourceStore.d.ts.map +1 -1
  251. package/dist/cjs/storage/server/DatasourceStore.js.map +1 -1
  252. package/dist/cjs/storage/server/ServerEndpointStore.d.ts +2 -2
  253. package/dist/cjs/storage/server/ServerEndpointStore.d.ts.map +1 -1
  254. package/dist/cjs/storage/server/ServerEndpointStore.js +1 -1
  255. package/dist/cjs/testing/mock-server-node.d.ts +2 -1
  256. package/dist/cjs/testing/mock-server-node.d.ts.map +1 -1
  257. package/dist/cjs/testing/mock-server-node.js +8 -5
  258. package/dist/cjs/testing/mock-server-node.js.map +2 -2
  259. package/dist/cjs/testing/node-helpers.d.ts +5 -0
  260. package/dist/cjs/testing/node-helpers.d.ts.map +1 -1
  261. package/dist/cjs/testing/node-helpers.js +4 -4
  262. package/dist/cjs/testing/node-helpers.js.map +1 -1
  263. package/dist/esm/behavior/Behavior.d.ts.map +1 -1
  264. package/dist/esm/behavior/Behavior.js +2 -0
  265. package/dist/esm/behavior/Behavior.js.map +1 -1
  266. package/dist/esm/behavior/Events.d.ts.map +1 -1
  267. package/dist/esm/behavior/Events.js +4 -2
  268. package/dist/esm/behavior/Events.js.map +1 -1
  269. package/dist/esm/behavior/cluster/ClusterBehavior.d.ts +17 -3
  270. package/dist/esm/behavior/cluster/ClusterBehavior.d.ts.map +1 -1
  271. package/dist/esm/behavior/cluster/ClusterBehavior.js +2 -20
  272. package/dist/esm/behavior/cluster/ClusterBehavior.js.map +1 -1
  273. package/dist/esm/behavior/cluster/ClusterBehaviorType.d.ts.map +1 -1
  274. package/dist/esm/behavior/cluster/ClusterBehaviorType.js +10 -159
  275. package/dist/esm/behavior/cluster/ClusterBehaviorType.js.map +1 -1
  276. package/dist/esm/behavior/context/server/LocalActorContext.d.ts +1 -1
  277. package/dist/esm/behavior/context/server/LocalActorContext.d.ts.map +1 -1
  278. package/dist/esm/behavior/internal/BehaviorBacking.d.ts +2 -2
  279. package/dist/esm/behavior/internal/BehaviorBacking.d.ts.map +1 -1
  280. package/dist/esm/behavior/internal/BehaviorBacking.js +2 -0
  281. package/dist/esm/behavior/internal/BehaviorBacking.js.map +1 -1
  282. package/dist/esm/behavior/internal/ClusterDerivation.d.ts +45 -0
  283. package/dist/esm/behavior/internal/ClusterDerivation.d.ts.map +1 -0
  284. package/dist/esm/behavior/internal/ClusterDerivation.js +172 -0
  285. package/dist/esm/behavior/internal/ClusterDerivation.js.map +6 -0
  286. package/dist/esm/behavior/internal/ClusterStatics.d.ts +16 -0
  287. package/dist/esm/behavior/internal/ClusterStatics.d.ts.map +1 -0
  288. package/dist/esm/behavior/internal/ClusterStatics.js +118 -0
  289. package/dist/esm/behavior/internal/ClusterStatics.js.map +6 -0
  290. package/dist/esm/behavior/internal/ModeledState.d.ts +18 -0
  291. package/dist/esm/behavior/internal/ModeledState.d.ts.map +1 -0
  292. package/dist/esm/behavior/internal/ModeledState.js +34 -0
  293. package/dist/esm/behavior/internal/ModeledState.js.map +6 -0
  294. package/dist/esm/behavior/internal/ServerBehaviorBacking.d.ts +1 -1
  295. package/dist/esm/behavior/internal/ServerBehaviorBacking.d.ts.map +1 -1
  296. package/dist/esm/behavior/internal/ServerBehaviorBacking.js +3 -12
  297. package/dist/esm/behavior/internal/ServerBehaviorBacking.js.map +1 -1
  298. package/dist/esm/behavior/state/managed/Datasource.d.ts +54 -10
  299. package/dist/esm/behavior/state/managed/Datasource.d.ts.map +1 -1
  300. package/dist/esm/behavior/state/managed/Datasource.js +107 -38
  301. package/dist/esm/behavior/state/managed/Datasource.js.map +1 -1
  302. package/dist/esm/behavior/state/managed/Internal.d.ts +20 -5
  303. package/dist/esm/behavior/state/managed/Internal.d.ts.map +1 -1
  304. package/dist/esm/behavior/state/managed/Internal.js +28 -26
  305. package/dist/esm/behavior/state/managed/Internal.js.map +1 -1
  306. package/dist/esm/behavior/state/managed/ManagedReference.d.ts +56 -12
  307. package/dist/esm/behavior/state/managed/ManagedReference.d.ts.map +1 -1
  308. package/dist/esm/behavior/state/managed/ManagedReference.js +103 -43
  309. package/dist/esm/behavior/state/managed/ManagedReference.js.map +1 -1
  310. package/dist/esm/behavior/state/managed/NameResolver.js +1 -1
  311. package/dist/esm/behavior/state/managed/NameResolver.js.map +1 -1
  312. package/dist/esm/behavior/state/managed/ReadOnlyReference.d.ts +33 -0
  313. package/dist/esm/behavior/state/managed/ReadOnlyReference.d.ts.map +1 -0
  314. package/dist/esm/behavior/state/managed/ReadOnlyReference.js +45 -0
  315. package/dist/esm/behavior/state/managed/ReadOnlyReference.js.map +6 -0
  316. package/dist/esm/behavior/state/managed/ValReference.d.ts +80 -13
  317. package/dist/esm/behavior/state/managed/ValReference.d.ts.map +1 -1
  318. package/dist/esm/behavior/state/managed/ValReference.js +28 -0
  319. package/dist/esm/behavior/state/managed/ValReference.js.map +2 -2
  320. package/dist/esm/behavior/state/managed/errors.d.ts +25 -0
  321. package/dist/esm/behavior/state/managed/errors.d.ts.map +1 -0
  322. package/dist/esm/behavior/state/managed/errors.js +20 -0
  323. package/dist/esm/behavior/state/managed/errors.js.map +6 -0
  324. package/dist/esm/behavior/state/managed/index.d.ts +1 -0
  325. package/dist/esm/behavior/state/managed/index.d.ts.map +1 -1
  326. package/dist/esm/behavior/state/managed/index.js +1 -0
  327. package/dist/esm/behavior/state/managed/index.js.map +1 -1
  328. package/dist/esm/behavior/state/managed/values/BitmapManager.js +6 -21
  329. package/dist/esm/behavior/state/managed/values/BitmapManager.js.map +1 -1
  330. package/dist/esm/behavior/state/managed/values/ListManager.d.ts +0 -5
  331. package/dist/esm/behavior/state/managed/values/ListManager.d.ts.map +1 -1
  332. package/dist/esm/behavior/state/managed/values/ListManager.js +277 -144
  333. package/dist/esm/behavior/state/managed/values/ListManager.js.map +2 -2
  334. package/dist/esm/behavior/state/managed/values/StructManager.d.ts.map +1 -1
  335. package/dist/esm/behavior/state/managed/values/StructManager.js +31 -36
  336. package/dist/esm/behavior/state/managed/values/StructManager.js.map +2 -2
  337. package/dist/esm/behavior/state/managed/values/ValuePatcher.d.ts +8 -0
  338. package/dist/esm/behavior/state/managed/values/ValuePatcher.d.ts.map +1 -1
  339. package/dist/esm/behavior/state/managed/values/ValuePatcher.js +13 -2
  340. package/dist/esm/behavior/state/managed/values/ValuePatcher.js.map +1 -1
  341. package/dist/esm/behavior/state/validation/FabricIndexField.d.ts +30 -0
  342. package/dist/esm/behavior/state/validation/FabricIndexField.d.ts.map +1 -0
  343. package/dist/esm/behavior/state/validation/FabricIndexField.js +33 -0
  344. package/dist/esm/behavior/state/validation/FabricIndexField.js.map +6 -0
  345. package/dist/esm/behavior/state/validation/ValueValidator.d.ts.map +1 -1
  346. package/dist/esm/behavior/state/validation/ValueValidator.js +17 -37
  347. package/dist/esm/behavior/state/validation/ValueValidator.js.map +1 -1
  348. package/dist/esm/behavior/state/validation/conformance.d.ts.map +1 -1
  349. package/dist/esm/behavior/state/validation/conformance.js +6 -5
  350. package/dist/esm/behavior/state/validation/conformance.js.map +1 -1
  351. package/dist/esm/behavior/state/validation/constraint.d.ts.map +1 -1
  352. package/dist/esm/behavior/state/validation/constraint.js +3 -1
  353. package/dist/esm/behavior/state/validation/constraint.js.map +1 -1
  354. package/dist/esm/behavior/state/validation/location.d.ts +6 -0
  355. package/dist/esm/behavior/state/validation/location.d.ts.map +1 -1
  356. package/dist/esm/behavior/state/validation/remote-validation.d.ts +57 -0
  357. package/dist/esm/behavior/state/validation/remote-validation.d.ts.map +1 -0
  358. package/dist/esm/behavior/state/validation/remote-validation.js +48 -0
  359. package/dist/esm/behavior/state/validation/remote-validation.js.map +6 -0
  360. package/dist/esm/behavior/supervision/Supervision.d.ts.map +1 -1
  361. package/dist/esm/behavior/supervision/Supervision.js +1 -1
  362. package/dist/esm/behavior/supervision/Supervision.js.map +1 -1
  363. package/dist/esm/behavior/supervision/SupervisionConfig.d.ts.map +1 -1
  364. package/dist/esm/behavior/supervision/SupervisionConfig.js +1 -1
  365. package/dist/esm/behavior/supervision/SupervisionConfig.js.map +1 -1
  366. package/dist/esm/behavior/supervision/ValueSupervisor.d.ts +3 -12
  367. package/dist/esm/behavior/supervision/ValueSupervisor.d.ts.map +1 -1
  368. package/dist/esm/behavior/system/commissioning/CommissioningClient.d.ts +57 -6
  369. package/dist/esm/behavior/system/commissioning/CommissioningClient.d.ts.map +1 -1
  370. package/dist/esm/behavior/system/commissioning/CommissioningClient.js +87 -0
  371. package/dist/esm/behavior/system/commissioning/CommissioningClient.js.map +1 -1
  372. package/dist/esm/behavior/system/commissioning/RemoteDescriptor.d.ts +9 -1
  373. package/dist/esm/behavior/system/commissioning/RemoteDescriptor.d.ts.map +1 -1
  374. package/dist/esm/behavior/system/commissioning/RemoteDescriptor.js +10 -1
  375. package/dist/esm/behavior/system/commissioning/RemoteDescriptor.js.map +1 -1
  376. package/dist/esm/behavior/system/controller/ControllerBehavior.d.ts +2 -1
  377. package/dist/esm/behavior/system/controller/ControllerBehavior.d.ts.map +1 -1
  378. package/dist/esm/behavior/system/controller/ControllerBehavior.js +2 -1
  379. package/dist/esm/behavior/system/controller/ControllerBehavior.js.map +1 -1
  380. package/dist/esm/behavior/system/dcl/DclBehavior.d.ts +3 -3
  381. package/dist/esm/behavior/system/network/ServerGroupNetworking.d.ts +2 -1
  382. package/dist/esm/behavior/system/network/ServerGroupNetworking.d.ts.map +1 -1
  383. package/dist/esm/behavior/system/network/ServerGroupNetworking.js.map +1 -1
  384. package/dist/esm/behavior/system/remote/api/ApiResource.d.ts +14 -0
  385. package/dist/esm/behavior/system/remote/api/ApiResource.d.ts.map +1 -1
  386. package/dist/esm/behavior/system/remote/api/ApiResource.js +19 -0
  387. package/dist/esm/behavior/system/remote/api/ApiResource.js.map +1 -1
  388. package/dist/esm/behavior/system/remote/api/Envelope.d.ts +4 -2
  389. package/dist/esm/behavior/system/remote/api/Envelope.d.ts.map +1 -1
  390. package/dist/esm/behavior/system/remote/api/Envelope.js +7 -5
  391. package/dist/esm/behavior/system/remote/api/Envelope.js.map +1 -1
  392. package/dist/esm/behavior/system/remote/api/resources/CommandResource.js +2 -2
  393. package/dist/esm/behavior/system/remote/api/resources/CommandResource.js.map +1 -1
  394. package/dist/esm/behavior/system/remote/api/resources/NodeResource.d.ts +1 -0
  395. package/dist/esm/behavior/system/remote/api/resources/NodeResource.d.ts.map +1 -1
  396. package/dist/esm/behavior/system/remote/api/resources/NodeResource.js +3 -0
  397. package/dist/esm/behavior/system/remote/api/resources/NodeResource.js.map +1 -1
  398. package/dist/esm/behavior/system/remote/api/resources/PropertyResource.d.ts.map +1 -1
  399. package/dist/esm/behavior/system/remote/api/resources/PropertyResource.js +5 -3
  400. package/dist/esm/behavior/system/remote/api/resources/PropertyResource.js.map +1 -1
  401. package/dist/esm/behavior/system/remote/api/resources/ServerNodeResource.d.ts.map +1 -1
  402. package/dist/esm/behavior/system/remote/api/resources/ServerNodeResource.js +2 -11
  403. package/dist/esm/behavior/system/remote/api/resources/ServerNodeResource.js.map +1 -1
  404. package/dist/esm/behavior/system/sessions/SessionsBehavior.d.ts +4 -0
  405. package/dist/esm/behavior/system/sessions/SessionsBehavior.d.ts.map +1 -1
  406. package/dist/esm/behavior/system/sessions/SessionsBehavior.js +6 -1
  407. package/dist/esm/behavior/system/sessions/SessionsBehavior.js.map +1 -1
  408. package/dist/esm/behavior/system/subscriptions/SubscriptionStore.d.ts +28 -0
  409. package/dist/esm/behavior/system/subscriptions/SubscriptionStore.d.ts.map +1 -0
  410. package/dist/esm/behavior/system/subscriptions/SubscriptionStore.js +54 -0
  411. package/dist/esm/behavior/system/subscriptions/SubscriptionStore.js.map +6 -0
  412. package/dist/esm/behavior/system/subscriptions/SubscriptionsServer.d.ts +8 -3
  413. package/dist/esm/behavior/system/subscriptions/SubscriptionsServer.d.ts.map +1 -1
  414. package/dist/esm/behavior/system/subscriptions/SubscriptionsServer.js +61 -30
  415. package/dist/esm/behavior/system/subscriptions/SubscriptionsServer.js.map +1 -1
  416. package/dist/esm/behaviors/access-control/AccessControlServer.d.ts +2 -2
  417. package/dist/esm/behaviors/access-control/AccessControlServer.d.ts.map +1 -1
  418. package/dist/esm/behaviors/administrator-commissioning/AdministratorCommissioningServer.d.ts.map +1 -1
  419. package/dist/esm/behaviors/administrator-commissioning/AdministratorCommissioningServer.js +43 -21
  420. package/dist/esm/behaviors/administrator-commissioning/AdministratorCommissioningServer.js.map +1 -1
  421. package/dist/esm/behaviors/general-diagnostics/GeneralDiagnosticsServer.d.ts +29 -23
  422. package/dist/esm/behaviors/general-diagnostics/GeneralDiagnosticsServer.d.ts.map +1 -1
  423. package/dist/esm/behaviors/general-diagnostics/GeneralDiagnosticsServer.js +105 -60
  424. package/dist/esm/behaviors/general-diagnostics/GeneralDiagnosticsServer.js.map +1 -1
  425. package/dist/esm/behaviors/group-key-management/GroupKeyManagementServer.d.ts +9 -1
  426. package/dist/esm/behaviors/group-key-management/GroupKeyManagementServer.d.ts.map +1 -1
  427. package/dist/esm/behaviors/group-key-management/GroupKeyManagementServer.js +11 -7
  428. package/dist/esm/behaviors/group-key-management/GroupKeyManagementServer.js.map +1 -1
  429. package/dist/esm/behaviors/groupcast/GroupcastServer.d.ts.map +1 -1
  430. package/dist/esm/behaviors/groupcast/GroupcastServer.js +42 -25
  431. package/dist/esm/behaviors/groupcast/GroupcastServer.js.map +2 -2
  432. package/dist/esm/behaviors/localization-configuration/LocalizationConfigurationServer.d.ts +1 -1
  433. package/dist/esm/behaviors/localization-configuration/LocalizationConfigurationServer.d.ts.map +1 -1
  434. package/dist/esm/behaviors/localization-configuration/LocalizationConfigurationServer.js +15 -4
  435. package/dist/esm/behaviors/localization-configuration/LocalizationConfigurationServer.js.map +2 -2
  436. package/dist/esm/behaviors/operational-credentials/VendorIdVerification.d.ts +2 -0
  437. package/dist/esm/behaviors/operational-credentials/VendorIdVerification.d.ts.map +1 -1
  438. package/dist/esm/behaviors/operational-credentials/VendorIdVerification.js +32 -24
  439. package/dist/esm/behaviors/operational-credentials/VendorIdVerification.js.map +1 -1
  440. package/dist/esm/behaviors/thermostat/ThermostatServer.d.ts +15 -4
  441. package/dist/esm/behaviors/thermostat/ThermostatServer.d.ts.map +1 -1
  442. package/dist/esm/behaviors/thermostat/ThermostatServer.js +66 -49
  443. package/dist/esm/behaviors/thermostat/ThermostatServer.js.map +1 -1
  444. package/dist/esm/behaviors/time-format-localization/TimeFormatLocalizationServer.d.ts +4 -4
  445. package/dist/esm/behaviors/time-format-localization/TimeFormatLocalizationServer.d.ts.map +1 -1
  446. package/dist/esm/behaviors/time-format-localization/TimeFormatLocalizationServer.js +19 -5
  447. package/dist/esm/behaviors/time-format-localization/TimeFormatLocalizationServer.js.map +2 -2
  448. package/dist/esm/behaviors/unit-localization/UnitLocalizationServer.d.ts.map +1 -1
  449. package/dist/esm/behaviors/unit-localization/UnitLocalizationServer.js +13 -3
  450. package/dist/esm/behaviors/unit-localization/UnitLocalizationServer.js.map +1 -1
  451. package/dist/esm/endpoint/Endpoint.d.ts +5 -9
  452. package/dist/esm/endpoint/Endpoint.d.ts.map +1 -1
  453. package/dist/esm/endpoint/Endpoint.js +5 -24
  454. package/dist/esm/endpoint/Endpoint.js.map +1 -1
  455. package/dist/esm/endpoint/properties/Behaviors.d.ts.map +1 -1
  456. package/dist/esm/endpoint/properties/Behaviors.js +6 -2
  457. package/dist/esm/endpoint/properties/Behaviors.js.map +1 -1
  458. package/dist/esm/node/ClientNode.d.ts +25 -0
  459. package/dist/esm/node/ClientNode.d.ts.map +1 -1
  460. package/dist/esm/node/ClientNode.js +41 -0
  461. package/dist/esm/node/ClientNode.js.map +1 -1
  462. package/dist/esm/node/ServerNode.d.ts.map +1 -1
  463. package/dist/esm/node/ServerNode.js +2 -0
  464. package/dist/esm/node/ServerNode.js.map +1 -1
  465. package/dist/esm/node/client/ClientCommandMethod.d.ts.map +1 -1
  466. package/dist/esm/node/client/ClientCommandMethod.js +4 -16
  467. package/dist/esm/node/client/ClientCommandMethod.js.map +1 -1
  468. package/dist/esm/node/client/ClientEventEmitter.d.ts.map +1 -1
  469. package/dist/esm/node/client/ClientEventEmitter.js +6 -2
  470. package/dist/esm/node/client/ClientEventEmitter.js.map +1 -1
  471. package/dist/esm/node/client/ClientStructure.d.ts.map +1 -1
  472. package/dist/esm/node/client/ClientStructure.js +181 -108
  473. package/dist/esm/node/client/ClientStructure.js.map +2 -2
  474. package/dist/esm/node/client/Peers.d.ts +18 -6
  475. package/dist/esm/node/client/Peers.d.ts.map +1 -1
  476. package/dist/esm/node/client/Peers.js +29 -14
  477. package/dist/esm/node/client/Peers.js.map +1 -1
  478. package/dist/esm/node/integration/ChangeNotificationService.d.ts +14 -3
  479. package/dist/esm/node/integration/ChangeNotificationService.d.ts.map +1 -1
  480. package/dist/esm/node/integration/ProtocolService.d.ts.map +1 -1
  481. package/dist/esm/node/integration/ProtocolService.js +40 -57
  482. package/dist/esm/node/integration/ProtocolService.js.map +1 -1
  483. package/dist/esm/node/server/InteractionServer.d.ts.map +1 -1
  484. package/dist/esm/node/server/InteractionServer.js +28 -25
  485. package/dist/esm/node/server/InteractionServer.js.map +2 -2
  486. package/dist/esm/node/server/ServerSubscription.d.ts +7 -2
  487. package/dist/esm/node/server/ServerSubscription.d.ts.map +1 -1
  488. package/dist/esm/node/server/ServerSubscription.js +83 -47
  489. package/dist/esm/node/server/ServerSubscription.js.map +1 -1
  490. package/dist/esm/storage/EndpointStore.d.ts +1 -1
  491. package/dist/esm/storage/EndpointStore.js +1 -1
  492. package/dist/esm/storage/client/ClientEndpointStore.d.ts +2 -2
  493. package/dist/esm/storage/client/ClientEndpointStore.d.ts.map +1 -1
  494. package/dist/esm/storage/client/ClientEndpointStore.js +1 -1
  495. package/dist/esm/storage/client/DatasourceCache.d.ts +5 -3
  496. package/dist/esm/storage/client/DatasourceCache.d.ts.map +1 -1
  497. package/dist/esm/storage/client/DatasourceCache.js +68 -71
  498. package/dist/esm/storage/client/DatasourceCache.js.map +1 -1
  499. package/dist/esm/storage/client/FabricScopedListWrite.d.ts +73 -0
  500. package/dist/esm/storage/client/FabricScopedListWrite.d.ts.map +1 -0
  501. package/dist/esm/storage/client/FabricScopedListWrite.js +148 -0
  502. package/dist/esm/storage/client/FabricScopedListWrite.js.map +6 -0
  503. package/dist/esm/storage/client/RemoteWriteParticipant.d.ts +9 -6
  504. package/dist/esm/storage/client/RemoteWriteParticipant.d.ts.map +1 -1
  505. package/dist/esm/storage/client/RemoteWriteParticipant.js +11 -15
  506. package/dist/esm/storage/client/RemoteWriteParticipant.js.map +1 -1
  507. package/dist/esm/storage/client/RemoteWriter.d.ts +67 -7
  508. package/dist/esm/storage/client/RemoteWriter.d.ts.map +1 -1
  509. package/dist/esm/storage/client/RemoteWriter.js +65 -14
  510. package/dist/esm/storage/client/RemoteWriter.js.map +1 -1
  511. package/dist/esm/storage/server/DatasourceStore.d.ts +2 -2
  512. package/dist/esm/storage/server/DatasourceStore.d.ts.map +1 -1
  513. package/dist/esm/storage/server/DatasourceStore.js.map +1 -1
  514. package/dist/esm/storage/server/ServerEndpointStore.d.ts +2 -2
  515. package/dist/esm/storage/server/ServerEndpointStore.d.ts.map +1 -1
  516. package/dist/esm/storage/server/ServerEndpointStore.js +1 -1
  517. package/dist/esm/testing/mock-server-node.d.ts +2 -1
  518. package/dist/esm/testing/mock-server-node.d.ts.map +1 -1
  519. package/dist/esm/testing/mock-server-node.js +16 -7
  520. package/dist/esm/testing/mock-server-node.js.map +2 -2
  521. package/dist/esm/testing/node-helpers.d.ts +5 -0
  522. package/dist/esm/testing/node-helpers.d.ts.map +1 -1
  523. package/dist/esm/testing/node-helpers.js +4 -4
  524. package/dist/esm/testing/node-helpers.js.map +1 -1
  525. package/package.json +6 -6
  526. package/src/behavior/Behavior.ts +2 -0
  527. package/src/behavior/Events.ts +6 -3
  528. package/src/behavior/cluster/ClusterBehavior.ts +22 -13
  529. package/src/behavior/cluster/ClusterBehaviorType.ts +9 -270
  530. package/src/behavior/context/server/LocalActorContext.ts +1 -4
  531. package/src/behavior/internal/BehaviorBacking.ts +10 -2
  532. package/src/behavior/internal/ClusterDerivation.ts +295 -0
  533. package/src/behavior/internal/ClusterStatics.ts +180 -0
  534. package/src/behavior/internal/ModeledState.ts +58 -0
  535. package/src/behavior/internal/ServerBehaviorBacking.ts +9 -16
  536. package/src/behavior/state/managed/Datasource.ts +181 -58
  537. package/src/behavior/state/managed/Internal.ts +44 -34
  538. package/src/behavior/state/managed/ManagedReference.ts +159 -70
  539. package/src/behavior/state/managed/NameResolver.ts +1 -1
  540. package/src/behavior/state/managed/ReadOnlyReference.ts +61 -0
  541. package/src/behavior/state/managed/ValReference.ts +104 -14
  542. package/src/behavior/state/managed/errors.ts +33 -0
  543. package/src/behavior/state/managed/index.ts +1 -0
  544. package/src/behavior/state/managed/values/BitmapManager.ts +6 -22
  545. package/src/behavior/state/managed/values/ListManager.ts +313 -164
  546. package/src/behavior/state/managed/values/StructManager.ts +48 -52
  547. package/src/behavior/state/managed/values/ValuePatcher.ts +25 -3
  548. package/src/behavior/state/validation/FabricIndexField.ts +51 -0
  549. package/src/behavior/state/validation/ValueValidator.ts +24 -54
  550. package/src/behavior/state/validation/conformance.ts +9 -7
  551. package/src/behavior/state/validation/constraint.ts +5 -1
  552. package/src/behavior/state/validation/location.ts +8 -0
  553. package/src/behavior/state/validation/remote-validation.ts +107 -0
  554. package/src/behavior/supervision/Supervision.ts +1 -2
  555. package/src/behavior/supervision/SupervisionConfig.ts +1 -2
  556. package/src/behavior/supervision/ValueSupervisor.ts +3 -13
  557. package/src/behavior/system/commissioning/CommissioningClient.ts +122 -6
  558. package/src/behavior/system/commissioning/RemoteDescriptor.ts +17 -1
  559. package/src/behavior/system/controller/ControllerBehavior.ts +2 -1
  560. package/src/behavior/system/dcl/DclBehavior.ts +3 -3
  561. package/src/behavior/system/network/ServerGroupNetworking.ts +3 -2
  562. package/src/behavior/system/remote/api/ApiResource.ts +23 -0
  563. package/src/behavior/system/remote/api/Envelope.ts +8 -6
  564. package/src/behavior/system/remote/api/resources/CommandResource.ts +2 -2
  565. package/src/behavior/system/remote/api/resources/NodeResource.ts +4 -0
  566. package/src/behavior/system/remote/api/resources/PropertyResource.ts +5 -3
  567. package/src/behavior/system/remote/api/resources/ServerNodeResource.ts +2 -13
  568. package/src/behavior/system/sessions/SessionsBehavior.ts +8 -2
  569. package/src/behavior/system/subscriptions/SubscriptionStore.ts +66 -0
  570. package/src/behavior/system/subscriptions/SubscriptionsServer.ts +73 -33
  571. package/src/behaviors/access-control/AccessControlServer.ts +3 -3
  572. package/src/behaviors/administrator-commissioning/AdministratorCommissioningServer.ts +47 -24
  573. package/src/behaviors/general-diagnostics/GeneralDiagnosticsServer.ts +138 -84
  574. package/src/behaviors/group-key-management/GroupKeyManagementServer.ts +12 -8
  575. package/src/behaviors/groupcast/GroupcastServer.ts +50 -34
  576. package/src/behaviors/localization-configuration/LocalizationConfigurationServer.ts +18 -6
  577. package/src/behaviors/operational-credentials/VendorIdVerification.ts +50 -35
  578. package/src/behaviors/thermostat/ThermostatServer.ts +93 -70
  579. package/src/behaviors/time-format-localization/TimeFormatLocalizationServer.ts +24 -9
  580. package/src/behaviors/unit-localization/UnitLocalizationServer.ts +17 -4
  581. package/src/endpoint/Endpoint.ts +5 -31
  582. package/src/endpoint/properties/Behaviors.ts +6 -2
  583. package/src/node/ClientNode.ts +41 -0
  584. package/src/node/ServerNode.ts +2 -0
  585. package/src/node/client/ClientCommandMethod.ts +4 -19
  586. package/src/node/client/ClientEventEmitter.ts +7 -3
  587. package/src/node/client/ClientStructure.ts +208 -135
  588. package/src/node/client/Peers.ts +36 -20
  589. package/src/node/integration/ChangeNotificationService.ts +18 -3
  590. package/src/node/integration/ProtocolService.ts +45 -57
  591. package/src/node/server/InteractionServer.ts +33 -35
  592. package/src/node/server/ServerSubscription.ts +88 -50
  593. package/src/storage/EndpointStore.ts +1 -1
  594. package/src/storage/client/ClientEndpointStore.ts +1 -1
  595. package/src/storage/client/DatasourceCache.ts +86 -79
  596. package/src/storage/client/FabricScopedListWrite.ts +245 -0
  597. package/src/storage/client/RemoteWriteParticipant.ts +20 -23
  598. package/src/storage/client/RemoteWriter.ts +156 -26
  599. package/src/storage/server/DatasourceStore.ts +2 -2
  600. package/src/storage/server/ServerEndpointStore.ts +1 -1
  601. package/src/testing/mock-server-node.ts +22 -9
  602. package/src/testing/node-helpers.ts +5 -1
  603. package/dist/cjs/behavior/state/validation/FabricIndexSentinel.d.ts +0 -14
  604. package/dist/cjs/behavior/state/validation/FabricIndexSentinel.d.ts.map +0 -1
  605. package/dist/cjs/behavior/state/validation/FabricIndexSentinel.js.map +0 -6
  606. package/dist/cjs/behavior/state/validation/peer-forwarding.d.ts +0 -20
  607. package/dist/cjs/behavior/state/validation/peer-forwarding.d.ts.map +0 -1
  608. package/dist/cjs/behavior/state/validation/peer-forwarding.js.map +0 -6
  609. package/dist/esm/behavior/state/validation/FabricIndexSentinel.d.ts +0 -14
  610. package/dist/esm/behavior/state/validation/FabricIndexSentinel.d.ts.map +0 -1
  611. package/dist/esm/behavior/state/validation/FabricIndexSentinel.js +0 -15
  612. package/dist/esm/behavior/state/validation/FabricIndexSentinel.js.map +0 -6
  613. package/dist/esm/behavior/state/validation/peer-forwarding.d.ts +0 -20
  614. package/dist/esm/behavior/state/validation/peer-forwarding.d.ts.map +0 -1
  615. package/dist/esm/behavior/state/validation/peer-forwarding.js +0 -26
  616. package/dist/esm/behavior/state/validation/peer-forwarding.js.map +0 -6
  617. package/src/behavior/state/validation/FabricIndexSentinel.ts +0 -20
  618. package/src/behavior/state/validation/peer-forwarding.ts +0 -47
@@ -20,7 +20,14 @@ import {
20
20
  UnexpectedDataError,
21
21
  } from "@matter/general";
22
22
  import { Icac, Noc, PeerSet, Rcac, Vvsc } from "@matter/protocol";
23
- import { FabricId, FabricIndex, ReceivedStatusResponseError, StatusResponse, VendorId } from "@matter/types";
23
+ import {
24
+ FabricId,
25
+ FabricIndex,
26
+ ReceivedStatusResponseError,
27
+ StatusResponse,
28
+ ValidationError,
29
+ VendorId,
30
+ } from "@matter/types";
24
31
  import type { OperationalCredentials } from "@matter/types/clusters/operational-credentials";
25
32
  import { OperationalCredentialsClient } from "../operational-credentials/OperationalCredentialsClient.js";
26
33
 
@@ -163,6 +170,8 @@ export namespace VendorIdVerification {
163
170
  /**
164
171
  * Verify VendorId ownership using VID Verification protocol on pure data level
165
172
  *
173
+ * Returns `false` when a certificate the peer sent does not decode or its chain does not verify.
174
+ *
166
175
  * @see {@link MatterSpecification.v161.Core} § 6.4.10.1.
167
176
  */
168
177
  export async function verifyData(
@@ -184,38 +193,58 @@ export namespace VendorIdVerification {
184
193
  rcac,
185
194
  fabric: { vendorId: rootVendorId, vidVerificationStatement, fabricIndex },
186
195
  } = options;
187
- const {
188
- subject: { fabricId },
189
- ellipticCurvePublicKey: rootPublicKey,
190
- } = Noc.fromTlv(noc).cert;
191
-
192
- const tbs = dataToSign({
193
- fabricBindingVersion,
194
- clientChallenge,
195
- attChallenge,
196
- fabricIndex,
197
- fabric: {
198
- rootPublicKey,
199
- fabricId,
200
- rootVendorId,
201
- vidVerificationStatement,
202
- },
203
- }).signatureData;
204
196
 
197
+ let tbs: Bytes;
198
+ let vvscCert: Vvsc | undefined;
205
199
  try {
200
+ const nocCert = Noc.fromTlv(noc);
201
+ const {
202
+ subject: { fabricId },
203
+ ellipticCurvePublicKey: rootPublicKey,
204
+ } = nocCert.cert;
205
+
206
+ tbs = dataToSign({
207
+ fabricBindingVersion,
208
+ clientChallenge,
209
+ attChallenge,
210
+ fabricIndex,
211
+ fabric: {
212
+ rootPublicKey,
213
+ fabricId,
214
+ rootVendorId,
215
+ vidVerificationStatement,
216
+ },
217
+ }).signatureData;
218
+
206
219
  // Validate signature over TBS data
207
220
  await crypto.verifyEcdsa(PublicKey(rootPublicKey), tbs, new EcdsaSignature(signature));
208
221
 
209
222
  // Verify Noc cert chain using trusted root
210
223
  const rootCert = Rcac.fromTlv(rcac);
211
- const nocCert = Noc.fromTlv(noc);
212
224
  const icaCert = icac ? Icac.fromTlv(icac) : undefined;
213
225
  if (icaCert !== undefined) {
214
226
  await icaCert.verify(crypto, rootCert);
215
227
  }
216
228
  await nocCert.verify(crypto, rootCert, icaCert);
229
+
230
+ if (vidVerificationStatement && vvsc !== undefined) {
231
+ vvscCert = Vvsc.fromTlv(vvsc);
232
+ // TODO Gather and Verify the VVSC cert chain using trusted root
233
+ // Validate the path of VIDVerificationSignerCertificate using the certificates in the Operational
234
+ // Trust Anchors Schema under the expected VendorID (VID field) being verified. If
235
+ // the path is invalid (e.g. any element of the chain missing, any certificate malformed, any
236
+ // signature verification fails, etc), then the procedure terminates as failed. Only the self-
237
+ // signed certificates among the set SHALL be considered as trust anchors during certificate
238
+ // path validation. The path length SHALL NOT be longer than 3. The verifier MAY
239
+ // apply knowledge of revoked entities obtained from outside the Distributed Compliance
240
+ // Ledger.
241
+ await vvscCert.verify(crypto);
242
+ }
217
243
  } catch (error) {
218
- CryptoError.accept(error);
244
+ // TLV the peer sent that does not decode, such as a repeated or missing field, fails the verification
245
+ if (!(error instanceof UnexpectedDataError || error instanceof ValidationError)) {
246
+ CryptoError.accept(error);
247
+ }
219
248
  logger.warn("Could not verify VendorId: certificate chain verification failed", error);
220
249
  return false;
221
250
  }
@@ -231,10 +260,7 @@ export namespace VendorIdVerification {
231
260
  throw new UnexpectedDataError("VID Verification Statement is missing signature");
232
261
  }
233
262
 
234
- let vvscCert: Vvsc;
235
- if (vvsc !== undefined) {
236
- vvscCert = Vvsc.fromTlv(vvsc);
237
- } else {
263
+ if (vvscCert === undefined) {
238
264
  // TODO Fetch VVSC from DCL if needed
239
265
  // Otherwise, look up the entry in the Operational Trust Anchors Schema
240
266
  // under the expected VendorID (VID field) being verified whose IsVIDVerificationSigner
@@ -253,17 +279,6 @@ export namespace VendorIdVerification {
253
279
  );
254
280
  }
255
281
 
256
- // TODO Gather and Verify the VVSC cert chain using trusted root
257
- // Validate the path of VIDVerificationSignerCertificate using the certificates in the Operational
258
- // Trust Anchors Schema under the expected VendorID (VID field) being verified. If
259
- // the path is invalid (e.g. any element of the chain missing, any certificate malformed, any
260
- // signature verification fails, etc), then the procedure terminates as failed. Only the self-
261
- // signed certificates among the set SHALL be considered as trust anchors during certificate
262
- // path validation. The path length SHALL NOT be longer than 3. The verifier MAY
263
- // apply knowledge of revoked entities obtained from outside the Distributed Compliance
264
- // Ledger.
265
- await vvscCert.verify(crypto);
266
-
267
282
  const ourStatement = createStatementBytes({
268
283
  version: vidStatementVersion,
269
284
  fabricBindingMessage: tbs,
@@ -1292,16 +1292,32 @@ export class ThermostatBaseServer extends ThermostatBehaviorLogicBase {
1292
1292
 
1293
1293
  /**
1294
1294
  * A stored write is already applied when validation runs, so the presets it replaces are the baseline.
1295
+ *
1296
+ * Pre-commit announces the presets again after any change in flight, with the previous announcement as
1297
+ * `oldPresets`. Every announcement is therefore validated against the presets the first announcement of the
1298
+ * transaction replaces.
1299
+ *
1300
+ * Once initialized, the presets stay stored: a transaction that leaves `persistedPresets` undefined fails with an
1301
+ * {@link ImplementationError}.
1295
1302
  */
1296
1303
  #handlePersistedPresetsChanging(
1297
- newPresets: Thermostat.Preset[],
1304
+ newPresets: Thermostat.Preset[] | undefined,
1298
1305
  oldPresets: Thermostat.Preset[] | undefined,
1299
1306
  context: ActionContext,
1300
1307
  ) {
1308
+ if (newPresets === undefined) {
1309
+ throw new ImplementationError(
1310
+ `Cannot clear persistedPresets of ${this.endpoint}; store an empty list to remove all presets`,
1311
+ );
1312
+ }
1313
+
1301
1314
  const presets = this.#presetsIn(context);
1315
+ presets.stored ??= { presets: oldPresets };
1316
+ const storedPresets = presets.stored.presets;
1302
1317
 
1303
- this.#validatePresetWriteRequest(newPresets, oldPresets, presets.handles);
1304
- this.#normalizeAndValidatePresetCommit(newPresets, oldPresets, presets.handles);
1318
+ this.#validatePresetWriteRequest(newPresets, storedPresets, presets.handles);
1319
+ this.#normalizePresets(newPresets, storedPresets, presets.handles);
1320
+ this.#validatePresetCommit(newPresets, storedPresets);
1305
1321
 
1306
1322
  if (!presets.validatesOnceSettled) {
1307
1323
  context.transaction.addParticipants({
@@ -1329,8 +1345,12 @@ export class ThermostatBaseServer extends ThermostatBehaviorLogicBase {
1329
1345
  * What this behavior did to the presets of the transaction in context.
1330
1346
  *
1331
1347
  * `handles` are the ones this device issued. Normalization mutates the value in flight, so pre-commit announces
1332
- * the presets again, and an atomic write stores what it staged; both carry handles the baseline predates. Every
1333
- * announcement is still validated - the handles are what the client did not supply.
1348
+ * the presets again, and an atomic write stores what it staged; both carry handles the stored presets do not carry.
1349
+ * Every announcement is still validated - the handles are what the client did not supply.
1350
+ *
1351
+ * `stored` holds the presets the transaction replaces, as the first announcement reports them. Later announcements
1352
+ * report the value in flight as the old value instead. `stored` wraps the presets because they are undefined
1353
+ * while the behavior seeds them, and that first announcement still counts as recorded.
1334
1354
  *
1335
1355
  * `validatesOnceSettled` records that the transaction will check the settled presets. An observer that puts back
1336
1356
  * exactly the value it was handed leaves pre-commit nothing to announce, so a revert of the handle this device
@@ -1367,8 +1387,6 @@ export class ThermostatBaseServer extends ThermostatBehaviorLogicBase {
1367
1387
  const oldPresetsMap = new Map<string, Thermostat.Preset>();
1368
1388
  if (oldPresets !== undefined) {
1369
1389
  for (const preset of oldPresets) {
1370
- // Pre-commit announces the presets again after normalization, so the value this one replaces is the
1371
- // one a client wrote, where a preset it is adding carries no handle yet
1372
1390
  if (preset.presetHandle !== null) {
1373
1391
  oldPresetsMap.set(Bytes.toHex(preset.presetHandle), preset);
1374
1392
  }
@@ -1484,14 +1502,12 @@ export class ThermostatBaseServer extends ThermostatBehaviorLogicBase {
1484
1502
  }
1485
1503
 
1486
1504
  /**
1487
- * Handles additional validation of preset changes when all chunks were written in an atomic write operation.
1505
+ * Refuses a commit that removes a built-in preset or the active preset, once every attribute of the atomic write is
1506
+ * staged, so the failure names the presets attribute. The staged value is a copy the store does not keep, so it is
1507
+ * checked, not normalized; pre-commit normalizes the stored value.
1488
1508
  */
1489
- #handlePresetsAtomicChanged(
1490
- newPresets: Thermostat.Preset[],
1491
- oldPresets: Thermostat.Preset[] | undefined,
1492
- context: ActionContext,
1493
- ) {
1494
- this.#normalizeAndValidatePresetCommit(newPresets, oldPresets, this.#presetsIn(context).handles);
1509
+ #handlePresetsAtomicChanged(newPresets: Thermostat.Preset[], oldPresets: Thermostat.Preset[] | undefined) {
1510
+ this.#validatePresetCommit(newPresets, oldPresets);
1495
1511
  }
1496
1512
 
1497
1513
  /**
@@ -1503,71 +1519,49 @@ export class ThermostatBaseServer extends ThermostatBehaviorLogicBase {
1503
1519
  }
1504
1520
 
1505
1521
  /**
1506
- * Assigns a handle to any preset lacking one and validates the set, for both the atomic and the stored path.
1522
+ * Assigns a handle to any preset lacking one and resolves a null `builtIn` from the stored preset with that handle.
1523
+ * Normalizes in place: the report that follows reads the presets back through the attribute's accessor.
1507
1524
  */
1508
- #normalizeAndValidatePresetCommit(
1525
+ #normalizePresets(
1509
1526
  newPresets: Thermostat.Preset[],
1510
1527
  oldPresets: Thermostat.Preset[] | undefined,
1511
1528
  issuedHandles: Set<string>,
1512
1529
  ) {
1513
- if (oldPresets === undefined) {
1514
- logger.debug(
1515
- "Old presets is undefined, skipping some checks. This should only happen on setup of the behavior.",
1516
- );
1517
- }
1518
-
1519
1530
  const entropy = this.endpoint.env.get(Entropy);
1520
- const newPresetHandles = new Set<string>();
1521
1531
 
1522
- // Normalized in place: the report that follows reads these back through the attribute's accessor
1523
1532
  for (const preset of newPresets) {
1524
1533
  if (preset.presetHandle == null) {
1525
1534
  logger.debug("Preset is missing presetHandle, generating a new one");
1526
1535
  preset.presetHandle = entropy.randomBytes(16);
1527
1536
  issuedHandles.add(Bytes.toHex(preset.presetHandle));
1528
1537
  }
1529
- newPresetHandles.add(Bytes.toHex(preset.presetHandle));
1530
- if (oldPresets === undefined) {
1531
- if (preset.builtIn === null) {
1532
- preset.builtIn = false;
1533
- }
1534
- } else {
1535
- if (preset.builtIn === null) {
1536
- const oldPreset = oldPresets.find(
1537
- p =>
1538
- p.presetHandle &&
1539
- preset.presetHandle &&
1540
- Bytes.areEqual(p.presetHandle, preset.presetHandle),
1541
- );
1542
- if (oldPreset !== undefined) {
1543
- preset.builtIn = oldPreset.builtIn;
1544
- } else {
1545
- preset.builtIn = false;
1546
- }
1547
- }
1538
+ if (preset.builtIn === null) {
1539
+ const { presetHandle } = preset;
1540
+ const oldPreset = oldPresets?.find(
1541
+ p => p.presetHandle !== null && Bytes.areEqual(p.presetHandle, presetHandle),
1542
+ );
1543
+ preset.builtIn = oldPreset?.builtIn ?? false;
1548
1544
  }
1549
1545
  }
1546
+ }
1550
1547
 
1551
- const newBuildInPresets = new Set<string>();
1552
- for (const preset of newPresets) {
1553
- if (preset.builtIn) {
1554
- newBuildInPresets.add(Bytes.toHex(preset.presetHandle!));
1555
- }
1556
- }
1557
- const oldBuildInPresets = new Set<string>();
1558
- if (oldPresets !== undefined) {
1559
- for (const preset of oldPresets) {
1560
- if (preset.builtIn && preset.presetHandle !== null) {
1561
- oldBuildInPresets.add(Bytes.toHex(preset.presetHandle));
1562
- }
1548
+ /**
1549
+ * Refuses presets that drop a built-in preset or the active preset. Checks handles only, so it needs no
1550
+ * normalization: {@link #validatePresetWriteRequest} already refused a preset whose `builtIn` differs from the
1551
+ * stored one, and a preset without a handle is new.
1552
+ */
1553
+ #validatePresetCommit(newPresets: Thermostat.Preset[], oldPresets: Thermostat.Preset[] | undefined) {
1554
+ const newPresetHandles = new Set<string>();
1555
+ for (const { presetHandle } of newPresets) {
1556
+ if (presetHandle != null) {
1557
+ newPresetHandles.add(Bytes.toHex(presetHandle));
1563
1558
  }
1564
1559
  }
1565
1560
 
1566
- // Ensure built-in presets are not removed
1567
- for (const oldBuiltInPreset of oldBuildInPresets) {
1568
- if (!newBuildInPresets.has(oldBuiltInPreset)) {
1561
+ for (const { presetHandle, builtIn } of oldPresets ?? []) {
1562
+ if (builtIn && presetHandle !== null && !newPresetHandles.has(Bytes.toHex(presetHandle))) {
1569
1563
  throw new StatusResponse.ConstraintErrorError(
1570
- `Cannot remove built-in preset with presetHandle ${oldBuiltInPreset}`,
1564
+ `Cannot remove built-in preset with presetHandle ${Bytes.toHex(presetHandle)}`,
1571
1565
  );
1572
1566
  }
1573
1567
  }
@@ -1691,12 +1685,13 @@ export namespace ThermostatBaseServer {
1691
1685
  return pendingValue as Thermostat.Preset[];
1692
1686
  }
1693
1687
 
1694
- return (
1695
- state.persistedPresets ??
1696
- configuredPresets(endpoint) ??
1697
- presetsIn(thermostat.defaults) ??
1698
- []
1699
- );
1688
+ if (state.persistedPresets !== undefined) {
1689
+ return state.persistedPresets;
1690
+ }
1691
+
1692
+ const internal = endpoint.behaviors.internalsOf(ThermostatBaseServer);
1693
+ return (internal.defaultPresets ??=
1694
+ configuredPresets(endpoint) ?? presetsIn(thermostat.defaults) ?? []);
1700
1695
  },
1701
1696
 
1702
1697
  set(value: Thermostat.Preset[]) {
@@ -1727,9 +1722,21 @@ export namespace ThermostatBaseServer {
1727
1722
  Observable<[value: number, oldValue: number, context: ActionContext]>();
1728
1723
  externallyMeasuredOccupancy$Changed = Observable<[value: boolean, oldValue: boolean, context: ActionContext]>();
1729
1724
  persistedPresets$Changed =
1730
- Observable<[value: Thermostat.Preset[], oldValue: Thermostat.Preset[], context: ActionContext]>();
1725
+ Observable<
1726
+ [
1727
+ value: Thermostat.Preset[] | undefined,
1728
+ oldValue: Thermostat.Preset[] | undefined,
1729
+ context: ActionContext,
1730
+ ]
1731
+ >();
1731
1732
  persistedPresets$Changing =
1732
- Observable<[value: Thermostat.Preset[], oldValue: Thermostat.Preset[], context: ActionContext]>();
1733
+ Observable<
1734
+ [
1735
+ value: Thermostat.Preset[] | undefined,
1736
+ oldValue: Thermostat.Preset[] | undefined,
1737
+ context: ActionContext,
1738
+ ]
1739
+ >();
1733
1740
 
1734
1741
  /**
1735
1742
  * Custom event emitted when the calibrated temperature changes.
@@ -1776,13 +1783,29 @@ export namespace ThermostatBaseServer {
1776
1783
  controlSequenceOfOperation!: Thermostat.ControlSequenceOfOperation;
1777
1784
 
1778
1785
  /**
1779
- * What this behavior did to the presets of each transaction in flight: the handles it issued, which no
1780
- * baseline within that transaction carries, and whether it enlisted the check of the settled presets.
1786
+ * The presets the `presets` getter serves until `persistedPresets` is set. One copy, because a getter returns
1787
+ * the same list on every read (see {@link Val.Dynamic}).
1788
+ *
1789
+ * After initialization the getter serves it only inside a transaction that sets `persistedPresets` to
1790
+ * undefined, which cannot commit unless it stores presets again.
1791
+ */
1792
+ defaultPresets?: Thermostat.Preset[];
1793
+
1794
+ /**
1795
+ * What this behavior did to the presets of each transaction in flight: the handles it issued, the presets the
1796
+ * transaction replaces, and whether it enlisted the check of the settled presets.
1781
1797
  *
1782
1798
  * Several transactions reach one endpoint at a time: an atomic write announces its staged presets before it
1783
1799
  * takes any lock.
1784
1800
  */
1785
- presetTransactions = new WeakMap<Transaction, { handles: Set<string>; validatesOnceSettled?: boolean }>();
1801
+ presetTransactions = new WeakMap<
1802
+ Transaction,
1803
+ {
1804
+ handles: Set<string>;
1805
+ stored?: { presets: Thermostat.Preset[] | undefined };
1806
+ validatesOnceSettled?: boolean;
1807
+ }
1808
+ >();
1786
1809
  }
1787
1810
  }
1788
1811
 
@@ -18,16 +18,31 @@ export class TimeFormatLocalizationServer extends TimeFormatLocalizationBehavior
18
18
  if (this.state.hourFormat === undefined) {
19
19
  this.state.hourFormat = this.detectedHourFormat;
20
20
  }
21
- if (this.state.activeCalendarType === undefined) {
22
- this.state.activeCalendarType = this.detectedCalendarType;
21
+ if (!this.features.calendarFormat) {
22
+ return;
23
23
  }
24
- if (this.state.supportedCalendarTypes === undefined) {
25
- this.state.supportedCalendarTypes = [this.state.activeCalendarType];
24
+ if (!this.state.supportedCalendarTypes?.length) {
25
+ const calendarType = this.state.activeCalendarType ?? this.detectedCalendarType;
26
+ this.state.supportedCalendarTypes = [calendarType];
27
+ this.state.activeCalendarType = calendarType;
26
28
  }
29
+ const { activeCalendarType, supportedCalendarTypes } = this.state;
30
+ if (activeCalendarType !== undefined && supportedCalendarTypes.includes(activeCalendarType)) {
31
+ return;
32
+ }
33
+
34
+ const detected = this.detectedCalendarType;
35
+ const calendarType = supportedCalendarTypes.includes(detected) ? detected : supportedCalendarTypes[0];
36
+ if (activeCalendarType !== undefined) {
37
+ logger.warn(
38
+ `Active calendar type ${TimeFormatLocalization.CalendarType[activeCalendarType]} is not in supportedCalendarTypes, using ${TimeFormatLocalization.CalendarType[calendarType]}`,
39
+ );
40
+ }
41
+ this.state.activeCalendarType = calendarType;
27
42
  }
28
43
 
29
44
  /** Override this getter with own implementation to detect the hour format of the system. */
30
- get detectedHourFormat() {
45
+ get detectedHourFormat(): TimeFormatLocalization.HourFormat {
31
46
  if (Intl.DateTimeFormat(undefined, { hour: "numeric" }).resolvedOptions().hour12) {
32
47
  return TimeFormatLocalization.HourFormat["12Hr"];
33
48
  }
@@ -35,7 +50,7 @@ export class TimeFormatLocalizationServer extends TimeFormatLocalizationBehavior
35
50
  }
36
51
 
37
52
  /** Override this getter with own implementation to detect the calendar type of the system. */
38
- get detectedCalendarType() {
53
+ get detectedCalendarType(): TimeFormatLocalization.CalendarType {
39
54
  const type = Intl.DateTimeFormat().resolvedOptions().calendar;
40
55
  switch (type) {
41
56
  case "buddhist":
@@ -75,7 +90,7 @@ export class TimeFormatLocalizationServer extends TimeFormatLocalizationBehavior
75
90
  return TimeFormatLocalization.CalendarType.Persian;
76
91
 
77
92
  default:
78
- logger.warn(`Unmapped calendar type "${type}"; falling back to Gregorian`);
93
+ logger.info(`Unmapped calendar type "${type}"; falling back to Gregorian`);
79
94
  return TimeFormatLocalization.CalendarType.Gregorian;
80
95
  }
81
96
  }
@@ -83,7 +98,7 @@ export class TimeFormatLocalizationServer extends TimeFormatLocalizationBehavior
83
98
 
84
99
  export namespace TimeFormatLocalizationServer {
85
100
  export declare const ExtensionInterface: {
86
- detectedHourFormat: string;
87
- detectedCalendarType: string;
101
+ get detectedHourFormat(): TimeFormatLocalization.HourFormat;
102
+ get detectedCalendarType(): TimeFormatLocalization.CalendarType;
88
103
  };
89
104
  }
@@ -4,23 +4,36 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- import { MaybePromise } from "@matter/general";
7
+ import { Logger, MaybePromise } from "@matter/general";
8
8
  import { UnitLocalization } from "@matter/types/clusters/unit-localization";
9
9
  import { UnitLocalizationBehavior } from "./UnitLocalizationBehavior.js";
10
10
 
11
+ const logger = Logger.get("UnitLocalizationServer");
12
+
11
13
  /**
12
14
  * This is the default server implementation of {@link UnitLocalizationBehavior}.
13
15
  */
14
16
  export class UnitLocalizationServer extends UnitLocalizationBehavior.with("TemperatureUnit") {
15
17
  override initialize(): MaybePromise {
16
- if (this.state.temperatureUnit === undefined) {
17
- this.state.temperatureUnit = UnitLocalization.TempUnit.Celsius;
18
- }
19
18
  if (!this.state.supportedTemperatureUnits?.length) {
20
19
  this.state.supportedTemperatureUnits = [
21
20
  UnitLocalization.TempUnit.Celsius,
22
21
  UnitLocalization.TempUnit.Fahrenheit,
23
22
  ];
24
23
  }
24
+ const { temperatureUnit, supportedTemperatureUnits } = this.state;
25
+ if (temperatureUnit !== undefined && supportedTemperatureUnits.includes(temperatureUnit)) {
26
+ return;
27
+ }
28
+
29
+ const unit = supportedTemperatureUnits.includes(UnitLocalization.TempUnit.Celsius)
30
+ ? UnitLocalization.TempUnit.Celsius
31
+ : supportedTemperatureUnits[0];
32
+ if (temperatureUnit !== undefined) {
33
+ logger.warn(
34
+ `Temperature unit ${UnitLocalization.TempUnit[temperatureUnit]} is not in supportedTemperatureUnits, using ${UnitLocalization.TempUnit[unit]}`,
35
+ );
36
+ }
37
+ this.state.temperatureUnit = unit;
25
38
  }
26
39
  }
@@ -31,7 +31,7 @@ import {
31
31
  } from "@matter/general";
32
32
  import { ClusterModel, DataModelPath } from "@matter/model";
33
33
  import { InteractionSettings, Read, ReadResult, Val } from "@matter/protocol";
34
- import { AttributeId, ClusterId, EndpointNumber, FabricIndex, Status } from "@matter/types";
34
+ import { AttributeId, ClusterId, EndpointNumber, Status } from "@matter/types";
35
35
  import { RootEndpoint } from "../endpoints/root.js";
36
36
  import { Agent } from "./Agent.js";
37
37
  import {
@@ -251,6 +251,10 @@ export class Endpoint<T extends EndpointType = EndpointType.Empty> {
251
251
  * This is a transactional operation. An error results in no change. The endpoint will wait for exclusive access
252
252
  * before applying changes.
253
253
  *
254
+ * On the cluster state of a client node each given attribute value is assigned whole, like `state.x = value` in an
255
+ * act, and is not merged into the cached value. On any other state, such as a local node or a local behavior of a
256
+ * client node, a struct or list is patched into the current value.
257
+ *
254
258
  * @param values the values to change
255
259
  */
256
260
  async set(values: SupportedBehaviors.StatePatchOf<T["behaviors"]>) {
@@ -895,7 +899,6 @@ export class Endpoint<T extends EndpointType = EndpointType.Empty> {
895
899
  this.#activity = this.env.get(NodeActivity);
896
900
  }
897
901
 
898
- const { clientPeerContext } = this;
899
902
  return LocalActorContext.act(
900
903
  purpose,
901
904
  context => {
@@ -904,40 +907,11 @@ export class Endpoint<T extends EndpointType = EndpointType.Empty> {
904
907
  {
905
908
  activity: this.#activity,
906
909
  lifetime: this.construction,
907
- clientPeerContext,
908
910
  abort: options?.abort,
909
911
  },
910
912
  );
911
913
  }
912
914
 
913
- /**
914
- * The peer context for actions on this endpoint if it belongs to a client node, otherwise undefined.
915
- *
916
- * @internal
917
- */
918
- get clientPeerContext(): { fabricIndexOnPeer?: FabricIndex } | undefined {
919
- const root = this.ownerOfType(RootEndpoint);
920
- if (root === undefined || (root as unknown as Node<any>).nodeType !== "client") {
921
- return undefined;
922
- }
923
- // String-keyed lookup avoids importing CommissioningClient/OperationalCredentialsClient: that would
924
- // form a cycle (Endpoint → CommissioningClient → ClientNode → Node → Endpoint).
925
- const commissioning = root.behaviors.maybeStateOf("commissioning") as
926
- | { fabricIndexOnPeer?: FabricIndex }
927
- | undefined;
928
- if (commissioning?.fabricIndexOnPeer !== undefined) {
929
- return { fabricIndexOnPeer: commissioning.fabricIndexOnPeer };
930
- }
931
- const opcreds = root.behaviors.maybeStateOf("operationalCredentials") as
932
- | { currentFabricIndex?: FabricIndex }
933
- | undefined;
934
- const fallback = opcreds?.currentFabricIndex;
935
- if (fallback !== undefined && fallback !== FabricIndex.NO_FABRIC) {
936
- return { fabricIndexOnPeer: fallback };
937
- }
938
- return {};
939
- }
940
-
941
915
  /**
942
916
  * Perform "soft" reset of the endpoint, reverting all in-memory structures to uninitialized.
943
917
  */
@@ -28,7 +28,7 @@ import {
28
28
  Transaction,
29
29
  UnexpectedDataError,
30
30
  } from "@matter/general";
31
- import { ClusterModel } from "@matter/model";
31
+ import { ClusterModel, SecretRedaction } from "@matter/model";
32
32
  import { ClusterTypeProtocol, Val } from "@matter/protocol";
33
33
  import type { ClusterId, ClusterType } from "@matter/types";
34
34
  import type { Agent } from "../Agent.js";
@@ -148,6 +148,7 @@ export class Behaviors {
148
148
 
149
149
  if (elements.attributes.size) {
150
150
  const behaviorData = new Array<unknown>();
151
+ const attributeModels = schema instanceof ClusterModel ? schema.attributes : undefined;
151
152
  for (const attributeName of elements.attributes) {
152
153
  const attr = cluster.attributes?.[attributeName];
153
154
  if (attr) {
@@ -155,7 +156,10 @@ export class Behaviors {
155
156
  attributeName,
156
157
  Diagnostic.dict({
157
158
  id: Diagnostic.hex(attr.id),
158
- val: (backing?.stateView as Val.Struct | undefined)?.[attributeName],
159
+ val: SecretRedaction.redact(
160
+ attributeModels?.(attr.id) ?? attr.schema,
161
+ (backing?.stateView as Val.Struct | undefined)?.[attributeName],
162
+ ),
159
163
  flags: Diagnostic.asFlags({
160
164
  fabricScoped: attr.schema.fabricScoped,
161
165
  }),
@@ -9,6 +9,7 @@ import { CommissioningClient } from "#behavior/system/commissioning/Commissionin
9
9
  import { ClientNetworkRuntime } from "#behavior/system/network/ClientNetworkRuntime.js";
10
10
  import { NetworkClient } from "#behavior/system/network/NetworkClient.js";
11
11
  import { NetworkRuntime } from "#behavior/system/network/NetworkRuntime.js";
12
+ import { OperationalCredentialsClient } from "#behaviors/operational-credentials";
12
13
  import { Agent } from "#endpoint/Agent.js";
13
14
  import type { Endpoint } from "#endpoint/Endpoint.js";
14
15
  import { ClientNodeEndpoints } from "#endpoint/properties/ClientNodeEndpoints.js";
@@ -33,6 +34,7 @@ import {
33
34
  } from "@matter/general";
34
35
  import { Matter, MatterModel } from "@matter/model";
35
36
  import { Interactable, OccurrenceManager, PeerAddress, PeerSet } from "@matter/protocol";
37
+ import { FabricIndex } from "@matter/types";
36
38
  import { ClientEndpointInitializer } from "./client/ClientEndpointInitializer.js";
37
39
  import { ClientNodeInteraction } from "./client/ClientNodeInteraction.js";
38
40
  import { ClientStructure } from "./client/ClientStructure.js";
@@ -83,6 +85,25 @@ export class ClientNode extends Node<ClientNode.RootEndpoint> {
83
85
 
84
86
  override readonly nodeType: "client" | "group" = "client";
85
87
 
88
+ /**
89
+ * Our fabric index on the peer, if known: `commissioning.fabricIndexOnPeer`, else
90
+ * `operationalCredentials.currentFabricIndex` unless the peer reported `FabricIndex.NO_FABRIC`.
91
+ *
92
+ * Any write of a fabric-scoped list such as `acl` needs it. The write sends only our entries and leaves out an
93
+ * entry of another fabric that equals a cached entry; it refuses any other entry of another fabric, and any write
94
+ * of a fabric-scoped list while this index is unknown.
95
+ *
96
+ * @see {@link MatterSpecification.v161.Core} § 7.19.1.8.2
97
+ */
98
+ get fabricIndexOnPeer() {
99
+ const recorded = this.maybeStateOf(CommissioningClient)?.fabricIndexOnPeer;
100
+ if (recorded !== undefined) {
101
+ return recorded;
102
+ }
103
+ const current = this.maybeStateOf(OperationalCredentialsClient)?.currentFabricIndex;
104
+ return current === FabricIndex.NO_FABRIC ? undefined : current;
105
+ }
106
+
86
107
  /**
87
108
  * Model of Matter semantics understood by this node.
88
109
  *
@@ -188,6 +209,20 @@ export class ClientNode extends Node<ClientNode.RootEndpoint> {
188
209
  });
189
210
  }
190
211
 
212
+ /**
213
+ * Replace this peer's operational certificate (NOC) with one for a new key pair, keeping node ID, fabric and ACLs.
214
+ *
215
+ * See {@link CommissioningClient.updateOperationalCertificate}. Rejects with `FabricOperationInProgressError` if a
216
+ * commission, decommission or certificate update of this node is already in progress.
217
+ */
218
+ async updateOperationalCertificate(options?: CommissioningClient.OperationalCertificateUpdateOptions) {
219
+ await this.#peers.runOperationalCertificateUpdate(this, () =>
220
+ this.act("updateOperationalCertificate", agent =>
221
+ agent.commissioning.updateOperationalCertificate(options),
222
+ ),
223
+ );
224
+ }
225
+
191
226
  /**
192
227
  * Open a Basic Commissioning Window on this peer (uses the passcode originally printed on the device).
193
228
  *
@@ -350,6 +385,12 @@ export class ClientNode extends Node<ClientNode.RootEndpoint> {
350
385
  return this.#interaction;
351
386
  }
352
387
 
388
+ /**
389
+ * The peer's operational address, or `undefined` if the peer is not commissioned or its storage is not available.
390
+ *
391
+ * Reads the commissioning state when it is loaded, otherwise a cached value or storage. So it also answers for a
392
+ * node whose commissioning state failed to load.
393
+ */
353
394
  get peerAddress(): PeerAddress | undefined {
354
395
  // Whenever the commissioning backing is loaded its state is authoritative - mirror it (set or cleared)
355
396
  // so the cache cannot survive a decommission as a stale value