Repository navigation
Conversation
InitialState now carries protocolVersion (1) and extensionVersion, so a server can tell which message format the extension speaks. Failed responses carry a machine-readable code (unauthorized, invalid_params, unknown_request, unavailable, command_failed) next to the human-readable error, so receivers no longer have to parse error texts. protocol/messages.schema.json describes all messages as JSON Schema. The tests validate every message the extension sends against it. Version 0.4.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E14pPhbcMWLg9j9gAfGW9f
Requests, responses, error codes, events, the state payload, authentication and versioning rules in one place. The README links to it instead of keeping its own (outdated) copy, and CONTRIBUTING explains how to change the protocol. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E14pPhbcMWLg9j9gAfGW9f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part 4 of the extension stack, on top of #12 (merge order: #10 → #11 → #12 → this PR). Makes the WebSocket messages an explicit, tested contract between the extension, spicetify-websocket and the Home Assistant integration. Version 0.4.0.
What changes and why
InitialStatecarriesprotocolVersion: 1andextensionVersioncode(unauthorized,invalid_params,unknown_request,unavailable,command_failed) next toerrorprotocol/messages.schema.json(JSON Schema 2020-12)ajv, dev dependency only)PROTOCOL.mdPROTOCOL_VERSIONonly for changes receivers must know about.Compatibility
Additive only: old servers ignore the new fields. The end-to-end tests in spicetify-websocket (tobfd/spicetify-websocket, PR "lib error codes, protocol version, E2E") run this extension against the real server and validate all frames in both directions against this schema.
Tests
npm test: 17 passed (2 new: version fields inInitialState, error codes), every sent message schema-validated.npm run lint: clean.codeon failure, missingprotocolVersion, volume out of range, queue longer than 5 are rejected).🤖 Generated with Claude Code
https://claude.ai/code/session_01E14pPhbcMWLg9j9gAfGW9f
Generated by Claude Code