Compare commits

...

1 Commits

Author SHA1 Message Date
Roy Han
18d6bc2d2f add image generation content model 2026-05-10 19:19:07 -07:00
25 changed files with 2112 additions and 1 deletions

View File

@@ -1932,6 +1932,102 @@
],
"type": "object"
},
"ImageGenerationContent": {
"oneOf": [
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"dataBase64": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"inline"
],
"title": "InlineImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"dataBase64",
"mimeType",
"type"
],
"title": "InlineImageGenerationContent",
"type": "object"
},
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"contentId": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"deferred"
],
"title": "DeferredImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"contentId",
"mimeType",
"type"
],
"title": "DeferredImageGenerationContent",
"type": "object"
}
]
},
"ItemCompletedNotification": {
"properties": {
"completedAtMs": {
@@ -3823,6 +3919,17 @@
},
{
"properties": {
"content": {
"anyOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
},
{
"type": "null"
}
],
"default": null
},
"id": {
"type": "string"
},

View File

@@ -9892,6 +9892,102 @@
],
"type": "string"
},
"ImageGenerationContent": {
"oneOf": [
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"dataBase64": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"inline"
],
"title": "InlineImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"dataBase64",
"mimeType",
"type"
],
"title": "InlineImageGenerationContent",
"type": "object"
},
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"contentId": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"deferred"
],
"title": "DeferredImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"contentId",
"mimeType",
"type"
],
"title": "DeferredImageGenerationContent",
"type": "object"
}
]
},
"InputModality": {
"description": "Canonical user-input modality tags advertised by a model.",
"oneOf": [
@@ -16150,6 +16246,17 @@
},
{
"properties": {
"content": {
"anyOf": [
{
"$ref": "#/definitions/v2/ImageGenerationContent"
},
{
"type": "null"
}
],
"default": null
},
"id": {
"type": "string"
},

View File

@@ -6392,6 +6392,102 @@
],
"type": "string"
},
"ImageGenerationContent": {
"oneOf": [
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"dataBase64": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"inline"
],
"title": "InlineImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"dataBase64",
"mimeType",
"type"
],
"title": "InlineImageGenerationContent",
"type": "object"
},
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"contentId": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"deferred"
],
"title": "DeferredImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"contentId",
"mimeType",
"type"
],
"title": "DeferredImageGenerationContent",
"type": "object"
}
]
},
"InitializeCapabilities": {
"description": "Client-declared capabilities negotiated during initialize.",
"properties": {
@@ -13974,6 +14070,17 @@
},
{
"properties": {
"content": {
"anyOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
},
{
"type": "null"
}
],
"default": null
},
"id": {
"type": "string"
},

View File

@@ -285,6 +285,102 @@
],
"type": "object"
},
"ImageGenerationContent": {
"oneOf": [
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"dataBase64": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"inline"
],
"title": "InlineImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"dataBase64",
"mimeType",
"type"
],
"title": "InlineImageGenerationContent",
"type": "object"
},
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"contentId": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"deferred"
],
"title": "DeferredImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"contentId",
"mimeType",
"type"
],
"title": "DeferredImageGenerationContent",
"type": "object"
}
]
},
"McpToolCallError": {
"properties": {
"message": {
@@ -1035,6 +1131,17 @@
},
{
"properties": {
"content": {
"anyOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
},
{
"type": "null"
}
],
"default": null
},
"id": {
"type": "string"
},

View File

@@ -285,6 +285,102 @@
],
"type": "object"
},
"ImageGenerationContent": {
"oneOf": [
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"dataBase64": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"inline"
],
"title": "InlineImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"dataBase64",
"mimeType",
"type"
],
"title": "InlineImageGenerationContent",
"type": "object"
},
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"contentId": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"deferred"
],
"title": "DeferredImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"contentId",
"mimeType",
"type"
],
"title": "DeferredImageGenerationContent",
"type": "object"
}
]
},
"McpToolCallError": {
"properties": {
"message": {
@@ -1035,6 +1131,17 @@
},
{
"properties": {
"content": {
"anyOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
},
{
"type": "null"
}
],
"default": null
},
"id": {
"type": "string"
},

View File

@@ -422,6 +422,102 @@
],
"type": "object"
},
"ImageGenerationContent": {
"oneOf": [
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"dataBase64": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"inline"
],
"title": "InlineImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"dataBase64",
"mimeType",
"type"
],
"title": "InlineImageGenerationContent",
"type": "object"
},
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"contentId": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"deferred"
],
"title": "DeferredImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"contentId",
"mimeType",
"type"
],
"title": "DeferredImageGenerationContent",
"type": "object"
}
]
},
"McpToolCallError": {
"properties": {
"message": {
@@ -1179,6 +1275,17 @@
},
{
"properties": {
"content": {
"anyOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
},
{
"type": "null"
}
],
"default": null
},
"id": {
"type": "string"
},

View File

@@ -756,6 +756,102 @@
],
"type": "object"
},
"ImageGenerationContent": {
"oneOf": [
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"dataBase64": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"inline"
],
"title": "InlineImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"dataBase64",
"mimeType",
"type"
],
"title": "InlineImageGenerationContent",
"type": "object"
},
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"contentId": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"deferred"
],
"title": "DeferredImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"contentId",
"mimeType",
"type"
],
"title": "DeferredImageGenerationContent",
"type": "object"
}
]
},
"McpToolCallError": {
"properties": {
"message": {
@@ -2014,6 +2110,17 @@
},
{
"properties": {
"content": {
"anyOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
},
{
"type": "null"
}
],
"default": null
},
"id": {
"type": "string"
},

View File

@@ -448,6 +448,102 @@
],
"type": "object"
},
"ImageGenerationContent": {
"oneOf": [
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"dataBase64": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"inline"
],
"title": "InlineImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"dataBase64",
"mimeType",
"type"
],
"title": "InlineImageGenerationContent",
"type": "object"
},
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"contentId": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"deferred"
],
"title": "DeferredImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"contentId",
"mimeType",
"type"
],
"title": "DeferredImageGenerationContent",
"type": "object"
}
]
},
"McpToolCallError": {
"properties": {
"message": {
@@ -1471,6 +1567,17 @@
},
{
"properties": {
"content": {
"anyOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
},
{
"type": "null"
}
],
"default": null
},
"id": {
"type": "string"
},

View File

@@ -448,6 +448,102 @@
],
"type": "object"
},
"ImageGenerationContent": {
"oneOf": [
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"dataBase64": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"inline"
],
"title": "InlineImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"dataBase64",
"mimeType",
"type"
],
"title": "InlineImageGenerationContent",
"type": "object"
},
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"contentId": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"deferred"
],
"title": "DeferredImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"contentId",
"mimeType",
"type"
],
"title": "DeferredImageGenerationContent",
"type": "object"
}
]
},
"McpToolCallError": {
"properties": {
"message": {
@@ -1471,6 +1567,17 @@
},
{
"properties": {
"content": {
"anyOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
},
{
"type": "null"
}
],
"default": null
},
"id": {
"type": "string"
},

View File

@@ -448,6 +448,102 @@
],
"type": "object"
},
"ImageGenerationContent": {
"oneOf": [
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"dataBase64": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"inline"
],
"title": "InlineImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"dataBase64",
"mimeType",
"type"
],
"title": "InlineImageGenerationContent",
"type": "object"
},
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"contentId": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"deferred"
],
"title": "DeferredImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"contentId",
"mimeType",
"type"
],
"title": "DeferredImageGenerationContent",
"type": "object"
}
]
},
"McpToolCallError": {
"properties": {
"message": {
@@ -1471,6 +1567,17 @@
},
{
"properties": {
"content": {
"anyOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
},
{
"type": "null"
}
],
"default": null
},
"id": {
"type": "string"
},

View File

@@ -756,6 +756,102 @@
],
"type": "object"
},
"ImageGenerationContent": {
"oneOf": [
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"dataBase64": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"inline"
],
"title": "InlineImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"dataBase64",
"mimeType",
"type"
],
"title": "InlineImageGenerationContent",
"type": "object"
},
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"contentId": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"deferred"
],
"title": "DeferredImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"contentId",
"mimeType",
"type"
],
"title": "DeferredImageGenerationContent",
"type": "object"
}
]
},
"McpToolCallError": {
"properties": {
"message": {
@@ -2014,6 +2110,17 @@
},
{
"properties": {
"content": {
"anyOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
},
{
"type": "null"
}
],
"default": null
},
"id": {
"type": "string"
},

View File

@@ -448,6 +448,102 @@
],
"type": "object"
},
"ImageGenerationContent": {
"oneOf": [
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"dataBase64": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"inline"
],
"title": "InlineImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"dataBase64",
"mimeType",
"type"
],
"title": "InlineImageGenerationContent",
"type": "object"
},
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"contentId": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"deferred"
],
"title": "DeferredImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"contentId",
"mimeType",
"type"
],
"title": "DeferredImageGenerationContent",
"type": "object"
}
]
},
"McpToolCallError": {
"properties": {
"message": {
@@ -1471,6 +1567,17 @@
},
{
"properties": {
"content": {
"anyOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
},
{
"type": "null"
}
],
"default": null
},
"id": {
"type": "string"
},

View File

@@ -756,6 +756,102 @@
],
"type": "object"
},
"ImageGenerationContent": {
"oneOf": [
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"dataBase64": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"inline"
],
"title": "InlineImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"dataBase64",
"mimeType",
"type"
],
"title": "InlineImageGenerationContent",
"type": "object"
},
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"contentId": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"deferred"
],
"title": "DeferredImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"contentId",
"mimeType",
"type"
],
"title": "DeferredImageGenerationContent",
"type": "object"
}
]
},
"McpToolCallError": {
"properties": {
"message": {
@@ -2014,6 +2110,17 @@
},
{
"properties": {
"content": {
"anyOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
},
{
"type": "null"
}
],
"default": null
},
"id": {
"type": "string"
},

View File

@@ -448,6 +448,102 @@
],
"type": "object"
},
"ImageGenerationContent": {
"oneOf": [
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"dataBase64": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"inline"
],
"title": "InlineImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"dataBase64",
"mimeType",
"type"
],
"title": "InlineImageGenerationContent",
"type": "object"
},
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"contentId": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"deferred"
],
"title": "DeferredImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"contentId",
"mimeType",
"type"
],
"title": "DeferredImageGenerationContent",
"type": "object"
}
]
},
"McpToolCallError": {
"properties": {
"message": {
@@ -1471,6 +1567,17 @@
},
{
"properties": {
"content": {
"anyOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
},
{
"type": "null"
}
],
"default": null
},
"id": {
"type": "string"
},

View File

@@ -448,6 +448,102 @@
],
"type": "object"
},
"ImageGenerationContent": {
"oneOf": [
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"dataBase64": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"inline"
],
"title": "InlineImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"dataBase64",
"mimeType",
"type"
],
"title": "InlineImageGenerationContent",
"type": "object"
},
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"contentId": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"deferred"
],
"title": "DeferredImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"contentId",
"mimeType",
"type"
],
"title": "DeferredImageGenerationContent",
"type": "object"
}
]
},
"McpToolCallError": {
"properties": {
"message": {
@@ -1471,6 +1567,17 @@
},
{
"properties": {
"content": {
"anyOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
},
{
"type": "null"
}
],
"default": null
},
"id": {
"type": "string"
},

View File

@@ -422,6 +422,102 @@
],
"type": "object"
},
"ImageGenerationContent": {
"oneOf": [
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"dataBase64": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"inline"
],
"title": "InlineImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"dataBase64",
"mimeType",
"type"
],
"title": "InlineImageGenerationContent",
"type": "object"
},
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"contentId": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"deferred"
],
"title": "DeferredImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"contentId",
"mimeType",
"type"
],
"title": "DeferredImageGenerationContent",
"type": "object"
}
]
},
"McpToolCallError": {
"properties": {
"message": {
@@ -1179,6 +1275,17 @@
},
{
"properties": {
"content": {
"anyOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
},
{
"type": "null"
}
],
"default": null
},
"id": {
"type": "string"
},

View File

@@ -422,6 +422,102 @@
],
"type": "object"
},
"ImageGenerationContent": {
"oneOf": [
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"dataBase64": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"inline"
],
"title": "InlineImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"dataBase64",
"mimeType",
"type"
],
"title": "InlineImageGenerationContent",
"type": "object"
},
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"contentId": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"deferred"
],
"title": "DeferredImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"contentId",
"mimeType",
"type"
],
"title": "DeferredImageGenerationContent",
"type": "object"
}
]
},
"McpToolCallError": {
"properties": {
"message": {
@@ -1179,6 +1275,17 @@
},
{
"properties": {
"content": {
"anyOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
},
{
"type": "null"
}
],
"default": null
},
"id": {
"type": "string"
},

View File

@@ -422,6 +422,102 @@
],
"type": "object"
},
"ImageGenerationContent": {
"oneOf": [
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"dataBase64": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"inline"
],
"title": "InlineImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"dataBase64",
"mimeType",
"type"
],
"title": "InlineImageGenerationContent",
"type": "object"
},
{
"properties": {
"byteLength": {
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"contentId": {
"type": "string"
},
"height": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
},
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"deferred"
],
"title": "DeferredImageGenerationContentType",
"type": "string"
},
"width": {
"format": "uint32",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"byteLength",
"contentId",
"mimeType",
"type"
],
"title": "DeferredImageGenerationContent",
"type": "object"
}
]
},
"McpToolCallError": {
"properties": {
"message": {
@@ -1179,6 +1275,17 @@
},
{
"properties": {
"content": {
"anyOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
},
{
"type": "null"
}
],
"default": null
},
"id": {
"type": "string"
},

View File

@@ -0,0 +1,5 @@
// GENERATED CODE! DO NOT MODIFY BY HAND!
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type ImageGenerationContent = { "type": "inline", mimeType: string, dataBase64: string, byteLength: bigint, width: number | null, height: number | null, } | { "type": "deferred", contentId: string, mimeType: string, byteLength: bigint, width: number | null, height: number | null, };

View File

@@ -15,6 +15,7 @@ import type { DynamicToolCallOutputContentItem } from "./DynamicToolCallOutputCo
import type { DynamicToolCallStatus } from "./DynamicToolCallStatus";
import type { FileUpdateChange } from "./FileUpdateChange";
import type { HookPromptFragment } from "./HookPromptFragment";
import type { ImageGenerationContent } from "./ImageGenerationContent";
import type { McpToolCallError } from "./McpToolCallError";
import type { McpToolCallResult } from "./McpToolCallResult";
import type { McpToolCallStatus } from "./McpToolCallStatus";
@@ -98,4 +99,4 @@ reasoningEffort: ReasoningEffort | null,
/**
* Last known status of the target agents, when available.
*/
agentsStates: { [key in string]?: CollabAgentState }, } | { "type": "webSearch", id: string, query: string, action: WebSearchAction | null, } | { "type": "imageView", id: string, path: AbsolutePathBuf, } | { "type": "imageGeneration", id: string, status: string, revisedPrompt: string | null, result: string, savedPath?: AbsolutePathBuf, } | { "type": "enteredReviewMode", id: string, review: string, } | { "type": "exitedReviewMode", id: string, review: string, } | { "type": "contextCompaction", id: string, };
agentsStates: { [key in string]?: CollabAgentState }, } | { "type": "webSearch", id: string, query: string, action: WebSearchAction | null, } | { "type": "imageView", id: string, path: AbsolutePathBuf, } | { "type": "imageGeneration", id: string, status: string, revisedPrompt: string | null, content: ImageGenerationContent | null, result: string, savedPath?: AbsolutePathBuf, } | { "type": "enteredReviewMode", id: string, review: string, } | { "type": "exitedReviewMode", id: string, review: string, } | { "type": "contextCompaction", id: string, };

View File

@@ -164,6 +164,7 @@ export type { HookTrustStatus } from "./HookTrustStatus";
export type { HooksListEntry } from "./HooksListEntry";
export type { HooksListParams } from "./HooksListParams";
export type { HooksListResponse } from "./HooksListResponse";
export type { ImageGenerationContent } from "./ImageGenerationContent";
export type { ItemCompletedNotification } from "./ItemCompletedNotification";
export type { ItemGuardianApprovalReviewCompletedNotification } from "./ItemGuardianApprovalReviewCompletedNotification";
export type { ItemGuardianApprovalReviewStartedNotification } from "./ItemGuardianApprovalReviewStartedNotification";

View File

@@ -586,6 +586,7 @@ impl ThreadHistoryBuilder {
id: payload.call_id.clone(),
status: String::new(),
revised_prompt: None,
content: None,
result: String::new(),
saved_path: None,
};
@@ -597,6 +598,7 @@ impl ThreadHistoryBuilder {
id: payload.call_id.clone(),
status: payload.status.clone(),
revised_prompt: payload.revised_prompt.clone(),
content: None,
result: payload.result.clone(),
saved_path: payload.saved_path.clone(),
};
@@ -1469,6 +1471,7 @@ mod tests {
id: "ig_123".into(),
status: "completed".into(),
revised_prompt: Some("final prompt".into()),
content: None,
result: "Zm9v".into(),
saved_path: Some(test_path_buf("/tmp/ig_123.png").abs()),
},

View File

@@ -345,6 +345,8 @@ pub enum ThreadItem {
id: String,
status: String,
revised_prompt: Option<String>,
#[serde(default)]
content: Option<ImageGenerationContent>,
result: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
@@ -361,6 +363,30 @@ pub enum ThreadItem {
ContextCompaction { id: String },
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(tag = "type", rename_all = "camelCase")]
#[ts(tag = "type", export_to = "v2/")]
pub enum ImageGenerationContent {
#[serde(rename_all = "camelCase")]
#[ts(rename_all = "camelCase")]
Inline {
mime_type: String,
data_base64: String,
byte_length: u64,
width: Option<u32>,
height: Option<u32>,
},
#[serde(rename_all = "camelCase")]
#[ts(rename_all = "camelCase")]
Deferred {
content_id: String,
mime_type: String,
byte_length: u64,
width: Option<u32>,
height: Option<u32>,
},
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(rename_all = "camelCase", export_to = "v2/")]
@@ -822,6 +848,7 @@ impl From<CoreTurnItem> for ThreadItem {
id: image.id,
status: image.status,
revised_prompt: image.revised_prompt,
content: None,
result: image.result,
saved_path: image.saved_path,
},

View File

@@ -148,6 +148,147 @@ fn thread_turns_items_list_round_trips() {
);
}
#[test]
fn image_generation_accepts_missing_content_for_legacy_payloads() {
let item: ThreadItem = serde_json::from_value(json!({
"type": "imageGeneration",
"id": "ig_123",
"status": "completed",
"revisedPrompt": null,
"result": "Zm9v",
"savedPath": null
}))
.expect("legacy image generation item should deserialize");
assert_eq!(
item,
ThreadItem::ImageGeneration {
id: "ig_123".to_string(),
status: "completed".to_string(),
revised_prompt: None,
content: None,
result: "Zm9v".to_string(),
saved_path: None,
}
);
}
#[test]
fn image_generation_serializes_missing_content_as_null() {
let item = ThreadItem::ImageGeneration {
id: "ig_123".to_string(),
status: "completed".to_string(),
revised_prompt: None,
content: None,
result: "Zm9v".to_string(),
saved_path: None,
};
assert_eq!(
serde_json::to_value(item).expect("image generation item should serialize"),
json!({
"type": "imageGeneration",
"id": "ig_123",
"status": "completed",
"revisedPrompt": null,
"content": null,
"result": "Zm9v",
})
);
}
#[test]
fn image_generation_inline_content_round_trips() {
let item = ThreadItem::ImageGeneration {
id: "ig_inline".to_string(),
status: "completed".to_string(),
revised_prompt: Some("final prompt".to_string()),
content: Some(ImageGenerationContent::Inline {
mime_type: "image/png".to_string(),
data_base64: "Zm9v".to_string(),
byte_length: 3,
width: Some(512),
height: Some(512),
}),
result: "Zm9v".to_string(),
saved_path: None,
};
let serialized =
serde_json::to_value(&item).expect("inline image generation item should serialize");
assert_eq!(
serialized,
json!({
"type": "imageGeneration",
"id": "ig_inline",
"status": "completed",
"revisedPrompt": "final prompt",
"content": {
"type": "inline",
"mimeType": "image/png",
"dataBase64": "Zm9v",
"byteLength": 3,
"width": 512,
"height": 512,
},
"result": "Zm9v",
})
);
assert_eq!(
serde_json::from_value::<ThreadItem>(serialized)
.expect("inline image generation item should deserialize"),
item
);
}
#[test]
fn image_generation_deferred_content_round_trips() {
let item = ThreadItem::ImageGeneration {
id: "ig_deferred".to_string(),
status: "completed".to_string(),
revised_prompt: None,
content: Some(ImageGenerationContent::Deferred {
content_id: "content_123".to_string(),
mime_type: "image/png".to_string(),
byte_length: 3,
width: None,
height: None,
}),
result: String::new(),
saved_path: None,
};
let serialized =
serde_json::to_value(&item).expect("deferred image generation item should serialize");
assert_eq!(
serialized,
json!({
"type": "imageGeneration",
"id": "ig_deferred",
"status": "completed",
"revisedPrompt": null,
"content": {
"type": "deferred",
"contentId": "content_123",
"mimeType": "image/png",
"byteLength": 3,
"width": null,
"height": null,
},
"result": "",
})
);
assert_eq!(
serde_json::from_value::<ThreadItem>(serialized)
.expect("deferred image generation item should deserialize"),
item
);
}
#[test]
fn thread_list_params_accepts_single_cwd() {
let params = serde_json::from_value::<ThreadListParams>(json!({

View File

@@ -706,6 +706,13 @@ pub(super) fn handle_image_generation_end(
id: call_id.into(),
status: "completed".to_string(),
revised_prompt,
content: Some(codex_app_server_protocol::ImageGenerationContent::Inline {
mime_type: "image/png".to_string(),
data_base64: String::new(),
byte_length: 0,
width: None,
height: None,
}),
result: String::new(),
saved_path,
},