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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// @generated from the MSP stable schema and protocol sources; do not edit by hand.
use super::turn::CommandStatus;
use serde::Deserialize;
use serde::Serialize;
mod catch_all;
/// `recap/request` params: the session plus the client-minted UUIDv7 retry id.
/// No other param; unknown fields are `invalidParams`.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct RecapRequestParams {
/// The session to recap (required).
pub session_id: String,
/// The client-minted retry id.
pub command_id: String,
}
/// `recap/request` result: admission only — the ack is never the recap.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[non_exhaustive]
pub struct RecapRequestResult {
/// The request's id, echoed.
pub command_id: String,
/// Always `accepted` on this path.
pub status: CommandStatus,
}
/// `recap/cancel` params: the session plus the cancel's own retry id. No target
/// — one in-flight slot per session makes the target unambiguous.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct RecapCancelParams {
/// The session whose in-flight recap to cancel (required).
pub session_id: String,
/// The cancel's own retry id.
pub command_id: String,
}
/// `recap/cancel` result: admission only. In flight → the recap settles
/// `cancelled`; idle → accepted no-op.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[non_exhaustive]
pub struct RecapCancelResult {
/// The cancel's id, echoed.
pub command_id: String,
/// Always `accepted` on this path.
pub status: CommandStatus,
}
/// `recap/completed` outcome: the terminal vocabulary, in camelCase. **Open**:
/// a server-produced result vocabulary.
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum RecapOutcome {
/// The recap text is delivered in `text`.
Completed,
/// The side-call failed; `reason` says why.
Failed,
/// `recap/cancel` won the race.
Cancelled,
/// The host-enforced 45s bound fired.
TimedOut,
/// A value from a newer host, kept verbatim so an older client decodes the
/// rest of the message. Never construct it with a known word.
Unknown(String),
}
/// `recap/completed` failure reason: post-ack failures fold to the single
/// initial value. **Open**: later splits stay additive.
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum RecapFailureReason {
/// Provider errors, tool requests, setup-fence and projection
/// refusals, missing models — the TUI's single failure rendering.
ProviderFailed,
/// A value from a newer host, kept verbatim so an older client decodes the
/// rest of the message. Never construct it with a known word.
Unknown(String),
}
/// `recap/completed` params: the settlement, delivered to the requesting
/// connection outside the view stream — no `viewCursor`, no `sourceRange`.
/// `text` is required on `completed`; `reason` is required on `failed`; neither
/// rides `cancelled`/`timedOut`. The struct marks the conditional members
/// optional; the SS prose pins the per-outcome rule, the `turn/completed`
/// usage/error convention.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[non_exhaustive]
pub struct RecapCompletedParams {
/// The recapped session.
pub session_id: String,
/// The request's id — the correlation key.
pub command_id: String,
/// How the request settled.
pub outcome: RecapOutcome,
/// The recap text verbatim (on `completed`).
#[serde(default, skip_serializing_if = "Option::is_none")]
pub text: Option<String>,
/// The model-produced short title (on `completed`, when produced).
#[serde(default, skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
/// Why the side-call failed (on `failed`).
#[serde(default, skip_serializing_if = "Option::is_none")]
pub reason: Option<RecapFailureReason>,
}