pub enum ControlRequestKind {
CanUseTool {
tool_name: String,
input: Value,
permission_suggestions: Vec<Value>,
blocked_path: Option<String>,
tool_use_id: String,
agent_id: Option<String>,
decision_reason: Option<String>,
title: Option<String>,
display_name: Option<String>,
description: Option<String>,
},
McpMessage {
server_name: String,
message: Value,
},
HookCallback {
callback_id: String,
input: Value,
tool_use_id: Option<String>,
},
Unknown {
subtype: String,
raw: Value,
},
}Expand description
Enumerates the kinds of control requests we handle.
Unknown is the forward-compat catch-all - any subtype the CLI
ships that forge-sdk doesn’t yet model lands here with the full
payload captured. The dispatcher in client/control_dispatch.rs
responds with a control_response error (since we have no handler)
and logs a tracing::warn! so callers notice drift.
Variants§
CanUseTool
A permission check for a tool call.
Fields
McpMessage
MCP JSON-RPC message routed in-process. See mcp module for the MCP
routing pipeline.
Fields
HookCallback
Hook callback invocation. callback_id was registered at connect
time via the initialize control_request. See Plan 3 hooks section.
Fields
Unknown
Forward-compat fallback for subtype values forge-sdk doesn’t
recognise. The dispatcher responds with an error (since no handler
is registered) and logs a warning. This prevents an unknown CLI
subtype from panicking the session.