add image generation content model

This commit is contained in:
Roy Han
2026-05-05 14:23:45 -07:00
committed by rhan-oai
parent 8c88f9a304
commit 0df7976553
24 changed files with 2133 additions and 6 deletions
@@ -1930,6 +1930,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": {
@@ -3783,6 +3879,21 @@
},
{
"properties": {
"content": {
"allOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
}
],
"default": {
"byteLength": 0,
"dataBase64": "",
"height": null,
"mimeType": "image/png",
"type": "inline",
"width": null
}
},
"id": {
"type": "string"
},
@@ -6074,4 +6185,4 @@
}
],
"title": "ServerNotification"
}
}
@@ -10169,6 +10169,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": [
@@ -10322,6 +10418,13 @@
"title": "ItemStartedNotification",
"type": "object"
},
"LargeContentMode": {
"enum": [
"inline",
"deferred"
],
"type": "string"
},
"ListMcpServerStatusParams": {
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
@@ -16188,6 +16291,21 @@
},
{
"properties": {
"content": {
"allOf": [
{
"$ref": "#/definitions/v2/ImageGenerationContent"
}
],
"default": {
"byteLength": 0,
"dataBase64": "",
"height": null,
"mimeType": "image/png",
"type": "inline",
"width": null
}
},
"id": {
"type": "string"
},
@@ -18553,4 +18671,4 @@
},
"title": "CodexAppServerProtocol",
"type": "object"
}
}
@@ -6736,6 +6736,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": {
@@ -6933,6 +7029,13 @@
"title": "ItemStartedNotification",
"type": "object"
},
"LargeContentMode": {
"enum": [
"inline",
"deferred"
],
"type": "string"
},
"ListMcpServerStatusParams": {
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
@@ -14074,6 +14177,21 @@
},
{
"properties": {
"content": {
"allOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
}
],
"default": {
"byteLength": 0,
"dataBase64": "",
"height": null,
"mimeType": "image/png",
"type": "inline",
"width": null
}
},
"id": {
"type": "string"
},
@@ -16438,4 +16556,4 @@
},
"title": "CodexAppServerProtocolV2",
"type": "object"
}
}
@@ -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,21 @@
},
{
"properties": {
"content": {
"allOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
}
],
"default": {
"byteLength": 0,
"dataBase64": "",
"height": null,
"mimeType": "image/png",
"type": "inline",
"width": null
}
},
"id": {
"type": "string"
},
@@ -1393,4 +1504,4 @@
],
"title": "ItemCompletedNotification",
"type": "object"
}
}
@@ -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,21 @@
},
{
"properties": {
"content": {
"allOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
}
],
"default": {
"byteLength": 0,
"dataBase64": "",
"height": null,
"mimeType": "image/png",
"type": "inline",
"width": null
}
},
"id": {
"type": "string"
},
@@ -1393,4 +1504,4 @@
],
"title": "ItemStartedNotification",
"type": "object"
}
}
@@ -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,21 @@
},
{
"properties": {
"content": {
"allOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
}
],
"default": {
"byteLength": 0,
"dataBase64": "",
"height": null,
"mimeType": "image/png",
"type": "inline",
"width": null
}
},
"id": {
"type": "string"
},
@@ -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": {
@@ -2005,6 +2101,21 @@
},
{
"properties": {
"content": {
"allOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
}
],
"default": {
"byteLength": 0,
"dataBase64": "",
"height": null,
"mimeType": "image/png",
"type": "inline",
"width": null
}
},
"id": {
"type": "string"
},
@@ -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": {
@@ -1455,6 +1551,21 @@
},
{
"properties": {
"content": {
"allOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
}
],
"default": {
"byteLength": 0,
"dataBase64": "",
"height": null,
"mimeType": "image/png",
"type": "inline",
"width": null
}
},
"id": {
"type": "string"
},
@@ -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": {
@@ -1455,6 +1551,21 @@
},
{
"properties": {
"content": {
"allOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
}
],
"default": {
"byteLength": 0,
"dataBase64": "",
"height": null,
"mimeType": "image/png",
"type": "inline",
"width": null
}
},
"id": {
"type": "string"
},
@@ -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": {
@@ -1455,6 +1551,21 @@
},
{
"properties": {
"content": {
"allOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
}
],
"default": {
"byteLength": 0,
"dataBase64": "",
"height": null,
"mimeType": "image/png",
"type": "inline",
"width": null
}
},
"id": {
"type": "string"
},
@@ -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": {
@@ -2005,6 +2101,21 @@
},
{
"properties": {
"content": {
"allOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
}
],
"default": {
"byteLength": 0,
"dataBase64": "",
"height": null,
"mimeType": "image/png",
"type": "inline",
"width": null
}
},
"id": {
"type": "string"
},
@@ -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": {
@@ -1455,6 +1551,21 @@
},
{
"properties": {
"content": {
"allOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
}
],
"default": {
"byteLength": 0,
"dataBase64": "",
"height": null,
"mimeType": "image/png",
"type": "inline",
"width": null
}
},
"id": {
"type": "string"
},
@@ -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": {
@@ -2005,6 +2101,21 @@
},
{
"properties": {
"content": {
"allOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
}
],
"default": {
"byteLength": 0,
"dataBase64": "",
"height": null,
"mimeType": "image/png",
"type": "inline",
"width": null
}
},
"id": {
"type": "string"
},
@@ -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": {
@@ -1455,6 +1551,21 @@
},
{
"properties": {
"content": {
"allOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
}
],
"default": {
"byteLength": 0,
"dataBase64": "",
"height": null,
"mimeType": "image/png",
"type": "inline",
"width": null
}
},
"id": {
"type": "string"
},
@@ -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": {
@@ -1455,6 +1551,21 @@
},
{
"properties": {
"content": {
"allOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
}
],
"default": {
"byteLength": 0,
"dataBase64": "",
"height": null,
"mimeType": "image/png",
"type": "inline",
"width": null
}
},
"id": {
"type": "string"
},
@@ -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,21 @@
},
{
"properties": {
"content": {
"allOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
}
],
"default": {
"byteLength": 0,
"dataBase64": "",
"height": null,
"mimeType": "image/png",
"type": "inline",
"width": null
}
},
"id": {
"type": "string"
},
@@ -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,21 @@
},
{
"properties": {
"content": {
"allOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
}
],
"default": {
"byteLength": 0,
"dataBase64": "",
"height": null,
"mimeType": "image/png",
"type": "inline",
"width": null
}
},
"id": {
"type": "string"
},
@@ -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,21 @@
},
{
"properties": {
"content": {
"allOf": [
{
"$ref": "#/definitions/ImageGenerationContent"
}
],
"default": {
"byteLength": 0,
"dataBase64": "",
"height": null,
"mimeType": "image/png",
"type": "inline",
"width": null
}
},
"id": {
"type": "string"
},
@@ -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, };
@@ -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, result: string, savedPath?: AbsolutePathBuf, } | { "type": "enteredReviewMode", id: string, review: string, } | { "type": "exitedReviewMode", id: string, review: string, } | { "type": "contextCompaction", id: string, };
@@ -172,6 +172,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";
@@ -586,6 +586,13 @@ impl ThreadHistoryBuilder {
id: payload.call_id.clone(),
status: String::new(),
revised_prompt: None,
content: crate::protocol::v2::ImageGenerationContent::Inline {
mime_type: "image/png".to_string(),
data_base64: String::new(),
byte_length: 0,
width: None,
height: None,
},
result: String::new(),
saved_path: None,
};
@@ -597,6 +604,13 @@ impl ThreadHistoryBuilder {
id: payload.call_id.clone(),
status: payload.status.clone(),
revised_prompt: payload.revised_prompt.clone(),
content: crate::protocol::v2::ImageGenerationContent::Inline {
mime_type: "image/png".to_string(),
data_base64: payload.result.clone(),
byte_length: crate::protocol::v2::image_generation_byte_length(&payload.result),
width: None,
height: None,
},
result: payload.result.clone(),
saved_path: payload.saved_path.clone(),
};
@@ -1469,6 +1483,13 @@ mod tests {
id: "ig_123".into(),
status: "completed".into(),
revised_prompt: Some("final prompt".into()),
content: crate::protocol::v2::ImageGenerationContent::Inline {
mime_type: "image/png".into(),
data_base64: "Zm9v".into(),
byte_length: 3,
width: None,
height: None,
},
result: "Zm9v".into(),
saved_path: Some(test_path_buf("/tmp/ig_123.png").abs()),
},
@@ -6250,6 +6250,8 @@ pub enum ThreadItem {
id: String,
status: String,
revised_prompt: Option<String>,
#[serde(default)]
content: ImageGenerationContent,
result: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
@@ -6266,6 +6268,52 @@ 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>,
},
}
impl Default for ImageGenerationContent {
fn default() -> Self {
Self::Inline {
mime_type: "image/png".to_string(),
data_base64: String::new(),
byte_length: 0,
width: None,
height: None,
}
}
}
pub(crate) fn image_generation_byte_length(data_base64: &str) -> u64 {
let padding_len = data_base64
.as_bytes()
.iter()
.rev()
.take_while(|byte| **byte == b'=')
.count();
((data_base64.len() / 4) * 3).saturating_sub(padding_len) as u64
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(rename_all = "camelCase", export_to = "v2/")]
@@ -6727,6 +6775,13 @@ impl From<CoreTurnItem> for ThreadItem {
id: image.id,
status: image.status,
revised_prompt: image.revised_prompt,
content: ImageGenerationContent::Inline {
mime_type: "image/png".to_string(),
data_base64: image.result.clone(),
byte_length: image_generation_byte_length(&image.result),
width: None,
height: None,
},
result: image.result,
saved_path: image.saved_path,
},
@@ -11950,4 +12005,29 @@ mod tests {
"unexpected error: {err}"
);
}
#[test]
fn image_generation_defaults_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: ImageGenerationContent::default(),
result: "Zm9v".to_string(),
saved_path: None,
}
);
}
}
@@ -832,6 +832,13 @@ pub(super) fn handle_image_generation_end(
id: call_id.into(),
status: "completed".to_string(),
revised_prompt,
content: 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,
},