Skip to content

Minor changes#12

Open
jonathan6620 wants to merge 6 commits intovrtejus:mainfrom
jonathan6620:main
Open

Minor changes#12
jonathan6620 wants to merge 6 commits intovrtejus:mainfrom
jonathan6620:main

Conversation

@jonathan6620
Copy link
Copy Markdown

Adds testing, type-checking (with type-hints and pydantic) and configuration tools for claude code.

Jonathan Ward and others added 6 commits February 22, 2026 21:29
- MCP server now sends structured JSON commands ({command, args}) instead
  of Python code strings over the socket
- Plugin dispatches to an allowlist of ~77 cmd.* handler functions instead
  of using exec() to run arbitrary code
- Removed dangerous commands: system (shell exec), cd, ls, pwd
- Added message-type validation and proper error propagation
- util.* commands use cmd.do() (PyMOL's safe command interpreter)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix duplicate 'spheres' in show/hide representation options
- Fix analyze_pymol_output() lowercasing regex patterns, which converted
  \S (non-whitespace) to \s (whitespace), breaking OBJECT_NOT_FOUND detection.
  Now uses re.IGNORECASE instead.
- Remove deprecated util.ss and nonexistent util.color_secondary from both
  server definitions and plugin dispatcher
- Add composite color_ss command to replace util.ss (colors helices red,
  sheets yellow, loops green)
- Add comprehensive test suite (175 tests) covering command definitions,
  pattern matching, error detection, and server/plugin sync

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds Option B (Claude Code CLI) alongside Claude Desktop for MCP server
configuration, documents manual and auto-start methods for the PyMOL
socket listener, and adds socket verification commands.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace raw dicts with validated Pydantic models throughout:
- ParameterDef, CommandDef, ErrorCategory, SocketRequest,
  SocketResponse, and ParseResult models in new models.py
- All 66 PYMOL_COMMANDS entries converted to CommandDef/ParameterDef
- ERROR_PATTERNS validated at module load time via ErrorCategory
- parse_pymol_input returns ParseResult (backward-compatible via __iter__)
- SocketRequest used for outbound serialization in send_command
- SocketResponse used for response parsing in parse_and_execute
- Port validation (1-65535) added to PyMOLConnection.__init__
- 26 new model validation tests in TestPydanticModels class

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant