mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
Similar to what @sayan-oai did in openai/codex#8956 for `config.schema.json`, this PR updates the repo so that it includes the output of `codex app-server generate-json-schema` and `codex app-server generate-ts` and adds a test to verify it is in sync with the current code. Motivation: - This makes any schema changes introduced by a PR transparent during code review. - In particular, this should help us catch PRs that would introduce a non-backwards-compatible change to the app schema (eventually, this should also be enforced by tooling). - Once https://github.com/openai/codex/pull/10231 is in to formalize the notion of "experimental" fields, we can work on ensuring the non-experimental bits are backwards-compatible. `codex-rs/app-server-protocol/tests/schema_fixtures.rs` was added as the test and `just write-app-server-schema` can be use to generate the vendored schema files. Incidentally, when I run: ``` rg _ codex-rs/app-server-protocol/schema/typescript/v2 ``` I see a number of `snake_case` names that should be `camelCase`.
165 lines
3.8 KiB
JSON
165 lines
3.8 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"definitions": {
|
|
"InputItem": {
|
|
"oneOf": [
|
|
{
|
|
"properties": {
|
|
"data": {
|
|
"properties": {
|
|
"text": {
|
|
"type": "string"
|
|
},
|
|
"text_elements": {
|
|
"default": [],
|
|
"description": "UI-defined spans within `text` used to render or persist special elements.",
|
|
"items": {
|
|
"$ref": "#/definitions/V1TextElement"
|
|
},
|
|
"type": "array"
|
|
}
|
|
},
|
|
"required": [
|
|
"text"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"type": {
|
|
"enum": [
|
|
"text"
|
|
],
|
|
"title": "TextInputItemType",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"data",
|
|
"type"
|
|
],
|
|
"title": "TextInputItem",
|
|
"type": "object"
|
|
},
|
|
{
|
|
"properties": {
|
|
"data": {
|
|
"properties": {
|
|
"image_url": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"image_url"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"type": {
|
|
"enum": [
|
|
"image"
|
|
],
|
|
"title": "ImageInputItemType",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"data",
|
|
"type"
|
|
],
|
|
"title": "ImageInputItem",
|
|
"type": "object"
|
|
},
|
|
{
|
|
"properties": {
|
|
"data": {
|
|
"properties": {
|
|
"path": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"path"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"type": {
|
|
"enum": [
|
|
"localImage"
|
|
],
|
|
"title": "LocalImageInputItemType",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"data",
|
|
"type"
|
|
],
|
|
"title": "LocalImageInputItem",
|
|
"type": "object"
|
|
}
|
|
]
|
|
},
|
|
"ThreadId": {
|
|
"type": "string"
|
|
},
|
|
"V1ByteRange": {
|
|
"properties": {
|
|
"end": {
|
|
"description": "End byte offset (exclusive) within the UTF-8 text buffer.",
|
|
"format": "uint",
|
|
"minimum": 0.0,
|
|
"type": "integer"
|
|
},
|
|
"start": {
|
|
"description": "Start byte offset (inclusive) within the UTF-8 text buffer.",
|
|
"format": "uint",
|
|
"minimum": 0.0,
|
|
"type": "integer"
|
|
}
|
|
},
|
|
"required": [
|
|
"end",
|
|
"start"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"V1TextElement": {
|
|
"properties": {
|
|
"byteRange": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/V1ByteRange"
|
|
}
|
|
],
|
|
"description": "Byte range in the parent `text` buffer that this element occupies."
|
|
},
|
|
"placeholder": {
|
|
"description": "Optional human-readable placeholder for the element, displayed in the UI.",
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"byteRange"
|
|
],
|
|
"type": "object"
|
|
}
|
|
},
|
|
"properties": {
|
|
"conversationId": {
|
|
"$ref": "#/definitions/ThreadId"
|
|
},
|
|
"items": {
|
|
"items": {
|
|
"$ref": "#/definitions/InputItem"
|
|
},
|
|
"type": "array"
|
|
}
|
|
},
|
|
"required": [
|
|
"conversationId",
|
|
"items"
|
|
],
|
|
"title": "SendUserMessageParams",
|
|
"type": "object"
|
|
} |