Skip to content
Developer Preview

TurnInputPart

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::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 shape either way; what a flat object cannot express is “mediaType is required exactly when type is image”.

RULED: the precedent is accepted. A strict union node kind may be funded later as a follow-up; if it is, it must cover [crate::method::lifecycle::PendingRequestPointer] too.

  • base64Data
  • height
  • mediaType
  • text
  • type
  • width
Source

schema/msp/experimental/msp.schema.json#/types/TurnInputPart

{
"dependentRequired": {
"height": [
"width"
],
"width": [
"height"
]
},
"description": "One ordered content part of a turn submission. File mentions\nare text, not a part type: write `@relative/path` in a text part. A\nstructured `mention` part is reserved and currently rejected, and an\nunknown part type is `invalidParams` — which is what\ncloses [`TurnInputPartType`].\n\nModelled as a discriminated flat object rather than a Rust `enum`, the\nconvention [`crate::view::approval::ApprovalSubject`] already established\nfor a wire union in this crate: the v1 schema model names no\nobject-variant union shape and fails closed on one. The serialized JSON is\nthe shape either way; what a flat object cannot express is\n\"`mediaType` is required exactly when `type` is `image`\".\n\n**RULED: the precedent is accepted.** A\nstrict union node kind may be funded later as a follow-up; if it is, it\nmust cover [`crate::method::lifecycle::PendingRequestPointer`] too.",
"properties": {
"base64Data": {
"description": "Base64 payload, required on an `image` part. Invalid base64 or an\nempty payload is rejected with invalid params.",
"type": "string"
},
"height": {
"description": "Pixel height; must be provided together with `width` or not at all.",
"type": "integer"
},
"mediaType": {
"description": "Media type, required on an `image` part.",
"type": "string"
},
"text": {
"description": "User prompt text, on a `text` part. Multiple text parts are joined in\norder into the turn's prompt.",
"type": "string"
},
"type": {
"$ref": "#/$defs/TurnInputPartType",
"description": "The part type."
},
"width": {
"description": "Pixel width; must be provided together with `height` or not at all. Published as a `dependentRequired` pair under an owner ruling.",
"type": "integer"
}
},
"required": [
"type"
],
"type": "object"
}