[kimi] refactor: extract WebSocket message types into shared protocol module (#667) #696

Merged
kimi merged 1 commits from kimi/issue-667 into main 2026-03-21 13:37:29 +00:00

1 Commits

Author SHA1 Message Date
kimi
5ad703e35f refactor: extract WebSocket message types into shared protocol module
Some checks failed
Tests / lint (pull_request) Has been cancelled
Tests / test (pull_request) Has been cancelled
Adds `src/infrastructure/protocol.py` with a `MessageType` StrEnum
covering all 9 Matrix PROTOCOL.md message types (agent_state,
visitor_state, bark, thought, system_status, connection_ack, error,
task_update, memory_flash) and typed dataclasses with `to_json()` /
`from_json()` serialisation.

Includes comprehensive unit tests for round-trip serialisation and
`WSMessage.from_json()` dispatch to the correct subclass.

Fixes #667

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 09:36:05 -04:00