@matter/protocol 0.18.0 → 0.18.1-alpha.0-20261111-b89790712

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 (527) hide show
  1. package/dist/cjs/action/Val.d.ts +8 -0
  2. package/dist/cjs/action/Val.d.ts.map +1 -1
  3. package/dist/cjs/action/client/ClientInteraction.d.ts.map +1 -1
  4. package/dist/cjs/action/client/ClientInteraction.js +19 -20
  5. package/dist/cjs/action/client/ClientInteraction.js.map +1 -1
  6. package/dist/cjs/action/client/ClientRequest.d.ts +14 -0
  7. package/dist/cjs/action/client/ClientRequest.d.ts.map +1 -1
  8. package/dist/cjs/action/client/InputChunk.js +39 -2
  9. package/dist/cjs/action/client/InputChunk.js.map +1 -1
  10. package/dist/cjs/action/errors.d.ts +3 -1
  11. package/dist/cjs/action/errors.d.ts.map +1 -1
  12. package/dist/cjs/action/errors.js +7 -2
  13. package/dist/cjs/action/errors.js.map +1 -1
  14. package/dist/cjs/action/protocols.d.ts +6 -1
  15. package/dist/cjs/action/protocols.d.ts.map +1 -1
  16. package/dist/cjs/action/request/Invoke.d.ts +24 -1
  17. package/dist/cjs/action/request/Invoke.d.ts.map +1 -1
  18. package/dist/cjs/action/request/Invoke.js +40 -12
  19. package/dist/cjs/action/request/Invoke.js.map +1 -1
  20. package/dist/cjs/action/request/Write.d.ts.map +1 -1
  21. package/dist/cjs/action/request/Write.js +6 -5
  22. package/dist/cjs/action/request/Write.js.map +1 -1
  23. package/dist/cjs/action/response/ReadResult.d.ts +14 -5
  24. package/dist/cjs/action/response/ReadResult.d.ts.map +1 -1
  25. package/dist/cjs/action/server/AttributeReadResponse.d.ts.map +1 -1
  26. package/dist/cjs/action/server/AttributeReadResponse.js +1 -1
  27. package/dist/cjs/action/server/AttributeReadResponse.js.map +1 -1
  28. package/dist/cjs/action/server/AttributeWriteResponse.d.ts.map +1 -1
  29. package/dist/cjs/action/server/AttributeWriteResponse.js +4 -2
  30. package/dist/cjs/action/server/AttributeWriteResponse.js.map +1 -1
  31. package/dist/cjs/action/server/EventReadResponse.d.ts.map +1 -1
  32. package/dist/cjs/action/server/EventReadResponse.js +1 -0
  33. package/dist/cjs/action/server/EventReadResponse.js.map +1 -1
  34. package/dist/cjs/advertisement/mdns/MdnsAdvertisement.d.ts +1 -1
  35. package/dist/cjs/advertisement/mdns/MdnsAdvertisement.d.ts.map +1 -1
  36. package/dist/cjs/advertisement/mdns/MdnsAdvertisement.js +7 -7
  37. package/dist/cjs/advertisement/mdns/MdnsAdvertisement.js.map +1 -1
  38. package/dist/cjs/ble/Ble.d.ts +2 -0
  39. package/dist/cjs/ble/Ble.d.ts.map +1 -1
  40. package/dist/cjs/ble/Ble.js +4 -0
  41. package/dist/cjs/ble/Ble.js.map +1 -1
  42. package/dist/cjs/certificate/CdSigners.d.ts +52 -0
  43. package/dist/cjs/certificate/CdSigners.d.ts.map +1 -0
  44. package/dist/cjs/certificate/CdSigners.js +111 -0
  45. package/dist/cjs/certificate/CdSigners.js.map +6 -0
  46. package/dist/cjs/certificate/CertificateAuthority.d.ts +1 -1
  47. package/dist/cjs/certificate/CertificateAuthority.d.ts.map +1 -1
  48. package/dist/cjs/certificate/DeviceAttestationValidator.d.ts +53 -7
  49. package/dist/cjs/certificate/DeviceAttestationValidator.d.ts.map +1 -1
  50. package/dist/cjs/certificate/DeviceAttestationValidator.js +114 -42
  51. package/dist/cjs/certificate/DeviceAttestationValidator.js.map +1 -1
  52. package/dist/cjs/certificate/DeviceCertification.d.ts.map +1 -1
  53. package/dist/cjs/certificate/DeviceCertification.js +5 -2
  54. package/dist/cjs/certificate/DeviceCertification.js.map +1 -1
  55. package/dist/cjs/certificate/index.d.ts +1 -0
  56. package/dist/cjs/certificate/index.d.ts.map +1 -1
  57. package/dist/cjs/certificate/index.js +1 -0
  58. package/dist/cjs/certificate/index.js.map +1 -1
  59. package/dist/cjs/certificate/kinds/AttestationCertificates.d.ts +42 -6
  60. package/dist/cjs/certificate/kinds/AttestationCertificates.d.ts.map +1 -1
  61. package/dist/cjs/certificate/kinds/AttestationCertificates.js +110 -13
  62. package/dist/cjs/certificate/kinds/AttestationCertificates.js.map +1 -1
  63. package/dist/cjs/certificate/kinds/Certificate.d.ts +13 -7
  64. package/dist/cjs/certificate/kinds/Certificate.d.ts.map +1 -1
  65. package/dist/cjs/certificate/kinds/Certificate.js +146 -240
  66. package/dist/cjs/certificate/kinds/Certificate.js.map +2 -2
  67. package/dist/cjs/certificate/kinds/CertificationDeclaration.d.ts +21 -3
  68. package/dist/cjs/certificate/kinds/CertificationDeclaration.d.ts.map +1 -1
  69. package/dist/cjs/certificate/kinds/CertificationDeclaration.js +76 -20
  70. package/dist/cjs/certificate/kinds/CertificationDeclaration.js.map +1 -1
  71. package/dist/cjs/certificate/kinds/DistinguishedName.d.ts +190 -0
  72. package/dist/cjs/certificate/kinds/DistinguishedName.d.ts.map +1 -0
  73. package/dist/cjs/certificate/kinds/DistinguishedName.js +417 -0
  74. package/dist/cjs/certificate/kinds/DistinguishedName.js.map +6 -0
  75. package/dist/cjs/certificate/kinds/Icac.d.ts.map +1 -1
  76. package/dist/cjs/certificate/kinds/Icac.js +5 -10
  77. package/dist/cjs/certificate/kinds/Icac.js.map +1 -1
  78. package/dist/cjs/certificate/kinds/Noc.d.ts.map +1 -1
  79. package/dist/cjs/certificate/kinds/Noc.js +5 -4
  80. package/dist/cjs/certificate/kinds/Noc.js.map +1 -1
  81. package/dist/cjs/certificate/kinds/OperationalBase.d.ts.map +1 -1
  82. package/dist/cjs/certificate/kinds/OperationalBase.js +4 -2
  83. package/dist/cjs/certificate/kinds/OperationalBase.js.map +1 -1
  84. package/dist/cjs/certificate/kinds/Rcac.d.ts.map +1 -1
  85. package/dist/cjs/certificate/kinds/Rcac.js +5 -10
  86. package/dist/cjs/certificate/kinds/Rcac.js.map +1 -1
  87. package/dist/cjs/certificate/kinds/Vvsc.d.ts +3 -3
  88. package/dist/cjs/certificate/kinds/Vvsc.d.ts.map +1 -1
  89. package/dist/cjs/certificate/kinds/Vvsc.js +19 -14
  90. package/dist/cjs/certificate/kinds/Vvsc.js.map +1 -1
  91. package/dist/cjs/certificate/kinds/definitions/asn.d.ts +1 -1
  92. package/dist/cjs/certificate/kinds/definitions/asn.d.ts.map +1 -1
  93. package/dist/cjs/certificate/kinds/definitions/asn.js.map +1 -1
  94. package/dist/cjs/certificate/kinds/definitions/attestation.d.ts +15 -15
  95. package/dist/cjs/certificate/kinds/definitions/attestation.d.ts.map +1 -1
  96. package/dist/cjs/certificate/kinds/definitions/base.d.ts +33 -0
  97. package/dist/cjs/certificate/kinds/definitions/base.d.ts.map +1 -1
  98. package/dist/cjs/certificate/kinds/definitions/base.js +8 -1
  99. package/dist/cjs/certificate/kinds/definitions/base.js.map +1 -1
  100. package/dist/cjs/certificate/kinds/definitions/operational.d.ts +24 -20
  101. package/dist/cjs/certificate/kinds/definitions/operational.d.ts.map +1 -1
  102. package/dist/cjs/certificate/kinds/definitions/operational.js +5 -3
  103. package/dist/cjs/certificate/kinds/definitions/operational.js.map +1 -1
  104. package/dist/cjs/codec/MessageCodec.d.ts +27 -2
  105. package/dist/cjs/codec/MessageCodec.d.ts.map +1 -1
  106. package/dist/cjs/codec/MessageCodec.js +81 -74
  107. package/dist/cjs/codec/MessageCodec.js.map +1 -1
  108. package/dist/cjs/dcl/DclCertificateService.d.ts +28 -7
  109. package/dist/cjs/dcl/DclCertificateService.d.ts.map +1 -1
  110. package/dist/cjs/dcl/DclCertificateService.js +103 -30
  111. package/dist/cjs/dcl/DclCertificateService.js.map +1 -1
  112. package/dist/cjs/fabric/Fabric.d.ts +10 -5
  113. package/dist/cjs/fabric/Fabric.d.ts.map +1 -1
  114. package/dist/cjs/fabric/Fabric.js +12 -5
  115. package/dist/cjs/fabric/Fabric.js.map +1 -1
  116. package/dist/cjs/fabric/FabricManager.d.ts +2 -2
  117. package/dist/cjs/fabric/FabricManager.js +2 -2
  118. package/dist/cjs/groups/FabricGroups.d.ts +2 -0
  119. package/dist/cjs/groups/FabricGroups.d.ts.map +1 -1
  120. package/dist/cjs/groups/FabricGroups.js +4 -0
  121. package/dist/cjs/groups/FabricGroups.js.map +1 -1
  122. package/dist/cjs/groups/Groups.d.ts +7 -0
  123. package/dist/cjs/groups/Groups.d.ts.map +1 -1
  124. package/dist/cjs/groups/Groups.js +11 -2
  125. package/dist/cjs/groups/Groups.js.map +1 -1
  126. package/dist/cjs/groups/KeySets.d.ts +3 -3
  127. package/dist/cjs/groups/KeySets.js +3 -3
  128. package/dist/cjs/mdns/InterfaceResponder.d.ts +137 -0
  129. package/dist/cjs/mdns/InterfaceResponder.d.ts.map +1 -0
  130. package/dist/cjs/mdns/InterfaceResponder.js +799 -0
  131. package/dist/cjs/mdns/InterfaceResponder.js.map +6 -0
  132. package/dist/cjs/mdns/MdnsServer.d.ts +82 -9
  133. package/dist/cjs/mdns/MdnsServer.d.ts.map +1 -1
  134. package/dist/cjs/mdns/MdnsServer.js +337 -267
  135. package/dist/cjs/mdns/MdnsServer.js.map +2 -2
  136. package/dist/cjs/peer/CommissioningConnection.d.ts.map +1 -1
  137. package/dist/cjs/peer/CommissioningConnection.js +4 -2
  138. package/dist/cjs/peer/CommissioningConnection.js.map +1 -1
  139. package/dist/cjs/peer/ControllerCommissioner.d.ts.map +1 -1
  140. package/dist/cjs/peer/ControllerCommissioner.js +48 -13
  141. package/dist/cjs/peer/ControllerCommissioner.js.map +1 -1
  142. package/dist/cjs/peer/ControllerCommissioningFlow.d.ts +7 -7
  143. package/dist/cjs/peer/ControllerCommissioningFlow.d.ts.map +1 -1
  144. package/dist/cjs/peer/ControllerCommissioningFlow.js +109 -32
  145. package/dist/cjs/peer/ControllerCommissioningFlow.js.map +1 -1
  146. package/dist/cjs/peer/Peer.d.ts +5 -0
  147. package/dist/cjs/peer/Peer.d.ts.map +1 -1
  148. package/dist/cjs/peer/Peer.js +29 -1
  149. package/dist/cjs/peer/Peer.js.map +1 -1
  150. package/dist/cjs/peer/PeerAddressStore.d.ts +37 -0
  151. package/dist/cjs/peer/PeerAddressStore.d.ts.map +1 -0
  152. package/dist/cjs/peer/PeerAddressStore.js +114 -0
  153. package/dist/cjs/peer/PeerAddressStore.js.map +6 -0
  154. package/dist/cjs/peer/PeerConnection.d.ts.map +1 -1
  155. package/dist/cjs/peer/PeerConnection.js +0 -1
  156. package/dist/cjs/peer/PeerConnection.js.map +1 -1
  157. package/dist/cjs/peer/PeerDescriptor.d.ts +3 -4
  158. package/dist/cjs/peer/PeerDescriptor.d.ts.map +1 -1
  159. package/dist/cjs/peer/PeerDescriptor.js.map +1 -1
  160. package/dist/cjs/peer/PeerExchangeProvider.d.ts.map +1 -1
  161. package/dist/cjs/peer/PeerExchangeProvider.js +2 -1
  162. package/dist/cjs/peer/PeerExchangeProvider.js.map +1 -1
  163. package/dist/cjs/peer/PeerLossContext.d.ts +10 -2
  164. package/dist/cjs/peer/PeerLossContext.d.ts.map +1 -1
  165. package/dist/cjs/peer/PhysicalDeviceProperties.d.ts +13 -0
  166. package/dist/cjs/peer/PhysicalDeviceProperties.d.ts.map +1 -1
  167. package/dist/cjs/peer/PhysicalDeviceProperties.js +3 -2
  168. package/dist/cjs/peer/PhysicalDeviceProperties.js.map +1 -1
  169. package/dist/cjs/peer/RebootResubscribeArmer.d.ts +3 -3
  170. package/dist/cjs/peer/RebootResubscribeArmer.d.ts.map +1 -1
  171. package/dist/cjs/peer/RebootResubscribeArmer.js +21 -9
  172. package/dist/cjs/peer/RebootResubscribeArmer.js.map +1 -1
  173. package/dist/cjs/peer/index.d.ts +1 -0
  174. package/dist/cjs/peer/index.d.ts.map +1 -1
  175. package/dist/cjs/peer/index.js +1 -0
  176. package/dist/cjs/peer/index.js.map +1 -1
  177. package/dist/cjs/protocol/DeviceAdvertiser.d.ts.map +1 -1
  178. package/dist/cjs/protocol/DeviceAdvertiser.js +1 -1
  179. package/dist/cjs/protocol/DeviceAdvertiser.js.map +1 -1
  180. package/dist/cjs/protocol/ExchangeManager.d.ts +0 -1
  181. package/dist/cjs/protocol/ExchangeManager.d.ts.map +1 -1
  182. package/dist/cjs/protocol/ExchangeManager.js +136 -64
  183. package/dist/cjs/protocol/ExchangeManager.js.map +1 -1
  184. package/dist/cjs/protocol/ExchangeProvider.d.ts +3 -2
  185. package/dist/cjs/protocol/ExchangeProvider.d.ts.map +1 -1
  186. package/dist/cjs/protocol/ExchangeProvider.js.map +1 -1
  187. package/dist/cjs/protocol/MessageExchange.d.ts +13 -0
  188. package/dist/cjs/protocol/MessageExchange.d.ts.map +1 -1
  189. package/dist/cjs/protocol/MessageExchange.js +16 -6
  190. package/dist/cjs/protocol/MessageExchange.js.map +1 -1
  191. package/dist/cjs/protocol/MessageReceptionState.d.ts +1 -1
  192. package/dist/cjs/protocol/errors.d.ts +7 -1
  193. package/dist/cjs/protocol/errors.d.ts.map +1 -1
  194. package/dist/cjs/protocol/errors.js +3 -0
  195. package/dist/cjs/protocol/errors.js.map +1 -1
  196. package/dist/cjs/securechannel/SecureChannelMessenger.d.ts +6 -1
  197. package/dist/cjs/securechannel/SecureChannelMessenger.d.ts.map +1 -1
  198. package/dist/cjs/securechannel/SecureChannelMessenger.js +27 -12
  199. package/dist/cjs/securechannel/SecureChannelMessenger.js.map +1 -1
  200. package/dist/cjs/session/GroupSession.d.ts +58 -15
  201. package/dist/cjs/session/GroupSession.d.ts.map +1 -1
  202. package/dist/cjs/session/GroupSession.js +97 -102
  203. package/dist/cjs/session/GroupSession.js.map +2 -2
  204. package/dist/cjs/session/NodeSession.d.ts +50 -1
  205. package/dist/cjs/session/NodeSession.d.ts.map +1 -1
  206. package/dist/cjs/session/NodeSession.js +80 -4
  207. package/dist/cjs/session/NodeSession.js.map +1 -1
  208. package/dist/cjs/session/SecureSession.d.ts +9 -0
  209. package/dist/cjs/session/SecureSession.d.ts.map +1 -1
  210. package/dist/cjs/session/SecureSession.js +12 -0
  211. package/dist/cjs/session/SecureSession.js.map +1 -1
  212. package/dist/cjs/session/Session.d.ts +2 -2
  213. package/dist/cjs/session/Session.d.ts.map +1 -1
  214. package/dist/cjs/session/Session.js +1 -1
  215. package/dist/cjs/session/SessionManager.d.ts +76 -28
  216. package/dist/cjs/session/SessionManager.d.ts.map +1 -1
  217. package/dist/cjs/session/SessionManager.js +316 -153
  218. package/dist/cjs/session/SessionManager.js.map +2 -2
  219. package/dist/cjs/session/UnsecuredSession.d.ts +0 -1
  220. package/dist/cjs/session/UnsecuredSession.d.ts.map +1 -1
  221. package/dist/cjs/session/UnsecuredSession.js +2 -4
  222. package/dist/cjs/session/UnsecuredSession.js.map +1 -1
  223. package/dist/cjs/session/case/CaseClient.d.ts +5 -0
  224. package/dist/cjs/session/case/CaseClient.d.ts.map +1 -1
  225. package/dist/cjs/session/case/CaseClient.js +12 -11
  226. package/dist/cjs/session/case/CaseClient.js.map +2 -2
  227. package/dist/cjs/session/case/CaseServer.d.ts.map +1 -1
  228. package/dist/cjs/session/case/CaseServer.js +31 -11
  229. package/dist/cjs/session/case/CaseServer.js.map +1 -1
  230. package/dist/esm/action/Val.d.ts +8 -0
  231. package/dist/esm/action/Val.d.ts.map +1 -1
  232. package/dist/esm/action/client/ClientInteraction.d.ts.map +1 -1
  233. package/dist/esm/action/client/ClientInteraction.js +19 -20
  234. package/dist/esm/action/client/ClientInteraction.js.map +1 -1
  235. package/dist/esm/action/client/ClientRequest.d.ts +14 -0
  236. package/dist/esm/action/client/ClientRequest.d.ts.map +1 -1
  237. package/dist/esm/action/client/InputChunk.js +39 -2
  238. package/dist/esm/action/client/InputChunk.js.map +1 -1
  239. package/dist/esm/action/errors.d.ts +3 -1
  240. package/dist/esm/action/errors.d.ts.map +1 -1
  241. package/dist/esm/action/errors.js +7 -2
  242. package/dist/esm/action/errors.js.map +1 -1
  243. package/dist/esm/action/protocols.d.ts +6 -1
  244. package/dist/esm/action/protocols.d.ts.map +1 -1
  245. package/dist/esm/action/request/Invoke.d.ts +24 -1
  246. package/dist/esm/action/request/Invoke.d.ts.map +1 -1
  247. package/dist/esm/action/request/Invoke.js +41 -13
  248. package/dist/esm/action/request/Invoke.js.map +1 -1
  249. package/dist/esm/action/request/Write.d.ts.map +1 -1
  250. package/dist/esm/action/request/Write.js +7 -6
  251. package/dist/esm/action/request/Write.js.map +1 -1
  252. package/dist/esm/action/response/ReadResult.d.ts +14 -5
  253. package/dist/esm/action/response/ReadResult.d.ts.map +1 -1
  254. package/dist/esm/action/server/AttributeReadResponse.d.ts.map +1 -1
  255. package/dist/esm/action/server/AttributeReadResponse.js +2 -2
  256. package/dist/esm/action/server/AttributeReadResponse.js.map +1 -1
  257. package/dist/esm/action/server/AttributeWriteResponse.d.ts.map +1 -1
  258. package/dist/esm/action/server/AttributeWriteResponse.js +11 -3
  259. package/dist/esm/action/server/AttributeWriteResponse.js.map +1 -1
  260. package/dist/esm/action/server/EventReadResponse.d.ts.map +1 -1
  261. package/dist/esm/action/server/EventReadResponse.js +1 -0
  262. package/dist/esm/action/server/EventReadResponse.js.map +1 -1
  263. package/dist/esm/advertisement/mdns/MdnsAdvertisement.d.ts +1 -1
  264. package/dist/esm/advertisement/mdns/MdnsAdvertisement.d.ts.map +1 -1
  265. package/dist/esm/advertisement/mdns/MdnsAdvertisement.js +7 -7
  266. package/dist/esm/advertisement/mdns/MdnsAdvertisement.js.map +1 -1
  267. package/dist/esm/ble/Ble.d.ts +2 -0
  268. package/dist/esm/ble/Ble.d.ts.map +1 -1
  269. package/dist/esm/ble/Ble.js +4 -0
  270. package/dist/esm/ble/Ble.js.map +1 -1
  271. package/dist/esm/certificate/CdSigners.d.ts +52 -0
  272. package/dist/esm/certificate/CdSigners.d.ts.map +1 -0
  273. package/dist/esm/certificate/CdSigners.js +91 -0
  274. package/dist/esm/certificate/CdSigners.js.map +6 -0
  275. package/dist/esm/certificate/CertificateAuthority.d.ts +1 -1
  276. package/dist/esm/certificate/CertificateAuthority.d.ts.map +1 -1
  277. package/dist/esm/certificate/DeviceAttestationValidator.d.ts +53 -7
  278. package/dist/esm/certificate/DeviceAttestationValidator.d.ts.map +1 -1
  279. package/dist/esm/certificate/DeviceAttestationValidator.js +115 -43
  280. package/dist/esm/certificate/DeviceAttestationValidator.js.map +1 -1
  281. package/dist/esm/certificate/DeviceCertification.d.ts.map +1 -1
  282. package/dist/esm/certificate/DeviceCertification.js +5 -2
  283. package/dist/esm/certificate/DeviceCertification.js.map +1 -1
  284. package/dist/esm/certificate/index.d.ts +1 -0
  285. package/dist/esm/certificate/index.d.ts.map +1 -1
  286. package/dist/esm/certificate/index.js +1 -0
  287. package/dist/esm/certificate/index.js.map +1 -1
  288. package/dist/esm/certificate/kinds/AttestationCertificates.d.ts +42 -6
  289. package/dist/esm/certificate/kinds/AttestationCertificates.d.ts.map +1 -1
  290. package/dist/esm/certificate/kinds/AttestationCertificates.js +112 -15
  291. package/dist/esm/certificate/kinds/AttestationCertificates.js.map +1 -1
  292. package/dist/esm/certificate/kinds/Certificate.d.ts +13 -7
  293. package/dist/esm/certificate/kinds/Certificate.d.ts.map +1 -1
  294. package/dist/esm/certificate/kinds/Certificate.js +153 -256
  295. package/dist/esm/certificate/kinds/Certificate.js.map +2 -2
  296. package/dist/esm/certificate/kinds/CertificationDeclaration.d.ts +21 -3
  297. package/dist/esm/certificate/kinds/CertificationDeclaration.d.ts.map +1 -1
  298. package/dist/esm/certificate/kinds/CertificationDeclaration.js +79 -20
  299. package/dist/esm/certificate/kinds/CertificationDeclaration.js.map +1 -1
  300. package/dist/esm/certificate/kinds/DistinguishedName.d.ts +190 -0
  301. package/dist/esm/certificate/kinds/DistinguishedName.d.ts.map +1 -0
  302. package/dist/esm/certificate/kinds/DistinguishedName.js +422 -0
  303. package/dist/esm/certificate/kinds/DistinguishedName.js.map +6 -0
  304. package/dist/esm/certificate/kinds/Icac.d.ts.map +1 -1
  305. package/dist/esm/certificate/kinds/Icac.js +6 -11
  306. package/dist/esm/certificate/kinds/Icac.js.map +1 -1
  307. package/dist/esm/certificate/kinds/Noc.d.ts.map +1 -1
  308. package/dist/esm/certificate/kinds/Noc.js +5 -4
  309. package/dist/esm/certificate/kinds/Noc.js.map +1 -1
  310. package/dist/esm/certificate/kinds/OperationalBase.d.ts.map +1 -1
  311. package/dist/esm/certificate/kinds/OperationalBase.js +4 -2
  312. package/dist/esm/certificate/kinds/OperationalBase.js.map +1 -1
  313. package/dist/esm/certificate/kinds/Rcac.d.ts.map +1 -1
  314. package/dist/esm/certificate/kinds/Rcac.js +6 -11
  315. package/dist/esm/certificate/kinds/Rcac.js.map +1 -1
  316. package/dist/esm/certificate/kinds/Vvsc.d.ts +3 -3
  317. package/dist/esm/certificate/kinds/Vvsc.d.ts.map +1 -1
  318. package/dist/esm/certificate/kinds/Vvsc.js +20 -15
  319. package/dist/esm/certificate/kinds/Vvsc.js.map +1 -1
  320. package/dist/esm/certificate/kinds/definitions/asn.d.ts +1 -1
  321. package/dist/esm/certificate/kinds/definitions/asn.d.ts.map +1 -1
  322. package/dist/esm/certificate/kinds/definitions/asn.js.map +1 -1
  323. package/dist/esm/certificate/kinds/definitions/attestation.d.ts +15 -15
  324. package/dist/esm/certificate/kinds/definitions/attestation.d.ts.map +1 -1
  325. package/dist/esm/certificate/kinds/definitions/base.d.ts +33 -0
  326. package/dist/esm/certificate/kinds/definitions/base.d.ts.map +1 -1
  327. package/dist/esm/certificate/kinds/definitions/base.js +9 -2
  328. package/dist/esm/certificate/kinds/definitions/base.js.map +1 -1
  329. package/dist/esm/certificate/kinds/definitions/operational.d.ts +24 -20
  330. package/dist/esm/certificate/kinds/definitions/operational.d.ts.map +1 -1
  331. package/dist/esm/certificate/kinds/definitions/operational.js +5 -3
  332. package/dist/esm/certificate/kinds/definitions/operational.js.map +1 -1
  333. package/dist/esm/codec/MessageCodec.d.ts +27 -2
  334. package/dist/esm/codec/MessageCodec.d.ts.map +1 -1
  335. package/dist/esm/codec/MessageCodec.js +82 -75
  336. package/dist/esm/codec/MessageCodec.js.map +1 -1
  337. package/dist/esm/dcl/DclCertificateService.d.ts +28 -7
  338. package/dist/esm/dcl/DclCertificateService.d.ts.map +1 -1
  339. package/dist/esm/dcl/DclCertificateService.js +108 -31
  340. package/dist/esm/dcl/DclCertificateService.js.map +1 -1
  341. package/dist/esm/fabric/Fabric.d.ts +10 -5
  342. package/dist/esm/fabric/Fabric.d.ts.map +1 -1
  343. package/dist/esm/fabric/Fabric.js +12 -5
  344. package/dist/esm/fabric/Fabric.js.map +1 -1
  345. package/dist/esm/fabric/FabricManager.d.ts +2 -2
  346. package/dist/esm/fabric/FabricManager.js +2 -2
  347. package/dist/esm/groups/FabricGroups.d.ts +2 -0
  348. package/dist/esm/groups/FabricGroups.d.ts.map +1 -1
  349. package/dist/esm/groups/FabricGroups.js +4 -0
  350. package/dist/esm/groups/FabricGroups.js.map +1 -1
  351. package/dist/esm/groups/Groups.d.ts +7 -0
  352. package/dist/esm/groups/Groups.d.ts.map +1 -1
  353. package/dist/esm/groups/Groups.js +11 -2
  354. package/dist/esm/groups/Groups.js.map +1 -1
  355. package/dist/esm/groups/KeySets.d.ts +3 -3
  356. package/dist/esm/groups/KeySets.js +3 -3
  357. package/dist/esm/mdns/InterfaceResponder.d.ts +137 -0
  358. package/dist/esm/mdns/InterfaceResponder.d.ts.map +1 -0
  359. package/dist/esm/mdns/InterfaceResponder.js +794 -0
  360. package/dist/esm/mdns/InterfaceResponder.js.map +6 -0
  361. package/dist/esm/mdns/MdnsServer.d.ts +82 -9
  362. package/dist/esm/mdns/MdnsServer.d.ts.map +1 -1
  363. package/dist/esm/mdns/MdnsServer.js +341 -273
  364. package/dist/esm/mdns/MdnsServer.js.map +2 -2
  365. package/dist/esm/peer/CommissioningConnection.d.ts.map +1 -1
  366. package/dist/esm/peer/CommissioningConnection.js +4 -2
  367. package/dist/esm/peer/CommissioningConnection.js.map +1 -1
  368. package/dist/esm/peer/ControllerCommissioner.d.ts.map +1 -1
  369. package/dist/esm/peer/ControllerCommissioner.js +48 -13
  370. package/dist/esm/peer/ControllerCommissioner.js.map +1 -1
  371. package/dist/esm/peer/ControllerCommissioningFlow.d.ts +7 -7
  372. package/dist/esm/peer/ControllerCommissioningFlow.d.ts.map +1 -1
  373. package/dist/esm/peer/ControllerCommissioningFlow.js +109 -32
  374. package/dist/esm/peer/ControllerCommissioningFlow.js.map +1 -1
  375. package/dist/esm/peer/Peer.d.ts +5 -0
  376. package/dist/esm/peer/Peer.d.ts.map +1 -1
  377. package/dist/esm/peer/Peer.js +29 -1
  378. package/dist/esm/peer/Peer.js.map +1 -1
  379. package/dist/esm/peer/PeerAddressStore.d.ts +37 -0
  380. package/dist/esm/peer/PeerAddressStore.d.ts.map +1 -0
  381. package/dist/esm/peer/PeerAddressStore.js +94 -0
  382. package/dist/esm/peer/PeerAddressStore.js.map +6 -0
  383. package/dist/esm/peer/PeerConnection.d.ts.map +1 -1
  384. package/dist/esm/peer/PeerConnection.js +0 -1
  385. package/dist/esm/peer/PeerConnection.js.map +1 -1
  386. package/dist/esm/peer/PeerDescriptor.d.ts +3 -4
  387. package/dist/esm/peer/PeerDescriptor.d.ts.map +1 -1
  388. package/dist/esm/peer/PeerDescriptor.js.map +1 -1
  389. package/dist/esm/peer/PeerExchangeProvider.d.ts.map +1 -1
  390. package/dist/esm/peer/PeerExchangeProvider.js +3 -2
  391. package/dist/esm/peer/PeerExchangeProvider.js.map +1 -1
  392. package/dist/esm/peer/PeerLossContext.d.ts +10 -2
  393. package/dist/esm/peer/PeerLossContext.d.ts.map +1 -1
  394. package/dist/esm/peer/PhysicalDeviceProperties.d.ts +13 -0
  395. package/dist/esm/peer/PhysicalDeviceProperties.d.ts.map +1 -1
  396. package/dist/esm/peer/PhysicalDeviceProperties.js +3 -2
  397. package/dist/esm/peer/PhysicalDeviceProperties.js.map +1 -1
  398. package/dist/esm/peer/RebootResubscribeArmer.d.ts +3 -3
  399. package/dist/esm/peer/RebootResubscribeArmer.d.ts.map +1 -1
  400. package/dist/esm/peer/RebootResubscribeArmer.js +21 -9
  401. package/dist/esm/peer/RebootResubscribeArmer.js.map +1 -1
  402. package/dist/esm/peer/index.d.ts +1 -0
  403. package/dist/esm/peer/index.d.ts.map +1 -1
  404. package/dist/esm/peer/index.js +1 -0
  405. package/dist/esm/peer/index.js.map +1 -1
  406. package/dist/esm/protocol/DeviceAdvertiser.d.ts.map +1 -1
  407. package/dist/esm/protocol/DeviceAdvertiser.js +1 -1
  408. package/dist/esm/protocol/DeviceAdvertiser.js.map +1 -1
  409. package/dist/esm/protocol/ExchangeManager.d.ts +0 -1
  410. package/dist/esm/protocol/ExchangeManager.d.ts.map +1 -1
  411. package/dist/esm/protocol/ExchangeManager.js +145 -67
  412. package/dist/esm/protocol/ExchangeManager.js.map +1 -1
  413. package/dist/esm/protocol/ExchangeProvider.d.ts +3 -2
  414. package/dist/esm/protocol/ExchangeProvider.d.ts.map +1 -1
  415. package/dist/esm/protocol/ExchangeProvider.js.map +1 -1
  416. package/dist/esm/protocol/MessageExchange.d.ts +13 -0
  417. package/dist/esm/protocol/MessageExchange.d.ts.map +1 -1
  418. package/dist/esm/protocol/MessageExchange.js +16 -6
  419. package/dist/esm/protocol/MessageExchange.js.map +1 -1
  420. package/dist/esm/protocol/MessageReceptionState.d.ts +1 -1
  421. package/dist/esm/protocol/errors.d.ts +7 -1
  422. package/dist/esm/protocol/errors.d.ts.map +1 -1
  423. package/dist/esm/protocol/errors.js +4 -1
  424. package/dist/esm/protocol/errors.js.map +1 -1
  425. package/dist/esm/securechannel/SecureChannelMessenger.d.ts +6 -1
  426. package/dist/esm/securechannel/SecureChannelMessenger.d.ts.map +1 -1
  427. package/dist/esm/securechannel/SecureChannelMessenger.js +27 -12
  428. package/dist/esm/securechannel/SecureChannelMessenger.js.map +1 -1
  429. package/dist/esm/session/GroupSession.d.ts +58 -15
  430. package/dist/esm/session/GroupSession.d.ts.map +1 -1
  431. package/dist/esm/session/GroupSession.js +97 -102
  432. package/dist/esm/session/GroupSession.js.map +2 -2
  433. package/dist/esm/session/NodeSession.d.ts +50 -1
  434. package/dist/esm/session/NodeSession.d.ts.map +1 -1
  435. package/dist/esm/session/NodeSession.js +83 -5
  436. package/dist/esm/session/NodeSession.js.map +1 -1
  437. package/dist/esm/session/SecureSession.d.ts +9 -0
  438. package/dist/esm/session/SecureSession.d.ts.map +1 -1
  439. package/dist/esm/session/SecureSession.js +18 -1
  440. package/dist/esm/session/SecureSession.js.map +1 -1
  441. package/dist/esm/session/Session.d.ts +2 -2
  442. package/dist/esm/session/Session.d.ts.map +1 -1
  443. package/dist/esm/session/Session.js +1 -1
  444. package/dist/esm/session/SessionManager.d.ts +76 -28
  445. package/dist/esm/session/SessionManager.d.ts.map +1 -1
  446. package/dist/esm/session/SessionManager.js +319 -156
  447. package/dist/esm/session/SessionManager.js.map +2 -2
  448. package/dist/esm/session/UnsecuredSession.d.ts +0 -1
  449. package/dist/esm/session/UnsecuredSession.d.ts.map +1 -1
  450. package/dist/esm/session/UnsecuredSession.js +5 -3
  451. package/dist/esm/session/UnsecuredSession.js.map +1 -1
  452. package/dist/esm/session/case/CaseClient.d.ts +5 -0
  453. package/dist/esm/session/case/CaseClient.d.ts.map +1 -1
  454. package/dist/esm/session/case/CaseClient.js +12 -11
  455. package/dist/esm/session/case/CaseClient.js.map +2 -2
  456. package/dist/esm/session/case/CaseServer.d.ts.map +1 -1
  457. package/dist/esm/session/case/CaseServer.js +31 -11
  458. package/dist/esm/session/case/CaseServer.js.map +1 -1
  459. package/package.json +5 -5
  460. package/src/action/Val.ts +8 -0
  461. package/src/action/client/ClientInteraction.ts +19 -21
  462. package/src/action/client/ClientRequest.ts +15 -0
  463. package/src/action/client/InputChunk.ts +57 -2
  464. package/src/action/errors.ts +10 -3
  465. package/src/action/protocols.ts +7 -1
  466. package/src/action/request/Invoke.ts +60 -15
  467. package/src/action/request/Write.ts +7 -6
  468. package/src/action/response/ReadResult.ts +15 -5
  469. package/src/action/server/AttributeReadResponse.ts +3 -2
  470. package/src/action/server/AttributeWriteResponse.ts +14 -3
  471. package/src/action/server/EventReadResponse.ts +1 -0
  472. package/src/advertisement/mdns/MdnsAdvertisement.ts +9 -9
  473. package/src/ble/Ble.ts +5 -0
  474. package/src/certificate/CdSigners.ts +137 -0
  475. package/src/certificate/CertificateAuthority.ts +1 -1
  476. package/src/certificate/DeviceAttestationValidator.ts +202 -54
  477. package/src/certificate/DeviceCertification.ts +6 -2
  478. package/src/certificate/index.ts +1 -0
  479. package/src/certificate/kinds/AttestationCertificates.ts +183 -15
  480. package/src/certificate/kinds/Certificate.ts +203 -308
  481. package/src/certificate/kinds/CertificationDeclaration.ts +100 -46
  482. package/src/certificate/kinds/DistinguishedName.ts +677 -0
  483. package/src/certificate/kinds/Icac.ts +7 -12
  484. package/src/certificate/kinds/Noc.ts +12 -8
  485. package/src/certificate/kinds/OperationalBase.ts +5 -2
  486. package/src/certificate/kinds/Rcac.ts +7 -12
  487. package/src/certificate/kinds/Vvsc.ts +24 -15
  488. package/src/certificate/kinds/definitions/asn.ts +1 -1
  489. package/src/certificate/kinds/definitions/attestation.ts +15 -15
  490. package/src/certificate/kinds/definitions/base.ts +43 -1
  491. package/src/certificate/kinds/definitions/operational.ts +4 -3
  492. package/src/codec/MessageCodec.ts +92 -81
  493. package/src/dcl/DclCertificateService.ts +135 -36
  494. package/src/fabric/Fabric.ts +13 -6
  495. package/src/fabric/FabricManager.ts +2 -2
  496. package/src/groups/FabricGroups.ts +5 -0
  497. package/src/groups/Groups.ts +12 -3
  498. package/src/groups/KeySets.ts +3 -3
  499. package/src/mdns/InterfaceResponder.ts +1031 -0
  500. package/src/mdns/MdnsServer.ts +400 -360
  501. package/src/peer/CommissioningConnection.ts +5 -1
  502. package/src/peer/ControllerCommissioner.ts +57 -19
  503. package/src/peer/ControllerCommissioningFlow.ts +132 -56
  504. package/src/peer/Peer.ts +31 -16
  505. package/src/peer/PeerAddressStore.ts +119 -0
  506. package/src/peer/PeerConnection.ts +0 -1
  507. package/src/peer/PeerDescriptor.ts +3 -4
  508. package/src/peer/PeerExchangeProvider.ts +4 -6
  509. package/src/peer/PeerLossContext.ts +11 -2
  510. package/src/peer/PhysicalDeviceProperties.ts +25 -12
  511. package/src/peer/RebootResubscribeArmer.ts +37 -16
  512. package/src/peer/index.ts +1 -0
  513. package/src/protocol/DeviceAdvertiser.ts +5 -1
  514. package/src/protocol/ExchangeManager.ts +162 -88
  515. package/src/protocol/ExchangeProvider.ts +3 -2
  516. package/src/protocol/MessageExchange.ts +22 -6
  517. package/src/protocol/MessageReceptionState.ts +2 -2
  518. package/src/protocol/errors.ts +7 -1
  519. package/src/securechannel/SecureChannelMessenger.ts +26 -13
  520. package/src/session/GroupSession.ts +147 -111
  521. package/src/session/NodeSession.ts +89 -4
  522. package/src/session/SecureSession.ts +27 -1
  523. package/src/session/Session.ts +2 -2
  524. package/src/session/SessionManager.ts +429 -189
  525. package/src/session/UnsecuredSession.ts +9 -3
  526. package/src/session/case/CaseClient.ts +15 -10
  527. package/src/session/case/CaseServer.ts +41 -17
@@ -338,10 +338,12 @@ function* emitEvents(input: DataReport): Generator<ReadResult.EventValue | ReadR
338
338
  const events = input.eventReports;
339
339
  if (events === undefined || events.length === 0) return;
340
340
 
341
+ const timestamps = new EventTimestampChain();
341
342
  for (const entry of events) {
342
343
  try {
343
344
  if (entry.eventData !== undefined) {
344
- const value = decodeEventValue(entry.eventData);
345
+ const resolvedTimestamp = timestamps.resolve(entry.eventData);
346
+ const value = decodeEventValue(entry.eventData, resolvedTimestamp);
345
347
  if (value !== undefined) yield value;
346
348
  } else if (entry.eventStatus !== undefined) {
347
349
  const status = buildEventStatus(entry.eventStatus);
@@ -354,7 +356,59 @@ function* emitEvents(input: DataReport): Generator<ReadResult.EventValue | ReadR
354
356
  }
355
357
  }
356
358
 
357
- function decodeEventValue(eventData: TypeFromSchema<typeof TlvEventData>): ReadResult.EventValue | undefined {
359
+ /**
360
+ * Reconstructs absolute event timestamps within one ReportData message.
361
+ *
362
+ * Per Matter Core §10.7.3.1 a delta timestamp is relative to the prior event. The CHIP SDK encodes each delta against
363
+ * the event directly before it in the same message and starts each message with an absolute timestamp, so a chain
364
+ * never spans messages. It sends deltas only on the system clock, and a system event after an epoch event gets a
365
+ * meaningless delta, so a delta resolves only when the event before it used the same clock. See
366
+ * {@link ReadResult.EventValue.resolvedTimestamp} for the result.
367
+ *
368
+ * @see {@link MatterSpecification.v161.Core} § 10.7.3.1
369
+ */
370
+ class EventTimestampChain {
371
+ #prior?: { clock: "epoch" | "system"; value: number };
372
+
373
+ resolve({
374
+ epochTimestamp,
375
+ systemTimestamp,
376
+ deltaEpochTimestamp,
377
+ deltaSystemTimestamp,
378
+ }: TypeFromSchema<typeof TlvEventData>): number | undefined {
379
+ if (epochTimestamp !== undefined) {
380
+ return this.#advance("epoch", Number(epochTimestamp));
381
+ }
382
+ if (systemTimestamp !== undefined) {
383
+ return this.#advance("system", Number(systemTimestamp));
384
+ }
385
+ if (deltaEpochTimestamp !== undefined) {
386
+ return this.#advanceBy("epoch", Number(deltaEpochTimestamp));
387
+ }
388
+ if (deltaSystemTimestamp !== undefined) {
389
+ return this.#advanceBy("system", Number(deltaSystemTimestamp));
390
+ }
391
+ this.#prior = undefined;
392
+ }
393
+
394
+ #advance(clock: "epoch" | "system", value: number) {
395
+ this.#prior = { clock, value };
396
+ return value;
397
+ }
398
+
399
+ #advanceBy(clock: "epoch" | "system", delta: number) {
400
+ if (this.#prior?.clock !== clock) {
401
+ this.#prior = undefined;
402
+ return;
403
+ }
404
+ return this.#advance(clock, this.#prior.value + delta);
405
+ }
406
+ }
407
+
408
+ function decodeEventValue(
409
+ eventData: TypeFromSchema<typeof TlvEventData>,
410
+ resolvedTimestamp: number | undefined,
411
+ ): ReadResult.EventValue | undefined {
358
412
  const {
359
413
  path: { nodeId, endpointId, clusterId, eventId },
360
414
  eventNumber,
@@ -396,6 +450,7 @@ function decodeEventValue(eventData: TypeFromSchema<typeof TlvEventData>): ReadR
396
450
  number: eventNumber,
397
451
  priority,
398
452
  timestamp,
453
+ resolvedTimestamp,
399
454
  epochTimestamp,
400
455
  systemTimestamp,
401
456
  deltaEpochTimestamp,
@@ -65,7 +65,7 @@ export class DatatypeError extends ValidateError {
65
65
  constructor(path: SchemaErrorPath, type: string, value: unknown, code?: Status) {
66
66
  let str = `${value}`;
67
67
  if (str.length > 60) {
68
- str = `${str.substring(60)}…`;
68
+ str = `${str.substring(0, 60)}…`;
69
69
  }
70
70
  super(path, `Value "${str}" is not ${type}`, code);
71
71
  }
@@ -123,11 +123,18 @@ export class ConformanceError extends ValidateError {
123
123
  export class EnumValueConformanceError extends ConformanceError {}
124
124
 
125
125
  /**
126
- * Thrown for access attempts against a managed value that is no longer valid.
126
+ * Thrown for access to a managed value that no longer tracks live state: its context exited, a change in its
127
+ * transaction moved, removed or replaced it in its list, or it is a read-only view. A write always throws. A read of
128
+ * a nested value returns its last value; a read of a root value, or of a value whose container is absent, throws.
127
129
  */
128
130
  export class ExpiredReferenceError extends SchemaViolationError {
129
131
  constructor(path: SchemaErrorPath) {
130
- super("Referencing", path, "This value is no longer available because its context has exited", Status.Failure);
132
+ super(
133
+ "Referencing",
134
+ path,
135
+ "This value is no longer live: its context exited, a change moved, removed or replaced it in its list, or it is a read-only view",
136
+ Status.Failure,
137
+ );
131
138
  }
132
139
  }
133
140
 
@@ -7,7 +7,7 @@
7
7
  import { InteractionSession } from "#action/Interactable.js";
8
8
  import { OccurrenceManager } from "#events/OccurrenceManager.js";
9
9
  import { MaybePromise, Observable } from "@matter/general";
10
- import { DataModelPath, MatterModel } from "@matter/model";
10
+ import { AttributeModel, DataModelPath, MatterModel } from "@matter/model";
11
11
  import type {
12
12
  AttributeId,
13
13
  ClusterId,
@@ -192,6 +192,12 @@ export interface AttributeTypeProtocol extends AddressableElementProtocol<Attrib
192
192
  */
193
193
  tlv: TlvSchema<unknown>;
194
194
 
195
+ /**
196
+ * The model of this attribute. Read and write logs use it to hide values the model marks secret; without it they
197
+ * log values as they are.
198
+ */
199
+ schema?: AttributeModel;
200
+
195
201
  /**
196
202
  * Access control information for the attribute.
197
203
  */
@@ -7,7 +7,7 @@
7
7
  import { ClientRequest } from "#action/client/ClientRequest.js";
8
8
  import { SessionParameters } from "#session/SessionParameters.js";
9
9
  import { Diagnostic, Duration, isObject } from "@matter/general";
10
- import { Specification } from "@matter/model";
10
+ import { CommandModel, Matter, SecretRedaction, Specification } from "@matter/model";
11
11
  import {
12
12
  ClusterType,
13
13
  CommandData,
@@ -154,20 +154,7 @@ export function Invoke(
154
154
  // Additional meta-data for client side processing
155
155
  skipValidation,
156
156
  commands: commandMap,
157
- [Diagnostic.value]: () =>
158
- Diagnostic.list(
159
- commands.map(cmd => {
160
- const { commandRef } = cmd;
161
- const fields = "fields" in cmd ? cmd.fields : undefined;
162
-
163
- return [
164
- Diagnostic.strong(Invoke.isLegacy(cmd) ? "(legacy)" : resolvePathForSpecifier(cmd)),
165
- "with",
166
- isObject(fields) ? Diagnostic.dict(fields) : "(no payload)",
167
- commandRef !== undefined && commands.length > 1 ? `(ref ${commandRef})` : "",
168
- ];
169
- }),
170
- ),
157
+ [Diagnostic.value]: () => Invoke.diagnosticOf(commands),
171
158
  } as ClientInvoke;
172
159
  }
173
160
 
@@ -298,6 +285,64 @@ export namespace Invoke {
298
285
  return typeof request.command !== "string" && "requestId" in request.command;
299
286
  }
300
287
 
288
+ /**
289
+ * The model of the request of {@link request}. A legacy request resolves through the standard model; the result
290
+ * is `undefined` if the standard model does not define its cluster or command.
291
+ */
292
+ export function requestModelOf(request: AnyCommandRequest): CommandModel | undefined {
293
+ if (!isLegacy(request)) {
294
+ return commandOf(request).schema;
295
+ }
296
+ const clusterModel = Matter.clusters(Specifier.clusterFor(request.cluster).id);
297
+ if (clusterModel === undefined) {
298
+ return undefined;
299
+ }
300
+ for (const command of clusterModel.commands) {
301
+ if (command.id === request.command.requestId && command.isRequest) {
302
+ return command;
303
+ }
304
+ }
305
+ }
306
+
307
+ /**
308
+ * Log presentation of {@link commands}: the path and the request fields of each command, with the values the model
309
+ * marks secret replaced.
310
+ */
311
+ export function diagnosticOf(commands: Iterable<AnyCommandRequest>) {
312
+ const list = [...commands];
313
+ return Diagnostic.list(
314
+ list.map(cmd => {
315
+ const { commandRef } = cmd;
316
+ const fields = "fields" in cmd ? redactRequestFields(cmd, cmd.fields) : undefined;
317
+
318
+ return [
319
+ Diagnostic.strong(isLegacy(cmd) ? "(legacy)" : resolvePathForSpecifier(cmd)),
320
+ "with",
321
+ isObject(fields) ? Diagnostic.dict(fields) : "(no payload)",
322
+ commandRef !== undefined && list.length > 1 ? `(ref ${commandRef})` : "",
323
+ ];
324
+ }),
325
+ );
326
+ }
327
+
328
+ /**
329
+ * Request fields of {@link request} for logging, with the values the model marks secret replaced.
330
+ *
331
+ * @see {@link SecretRedaction.redact}
332
+ */
333
+ export function redactRequestFields(request: AnyCommandRequest, fields: unknown) {
334
+ return SecretRedaction.redact(requestModelOf(request), fields);
335
+ }
336
+
337
+ /**
338
+ * Response fields of {@link request} for logging, with the values the model marks secret replaced.
339
+ *
340
+ * @see {@link SecretRedaction.redact}
341
+ */
342
+ export function redactResponseFields(request: AnyCommandRequest, fields: unknown) {
343
+ return SecretRedaction.redact(requestModelOf(request)?.responseModel, fields);
344
+ }
345
+
301
346
  export type CommandRequest<
302
347
  C extends Specifier.Cluster = Specifier.Cluster,
303
348
  CMD extends Specifier.Command<Specifier.ClusterFor<C>> = Specifier.Command<Specifier.ClusterFor<C>>,
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  import { Diagnostic, Duration } from "@matter/general";
8
- import { Specification } from "@matter/model";
8
+ import { SecretRedaction, Specification } from "@matter/model";
9
9
  import { ArraySchema, AttributeData, AttributeId, ClusterId, TlvOfModel, WriteRequest } from "@matter/types";
10
10
  import { AccessControl } from "@matter/types/clusters/access-control";
11
11
  import { MalformedRequestError } from "./MalformedRequestError.js";
@@ -87,15 +87,16 @@ export function Write(optionsOrData: Write.Options | Write.Attribute, ...data: W
87
87
  [Diagnostic.value]: () => {
88
88
  const items = data.flatMap(entry => {
89
89
  const { version, value, endpoint, cluster, attributes } = entry;
90
- const valueString = Diagnostic.json(value);
91
90
  const list = Array.isArray(attributes) ? attributes : [attributes];
92
91
  const versionString = version !== undefined ? `(version=${version})` : "";
93
- return list.map(attribute =>
94
- Diagnostic.squash(
92
+ return list.map(attribute => {
93
+ const { schema } = Specifier.attributeFor(Specifier.clusterOf(entry), attribute);
94
+ const valueString = Diagnostic.json(SecretRedaction.redact(schema, value));
95
+ return Diagnostic.squash(
95
96
  Diagnostic.strong(resolvePathForSpecifier({ endpoint, cluster, attribute })),
96
97
  ` = ${valueString}${versionString}`,
97
- ),
98
- );
98
+ );
99
+ });
99
100
  });
100
101
  if (chunked) {
101
102
  return [Diagnostic.asFlags({ chunked: true }), Diagnostic.list(items)];
@@ -72,21 +72,31 @@ export namespace ReadResult {
72
72
  number: EventNumber;
73
73
 
74
74
  /**
75
- * Collapsed numeric form of whichever wire timestamp variant the publisher sent. Convenience for callers
76
- * that don't care about the distinction; the specific variant is in the four fields below.
75
+ * Collapsed numeric form of whichever wire timestamp variant the publisher sent. For a delta variant this is
76
+ * the delta; use {@link resolvedTimestamp} for the absolute time.
77
77
  */
78
78
  timestamp: number;
79
79
 
80
- /** Absolute Posix epoch timestamp (milliseconds). Per Matter Core §10.7 exactly one of the four is set. */
80
+ /**
81
+ * Absolute timestamp in milliseconds, on the clock of whichever variant the publisher sent. Equals the absolute
82
+ * variant when the publisher sent one. For a delta it is the absolute time of the event directly before it in
83
+ * the same ReportData message plus the delta. Undefined when the publisher sent no timestamp, or sent a delta
84
+ * and the event directly before it has no absolute time on the same clock.
85
+ *
86
+ * @see {@link MatterSpecification.v161.Core} § 10.7.3.1
87
+ */
88
+ resolvedTimestamp?: number;
89
+
90
+ /** Absolute Posix epoch timestamp (milliseconds). Matter Core §10.6.9 allows a peer to send only one of the four. */
81
91
  epochTimestamp?: number | bigint;
82
92
 
83
93
  /** Absolute system-time timestamp (milliseconds). */
84
94
  systemTimestamp?: number | bigint;
85
95
 
86
- /** Relative epoch-time delta from the previous event (milliseconds). */
96
+ /** Relative epoch-time delta from the prior event (milliseconds). */
87
97
  deltaEpochTimestamp?: number | bigint;
88
98
 
89
- /** Relative system-time delta from the previous event (milliseconds). */
99
+ /** Relative system-time delta from the prior event (milliseconds). */
90
100
  deltaSystemTimestamp?: number | bigint;
91
101
 
92
102
  priority: Priority;
@@ -12,7 +12,7 @@ import { AccessControl, hasLocalActor, hasRemoteActor } from "#action/server/Acc
12
12
  import { DataResponse, FallbackLimits, WildcardPathFlagsCodec } from "#action/server/DataResponse.js";
13
13
  import { Val } from "#action/Val.js";
14
14
  import { InternalError, Logger, serialize } from "@matter/general";
15
- import { AccessLevel, AttributeModel, DataModelPath, ElementTag } from "@matter/model";
15
+ import { AccessLevel, AttributeModel, DataModelPath, ElementTag, SecretRedaction } from "@matter/model";
16
16
  import {
17
17
  AttributePath,
18
18
  ClusterId,
@@ -301,7 +301,8 @@ export class AttributeReadResponse<
301
301
  const value = this.#currentState[attributeId];
302
302
  const version = cluster.version;
303
303
  logger.debug(
304
- () => `Reading attribute ${this.node.inspectPath(path)}=${serialize(value)} (version=${version})`,
304
+ () =>
305
+ `Reading attribute ${this.node.inspectPath(path)}=${serialize(SecretRedaction.redact(cluster.type.attributes[attributeId]?.schema, value))} (version=${version})`,
305
306
  );
306
307
  // Perform actual read of one attribute
307
308
  this.#addValue(path, value, version, this.#currentCluster.type.attributes[attributeId]!.tlv);
@@ -11,7 +11,14 @@ import { WriteResult } from "#action/response/WriteResult.js";
11
11
  import { AccessControl, hasRemoteActor } from "#action/server/AccessControl.js";
12
12
  import { DataResponse, FallbackLimits } from "#action/server/DataResponse.js";
13
13
  import { Diagnostic, InternalError, Logger, serialize, toHex } from "@matter/general";
14
- import { AccessLevel, AttributeModel, DataModelPath, ElementTag, FabricIndex as FabricIndexField } from "@matter/model";
14
+ import {
15
+ AccessLevel,
16
+ AttributeModel,
17
+ DataModelPath,
18
+ ElementTag,
19
+ FabricIndex as FabricIndexField,
20
+ SecretRedaction,
21
+ } from "@matter/model";
15
22
  import {
16
23
  ArraySchema,
17
24
  AttributePath,
@@ -429,7 +436,10 @@ export class AttributeWriteResponse<
429
436
  const decoded = this.#decodeWithSchema(tlv, value);
430
437
  // REPLACE_ALL
431
438
  //await this.session.transaction?.begin();
432
- logger.debug(() => `Writing attribute ${this.node.inspectPath(path)}=${Diagnostic.json(decoded)}`);
439
+ logger.debug(
440
+ () =>
441
+ `Writing attribute ${this.node.inspectPath(path)}=${Diagnostic.json(SecretRedaction.redact(attribute.schema, decoded))}`,
442
+ );
433
443
  const writeState = await this.#guardedCurrentCluster.openForWrite(this.session);
434
444
  writeState[attributeId] = decoded;
435
445
  await this.session.transaction?.commit();
@@ -444,7 +454,8 @@ export class AttributeWriteResponse<
444
454
  const writeState = await this.#guardedCurrentCluster.openForWrite(this.session);
445
455
  const decoded = this.#decodeWithSchema(tlv.elementSchema, value);
446
456
  logger.debug(
447
- () => `Writing attribute chunk ${this.node.inspectPath(path)} adding ${serialize(decoded)}`,
457
+ () =>
458
+ `Writing attribute chunk ${this.node.inspectPath(path)} adding ${serialize(SecretRedaction.redactEntry(attribute.schema, decoded))}`,
448
459
  );
449
460
  (writeState[attributeId] as any[]).push(decoded);
450
461
  await this.session.transaction?.commit();
@@ -417,6 +417,7 @@ export class EventReadResponse<
417
417
  number,
418
418
  priority,
419
419
  timestamp,
420
+ resolvedTimestamp: timestamp,
420
421
  value,
421
422
  tlv,
422
423
  };
@@ -44,6 +44,7 @@ export abstract class MdnsAdvertisement<T extends ServiceDescription = ServiceDe
44
44
  #isPrivacyMasked: boolean;
45
45
  #stopAt?: Timestamp;
46
46
  #broadcastPromise?: Promise<void>;
47
+ #registration?: MdnsServer.Registration;
47
48
 
48
49
  constructor(advertiser: MdnsAdvertiser, qname: string, description: T) {
49
50
  description = {
@@ -97,21 +98,21 @@ export abstract class MdnsAdvertisement<T extends ServiceDescription = ServiceDe
97
98
  async #broadcast() {
98
99
  if (!this.#isPrivacyMasked && this.isPrivacyMasked) {
99
100
  this.#isPrivacyMasked = true;
100
- await this.advertiser.server.setRecordsGenerator(this.service, this.#recordsGenerator);
101
+ await this.#registration?.refresh();
101
102
  }
102
103
 
103
104
  await this.advertiser.server.broadcast(this.service);
104
105
  }
105
106
 
106
107
  /**
107
- * Broadcast expiration announcement immediately.
108
+ * Withdraw the service and send its goodbye.
108
109
  */
109
110
  async expire() {
110
111
  if (this.#broadcastPromise !== undefined) {
111
112
  await this.#broadcastPromise;
112
113
  }
113
114
  logger.info("Unpublishing", this.dict({ time: Duration.format(this.duration) }));
114
- await this.advertiser.server.expireAnnouncements(this.service);
115
+ await this.#registration?.withdraw();
115
116
  }
116
117
 
117
118
  override serviceConnected() {
@@ -135,15 +136,14 @@ export abstract class MdnsAdvertisement<T extends ServiceDescription = ServiceDe
135
136
 
136
137
  protected override async onCreate() {
137
138
  // Use Promise.resolve() to initialize on next microtick so the constructor completes before invocation
138
- await Promise.resolve().then(() => {
139
- // Install the records generator. This will be used for broadcast and to respond to queries
140
- logger.info("Publishing", this.dict());
141
- return this.advertiser.server.setRecordsGenerator(this.service, this.#recordsGenerator);
142
- });
139
+ await Promise.resolve();
140
+
141
+ // Install the records generator. This will be used for broadcast and to respond to queries
142
+ logger.info("Publishing", this.dict());
143
+ this.#registration = await this.advertiser.server.register(this.service, this.#recordsGenerator);
143
144
  }
144
145
 
145
146
  protected override async onClose() {
146
- // The MDNS server doesn't currently track which answers have been sent so just expire unconditionally
147
147
  await this.expire();
148
148
  }
149
149
 
package/src/ble/Ble.ts CHANGED
@@ -61,6 +61,11 @@ export abstract class BleChannel<T extends Bytes = Bytes> implements Channel<T>,
61
61
  return this.#closed;
62
62
  }
63
63
 
64
+ /** True once {@link closed} was emitted. Lets a consumer that subscribes late detect a loss it did not observe. */
65
+ get isClosed() {
66
+ return this.#closedFired;
67
+ }
68
+
64
69
  protected emitClosed() {
65
70
  if (this.#closedFired) {
66
71
  return;
@@ -0,0 +1,137 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022-2026 Matter.js Authors
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ import { Bytes, CertificateError, Crypto, EcdsaSignature, InternalError, PublicKey } from "@matter/general";
8
+ import { Certificate } from "./kinds/Certificate.js";
9
+ import { CertificationDeclaration } from "./kinds/CertificationDeclaration.js";
10
+
11
+ /** Subject key identifier of the CSA "Matter Certification and Testing CA", the root every CD signing key chains to. */
12
+ const CSA_CD_ROOT_SKID = Bytes.fromHex("97E469D0C50414C26FC701F77E947739098DF6A5");
13
+
14
+ /** Public key of the CSA "Matter Certification and Testing CA". */
15
+ const CSA_CD_ROOT_PUBLIC_KEY = Bytes.fromHex(
16
+ "04384a3ac3aa5dbecb720fe6211d3cad48626ff711a0a4929fadd860f8e277ffc0de1f3eb6337a34847b5a3a056ea8710e9377eeedee251703fdd9350125cb8e48",
17
+ );
18
+
19
+ /** CSA "Certification Declaration Signing Key 001" to "005", by subject key identifier, as CHIP ships them built in. */
20
+ const CSA_CD_SIGNING_KEYS = new Map(
21
+ [
22
+ [
23
+ "FE343F959947763B61EE4539131338494FE67D8E",
24
+ "04cdeee93e44f8b72be3d1a9c07e21968b9afff3b403f05e1669d7b1e5caee6fc7714b42e7e23695e92cd7635473a280ae688f37bb9489e11629b9b94ff7b09929",
25
+ ],
26
+ [
27
+ "DD04DB585B214C1C581587E6568DF487B6DDC701",
28
+ "04031937e8f94251045df27457bb46253ee3754e8c12ae28557d8027b9d4c356d91b408cff32275017b25f8c8ba20516d5c83af2b724128013dfcc8f95d200a90b",
29
+ ],
30
+ [
31
+ "471035E7C04EAAA8BE7C4D4C13E3E4C20995A84B",
32
+ "049f575cd5fdb7521f10a4df31f073912b614728f2d37f5b6b96bc2cbf7c0b119690577d555d21a09660a8b082a339ea530f7a812d8693b56fd764185fabcd32f5",
33
+ ],
34
+ [
35
+ "F68603A3692E981072419EA1E1AB3854BD7795D3",
36
+ "047cfc8d8810a89cf4fa191778f2afec78f8517a97a3e57fc213bad888e3611e74ffb684bdeba8a68b25234a5c358f373bab9b6d304e1306dd7620a528d1161c0b",
37
+ ],
38
+ [
39
+ "637F2634AD62EAFE6AF662EFB96F6FD2FCBFFC2F",
40
+ "04438a52c662a2a6d72647f95eb753136ee4ae0fdb3aa9c16931426b3d0867f9103ae7d7a1b887e9f813a6f26f76bbcda93593787c12778ca8f2975dc45a2042f9",
41
+ ],
42
+ ].map(([skid, publicKey]) => [skid, Bytes.fromHex(publicKey)]),
43
+ );
44
+
45
+ /** Validity of the CSA CD root, in Matter epoch seconds: 2022-07-07T19:28:04Z to 2122-06-13T19:28:04Z. */
46
+ const CSA_CD_ROOT_NOT_BEFORE = 710537284;
47
+ const CSA_CD_ROOT_NOT_AFTER = 3864137284;
48
+
49
+ /**
50
+ * The keys that may sign a Certification Declaration, as CHIP trusts them.
51
+ *
52
+ * | Signer | Known through |
53
+ * |-------------------------------------------------|------------------------------------------------|
54
+ * | CSA CD signing keys 001 to 005 | {@link known}, built in |
55
+ * | The Matter test CD signer | {@link known}; the caller applies its policy |
56
+ * | A certificate the CSA CD root issued and signed | {@link verifyCertificate}, for a DCL answer |
57
+ *
58
+ * No other key is a CD signer, in particular no PAA or PAI.
59
+ *
60
+ * @see {@link MatterSpecification.v161.Core} § 6.2.3.1
61
+ * @see {@link MatterSpecification.v161.Core} § 6.3.1
62
+ */
63
+ export namespace CdSigners {
64
+ /** A trusted CD signer. */
65
+ export interface Signer {
66
+ /** EC P-256 public key that verifies the CD signature. */
67
+ publicKey: Bytes;
68
+
69
+ /**
70
+ * Marks the Matter test CD signer. It may sign only CDs of certification_type test or provisional, and only a
71
+ * caller that accepts test certificates should trust it.
72
+ */
73
+ isTestSigner: boolean;
74
+ }
75
+
76
+ /** The built-in CSA signing key or the Matter test CD signer that `subjectKeyId` names, else `undefined`. */
77
+ export function known(subjectKeyId: Bytes): Signer | undefined {
78
+ if (isTestSigner(subjectKeyId)) {
79
+ return { publicKey: CertificationDeclaration.testSignerInfo().publicKey, isTestSigner: true };
80
+ }
81
+ const publicKey = CSA_CD_SIGNING_KEYS.get(Bytes.toHex(subjectKeyId).toUpperCase());
82
+ return publicKey === undefined ? undefined : { publicKey: Bytes.of(publicKey).slice(), isTestSigner: false };
83
+ }
84
+
85
+ /** Whether `subjectKeyId` names the Matter test CD signer ({@link CertificationDeclaration.testSignerInfo}). */
86
+ export function isTestSigner(subjectKeyId: Bytes) {
87
+ return Bytes.areEqual(subjectKeyId, CertificationDeclaration.testSignerInfo().subjectKeyId);
88
+ }
89
+
90
+ /**
91
+ * Check that a DER certificate is a CD signer for `subjectKeyId`:
92
+ *
93
+ * - its subject key identifier is `subjectKeyId`,
94
+ * - it is not the CSA "Matter Certification and Testing CA" root itself,
95
+ * - its authority key identifier is that root's subject key identifier and the root's key verifies its signature,
96
+ * - the root was valid when the certificate became valid.
97
+ *
98
+ * The validity rule follows CHIP, which validates the chain at the certificate's notBefore time. CHIP's strict
99
+ * X.509 profile checks of the chain are not repeated.
100
+ *
101
+ * @returns the certificate's EC P-256 public key
102
+ * @throws CertificateError naming the rule the certificate breaks, or why it cannot be parsed
103
+ */
104
+ export async function verifyCertificate(crypto: Crypto, der: Bytes, subjectKeyId: Bytes): Promise<Bytes> {
105
+ const cert = Certificate.parseAsn1Certificate(der, Certificate.REQUIRED_EXTENSIONS);
106
+ const { subjectKeyIdentifier, authorityKeyIdentifier } = cert.extensions;
107
+ if (!Bytes.areEqual(subjectKeyIdentifier, subjectKeyId)) {
108
+ throw new CertificateError(
109
+ `Certificate has subject key identifier ${Bytes.toHex(subjectKeyIdentifier)}, not ${Bytes.toHex(subjectKeyId)}`,
110
+ );
111
+ }
112
+ if (Bytes.areEqual(subjectKeyIdentifier, CSA_CD_ROOT_SKID)) {
113
+ throw new CertificateError("The CSA CD root certificate is not itself a CD signer");
114
+ }
115
+ if (!Bytes.areEqual(authorityKeyIdentifier, CSA_CD_ROOT_SKID)) {
116
+ throw new CertificateError(
117
+ `Certificate is issued by ${Bytes.toHex(authorityKeyIdentifier)}, not the CSA CD root ${Bytes.toHex(CSA_CD_ROOT_SKID)}`,
118
+ );
119
+ }
120
+ if (cert.notBefore < CSA_CD_ROOT_NOT_BEFORE || cert.notBefore > CSA_CD_ROOT_NOT_AFTER) {
121
+ throw new CertificateError("Certificate became valid outside the validity period of the CSA CD root");
122
+ }
123
+ if (cert.tbsDer === undefined) {
124
+ throw new InternalError("A parsed certificate carries its TBSCertificate");
125
+ }
126
+ try {
127
+ await crypto.verifyEcdsa(
128
+ PublicKey(CSA_CD_ROOT_PUBLIC_KEY),
129
+ cert.tbsDer,
130
+ new EcdsaSignature(cert.signature),
131
+ );
132
+ } catch (cause) {
133
+ throw new CertificateError("Certificate signature does not verify against the CSA CD root", { cause });
134
+ }
135
+ return cert.ellipticCurvePublicKey;
136
+ }
137
+ }
@@ -288,7 +288,7 @@ export class CertificateAuthority {
288
288
  publicKey: Bytes,
289
289
  fabricId: FabricId,
290
290
  nodeId: NodeId,
291
- caseAuthenticatedTags?: CaseAuthenticatedTag[],
291
+ caseAuthenticatedTags?: readonly CaseAuthenticatedTag[],
292
292
  ) {
293
293
  const now = Time.now;
294
294
  const certId = this.#nextCertificateId++;