pub enum Event {
Show 17 variants
TurnBegin {
user_input: UserInput,
},
TurnEnd,
StepBegin {
n: u32,
},
StepInterrupted,
CompactionBegin,
CompactionEnd,
StatusUpdate(StatusUpdate),
ContentPart(ContentPart),
ToolCall {
id: String,
function: ToolCallFunction,
extras: Option<Value>,
},
ToolCallPart {
arguments_part: Option<String>,
},
ToolResult {
tool_call_id: String,
return_value: ToolReturnValue,
},
ApprovalResponse {
request_id: String,
response: ApprovalResponseKind,
feedback: Option<String>,
},
SubagentEvent {
parent_tool_call_id: Option<String>,
agent_id: Option<String>,
subagent_type: Option<String>,
event: SubagentEventPayload,
},
SteerInput {
user_input: UserInput,
},
PlanDisplay {
content: String,
file_path: String,
},
HookTriggered {
event: String,
target: String,
hook_count: u32,
},
HookResolved {
event: String,
target: String,
action: HookAction,
reason: String,
duration_ms: u64,
},
}Expand description
An event emitted by the agent during a turn.
Events are sent as JSON-RPC notifications (method: "event") and do not
require a response.
Serialization follows the official wire envelope format:
{"type": "TurnBegin", "payload": {"user_input": ...}}.
Variants§
TurnBegin
A new turn has started with the given user input.
TurnEnd
The current turn has ended.
StepBegin
A new step within the turn has started.
StepInterrupted
The current step was interrupted (e.g. by user input).
CompactionBegin
Context compaction has started.
CompactionEnd
Context compaction has finished.
StatusUpdate(StatusUpdate)
Server status update (token usage, context size, etc.).
ContentPart(ContentPart)
A content part (text, image, etc.) from the model.
ToolCall
A tool call from the model.
Wire name is "function" because Kimi serializes tool calls as function type.
Fields
function: ToolCallFunctionFunction name and arguments.
ToolCallPart
A partial tool call (streaming arguments).
ToolResult
Result of a tool execution.
Fields
return_value: ToolReturnValueReturn value from the tool.
ApprovalResponse
Response to an approval request (sent by the client).
Fields
response: ApprovalResponseKindApproval decision.
SubagentEvent
An event from a subagent.
Fields
event: SubagentEventPayloadNested wire message in envelope form.
SteerInput
Additional user input steering the current turn.
PlanDisplay
Plan display content.
HookTriggered
A hook was triggered.
Fields
HookResolved
A hook was resolved.