pub struct TurnInputPart {
pub part_type: TurnInputPartType,
pub text: Option<String>,
pub media_type: Option<String>,
pub base64_data: Option<String>,
pub width: Option<u64>,
pub height: Option<u64>,
pub selector: Option<String>,
pub arguments: Option<String>,
pub source: Option<SkillInvocationSource>,
pub upload_id: Option<String>,
pub client_ref: Option<ClientRef>,
}Expand description
One ordered content part of a turn submission. File mentions are text, not a
part type: write @relative/path in a text part. A structured mention
part is reserved and currently rejected, and an unknown part type is
invalidParams — which is what closes TurnInputPartType.
Modelled as a discriminated flat object rather than a Rust enum, the
convention crate::msp::view::approval::ApprovalSubject already established
for a wire union in this crate: the v1 schema model names no
object-variant union shape and fails closed on one. The serialized JSON is
the same either way; what a flat object cannot express is “mediaType is
required exactly when type is image”.
Fields§
§part_type: TurnInputPartTypeThe part type.
text: Option<String>User prompt text, on a text part. Multiple text parts are joined in
order into the turn’s prompt.
media_type: Option<String>Media type, required on an image part.
base64_data: Option<String>Base64 payload, required on an image part. Invalid base64 or an
empty payload is rejected with invalid params.
width: Option<u64>Pixel width; must be provided together with height or not at all.
Published as a dependentRequired pair.
height: Option<u64>Pixel height; must be provided together with width or not at all.
selector: Option<String>The skill to invoke, required on a skill part: a bare or
plugin-qualified shortcut token from skill/list. The HOST resolves and
expands; an unknown selector is the typed -32032 skillNotFound request
error.
arguments: Option<String>Free-text skill arguments, optional on a skill part — the wire twin of
what the TUI accepts after the shortcut token.
source: Option<SkillInvocationSource>The picked copy’s source, optional on a skill part: one of the catalog
rows’ source values. When present the host resolves the exact
(selector, source) row; when absent it resolves the selector, bare or
plugin-qualified, against the session’s skill catalog, as the TUI
shortcut does. Closed: an unknown value is invalidParams, never a
fall-through.
upload_id: Option<String>The upload receipt, required on a video part: the client-minted id
media/upload echoed.
client_ref: Option<ClientRef>The client’s own name for this image, optional on an image part: { "name" }, 1 to 256 bytes of UTF-8 with no character restriction; an
empty or longer name is invalid params. Other part types ignore it.
Returned verbatim in session/resume.unavailableInputAssets and the
lost-image marker once the host records it. Experimental
(TurnInputPart.clientRef).