#[non_exhaustive]pub enum ClientNotification {
CancelNotification(CancelNotification),
DidOpenDocumentNotification(DidOpenDocumentNotification),
DidChangeDocumentNotification(DidChangeDocumentNotification),
DidCloseDocumentNotification(DidCloseDocumentNotification),
DidSaveDocumentNotification(DidSaveDocumentNotification),
DidFocusDocumentNotification(DidFocusDocumentNotification),
AcceptNesNotification(AcceptNesNotification),
RejectNesNotification(RejectNesNotification),
MessageMcpNotification(MessageMcpNotification),
ExtNotification(ExtNotification),
}Expand description
All possible notifications that a client can send to an agent.
This enum is used internally for routing RPC notifications. You typically won’t need to use this directly.
Notifications do not expect a response.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
CancelNotification(CancelNotification)
Cancels ongoing operations for a session.
This is a notification sent by the client to cancel an ongoing prompt turn.
Upon receiving this notification, the Agent SHOULD:
- Stop all language model requests as soon as possible
- Abort all tool call invocations in progress
- Send any pending
session/updatenotifications - Respond to the original
session/promptrequest withStopReason::Cancelled
See protocol docs: Cancellation
DidOpenDocumentNotification(DidOpenDocumentNotification)
unstable_nes only.UNSTABLE
Notification sent when a file is opened in the editor.
DidChangeDocumentNotification(DidChangeDocumentNotification)
unstable_nes only.UNSTABLE
Notification sent when a file is edited.
DidCloseDocumentNotification(DidCloseDocumentNotification)
unstable_nes only.UNSTABLE
Notification sent when a file is closed.
DidSaveDocumentNotification(DidSaveDocumentNotification)
unstable_nes only.UNSTABLE
Notification sent when a file is saved.
DidFocusDocumentNotification(DidFocusDocumentNotification)
unstable_nes only.UNSTABLE
Notification sent when a file becomes the active editor tab.
AcceptNesNotification(AcceptNesNotification)
unstable_nes only.UNSTABLE
Notification sent when a suggestion is accepted.
RejectNesNotification(RejectNesNotification)
unstable_nes only.UNSTABLE
Notification sent when a suggestion is rejected.
MessageMcpNotification(MessageMcpNotification)
unstable_mcp_over_acp only.UNSTABLE
This capability is not part of the spec yet, and may be removed or changed at any point.
Sends an MCP-over-ACP notification.
ExtNotification(ExtNotification)
Handles extension notifications from the client.
Extension notifications provide a way to send one-way messages for custom functionality while maintaining protocol compatibility.
See protocol docs: Extensibility
Implementations§
Trait Implementations§
Source§impl Clone for ClientNotification
impl Clone for ClientNotification
Source§fn clone(&self) -> ClientNotification
fn clone(&self) -> ClientNotification
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClientNotification
impl Debug for ClientNotification
Source§impl<'de> Deserialize<'de> for ClientNotification
impl<'de> Deserialize<'de> for ClientNotification
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl IntoV2 for ClientNotification
Available on crate feature unstable_protocol_v2 only.
impl IntoV2 for ClientNotification
unstable_protocol_v2 only.Source§impl JsonSchema for ClientNotification
impl JsonSchema for ClientNotification
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more