1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Wire format for the plugin output protocol.
//!
//! Plugins emit one [`Output`] JSON object per line on their stdout.
//! The host parses each line and dispatches per variant: `command`
//! is a request for the host to perform some action and (potentially)
//! reply, `mcp` announces the URL of an MCP server the plugin just
//! started, `error` is displayed, and anything that doesn't match
//! those three lands in the untagged [`Output::Notification`]
//! catch-all carrying the raw JSON value.
use JsonSchema;
use ;
use Command;
use crateError;
/// One line of plugin output. Untagged outer enum — deserialization
/// tries each typed variant by its constant `type:"…"` discriminator
/// in source order and falls through to [`Output::Notification`] as
/// a catch-all carrying the raw JSON value.
///
/// The former `Mcp` announcement variant was removed with the
/// `plugins run` machinery — future plugins have no stdout protocol
/// at all; an MCP-URL announcement lands in the `Notification`
/// catch-all like any other untyped line.