Expand description
Control-protocol messages exchanged over the main stream-json stdio channel.
These carry out-of-band requests that the SDK must answer synchronously,
such as permission checks (can_use_tool). The shapes here mirror what
the CLI emits on that channel, observed rather than specified.
Re-exportsยง
use serde::Deserialize;๐use serde::Deserialize;๐use serde::Serialize;๐use serde::Serialize;๐use serde_json::Value;๐
Structsยง
- Control
Request - A control request emitted by the
claudebinary. The SDK must respond with a matchingControlResponsecarrying the samerequest_id. - Control
Response - Control response from SDK back to the
claudebinary.
Enumsยง
- Allow
Behavior - Serialisable shape for the
responsefield inside a successfulcan_use_toolresponse. - Control
Request Kind - Enumerates the kinds of control requests we handle.
- Control
Request Type - The discriminant type for
ControlRequest. Always"control_request". - Control
Response Kind - Response body, success or error.
- Control
Response Type - The discriminant type for
ControlResponse. Always"control_response".