pdftract/crates/pdftract-cli
jedarden c17ce713ee feat(pdftract-5xq16): implement JSON-RPC 2.0 framing layer
Add hand-rolled JSON-RPC 2.0 implementation for MCP server transports.

Module: crates/pdftract-cli/src/mcp/framing/
- Id enum with Number/String/Null variants preserving JSON type
- Request, Response, Notification, ErrorObject structs
- BatchMessage for batch request handling
- Strict jsonrpc version validation (must be "2.0")
- All 6 spec-defined error codes (-32700, -32600, -32601, -32602, -32603, -32099..-32000)
- Constructor helpers for common patterns

Acceptance criteria verified:
- Round-trip serialization/deserialization
- ID type preservation (number/string/null)
- Parse error responses with null id
- Method not found error construction
- Notification detection (no id field)
- Batch request handling
- Rejection of invalid jsonrpc versions
- Empty batch rejection

16 unit tests covering all spec requirements.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 00:00:47 -04:00
..
src feat(pdftract-5xq16): implement JSON-RPC 2.0 framing layer 2026-05-23 00:00:47 -04:00
tests fix(pdftract-2a6rk): fix xref.rs u64 literal overflow in proptest 2026-05-22 17:26:27 -04:00
Cargo.toml feat(pdftract-29z7b): implement unified diagnostic system + CLI commands 2026-05-22 22:38:31 -04:00