Skip to main content

muse_code_sdk/msp/view/item/object/
tool_call.rs

1// @generated from the MSP stable schema and protocol sources; do not edit by hand.
2
3use crate::msp::view::item_background::BackgroundInitiator;
4use crate::msp::view::item_background::BackgroundStatus;
5use crate::msp::view::item_content::ModelVisibleContent;
6use crate::msp::view::item_content::OutputRef;
7use crate::msp::view::item_content::PatchSummary;
8use crate::msp::view::item_status::StatusAttempt;
9use crate::msp::view::item_status::StatusChildren;
10use crate::msp::view::item_status::StatusHealth;
11use crate::msp::view::item_status::StatusProgress;
12use crate::msp::view::item_status::StatusStep;
13use crate::msp::view::tool_receipt::ToolReceipt;
14use serde::Deserialize;
15use serde::Serialize;
16
17/// `toolCall` members, flattened into the item row.
18#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19#[serde(rename_all = "camelCase")]
20#[non_exhaustive]
21pub struct ToolCallMembers {
22    /// `toolCall`: tool name.
23    #[serde(skip_serializing_if = "Option::is_none")]
24    pub tool: Option<String>,
25    /// `toolCall`: the provider call id (`call_...`), opaque.
26    #[serde(skip_serializing_if = "Option::is_none")]
27    pub call_id: Option<String>,
28    /// `toolCall`: the model-authored argument JSON, **verbatim**; clients
29    /// parse. Verbatim keeps the fold byte-deterministic and survives
30    /// model-emitted almost-JSON.
31    #[serde(skip_serializing_if = "Option::is_none")]
32    pub args: Option<String>,
33    /// `toolCall`/`subagent`: `Failed`/`Rejected`/`Cancelled` reason text,
34    /// verbatim.
35    #[serde(skip_serializing_if = "Option::is_none")]
36    pub failure_reason: Option<String>,
37    /// `toolCall`: machine-readable failure class.
38    #[serde(skip_serializing_if = "Option::is_none")]
39    pub failure_kind: Option<String>,
40    /// `toolCall`/`userShell`: bounded transcript-visible result text; streams
41    /// via `item/delta` field `"output"`.
42    #[serde(skip_serializing_if = "Option::is_none")]
43    pub visible_output: Option<String>,
44    /// `toolCall`/`userShell`: stored-output reference; fetch the full bytes
45    /// via `item/readOutput`.
46    #[serde(skip_serializing_if = "Option::is_none")]
47    pub output_ref: Option<OutputRef>,
48    /// `toolCall`: the shared semantic receipt — what the operation did, as
49    /// machine-readable fact. Optional and additive: absence is always valid
50    /// and is never an error. When present, a server serves the **same**
51    /// receipt on every item path — `item/completed`, `view/page`, seeded
52    /// snapshots and resume. Observation only; carries no control authority,
53    /// and no field in it enters model-visible content.
54    #[serde(skip_serializing_if = "Option::is_none")]
55    pub tool_receipt: Option<Box<ToolReceipt>>,
56    /// `toolCall`: server-authored edit-family diff summary — always beside
57    /// `patchRef`; absent = no diff available.
58    #[serde(skip_serializing_if = "Option::is_none")]
59    pub patch_summary: Option<PatchSummary>,
60    /// `toolCall`: stored structured-patch reference (`kind: "tool_patch"`,
61    /// `mediaType: "application/json"`); the body is fetched via
62    /// `item/readOutput` with `patchRef.id`, and the ref survives the
63    /// elided-snapshot rung exactly like `outputRef` without ever being an
64    /// elision trigger.
65    #[serde(skip_serializing_if = "Option::is_none")]
66    pub patch_ref: Option<OutputRef>,
67    /// `toolCall`: rich content the model saw beyond text; base64 is not
68    /// inlined on the view.
69    #[serde(skip_serializing_if = "Option::is_none")]
70    pub model_visible_content: Option<Vec<ModelVisibleContent>>,
71    /// `toolCall`: the approval that gated this call; join key for the approval
72    /// view events.
73    #[serde(skip_serializing_if = "Option::is_none")]
74    pub approval_id: Option<String>,
75    /// `toolCall`: `true` once the task was durably backgrounded; delivered
76    /// via `item/updated`.
77    #[serde(skip_serializing_if = "Option::is_none")]
78    pub background: Option<bool>,
79    /// `toolCall`: who backgrounded the task; absent on pre-split records —
80    /// never inferred.
81    #[serde(skip_serializing_if = "Option::is_none")]
82    pub background_initiator: Option<BackgroundInitiator>,
83    /// `toolCall`: the backgrounded-row payload for a running backgrounded item
84    /// — auto-yield or an explicit user/timeout background; may appear with or
85    /// without `background`/`backgroundInitiator`. Experimental, delivered via
86    /// `item/updated`. Presentation only — never a durability claim.
87    #[serde(skip_serializing_if = "Option::is_none")]
88    pub background_status: Option<BackgroundStatus>,
89    /// `toolCall`: the task's visible latest-status line — the latest `Status`
90    /// message through the shared detail normalization; absent when no status
91    /// folded or nothing displayable remains.
92    #[serde(skip_serializing_if = "Option::is_none")]
93    pub status_line: Option<String>,
94    /// `toolCall`: the latest detail's phase row, verbatim; absent when the
95    /// latest detail carries none.
96    #[serde(skip_serializing_if = "Option::is_none")]
97    pub status_phase: Option<String>,
98    /// `toolCall`: the latest progress facet, field-for-field; absent when the
99    /// latest detail carries none.
100    #[serde(skip_serializing_if = "Option::is_none")]
101    pub status_progress: Option<StatusProgress>,
102    /// `toolCall`: the latest active-step facet, field-for-field; absent when
103    /// the latest detail carries none.
104    #[serde(skip_serializing_if = "Option::is_none")]
105    pub status_step: Option<StatusStep>,
106    /// `toolCall`: the latest external-attempt facet, field-for-field —
107    /// countdown inputs the client renders the tick from; absent when the
108    /// latest detail carries none.
109    #[serde(skip_serializing_if = "Option::is_none")]
110    pub status_attempt: Option<StatusAttempt>,
111    /// `toolCall`: the latest health facet, field-for-field; absent when the
112    /// latest detail carries none.
113    #[serde(skip_serializing_if = "Option::is_none")]
114    pub status_health: Option<StatusHealth>,
115    /// `toolCall`: the latest child-summary facet, field-for-field; absent when
116    /// the latest detail carries none.
117    #[serde(skip_serializing_if = "Option::is_none")]
118    pub status_children: Option<StatusChildren>,
119    /// `toolCall`: the tool's own words for this call; absent = none.
120    #[serde(skip_serializing_if = "Option::is_none")]
121    pub display_label: Option<Box<crate::msp::view::tool_label::ToolDisplayLabel>>,
122}