muse_code_sdk/msp/method/goal.rs
1// @generated from the MSP stable schema and protocol sources; do not edit by hand.
2
3use crate::msp::method::turn::CommandStatus;
4use serde::Deserialize;
5use serde::Serialize;
6
7/// `goal/set` params: set the session's goal objective.
8#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
9#[serde(rename_all = "camelCase")]
10pub struct GoalSetParams {
11 /// The target session.
12 pub session_id: String,
13 /// The idempotency handle (UUIDv7).
14 pub command_id: String,
15 /// The objective text; required, non-empty after Unicode-whitespace trim
16 /// (the trimmed text is the payload). Empty-after-trim is `-32602
17 /// invalidParams`.
18 pub objective: String,
19}
20
21/// `goal/edit` params: replace the current goal's objective. Same shape as
22/// `goal/set`; the verbs differ in their `missing_goal` precondition, not their
23/// payload.
24#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
25#[serde(rename_all = "camelCase")]
26pub struct GoalEditParams {
27 /// The target session.
28 pub session_id: String,
29 /// The idempotency handle (UUIDv7).
30 pub command_id: String,
31 /// The replacement objective; same trim/non-empty rule as `goal/set`.
32 pub objective: String,
33}
34
35/// `goal/clear` params. An `objective` here is an unknown field and rejects
36/// `-32602 invalidParams` — the bare verbs carry exactly this pair.
37#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
38#[serde(rename_all = "camelCase")]
39pub struct GoalClearParams {
40 /// The target session.
41 pub session_id: String,
42 /// The idempotency handle (UUIDv7).
43 pub command_id: String,
44}
45
46/// `goal/pause` params; shape as `goal/clear`.
47#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
48#[serde(rename_all = "camelCase")]
49pub struct GoalPauseParams {
50 /// The target session.
51 pub session_id: String,
52 /// The idempotency handle (UUIDv7).
53 pub command_id: String,
54}
55
56/// `goal/resume` params; shape as `goal/clear`.
57#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
58#[serde(rename_all = "camelCase")]
59pub struct GoalResumeParams {
60 /// The target session.
61 pub session_id: String,
62 /// The idempotency handle (UUIDv7).
63 pub command_id: String,
64}
65
66/// The shared goal ack, admission-only: all five verbs answer this one shape,
67/// differing only in when `turnId` is present.
68#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
69#[serde(rename_all = "camelCase")]
70#[non_exhaustive]
71pub struct GoalCommandResult {
72 /// Echoes the client's id.
73 pub command_id: String,
74 /// Admission status.
75 pub status: CommandStatus,
76 /// Present by exactly the four result cases: an idle wake carries the fresh
77 /// goal turn's id; a busy `set`/`edit`/`resume` carries the admission-time
78 /// active turn's id (a routing fact, not a delivery promise);
79 /// `pause`/`clear` never carry it; an idle admission whose resulting goal
80 /// is not unfinished parks the notification and carries none.
81 /// **Additive-optional**: absent means "no turn named", never fabricated.
82 #[serde(skip_serializing_if = "Option::is_none")]
83 pub turn_id: Option<String>,
84}