What problem does it solve?
Parser-development helps you reliably interpret Claude Code CLI NDJSON output, validate event payloads, and convert parsed protocol events into stable socket events for the client.
Core Features & Use Cases
- ProtocolEvent → SocketEvent pipeline: Transform CLI protocol events into
SocketEvent messages that the UI can render.
- Zod-based schema validation: Safely parse and validate discriminated event types (with explicit handling for unknown events).
- Adapter pattern with server actions: Produce adapter outputs that include
events, autoResponses, controlResponses, and serverActions such as auto_respond, read_diff, and forward_to_client.
- Debuggable, testable workflow: Provides a clear flow for
parseLine() and transform() plus a test pattern for adapter behavior.
- Event naming convention coverage: Supports
type:subtype naming (message, stream, control, system, notification, and raw fallback for unknown types) to keep the event contract consistent.
Quick Start
Add a new Zod schema for the event in claude-schemas.ts, register it in KNOWN_EVENT_TYPES/getSchemaForType(), then implement the conversion in claude-adapter.ts and validate with tests in apps/summoner/src/protocol/__tests__/.