Expand description
§kimi-wire
Typed Rust client for the Kimi Code CLI Wire protocol.
§Overview
The Wire protocol is a JSON-RPC 2.0 based bidirectional communication
protocol exposed by kimi --wire. This crate provides:
- Strongly typed protocol structs (
protocol::event::Event,protocol::request::Request,protocol::method::PromptResult, …). - A
WireClienttrait with high-level methods (prompt,replay,steer, …). - A
transport::Transportabstraction for stdio, in-memory channels, or custom backends. - Optional secret redaction for wire logs.
§Feature flags
| Feature | Description |
|---|---|
process (default) | Enables transport::ChildProcessTransport for spawning kimi --wire. |
redact (default) | Enables protocol::redact::redact_secrets for scrubbing secrets from JSON. |
§Example
use kimi_wire::{InMemoryWireClient, WireClient};
let mut client = InMemoryWireClient::new();
let result = client.prompt("hello").await?;Re-exports§
pub use client::InMemoryWireClient;pub use client::WireClient;pub use error::WireError;
Modules§
- client
- Client trait and in-memory implementation for the Wire protocol.
- error
- Error types for wire protocol failures.
- protocol
- Protocol types: JSON-RPC, events, requests, methods, and content parts.
- transport
- Transport implementations (child process, channels). Transport layer for the Kimi Wire protocol.
Constants§
- WIRE_
PROTOCOL_ LEGACY_ VERSION - Legacy protocol version used when the server does not support
initialize. - WIRE_
PROTOCOL_ VERSION - The latest wire protocol version supported by this crate.