Skip to content

Commit e8d6747

Browse files
Apollon77claude
andauthored
Upgrade to Matter specification 1.5.1 (#3474)
* Spec parsing and codegen improvements for Matter 1.5 Update spec parser to handle Matter 1.5 HTML structure changes including new table formats, namespace translations, device type parsing, and large message quality. Fix JSDoc comment escaping for */ sequences. Build cluster index from all device children for element requirement resolution. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Add missing generated file patterns to .prettierignore Add *Server.ts and top-level behaviors/index.ts to prevent prettier from reformatting generated behavior files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix codegen for device types with no cluster requirements Skip emitting requirements reference when the requirements namespace is empty, preventing TypeScript errors for composite device types like FloodlightCamera and VideoDoorbell that have no direct requirements. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Adjust tests for Matter 1.5 spec changes Update WindowCovering test to remove AbsolutePosition feature and use currentPositionLiftPercent100ths. Fix server list ClusterId ordering in InteractionProtocolTest to match 1.5 cluster definitions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Regenerate code for Matter 1.5 specification Generated cluster definitions, behaviors, device types, endpoints, globals, tags, and forward declarations from the Matter 1.5 parsed specification. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Update changelog for Matter 1.5 specification upgrade Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Remove *Server.ts from prettierignore and drop plan file Server behavior files are hand-customized and should remain formatted. The generated output is already prettier-compliant. Also remove plan document that should not be committed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix spec parser for renamed "Derived Cluster Namespace" section Matter 1.5 renamed "Derived Cluster Type" to "Derived Cluster Namespace" in mode-derived clusters. Add the new section name so ModeTag and ModeChangeStatus datatypes are correctly parsed for RVC Run/Clean Mode, Dishwasher Mode, Laundry Washer Mode, and other derivative clusters. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix [object Object] in validation error messages Use JSON.stringify instead of string interpolation for default values in INVALID_VALUE error messages so object values render meaningfully. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * formatting * Emit abstract clusters for shared spec sections without cluster IDs Instead of duplicating types from common spec sections (e.g. WebRTC Transport §11.4) into each consuming cluster via overrides, emit them as abstract clusters (no ID) so shared datatypes have a single home. Remove WebRtcTransportProvider/Requestor override files that previously duplicated ICECandidateStruct, WebRTCSessionStruct, ICEServerStruct, WebRTCEndReasonEnum, and WebRTCSessionID into each cluster. Sections that have a cluster ID table but fail to parse IDs (e.g. OccupancySensing) are still skipped — they need full overrides. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * formatting * Restore files accidentally reverted from main Reset 36 files that were inadvertently overwritten with older versions from the spec15gen branch merge. These files belong to PR #3471 (Conformance validation upgrades) and other main-only changes that should not have been part of this branch. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Parse OccupancySensing cluster from spec HTML instead of override The 1.5 spec uses "clusterid"/"clustername" column headers in the cluster ID table instead of "id"/"name". Add these as column aliases in translateIds() so OccupancySensing (and any future clusters using this format) parse correctly. Remove the OccupancySensingOverrides file that was only needed because the parser couldn't handle the table. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Re-gen after latest codegen changes * Matter 1.5.1 Parse and regen * AccessControl: Set capability attribute defaults for 1.5.1 constraints Spec 1.5.1 tightened constraints on SubjectsPerAccessControlEntry, TargetsPerAccessControlEntry and AccessControlEntriesPerFabric from "min N" to "N to 65534". Set defaults in initialize() to prevent constraint validation failures. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * LevelControl: Set minLevel/maxLevel defaults for Rev >= v7 conformance Spec 1.5.1 made MinLevel and MaxLevel mandatory at cluster revision 7 with Fixed quality. Set defaults in initialize() when not configured: minLevel defaults to 1 (lighting) or 0 (non-lighting), maxLevel to 254. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * DoorLock: Remove legacy Zigbee commands and vestigial supervision Spec 1.5.1 removed legacy non-USR commands (SetPINCode, GetPINCode, ClearPINCode, ClearAllPINCodes, SetRFIDCode, GetRFIDCode, ClearRFIDCode, ClearAllRFIDCodes, SetUserStatus, GetUserStatus, SetUserType, GetUserType) and all associated helper methods. Also removes supervision wiring for the removed clearPinCode/clearRfidCode methods. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * UserLabel: Add RESOURCE_EXHAUSTED validation for LabelList writes Spec 1.5 requires returning RESOURCE_EXHAUSTED when LabelList exceeds the supported length. Default max is 255, configurable via State.maxLabels. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Remove REQUIRED_CAT_MISMATCH secure channel status code Spec 1.5.1 removed this status code from the Secure Channel General Status Codes table. It was defined but never used in the codebase. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * PairingHintBitmap: Add bits 20-22 for spec 1.5.0/1.5.1 Add missing pairing hint bits: - Bit 20: Press and release setup button N times (1.5.0) - Bit 21: Press button for N seconds with indication (1.5.1) - Bit 22: Power cycle until indication (1.5.1) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * OpCreds: RevokeCommissioning before and after RemoveFabric Spec 1.5 recommends (SHOULD) invoking RevokeCommissioning before and after RemoveFabric for security. Checks window status before calling to avoid WindowNotOpenError. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * RevokeCommissioning: Run cleanup before window check per spec 1.5.1 Spec 1.5.1 restructured RevokeCommissioning Effect on Receipt: Step 1 (PASE session termination, fail-safe expiry) now runs regardless of window state. Window check moved to Step 2 after cleanup. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Reject WildcardPathFlags in write interactions per spec 1.5 Spec 1.5: "WildcardPathFlags SHALL ONLY be used for either Read or Subscribe interactions." Rejects with InvalidAction when present in write requests. CommandPath doesn't carry this field so invoke is unaffected. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * RVC example: Support DirectModeChange feature bypass When DirectModeChange feature is enabled, skip the Idle-first requirement and allow direct transitions between non-idle run modes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Mark spec-fixed overrides with until and regen - ColorControl ColorCapabilities bitmap: until 1.4.2 (spec 1.5 adds ColorCapabilitiesBitmap type) - DoorLock GetYearDayScheduleResponse field IDs: until 1.4.2 (spec 1.5 has correct IDs) - Regen picks up BasicInformation productAppearance move to optional (Rev >= v2 conformance in 1.5.1) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Update spec references from v1.4.2 to v1.5.1 and regen Add MatterSpecification namespaces for v1.5 and v1.5.1 in Specifications.d.ts. Update codegen to emit v151 spec references. Full regeneration of all cluster, endpoint and forward files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Disable RevokeCommissioning spec 1.5.1 changes pending test alignment Comment out RevokeCommissioning ordering change (Step 1 before window check) and RevokeCommissioning around RemoveFabric — as of 1.5.1 release, certification tests are not yet adjusted for these behaviors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Tweak CADMIN 1.10 error expectation * Try2: Tweak CADMIN 1.10 error expectation * Try3: Tweak CADMIN 1.10 error expectation * Disable RevokeCommissioning around RemoveFabric pending test alignment Remove server-side RevokeCommissioning around RemoveFabric — this is a controller-side concern per spec 1.5 (administrator calling RevokeCommissioning before/after removing another fabric over CASE). Keep RevokeCommissioning ordering fix (Step 1 cleanup before window check) using graceful initiateClose(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: markdown spec parser for generate-spec (#3528) * feat(codegen): add markdown spec parser alongside existing HTML parser The generate-spec tool now auto-detects markdown spec directories (containing _index.md files) and parses them using a new markdown pipeline, while preserving the existing HTML pipeline as fallback. New modules in support/codegen/src/mom/spec/md/: - md-utils.ts: frontmatter parsing, text/prose element helpers - parse-tables.ts: pipe table + HTML table parsing with overflow cell merging for unescaped | in conformance expressions - scan-markdown.ts: document scanner yielding HtmlReference objects - load-markdown-files.ts: directory discovery and file concatenation Also adds scan-spec.ts routing function and extends translate-cluster.ts and translate-global.ts for markdown-specific patterns (command direction <= syntax, status code obsolete name cleanup). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore(models): regenerate v1.5.1 spec.ts from markdown source Generated from the markdown version of the Matter 1.5.1 specification. Produces identical validation results (7 errors, 7980 elements) as the HTML source. Text differences are limited to prose formatting: different word wrapping, admonition markers, list formatting, and minor punctuation. No structural or semantic changes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: regenerate model, clusters and endpoints from updated spec.ts All changes are in generated JSDoc comments and description strings reflecting the markdown-sourced spec.ts text formatting. No structural or API changes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: regenerate remaining endpoint and tag files from updated spec.ts More generated JSDoc/description text updates from the markdown-sourced spec.ts. No structural or API changes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor(codegen): eliminate HTML intermediate in markdown spec parser Replace MD → HTMLElement → text pipeline with direct MD → text. Drop HTML spec input support entirely. Translators now operate on strings, tables produce string cells at parse time, prose is string[]. Delete scan-document.ts, scan-tables.ts, doc-utils.ts (HTML-only). Rename html-translators.ts → translators.ts with string signatures. Rename HtmlReference → SpecReference across the codebase. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore(models): regenerate v1.5.1 spec.ts from refactored parser Minor improvements from direct MD → text pipeline: removed spurious heading markers on legend text, better paragraph merging, picked up 8 missing network conditions (Ethernet, WiFi, Thread, etc.). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: regenerate model, clusters and endpoints from updated spec.ts Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: update docs and fix formatting after HTML parser removal Remove references to HTML spec input from README and generate-spec usage text. Fix formatting in generated file. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: merge NonUserDoorLockServer and UserDoorLockServer into DoorLockBaseServer USR feature is mandatory on the DoorLock device type, so the two-stage class hierarchy (NonUser → User) had no standalone use case. Merged into a single DoorLockBaseServer following the *BaseServer naming convention used by all other behaviors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Regenerate * chore: regenerate forwards after codegen fix Removes stray .d.ts forward files left from the broken chooseName() and regenerates clean .ts forwards for clusters added in Matter 1.5 (camera-av-*, chime, closure-*, commodity-*, electrical-grid-conditions, meter-identification, push-av-stream-transport, soil-measurement, tls-*, web-rtc-*, zone-management). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test(node): replace removed Thermostat.Feature.ScheduleConfiguration in narrowing test `Thermostat.Feature.ScheduleConfiguration` and its weekly-schedule commands (setWeeklySchedule / getWeeklySchedule / clearWeeklySchedule) were removed from the spec-generated cluster types per Matter 1.5.1, replaced by `MatterScheduleConfiguration` (MSCH) gating `setActiveScheduleRequest`. `atomicRequest` is gated on `Presets | MatterScheduleConfiguration`. Update the `commandsOf narrowing via .for()` block in the regression harness added in #3652 to use the new feature and command set, preserving the test intent: bare ThermostatServer hides feature-gated commands; `.with(MatterScheduleConfiguration)` exposes setActiveScheduleRequest + atomicRequest while keeping Presets-only commands hidden; `.with(Presets)` exposes setActivePresetRequest + atomicRequest while keeping MSCH-only commands hidden. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e76438c commit e8d6747

854 files changed

Lines changed: 142849 additions & 20840 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ packages/types/src/globals/*
1010
packages/node/src/tags/*
1111
packages/node/src/endpoints/*
1212
packages/node/src/devices/*
13+
packages/node/src/behaviors/index.ts
1314
packages/node/src/behaviors/*/index.ts
1415
packages/node/src/behaviors/*/*Behavior.ts
1516
packages/node/src/behaviors/*/*Interface.ts

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ The main work (all changes without a GitHub username in brackets in the below li
1111

1212
## __WORK IN PROGRESS__
1313

14+
- Breaking: Matter 1.5 specification introduces some changes, as always with new Matter specification versions. You might need to adjust your code.
15+
- Some Namespaces were renamed and now have a "Common*" prefix
16+
- Several previous "Zigbee only" features, attributes and commands were removed because they were never allowed for Matter
17+
1418
- @matter/\*
1519
- 20%–50% RAM usage reductions and improvements
1620

@@ -29,6 +33,9 @@ The main work (all changes without a GitHub username in brackets in the below li
2933
- Enhancement: Split out Blob-Storage into its own `dir`-based BlobStorage implementation
3034
- Enhancement: Added Storage Migration logic that can generically migrate between different storage engines
3135

36+
- @matter/\*:
37+
- Upgraded to Matter specification version 1.5
38+
3239
- @matter/node
3340
- Feature: (@adeepn) Added `DclBehavior` for centralized DCL configuration via environment variables (`MATTER_DCL_*`), config files, or programmatic setup
3441
- Feature: `CommissioningClient.BaseCommissioningOptions` now accepts `wifiNetwork`, `threadNetwork`, `regulatoryLocation`, and `regulatoryCountryCode` for passing network credentials and regulatory configuration during commissioning

examples/device-robotic-vacuum-cleaner/src/RoboticVacuumCleanerDevice.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
// This demonstrates bringing a "Robotic Vacuum Cleaner" device online with matter.js.
99

10-
import { AreaNamespaceTag, ServerNode } from "@matter/main";
10+
import { CommonAreaNamespaceTag, ServerNode } from "@matter/main";
1111
import { ServiceAreaServer } from "@matter/main/behaviors/service-area";
1212
import { ModeBase } from "@matter/main/clusters/mode-base";
1313
import { RvcCleanMode } from "@matter/main/clusters/rvc-clean-mode";
@@ -104,7 +104,7 @@ await node.add(
104104
locationInfo: {
105105
locationName: "Kitchen",
106106
floorNumber: 0,
107-
areaType: AreaNamespaceTag.Kitchen.tag,
107+
areaType: CommonAreaNamespaceTag.Kitchen.tag,
108108
},
109109
landmarkInfo: null,
110110
},
@@ -116,7 +116,7 @@ await node.add(
116116
locationInfo: {
117117
locationName: "Living Room",
118118
floorNumber: 0,
119-
areaType: AreaNamespaceTag.LivingRoom.tag,
119+
areaType: CommonAreaNamespaceTag.LivingRoom.tag,
120120
},
121121
landmarkInfo: null,
122122
},
@@ -128,7 +128,7 @@ await node.add(
128128
locationInfo: {
129129
locationName: "Bathroom",
130130
floorNumber: 0,
131-
areaType: AreaNamespaceTag.Bathroom.tag,
131+
areaType: CommonAreaNamespaceTag.Bathroom.tag,
132132
},
133133
landmarkInfo: null,
134134
},
@@ -140,7 +140,7 @@ await node.add(
140140
locationInfo: {
141141
locationName: "Bedroom",
142142
floorNumber: 0,
143-
areaType: AreaNamespaceTag.Bedroom.tag,
143+
areaType: CommonAreaNamespaceTag.Bedroom.tag,
144144
},
145145
landmarkInfo: null,
146146
},

examples/device-robotic-vacuum-cleaner/src/behaviors/CustomRvcRunModeServer.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ import { RvcDeviceRunModes } from "../RvcDeviceLogic.js";
1111

1212
/**
1313
* This is a custom implementation of {@link RvcRunModeServer} that makes sure that the Run Mode can not be changed
14-
* when the device is not in the Idle mode. SO a change from Mapping to Cleaning or such is not allowed without being
14+
* when the device is not in the Idle mode. So a change from Mapping to Cleaning or such is not allowed without being
1515
* Idle in between which mainly means that the current operation was stopped.
16-
* Additionally, the run mode is set to Idle on start of the device to make sure potentially old states sre reset.
16+
*
17+
* When the DirectModeChange feature is enabled, direct transitions between non-idle modes are allowed.
18+
*
19+
* Additionally, the run mode is set to Idle on start of the device to make sure potentially old states are reset.
1720
*/
1821
export class CustomRvcRunModeServer extends RvcRunModeServer {
1922
override initialize() {
@@ -27,7 +30,12 @@ export class CustomRvcRunModeServer extends RvcRunModeServer {
2730
if (result.status !== ModeBase.ModeChangeStatus.Success) {
2831
return result;
2932
}
30-
if (newMode !== RvcDeviceRunModes.Idle && this.state.currentMode !== RvcDeviceRunModes.Idle) {
33+
// When DirectModeChange is not enabled, require going through Idle first
34+
if (
35+
!this.features.directModeChange &&
36+
newMode !== RvcDeviceRunModes.Idle &&
37+
this.state.currentMode !== RvcDeviceRunModes.Idle
38+
) {
3139
return {
3240
status: ModeBase.ModeChangeStatus.InvalidInMode,
3341
statusText: `Can not switch operative modes while in a non-idle state (${this.state.currentMode})`,
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright 2022-2026 Matter.js Authors
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/*** THIS FILE IS GENERATED, DO NOT EDIT ***/
8+
9+
import "@matter/main/platform";
10+
11+
export * from "@matter/node/behaviors/camera-av-settings-user-level-management";
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright 2022-2026 Matter.js Authors
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/*** THIS FILE IS GENERATED, DO NOT EDIT ***/
8+
9+
import "@matter/main/platform";
10+
11+
export * from "@matter/node/behaviors/camera-av-stream-management";
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright 2022-2026 Matter.js Authors
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/*** THIS FILE IS GENERATED, DO NOT EDIT ***/
8+
9+
import "@matter/main/platform";
10+
11+
export * from "@matter/node/behaviors/chime";
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright 2022-2026 Matter.js Authors
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/*** THIS FILE IS GENERATED, DO NOT EDIT ***/
8+
9+
import "@matter/main/platform";
10+
11+
export * from "@matter/node/behaviors/closure-control";
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright 2022-2026 Matter.js Authors
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/*** THIS FILE IS GENERATED, DO NOT EDIT ***/
8+
9+
import "@matter/main/platform";
10+
11+
export * from "@matter/node/behaviors/closure-dimension";
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright 2022-2026 Matter.js Authors
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/*** THIS FILE IS GENERATED, DO NOT EDIT ***/
8+
9+
import "@matter/main/platform";
10+
11+
export * from "@matter/node/behaviors/commodity-metering";

0 commit comments

Comments
 (0)