@redonvn/cli-protocol
v0.1.5
Published
Shared protocol types and Zod schemas for RedAI CLI <-> Backend WebSocket communication
Readme
@redonvn/cli-protocol
Shared protocol types and Zod schemas dùng giữa @redonvn/cli và RedAI backend.
User cuối không cần cài package này — npm sẽ tự pull khi cài @redonvn/cli.
Cấu trúc
src/
├── events.ts # CLI_NAMESPACE='/redai-cli', CLI_SOCKET_EVENTS, CLI_ENVELOPE_TYPES
├── envelope.ts # EnvelopeSchema + buildEnvelope()
├── messages.ts # Hello / Heartbeat / ToolCall / ToolResult / ToolStream payloads
├── tools.ts # Param schemas cho Read/Write/Edit/Bash/Grep/Glob/WebFetch/RunCli
└── llm.ts # LLMRequestParams (8 provider) + LLMResponseWire format
{
v: 1,
type: 'HELLO' | 'HELLO_ACK' | 'HEARTBEAT' | 'TOOL_CALL' | 'TOOL_RESULT' | 'TOOL_STREAM' | 'TOOL_CANCEL',
requestId?: string,
sessionId?: string,
ts: string, // ISO timestamp
payload: unknown // shape tuỳ type
}License
MIT
